Hotmesh or Hot mess?
-
Ok, title is a bit of a joke but here is my question:
I recently found this great github archive:
https://github.com/rkolbi/RRF-machine-config-files/tree/master/Prusa MK3sAlthough i do not have a prusa I liked some of the macros . This approach assumes that a detailed hot mesh bed analysis occurs and is saved per filament type and is calibrated on the filament bed temp.
After I reload config.g, home, and then run a G29 I get a normal height map:
However, when I run the hotmesh.g macro I end up with a height map that is way is about 0.3mm above where it should be. I seem to be missing what is causing the additional 0.3mm and how to fix it. What am I missing here?
bed.g
M561 ; clear any bed transform G29 ; probe the bed and enable compensation
Hotmesh.g
; 0:/macros/Maintenance/Hotmesh ; Called to perform automatic heated bedmesh compensation ; This saves the heightmap to the system's set filament's type directory (0:/filaments/XXXX/heightmap.csv) M80 if state.status = "processing" ; Printer is currently printing! M99 ; Abort this macro T0 ; Ensure tool is selected ; Heat bed to set temp based off current system filament type if move.extruders[0].filament = "PLA" M140 S60 ; Set PLA Bed Temp to 60C elif move.extruders[0].filament = "PETG" M140 S70 ; Set PETG Bed Temp to 70C else M291 P"Hotmesh requires a filament to be loaded. Please load a filament and re-run hotmesh." R"Hotmesh" S0 T10 M99 ; Abort this macro M104 S0 ; Turn off hotend M106 S0 ; Turn part cooling blower off if it is on M291 P{"Performing bed heatup per " ^ move.extruders[0].filament ^ " profile. This process will take approximately 6 minutes."} R"Hotmesh" S0 T10 G28 ; Home M98 P"0:/macros/general/1_Center_Nozzle.g" ; Place nozzle center of bed= ; Give 5 minutes for stabilization G91 ; Set to Rel Positioning while iterations <=9 ; Perform 10 passes G1 Z15 F300 ; Move Z 15mm up G4 S0.5 ; Wait .5 seconds G1 Z3 F300 ; Raise an additional 3mm M116 ; Wait for all temperatures M291 P"Bed temperature at setpoint. Please wait 5 minutes for stabilization, Z indicates countdown." R"Hotmesh" S0 T10 ; Start countdown - use Z as indicator while iterations <=9 ; Perform 10 passes G4 S30 ; Wait 30 seconds G1 Z-15 F300 ; Move Z 15mm down G90 ; Set to Absolute Positioning M291 P"Performing homing, gantry alignment, and mesh probing. Please wait." R"Hotmesh" S0 T10 G32 ; Home and Level gantry M400 ; Clear queue M558 F50 A4 S-1 ; slow z-probe, take 5 probes and yield average G29 ; Perfrom bed mesh G29 S3 [P{"0:/filaments/" ^ move.extruders[0].filament ^ "/heightmap.csv"}] ; Save heightmap.csv to filament type's directory M558 F200 A1 ; normal z-probe M104 S0 ; Turn off hotend M140 S0 ; Turn off heatbed M291 P"Hotmesh complete. Hotend and Heatbed are turned off. Performing final homing routine. Please wait." R"Hotmesh" S0 T10 G28 ; Home M18 ; Free all
Config.g
; Configuration file for Duet WiFi (firmware version 3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v2.1.8 on Sun Feb 09 2020 08:41:29 GMT-0600 (Central Standard Time) ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"Ender 5 Hemera" ; set printer name M918 P1 E4 F2000000 ; configure direct-connect display ; Network M552 P0.0.0.0 S1 ; enable network and acquire dynamic address via DHCP M586 P0 S1 ; enable HTTP M586 P1 S1 ; enable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P0 S0 ; physical drive 0 goes backwards M569 P1 S0 ; physical drive 1 goes backwards M569 P2 S0 ; physical drive 2 goes backwards M569 P3 S0 ; physical drive 3 goes backwards M584 X0 Y1 Z2 E3 ; set drive mapping M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X80.00 Y80.00 Z800.00 E399.78 ; set steps per mm M566 X1200.00 Y1200.00 Z24.00 E300.00 ; set maximum instantaneous speed changes (mm/min) M203 X9000.00 Y9000.00 Z1800.00 E3600.00 ; set maximum speeds (mm/min) M201 X500.00 Y500.00 Z100.00 E5000.00 ; set accelerations (mm/s^2) M906 X800 Y800 Z800 E980 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X220 Y207 Z300 S0 ; set axis maxima ; Endstops M574 X2 S1 P"xstop" ; configure active-high endstop for high end on X via pin xstop M574 Y2 S1 P"ystop" ; configure active-high endstop for high end on Y via pin ystop M574 Z1 S2 ; configure Z-probe endstop for low end on Z ; Z-Probe M950 S0 C"exp.heater4" ; create servo pin 0 for BLTouch M558 P9 C"zprobe.in+zprobe.mod" H5 F120 T6000 ; set Z probe type to bltouch and the dive height + speeds G31 P500 X-43 Y3 Z2.01 ; set Z probe trigger value, offset and trigger height M557 X0:177 Y3:204 P5:6 ; define mesh grid of 20 points ; Heaters M308 S0 P"bedtemp" Y"thermistor" T100000 B4138 ; configure sensor 0 as thermistor on pin bedtemp M950 H0 C"bedheat" T0 ; create bed heater output on bedheat and map it to sensor 0 M143 H0 S120 ; set temperature limit for heater 0 to 120C M307 H0 B0 S1.00 ; disable bang-bang mode for the bed heater and set PWM limit M140 H0 ; map heated bed to heater 0 M308 S1 P"e0temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 1 as thermistor on pin e0temp M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1 M143 H1 S285 ; set temperature limit for heater 1 to 285C M307 H1 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit ; Fans M950 F0 C"fan0" Q500 ; create fan 0 on pin fan0 and set its frequency M106 P0 C"F0 Part Cooling Fan" S0 H-1 ; set fan 0 name and value. Thermostatic control is turned off M950 F1 C"fan1" Q500 ; create fan 1 on pin fan1 and set its frequency M106 P1 C"F1 Hot End Fan" S1 H1 T45 ; set fan 1 name and value. Thermostatic control is turned on M950 F2 C"fan2" Q500 ; create fan 2 on pin fan2 and set its frequency M106 P2 C"F2 Case Fan" S1 H1:0 T45 ; set fan 2 name and value. Thermostatic control is turned on ; Tools M563 P0 S"Hemera" D0 H1 F0 ; define tool 0 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; Custom settings ;M591 D0 P5 C"e0stop" R15:110 E3.0 S0 ; Duet3D laser sensor for extruder drive 0, connected to endstop input 3 (E0), tolerance 40 to 120%, 3mm, S1=Enabled, S0=Disabled ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 34.243mm/rev, 70% to 130% tolerance, 3mm detection length, S1=Enabled, S0=Disabled M591 D0 P6 C"e0stop" R230:270 L0.4 E3.0 S0 M501 ; automatic loading of the config-override file should be enabled M81 ; Turn off 24VDC power on start up and enable control in the UI ; Soft Power Control M950 J0 C"^exp.e6stop" ; create GPIO input pin 0 attached to Estop6 expansion connector - Senses Power Button, Low=Button Pressed M950 P1 C"!exp.31" ; create GPIO output pin 1 attached to heater7 on expansion connector - Controls Duet2 On=S1 (default), Off=S0 M581 P0 S1 T2 C0 ; When E6 goes Low, execute trigger2.g to complete shutdown ; Miscellaneous T0 ; select first tool M575 P1 S1 B57600 ; set the PanelDue Baudrate
config-override.g
; config-override.g file generated in response to M500 at 2020-09-08 14:58 ; This is a system-generated file - do not edit ; Heater model parameters M307 H0 A102.4 C353.4 D1.2 S1.00 V24.3 B0 M307 H1 A393.8 C198.6 D3.9 S1.00 V24.4 B0 ; Workplace coordinates G10 L2 P1 X0.00 Y0.00 Z0.00 G10 L2 P2 X0.00 Y0.00 Z0.00 G10 L2 P3 X0.00 Y0.00 Z0.00 G10 L2 P4 X0.00 Y0.00 Z0.00 G10 L2 P5 X0.00 Y0.00 Z0.00 G10 L2 P6 X0.00 Y0.00 Z0.00 G10 L2 P7 X0.00 Y0.00 Z0.00 G10 L2 P8 X0.00 Y0.00 Z0.00 G10 L2 P9 X0.00 Y0.00 Z0.00
-
Hi,
-
Have you considered using the filament handling feature of DWC to set hotend temperature based on the currently selected filament instead of testing for the filament name?
-
Where are you setting the Z=0 datum using G30?
-
What is the purpose of the following?
Thanks.
while iterations <=9 ; Perform 10 passes G1 Z15 F300 ; Move Z 15mm up G4 S0.5 ; Wait .5 seconds G1 Z3 F300 ; Raise an additional 3mm M116 ; Wait for all temperatures M291 P"Bed temperature at setpoint. Please wait 5 minutes for stabilization, Z indicates countdown." R"Hotmesh" S0 T10 ; Start countdown - use Z as indicator while iterations <=9 ; Perform 10 passes G4 S30 ; Wait 30 seconds G1 Z-15 F300 ; Move Z 15mm down G90
-
-
@fcwilt thanks for the replay
-
Yes, I believe that is what the author's macro is already doing. It is testing for the filament name which was set per DWC or by using the M701 command. The "move.extruders[0].filament" call just returns the filament type that was set and in this case it is used to determine the bed temp with if logic. Perhaps I have missed your question. Can you elaborate?
-
Ok, remember, I didn't author these macros. I am just trying to figure out how to make them work. Perhaps you are onto the root problem. Where should we add this to the macro?
-
It looks like the author was using the z height as a kind of counter/delay. He drops the bed at the start, then raises it in increments while waiting for the bed temp to stabilize.
per the github link:
"Hotmesh" preforms a bed mesh probing routine with a heat stabilized bed. This macro will heat the bed based on the currently set system filament type, wait 5 minutes for the bed temperature to stabilize, and then perform mesh probe. Once initiated, the nozzle will rise to 150mm and then lower 15mm for every 30 seconds elapsed - about minutes 5 in total. Once the nozzle is at the bed, the mesh probing cycle will commence.
-
-
@fcwilt looking at the author's version of bed.g
; 0:/sys/bed.g ; Called to perform automatic bed compensation via G32 M561 ; Clear any existing bed transform. G28 ; Home all axis. M558 F50 A5 S0.003 ; Slow z-probe, up to 5 probes until disparity is 0.003 or less - else yield average. while iterations <=2 ; Perform 3 passes. G30 P0 X25 Y105 Z-99999 ; Probe near a leadscrew, halfway along Y-axis. G30 P1 X225 Y105 Z-99999 S2 ; Probe near a leadscrew and calibrate 2 motors. G1 X105 F10000 ; Move to the center of the bed. G30 ; Probe the bed at the current XY position. M400 ; Finish all moves, clear the buffer. M558 F50 A5 S-1 ; Slow the z-probe, perform 5 probes and yield the average. while move.calibration.initial.deviation >= 0.003 ; Perform additional leveling if previous deviation was over 0.003mm. if iterations = 5 ; Perform 5 addition checks, if needed. M300 S3000 P500 ; Sound alert, the required deviation could not be achieved. M558 F200 A1 ; Set normal z-probe speed. abort "!!! ABORTED !!! Failed to achieve < 0.002 deviation. Current deviation is " ^ move.calibration.initial.deviation ^ "mm." G30 P0 X25 Y105 Z-99999 ; Probe near the left leadscrew, halfway along Y-axis. G30 P1 X225 Y105 Z-99999 S2 ; Probe near the right leadscrew and calibrate 2 motors. G1 X105 F10000 ; Move the nozzle to the center of the bed. G30 ; Probe the bed at the current XY position. M400 ; Finish all moves, clear the buffer. M558 F200 A1 ; Set normal z-probe speed. echo "Gantry deviation of " ^ move.calibration.initial.deviation ^ "mm obtained." G1 Z8 ; Raise head 8mm to ensure it is above the Z probe trigger height.
He has the G30 call at the end of the bed.g
I didn't use the bed.g because I only have a single z screw and didn't see the advantage to what he was doing in that macro. Perhaps I missed something.
-
@mitch, Yes, the name was purposely chosen for that exact joke.
But, I don't understand what you're trying to do - the following code you ref'd is not mine:
; Heat bed to set temp based off current system filament type if move.extruders[0].filament = "PLA" M140 S60 ; Set PLA Bed Temp to 60C elif move.extruders[0].filament = "PETG" M140 S70 ; Set PETG Bed Temp to 70C else M291 P"Hotmesh requires a filament to be loaded. Please load a filament and re-run hotmesh." R"Hotmesh" S0 T10 M99 ; Abort this macro
This is from my github:
; 0:/macros/Maintenance/Hotmesh ; Called to perform automatic heated bedmesh compensation ; This saves the heightmap to the system's set filament's type directory (0:/filaments/XXXX/heightmap.csv) if state.status = "processing" ; Printer is currently printing! M99 ; Abort this macro T0 ; Ensure tool is selected M703 ; Heat bed to set temp based off current system filament type M104 S-273 ; Turn off hotend M106 S0 ; Turn part cooling blower off if it is on M291 P{"Performing bed heatup per " ^ move.extruders[0].filament ^ " profile. This process will take approximately 6 minutes."} R"Hotmesh" S0 T10 G28 ; Home G1 X105 Y105 ; Place nozzle center of bed ; Give 5 minutes for stabilization G91 ; Set to Rel Positioning while iterations <=9 ; Perform 10 passes G1 Z15 F300 ; Move Z 15mm up G4 S0.5 ; Wait .5 seconds G1 Z3 F300 ; Raise an additional 3mm M116 ; Wait for all temperatures M291 P"Bed temperature at setpoint. Please wait 5 minutes for stabilization, Z indicates countdown." R"Hotmesh" S0 T10 ; Start countdown - use Z as indicator while iterations <=9 ; Perform 10 passes G4 S30 ; Wait 30 seconds G1 Z-15 F300 ; Move Z 15mm down G90 ; Set to Absolute Positioning M291 P"Performing homing, gantry alignment, and mesh probing. Please wait." R"Hotmesh" S0 T10 G32 ; Home and Level gantry M400 ; Clear queue M558 F50 A4 S-1 ; slow z-probe, take 5 probes and yield average G29 ; Perfrom bed mesh G29 S3 [P{"0:/filaments/" ^ move.extruders[0].filament ^ "/heightmap.csv"}] ; Save heightmap.csv to filament type's directory M558 F200 A1 ; normal z-probe M104 S-273 ; Turn off hotend M140 S-273 ; Turn off heatbed M291 P"Hotmesh complete. Hotend and Heatbed are turned off. Performing final homing routine. Please wait." R"Hotmesh" S0 T10 G28 ; Home M18 ; Free all
-
@Kolbi Ah, my bad. sorry, yes let me explain:
I am approaching the filament management a bit different. Your approach uses the config.g for each filament to set the temps. I have a different approach in place and not ready to convert over to that yet. So instead I just dropped in some if logic for now for the decision.
I also didn't catch that I was talking to the actual author of the macros. LOL, GREAT! glad I found you. I like your approach and would like to make the tweaks I need to take advantage of it.
With respect to not setting the datum first. I made the following modification
Now I am a bit closer but still hovering above the bed about 0.17mm higher than if I perform a reboot and standard G29.
On line 28 I added a G30 to reset the datum with a single probe point at the center.
; 0:/macros/Maintenance/Hotmesh ; Called to perform automatic heated bedmesh compensation ; This saves the heightmap to the system's set filament's type directory (0:/filaments/XXXX/heightmap.csv) M80 if state.status = "processing" ; Printer is currently printing! M99 ; Abort this macro T0 ; Ensure tool is selected ; Heat bed to set temp based off current system filament type if move.extruders[0].filament = "PLA" M140 S60 ; Set PLA Bed Temp to 60C elif move.extruders[0].filament = "PETG" M140 S70 ; Set PETG Bed Temp to 70C else M291 P"Hotmesh requires a filament to be loaded. Please load a filament and re-run hotmesh." R"Hotmesh" S0 T10 M99 ; Abort this macro M104 S0 ; Turn off hotend M106 S0 ; Turn part cooling blower off if it is on M291 P{"Performing bed heatup per " ^ move.extruders[0].filament ^ " profile. This process will take approximately 6 minutes."} R"Hotmesh" S0 T10 G28 ; Home M98 P"0:/macros/general/1_Center_Nozzle" ; Place nozzle center of bed G30 ; Give 5 minutes for stabilization G91 ; Set to Rel Positioning while iterations <=9 ; Perform 10 passes G1 Z15 F300 ; Move Z 15mm up G4 S0.5 ; Wait .5 seconds G1 Z3 F300 ; Raise an additional 3mm M116 ; Wait for all temperatures M291 P"Bed temperature at setpoint. Please wait 5 minutes for stabilization, Z indicates countdown." R"Hotmesh" S0 T10 ; Start countdown - use Z as indicator while iterations <=9 ; Perform 10 passes G4 S30 ; Wait 30 seconds G1 Z-15 F300 ; Move Z 15mm down G90 ; Set to Absolute Positioning M291 P"Performing homing, gantry alignment, and mesh probing. Please wait." R"Hotmesh" S0 T10 G32 ; Home and Level gantry M400 ; Clear queue M558 F50 A4 S-1 ; slow z-probe, take 5 probes and yield average G29 ; Perfrom bed mesh G29 S3 [P{"0:/filaments/" ^ move.extruders[0].filament ^ "/heightmap.csv"}] ; Save heightmap.csv to filament type's directory M558 F200 A1 ; normal z-probe M104 S0 ; Turn off hotend M140 S0 ; Turn off heatbed M291 P"Hotmesh complete. Hotend and Heatbed are turned off. Performing final homing routine. Please wait." R"Hotmesh" S0 T10 G28 ; Home M18 ; Free all
-
@mitch No worries, glad you found them helpful.
What is your normal probing speed? Change the macro's probing speed to match your normal one and see if it makes a difference. -
This is what is in my config.g
M558 P9 C"zprobe.in+zprobe.mod" H5 F120 T6000
Not sure how the probe speed would make that much difference. Seems like something else must still be wrong.
-
@mitch
Line #47 of your above:
M558 F50 A4 S-1 ; slow z-probe, take 5 probes and yield averageTo prove/try it - either take the M558's out of the macro or change Line #47 to:
M558 F120 A1Also, in your case you shouldn't be using G32 - use G28 (Line #45)
Something like this:
; 0:/macros/Maintenance/Hotmesh ; Called to perform automatic heated bedmesh compensation if state.status = "processing" ; Printer is currently printing! M99 ; Abort this macro T0 ; Ensure tool is selected ; Heat bed to set temp based off current system filament type if move.extruders[0].filament = "PLA" M140 S60 ; Set PLA Bed Temp to 60C M291 P"Performing bed heatup 60c. This process will take approximately 6 minutes." R"Hotmesh" S0 T10 else M140 S70 ; Set PETG Bed Temp to 70C M291 P"Performing bed heatup 70c. This process will take approximately 6 minutes." R"Hotmesh" S0 T10 G28 ; Home G1 X105 Y105 ; Place nozzle center of bed ; Give 5 minutes for stabilization G91 ; Set to Rel Positioning while iterations <=9 ; Perform 10 passes G1 Z15 F300 ; Move Z 15mm up G4 S0.5 ; Wait .5 seconds G1 Z3 F300 ; Raise an additional 3mm M116 ; Wait for all temperatures M291 P"Bed temperature at setpoint. Please wait 5 minutes for stabilization, Z indicates countdown." R"Hotmesh" S0 T10 ; Start countdown - use Z as indicator while iterations <=9 ; Perform 10 passes G4 S30 ; Wait 30 seconds G1 Z-15 F300 ; Move Z 15mm down G90 ; Set to Absolute Positioning M291 P"Performing homing and mesh probing. Please wait." R"Hotmesh" S0 T10 G28 ; Home M400 ; Clear queue G29 ; Perfrom bed mesh G29 S3 [P{"0:/filaments/" ^ move.extruders[0].filament ^ "/heightmap.csv"}] ; Save heightmap.csv to filament type's directory M104 S-273 ; Turn off hotend M140 S-273 ; Turn off heatbed M291 P"Hotmesh complete. Hotend and Heatbed are turned off. Performing final homing routine. Please wait." R"Hotmesh" S0 T10 G28 ; Home M18 ; Free all
-
@Kolbi I swapped over ot using G28 as you suggested and the results were much better.
But now you have me thinking maybe I have been probing to fast all along. Perhaps instead I need to slow my config.g M558 down to 50 instead of the 120 I was at before:
M558 P9 C"zprobe.in+zprobe.mod" H5 F50 T6000
-
@mitch, I did shift all my probing to slower speeds. Just make sure that all your probing is done the same to ensure no disparities happen.
For example, my homez has two speeds, but does final probing at 50 - like this macro.
; 0:/sys/homez.g ; Home the Z axis M98 P"current-sense-homing.g" ; Ensure the current and sensitivity is set for homing routines. ; !!! If using Pinda, comment-out the following two lines M280 P0 S160 ; BLTouch, alarm release. G4 P100 ; BLTouch, delay for the release command. G91 ; Set relative positioning. G1 H0 Z3 F6000 ; Lift Z axis 3mm. G90 ; Set absolute positioning. G1 X105 Y105 F6000 ; Go to the center of the bed for probe point. M558 F1000 A1 ; Set probing speed to fast for the first pass. G30 ; Perform Z probing. G1 H0 Z5 F400 ; Lift Z axis to the 5mm position. M558 F50 A5 S-1 ; Set probing speed to slow for second pass, take 5 probes and yield the average. G30 ; Perform Z probing. G1 H0 Z5 F400 ; Lift Z axis to the 5mm position. M558 F200 A1 ; Set normal z-probe speed.
-
Hi,
I would suggest you ignore all of those files you found. I think "hot mess" is an accurate description.
For example, while using M116 to wait for temps to reach their set points is perfectly fine using the Z position as some sort of timer/indicator seems very odd.
Why not just use M291 to display messages as to what is actually going on?
And before you go to the trouble of handling height maps for different temperatures verify that you actually will benefit from having them.
And if you are not currently using the filament handling features of the DWC I suggest you give some more consideration to using them.
For example by making using of the config macro for each filament you could handle 2, 3 or more bed temperatures with no change at all to your system macros.
Anyway that's just my two cents. My system macros are simple, easily understood and the results I get when printing are most satisfactory and that, after all, is the goal, is it not?
Glad to help at any time.
Frederick
-
@fcwilt said in Hotmesh or Hot mess?:
For example, while using M116 to wait for temps to reach their set points is perfectly fine using the Z position as some sort of timer/indicator seems very odd.
Why not just use M291 to display messages as to what is actually going on?Easy reason why - users can't read the screen from 10+ feet away while doing other things, and why not take advantage of an available indicator. This way, a quick glance over at it and you can easily tell the status. This came from feedback from several people, but we're all mil and like our easy status reads, so maybe we are odd?
-
@fcwilt appreciate the comment. I am just exploring different macros. I did have to go back to simpler home.g files as these weren't working for me.
However, after three comments about me "not using DWC filament handling" please post your filament files. I BELIEVE I AM using DWC filament handling. I just used a quick if statement to test out this macro as the author was using the filament config.g to heat the hot end whereas I am using the load and unload files to do set temps and just using the config.g to store config such as PID for that filament. But I am always open to being enlightened. If you can post your filament files I am curious what it is that I am missing out on.