Notifications
Clear all

Hyperfine bed leveling?  

Page 12 / 22
  RSS
Reprapper
(@reprapper)
Active Member
Re: Hyperfine bed leveling?

I would like the source code for hyperfine bed leveling based on the latest Prusa 3.1.0 firmware as a base for further simple modifications such as preheat values that match the filaments I use. Can anyone tell me where to find this on Github? I would also like it to match the options actually implemented in the current Prusa downloadable hex files. The 3.1.0 source code on the Prusa Github site seems to have options such as Thermal Runaway Protection commented out by default but I have had bed thermal runaway errors a couple of times since flashing the Prusa hex file for 3.1.0 so I know they are implemented by Prusa despite being switched off by default in the source code. How do I find out which options are actually switched on and which are not in the official Prusa release? I asked Prusa support but did not get a clear answer, they said "to be honest the code is not exactly in its pure form, but the source you downloaded is the one we just compile to make the hex. Every feature we have is implemented, some which are commented out may be just older version of implementation."

Posted : 01/12/2017 1:05 pm
3d-gussner
(@3d-gussner)
Reputable Member Prusa-Translations
Re: Hyperfine bed leveling?


I would like the source code for hyperfine bed leveling based on the latest Prusa 3.1.0 firmware as a base for further simple modifications such as preheat values that match the filaments I use. Can anyone tell me where to find this on Github?

Hi,

you can find the source code attached to the release or ongoing/develop version in the branches.
I did a github fork from Prusa and keep the MK2 in sync with the origin. My Github https://github.com/3d-gussner/Prusa-Firmware has at this moment 10 branches where the https://github.com/3d-gussner/Prusa-Firmware/tree/MK2-Private_build contains/merged most of the others. Having different branches make pull requests easier.
Example: Branch 'MK2-PLA_1st' contains just one change: Preheat menu show now PLA 1st and ABS 2nd and so on.

The preheat values can be found/changed in the 'Configuration_prusa.h' file under 'PREHEAT SETTINGS'. Adding other materials will need some more work!


I would also like it to match the options actually implemented in the current Prusa downloadable hex files. The 3.1.0 source code on the Prusa Github site seems to have options such as Thermal Runaway Protection commented out by default but I have had bed thermal runaway errors a couple of times since flashing the Prusa hex file for 3.1.0 so I know they are implemented by Prusa despite being switched off by default in the source code. How do I find out which options are actually switched on and which are not in the official Prusa release? I asked Prusa support but did not get a clear answer, they said "to be honest the code is not exactly in its pure form, but the source you downloaded is the one we just compile to make the hex. Every feature we have is implemented, some which are commented out may be just older version of implementation."

Most features are defined in these files: Configuration.h, Configuration_adv.h and Configuration_prusa.h (one of the variants/<xxxx>.h files)

Read also: https://github.com/3d-gussner/Prusa-Firmware/blob/MK2-Private_build/BUILDING.md

Hope could answer your question

Posted : 01/12/2017 5:57 pm
Reprapper
(@reprapper)
Active Member
Re: Hyperfine bed leveling?

Hi Waldemar,
Thank you so much for your reply. You have partly answered my question and your source code is certainly what I need to implement hyperfine bed leveling. However I am still confused about whether I need to go through all the code to see which options I need and to turn them on. For example in Configuration.h in both the Prusa 3.1.0 code and your modified branch with the hyperfine code in, the following lines are present:

// If you want to enable this feature for all your extruder heaters,
// uncomment the 2 defines below:

// Parameters for all extruder heaters
//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius

// If you want to enable this feature for your bed heater,
// uncomment the 2 defines below:

// Parameters for the bed heater
//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius

Does this mean that in order to have Thermal Runaway protection implemented I have to un-comment the lines above? If so how do I know what other options I may need to un-comment in order to have firmware that exactly matches the Prusa release plus your added hyperfine code? I hope I have explained the reason for my confusion. I am new to all this and haven't built any firmware yet but had no problems getting the Aduino IDE to work and I am confident I can compile and upload the modified firmware. I am just not sure what features I will be getting!

Posted : 01/12/2017 6:57 pm
3d-gussner
(@3d-gussner)
Reputable Member Prusa-Translations
Re: Hyperfine bed leveling?


Hi Waldemar,
Thank you so much for your reply. You have partly answered my question and your source code is certainly what I need to implement hyperfine bed leveling. However I am still confused about whether I need to go through all the code to see which options I need and to turn them on. For example in Configuration.h in both the Prusa 3.1.0 code and your modified branch with the hyperfine code in, the following lines are present:

// If you want to enable this feature for all your extruder heaters,
// uncomment the 2 defines below:

// Parameters for all extruder heaters
//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius

// If you want to enable this feature for your bed heater,
// uncomment the 2 defines below:

// Parameters for the bed heater
//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius

Does this mean that in order to have Thermal Runaway protection implemented I have to un-comment the lines above?

Yes you have to un-comment as it says in the description to get that feature.


If so how do I know what other options I may need to un-comment in order to have firmware that exactly matches the Prusa release plus your added hyperfine code?

If you download MY https://github.com/3d-gussner/Prusa-Firmware/archive/MK2-Private_build.zip (this may change over time) or the https://github.com/3d-gussner/Prusa-Firmware/archive/v3.1.0-HFM.zip (this is a snapshot of my MK2-Private_build branch when i started the release notes and will not change!!!) you have the source code for that firmware described in the release.

This firmware is Prusa 3.1.0 release and has Hyperfine Bed Leveling, Filament Runout Sensor, PLA 1st, and some other modifications.
So if you follow the BUILDING.md instructions you should be able to compile exact the same hex file which i uploaded.

So after you un-comment the THERMAL_RUNAWAY_... compile the code and check that there are no errors! Then you have our firmware with HF, FRS, ... AND Thermal Runaway

Usually activate/de-activate features in Configuration.h, Configuration_adv.h and Configuration_prusa.h will activate/de-active needed parts in the firmware code. Hope that makes sens.


I hope I have explained the reason for my confusion. I am new to all this and haven't built any firmware yet but had no problems getting the Aduino IDE to work and I am confident I can compile and upload the modified firmware.

I think everybody starts somewhere and sometime so don't excuse yourself. There are (nearly) no stupid questions just stupid answers, so if you don't know something try to find information about and just ask!

Most people in this forum are glad to help and i am sure you also can help somebody else if they have a question or issue.

Most important is to follow the BUILDING instructions.
When you want to make multiple changes you should try one by one and THEN combine them if your aren't sure.


I am just not sure what features I will be getting!

What ever you activate should work.

Hope could make it more clear.

Posted : 01/12/2017 7:37 pm
Reprapper
(@reprapper)
Active Member
Re: Hyperfine bed leveling?

Sorry but I am still not clear in my own mind about this. Are you saying that I need to go through the code in all the configuration files to see which options are active and which are commented out? I can do this but I still won't know which ones are active in the official Prusa 3.1.0 release and therefore which ones I need to un-comment or re-comment in order to be identical to it. My target printers are a completely standard Prusa i3 Mk2 and Mk2S. Surely there must either be a version of the Prusa 3.1.0 release code on Github which exactly reflects the released hex files for these printers ie. it has all the needed options un-commented and those not needed commented out such that if I compiled it without change I would make an identical hex file? Alternatively there must be a list of the options which are activated in the release. I should not need to know whether I have a corexy printer or if I need filament runout sensor code or thermal runaway protection turned on, it should be obvious in the code documentation which options are required for which printer models/features.

If I were designing the firmware, then I would have one central point at the start where the options were all designated either "ON" or "OFF" rather than having to wade through the code in all the configuration files to establish this.

Posted : 02/12/2017 11:06 am
3d-gussner
(@3d-gussner)
Reputable Member Prusa-Translations
Re: Hyperfine bed leveling?


Sorry but I am still not clear in my own mind about this. Are you saying that I need to go through the code in all the configuration files to see which options are active and which are commented out? I can do this but I still won't know which ones are active in the official Prusa 3.1.0 release and therefore which ones I need to un-comment or re-comment in order to be identical to it.

Hi,

if you use the https://github.com/prusa3d/Prusa-Firmware/archive/v3.1.0.zip , don't changing anything and compile the code you HAVE the same firmware (hex files). That means it is exactly the same as the Prusa i3 MK2/s 3.1.0 firmware.
If you use https://github.com/3d-gussner/Prusa-Firmware/archive/v3.1.0-HFM.zip , don't change anything and compile the code you HAVE the same firmware (hex file) as i uploaded: 3.1.0 firmware for Prusa i3 MK2/S/MMU with Hyperfine Bed Tuning and Filament Runout Sensor.
By comparing these source codes (WinMerge) you can see changes we/I have done to the origin Prusa code.

Example: To get Filament runout sensor running in the 1st place:

In the I un-commented
- in 'Configuration_h' the code '//#define FILAMENT_SENSOR'
- in 'Configuration_prusa.h' the code '//#define FILAMENT_RUNOUT_SUPPORT'
- modified the 'pins.h' from '#define FR_SENS 21' to '#define FR_SENS 24' to use the y-max entstop pin.
to activate the Filament Runout Function.
This was the 2st approach in my release 3.0.12 firmware for Prusa i3 MK2 with Filament runout sensor

This feature was more or less hard-coded and you had to know what kind of FR sensor you are using. You could not dis-/enable it and so on.

TheZeroBeast had another sensor as i used and needed to modify the code so it worked with that one.
Here the idea was born to make it available in the LCD menu, which has started in release 3.1.0-RC1 firmware for Prusa i3 MK2/S/MMU with Hyperfine Bed Tuning and Filament Runout Sensor.


My target printers are a completely standard Prusa i3 Mk2 and Mk2S. Surely there must either be a version of the Prusa 3.1.0 release code on Github which exactly reflects the released hex files for these printers ie. it has all the needed options un-commented and those not needed commented out such that if I compiled it without change I would make an identical hex file?

Un-comment in these files will activate an ADDITIONAL feature/function and all stock things will stay.


Alternatively there must be a list of the options which are activated in the release. I should not need to know whether I have a corexy printer or if I need filament runout sensor code or thermal runaway protection turned on, it should be obvious in the code documentation which options are required for which printer models/features.

The Configuration....h files are the list.


If I were designing the firmware, then I would have one central point at the start where the options were all designated either "ON" or "OFF" rather than having to wade through the code in all the configuration files to establish this.

The comment / un-comment is your "ON/OFF" in the Configuration....h files.
- Configuration.h for common settings
- Configuration_adv.h is for advanced settings
- Configuration_prusa.h for Prusa specific settings

Waldemar

Posted : 02/12/2017 5:31 pm
Reprapper
(@reprapper)
Active Member
Re: Hyperfine bed leveling?

Hi again. Thanks for your time in replying to me. I still beg to differ about the source code reflecting the released hex files. In the Prusa 3.1.0 firmware the Thermal Runaway Protection is commented out and so is disabled but since I am capable of getting those errors after flashing the released hex file (just print a very small item in the centre of the bed in a cold room and the fan will prevent the bed ever reaching the set temperature and so the bed heater is on all the time and a thermal runaway is detected) then it must be turned on in the Prusa compiled version.

Anyway, I compiled your Prusa-Firmware-3.1.0-HFM code after enabling Thermal Runaway and altering the filament preheat values and then flashed the hex file onto my printer. The new preheat values work perfectly but when I tried to print I got the same problem that some others have had with the Filament Runout Sensor code. Despite Fil.RS being [OFF] it did a change filament at the start of the print and unloaded the filament. After I had reloaded the filament it now seems to work Ok.

I can now go and play with the hyperfine bed leveling and see if I can "flatten-out" my print bed which has been a source of frustration for a while now. Thank you so much for all the help you have given me. I have learned a lot during the process. When I get time I will delve into the Preheat coding and see if I can add some new filaments instead of just changing the temperature values for the existing ones. My thanks also to PJR and JeffJordan for their great work on Hyperfine Bed Leveling and First Layer Calibration.

Posted : 02/12/2017 6:31 pm
3d-gussner
(@3d-gussner)
Reputable Member Prusa-Translations
Re: Hyperfine bed leveling?


Hi again. Thanks for your time in replying to me. I still beg to differ about the source code reflecting the released hex files. In the Prusa 3.1.0 firmware the Thermal Runaway Protection is commented out and so is disabled but since I am capable of getting those errors after flashing the released hex file (just print a very small item in the centre of the bed in a cold room and the fan will prevent the bed ever reaching the set temperature and so the bed heater is on all the time and a thermal runaway is detected) then it must be turned on in the Prusa compiled version.

Anyway, I compiled your Prusa-Firmware-3.1.0-HFM code after enabling Thermal Runaway and altering the filament preheat values and then flashed the hex file onto my printer. The new preheat values work perfectly

Great to hear you got your fimware modified as you needed and it works!


but when I tried to print I got the same problem that some others have had with the Filament Runout Sensor code. Despite Fil.RS being [OFF] it did a change filament at the start of the print and unloaded the filament. After I had reloaded the filament it now seems to work Ok.

Sorry for that, i still have to look into it as it seams that unused EEPROM space has some different values. As i wrote in the release note: Please double check the FRS Settings and under Calibration->show endstops or M119 gcode the status of this feature, after flashing the firmware and BEFORE the 1st print 🙂


I can now go and play with the hyperfine bed leveling and see if I can "flatten-out" my print bed which has been a source of frustration for a while now. Thank you so much for all the help you have given me. I have learned a lot during the process.

Glad i could help you and it is great that you have learned something. Thanks for the kind words.


When I get time I will delve into the Preheat coding and see if I can add some new filaments instead of just changing the temperature values for the existing ones.

I think most materials in the Preheat are presented and as you are close to your material temps it is fine. At the end the sliced g-code will do the rest.


My thanks also to PJR and JeffJordan for their great work on Hyperfine Bed Leveling and First Layer Calibration.

Yes great job they have done.

Posted : 03/12/2017 9:39 am
freedom2000
(@freedom2000)
Active Member
Re: Hyperfine bed leveling?

First of all : BIG thanks to you all who have found this idea, tested it and implemented into the firmware.

I have just flashed Waldemar's firmware, tested it with the files provided by Jeff.

I do not have the out of filament switch so been obliged to Fil.RS OF/on/Off method to clear the eprom and avoid endless loop to unload/reload the filament.
With this trick, everything is working fine and I have now an almost perfect bed leveling 😀

Again thank you to the gurus

JP

Posted : 03/12/2017 3:44 pm
marko.j
(@marko-j)
New Member
Re: Hyperfine bed leveling?

Hi,

I'm trying to level the bed with the protocol mentioned above. Problem is, there's quite big Z variation already in the printed "Life Adjust Z" calibration area (see picture below)

Here's the printed middle part. The upper right perimeter is almost perfect, and lower left perimeter is very stringy.

I did try calibrating with the protocol anyway, and was surprised how small were the actual changes (in microm) compared to middle part. Here's the bed level adjustment:
-65, -30, +40
-50, 0, +25
-35, -35, +50

And here's the whole result printed after punching in the adjustment:

All in all, somewhat decent leveling in almost all corners, and not at all that huge difference what one could anticipate from looking at the middle part. Note that the middle part looks almost the same before and after bed level adjustment.

Some stringiness on the 'D' part:

But what could explain this huge Z variation at the center? Any idea how to pinpoint this problem?

Posted : 04/12/2017 10:01 pm
marko.j
(@marko-j)
New Member
Re: Hyperfine bed leveling?

Ok, this is weird.

I was fixing another, seemingly unrelated problem, namely the x axis belt twisting on the right side:
( https://shop.prusa3d.com/forum/prusa-i3-kit-building-calibrating-first-print-main-f6/inexplicable-x-axis-belt-twisting-t5906.html ).

I loosened the X axis belt by two notches, and that not only reduced the twisting but also corrected almost all of the centralized stringing! 😕

I haven't seen anyone mention that tight belt could cause these kind of first layer artefacts, so this could worth adding to a troubleshooting list!

Posted : 06/12/2017 12:51 am
Reprapper
(@reprapper)
Active Member
Re: Hyperfine bed leveling?

After a few iterations adjusting the a to h values I can now get an excellent first layer anywhere on the beds of both of my Prusa printers. Implementing the Hyperfine firmware mod is well worth the effort and ought to be adopted by Prusa as standard. Thanks again to all involved.

Posted : 11/12/2017 3:25 pm
ir_fuel
(@ir_fuel)
Estimable Member
Re: Hyperfine bed leveling?

I'm trying to install the firmware here, well try to build it, but the documentation seems to be very incomplete unfortunately.

For instance:

"Install the arduino addon located in the root of this repo. Don't forget to install the correct version!"

Which one is the correct version? 1.6.x or 1.x.x? Since the IDE is at 1.8.5.

Then, for the installation: it's clear that there are libraries to add to the Arduino Libraries directory, but should we also copy the hardware contents to the Arduino hardware directory?

Anyway, I copied it there too.

Next I copied the right config file and renamed it.

Then I launched the compilation.
Result:

Error: DIOFILL_RUNOUT_PIN_RPORT was not declared in this scope.

So, what's next? 🙂

Posted : 14/12/2017 7:58 pm
ir_fuel
(@ir_fuel)
Estimable Member
Re: Hyperfine bed leveling?

So I gave up and just downloaded the hex files from github.

I'm running on a MMU machine, and there is something weird. When running the first gcode file all goes well until after it heats up to 215 degrees. It then spits out the filament and asks me to load new filament. When I do this it moves around, and does the same again, and it gets in an infinite unload/load filament loop 😐

Posted : 14/12/2017 8:51 pm
ir_fuel
(@ir_fuel)
Estimable Member
Re: Hyperfine bed leveling?

So, I did some more testing. Compared a single extrusion MMU file that works against the gcode files posted here. The only difference is a few "T0" commands, so I added them and I ran the gcode line by line by sending it manually to the printer.

What happens:

Right when sending this:
G1 Y-3.0 F1000.0 ; go outside printer area

In the terminal all of the sudden I see: "enqueuing "M600" to front" (or something along those lines).

So for some reason the printer decides to insert an M600 "change filament" command.

Any idea why?

Posted : 14/12/2017 9:27 pm
3d-gussner
(@3d-gussner)
Reputable Member Prusa-Translations
Re: Hyperfine bed leveling?


I'm trying to install the firmware here, well try to build it, but the documentation seems to be very incomplete unfortunately.

For instance:

"Install the arduino addon located in the root of this repo. Don't forget to install the correct version!"

Which one is the correct version? 1.6.x or 1.x.x? Since the IDE is at 1.8.5.

Then, for the installation: it's clear that there are libraries to add to the Arduino Libraries directory, but should we also copy the hardware contents to the Arduino hardware directory?

Anyway, I copied it there too.

Next I copied the right config file and renamed it.

Then I launched the compilation.
Result:

Error: DIOFILL_RUNOUT_PIN_RPORT was not declared in this scope.

So, what's next?

Hi, did you follow the https://github.com/3d-gussner/Prusa-Firmware/blob/MK2-Private_build/BUILDING.md instructions?

Posted : 14/12/2017 11:46 pm
3d-gussner
(@3d-gussner)
Reputable Member Prusa-Translations
Re: Hyperfine bed leveling?


So I gave up and just downloaded the hex files from github.

I'm running on a MMU machine, and there is something weird. When running the first gcode file all goes well until after it heats up to 215 degrees. It then spits out the filament and asks me to load new filament. When I do this it moves around, and does the same again, and it gets in an infinite unload/load filament loop 😐

Hi, did you read the release notes? You need to set the FRS off/on/off in the settings BEFORE the 1st print if you don't have a filament runout sensor connected to y-max.

Posted : 14/12/2017 11:49 pm
3d-gussner
(@3d-gussner)
Reputable Member Prusa-Translations
Re: Hyperfine bed leveling?


So, I did some more testing. Compared a single extrusion MMU file that works against the gcode files posted here. The only difference is a few "T0" commands, so I added them and I ran the gcode line by line by sending it manually to the printer.

What happens:

Right when sending this:
G1 Y-3.0 F1000.0 ; go outside printer area

In the terminal all of the sudden I see: "enqueuing "M600" to front" (or something along those lines).

So for some reason the printer decides to insert an M600 "change filament" command.

Any idea why?

Hi, the FRS is activated and you need to set if off or on depending if you have a filament runout sensor connected or not.

Posted : 14/12/2017 11:52 pm
ir_fuel
(@ir_fuel)
Estimable Member
Re: Hyperfine bed leveling?

Yes I followed the instructions, and yes my filament runout sensor is OFF when you look in the LCD settings.

Posted : 15/12/2017 9:30 am
ir_fuel
(@ir_fuel)
Estimable Member
Re: Hyperfine bed leveling?

And btw, I opened the stl files of those cubes and sliced them myself. Those files work perfectly.

Posted : 15/12/2017 9:31 am
Page 12 / 22
Share: