Another mesh bed leveling thread...
-
Custom printer. Just finished the pid tuning on the bed tonight. Now want to set up bed mesh leveling but have some questions.
In reading the dozuki it mentions being able to do both lead screw leveling and mesh leveling. Is this a good option to do both as i have independant z lead screws and the bl touch?
I think i have my mesh grid set properly but want to post some assorted gcode files for examination by the experts here before i try any commands. Also, what spacing do most of you use?
Config G
; Configuration file for Duet WiFi (firmware version 3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.2.3 on Wed Mar 03 2021 15:26:56 GMT-0600 (Central Standard Time) ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"The Big One" ; set printer name ; Network M552 S1 ; enable network M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P0 S0 ; physical drive 0 goes reverse M569 P1 S0 ; physical drive 1 goes reverse M569 P2 S1 ; physical drive 2 goes forwards M569 P3 S0 ; physical drive 3 goes reverse M569 P4 S1 ; physical drive 4 goes forwards M569 P5 S0 ; physical drive 5 goes reverse M584 X0:3 Y1 Z2:5 E4 ; set drive mapping M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X395.52 Y80.00 Z400.00 E420.00 ; set steps per mm M566 X300.00 Y900.00 Z180.00 E120.00 ; set maximum instantaneous speed changes (mm/min) M203 X4000.00 Y4000.00 Z600.00 E1200.00 ; set maximum speeds (mm/min) M201 X400.00 Y500.00 Z20.00 E250.00 ; set accelerations (mm/s^2) M906 X1400 Y1000 Z1200 E800 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 X655 Y440 Z400 S0 ; set axis maxima ; Endstops M574 X1 S1 P"!xstop+!e0stop" ; configure active-high endstop for low end on X via pin xstop M574 Y1 S1 P"!ystop" ; configure active-high endstop for low end on Y via pin ystop M574 Z1 S2 ; configure Z-probe endstop for low end on Z ; Z-Probe M950 S0 C"duex.pwm3" ; create servo pin 0 for BLTouch M558 P9 C"^zprobe.in" H5 F120 T6000 ; set Z probe type to bltouch and the dive height + speeds G31 P500 X0 Y-35 Z2.757 ; set Z probe trigger value, offset and trigger height M557 X15:630 Y15:415 S20 ; define mesh grid ; Heaters M308 S0 P"bedtemp" Y"thermistor" T100000 B3950 ; 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 M307 H0 R0.257 C549.0 D2.37 S1.00 ; disable bang-bang mode for the bed heater and set PWM limit M140 H0 ; map heated bed to heater 0 M143 H0 S120 ; set temperature limit for heater 0 to 120C M308 S1 P"e1temp" Y"thermistor" T100000 B4725 C7.06e-8 ; define E1 temperature sensor M950 H1 C"e1heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1 M307 H1 R1.856 C216.2 D4.86 S1.00 V11.8 ; disable bang-bang mode for heater and set PWM limit M143 H1 S280 ; set temperature limit for heater 1 to 280C ; Fans M950 F0 C"fan0" Q500 ; create fan 0 on pin fan0 and set its frequency M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off M950 F1 C"fan1" Q500 ; create fan 1 on pin fan1 and set its frequency M106 P1 S1 H1 T45 ; set fan 1 value. Thermostatic control is turned on ; Tools M563 P0 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 are not defined ; Miscellaneous M575 P1 S1 B57600 ; enable support for PanelDue T0
Home z
G91 ; relative positioning G1 H2 Z5 F2000 ; lift z for clearance G90 ; absolute positioning G1 X320 Y220 F4000 ; move probe to bed center. Adjust coordinates as needed. G30 ; probe the bed G1 X0 Y0 Z5 F4000 ; return to origin position
Home All
; homeall.g ; called to home all axes ; ; generated by RepRapFirmware Configuration Tool v2.1.1 on Sun Nov 03 2019 09:32:23 GMT-0500 (Eastern Standard Time) G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 X-805 Y-505 F800 ; move quickly to X and Y axis endstops and stop there (first pass) G91 G1 H2 X5 Y5 F1800 ; go back a few mm G1 H1 X-10 Y-10 F360 ; move slowly to X and Y axis endstops once more (second pass) ; G1 H1 Z-400 F400 ; move quickly to z axis endstops and stop there (first pass) G1 H2 Z5 F1800 ; go back a few mm G1 H1 Z-10 F360 ; move slowly to z axis endstops once more (second pass) G92 X0 Y0 Z0 G90 ; absolute positioning G1 H2 X15 Y15 F6000 ; go to first bed probe point and home Z G30 ; home Z by probing the bed ; Uncomment the following lines to lift Z after probing G91 ; relative positioning G1 H2 Z5 F100 ; lift Z relative to current position G90 ; absolute positioning
-
-
@wingtip said in Another mesh bed leveling thread...:
Is this a good option to do both as i have independant z lead screws and the bl touch?
I think so. The first will level mechanically the Z mounting points, and the second will take care of any leveling error or surface non flatness.
Also, you want to re-home z after the technical leveling since it can shift the 0 point and you want to do the entire process with bed heated to print temperature. Or at least this is what my printer does.
-
@zapta said in Another mesh bed leveling thread...:
@wingtip said in Another mesh bed leveling thread...:
Is this a good option to do both as i have independant z lead screws and the bl touch?
I think so. The first will level mechanically the Z mounting points, and the second will take care of any leveling error or surface non flatness.
Also, you want to re-home z after the technical leveling since it can shift the 0 point and you want to do the entire process with bed heated to print temperature. Or at least this is what my printer does.
This is my approach also. One thing I do when running the Z level is to disable the mesh if there's one. I think this is the logical thing to do.
-
-
@wingtip said in Another mesh bed leveling thread...:
@fcwilt
https://duet3d.dozuki.com/Wiki/Using_mesh_bed_compensationThanks.
I just wanted to verify the the docs were not using the term "mesh bed leveling" which is what you used in the title of your post.
Bed Leveling (manual or automatic) and Mesh Bed Compensation are two very different things.
Mixing the terms can lead to confusion.
Frederick
-
@fcwilt ummmm so then i cant use both z lead screw leveling and mesh leveling then after all... this is all new stuff to me as this is my first duet, first bl touch, and first time with reprap having been used to marlin with my ft5...
Does my configs look ok and what should my next step be?
-
Yes you can use both Bed Leveling (either Manual or Automatic) and Mesh Bed Compensation
Please note to avoid confusion the term is Mesh Bed Compensation not Mesh Bed Leveling
Frederick
-
Mesh compensation is virtual leveling and flattening.
The duet could use mesh information for a more accurate mechanical leveling but I don't think it's supported.
I think we use different words but talk about same concepts.
-
@wingtip said in Another mesh bed leveling thread...:
G1 H1 Z-400 F400 ; move quickly to z axis endstops and stop there (first pass) G1 H2 Z5 F1800 ; go back a few mm G1 H1 Z-10 F360 ; move slowly to z axis endstops once more (second pass)
Your homeall still has a endstop homing pass for Z, but you don't have an endstop for Z defined in config.g so that will generate an error. You can remove those lines and just use the probe for homing Z. Or if you do have a Z endstop, you'd need to define that endstop in config.g
@wingtip said in Another mesh bed leveling thread...:
G1 H2 X5 Y5 F1800 ; go back a few mm
The H2 switch should only be used for the Z axis to lift it for clearance before it's been homed. Don't use H2 on the X Y back off moves. It could potentially mask an endstop failure.
@wingtip said in Another mesh bed leveling thread...:
In reading the dozuki it mentions being able to do both lead screw leveling and mesh leveling. Is this a good option to do both as i have independant z lead screws and the bl touch?
Yes, it's a good idea if you have 2 Z motors raising the X gantry. Overtime the two Z motors can get out of sync from power cycles causing them to jump in opposite directions.
There's an example for 2 motors here: https://duet3d.dozuki.com/Wiki/Bed_levelling_using_multiple_independent_Z_motors
Here's a sequence of gcode events that might help clear up how you want things to happen.
G28 should home XY and Z with the probe in the center of the bed with G30.
G32 (bed.g) should probe (g30) at both ends of the X axis for tilt correction and then home Z again in the center of the bed (g30).
G29 would then be used to create a heightmap of the surface of the bed and would compensate for the shape of the bed by lifting and lowering Z to keep the distance between nozzle and bed the same across the entire surface.
For spacing between points it's usually best if you can max out the number of points and then just load that saved detailed map before each print rather than redoing the mesh each time.
You should do a detailed probing at least once so you can get a good idea of what the surface of the bed looks like. If it's exceedingly flat you can get away with a lower density.
-
@zapta said in Another mesh bed leveling thread...:
Mesh compensation is virtual leveling and flattening.
While it can compensate for a out of level bed that is not the best approach to dealing with a out of level bed.
The documentation refers to Mesh Bed Compensation not Mesh Bed Leveling.
Using another term can lead to confusion.
Frederick
-
@blacksheep99 said in Another mesh bed leveling thread...:
when running the Z level is to disable the mesh if there's one
Is the independent Z leveling affected by the mesh data, if loaded? That is, different mesh data will result in different Z leveling?
-
@zapta I don't think so, since the tilt correction would be using G30 commands to find Z0, but it is recommended to cancel any transforms with M561 regardless.
-
Im really trying to get a grasp on all this but there are so many options and functions you can do and its overwhelming.
I did have endstops on the dual z lead screws but was told i couldnt use those if i was installing the bl touch so i removed those quite a bit ago. All that i have for z is the bltouch right now.Based on padreux suggestion i removed those lines from the homeall... the new homeall is as follows:
; homeall.g ; called to home all axes ; ; generated by RepRapFirmware Configuration Tool v2.1.1 on Sun Nov 03 2019 09:32:23 GMT-0500 (Eastern Standard Time) G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 X-805 Y-505 F800 ; move quickly to X and Y axis endstops and stop there (first pass) G91 G1 H2 X5 Y5 F1800 ; go back a few mm G1 H1 X-10 Y-10 F360 ; move slowly to X and Y axis endstops once more (second pass) G92 X0 Y0 Z0 G90 ; absolute positioning G1 H2 X15 Y15 F6000 ; go to first bed probe point and home Z G30 ; home Z by probing the bed ; Uncomment the following lines to lift Z after probing G91 ; relative positioning G1 H2 Z5 F100 ; lift Z relative to current position G90 ; absolute positioning
as for the H1 and H2, those were what was told to me by others in another thread on these forums. If a line needs edited please identify (and hopefully explain why so im learning, albeit slowly lol)
Home z is still
G91 ; relative positioning G1 H2 Z5 F2000 ; lift z for clearance G90 ; absolute positioning G1 X320 Y220 F4000 ; moves probe to approximate bed center. G30 ; probe the bed G1 X0 Y0 Z5 F4000 ; return to origin position
Im guessing i need another macro or two , to execute bed probing and then auto leveling?? And still wondering what spacing you guys suggest on the probing. Currently i have it set to 20mm. On a bed thats nearly 800x500 that could be a lot of probes??
-
@wingtip said in Another mesh bed leveling thread...:
I did have endstops on the dual z lead screws but was told i couldnt use those if i was installing the bl touch
Not true.
You can use typical endstop devices for homing Z even with multiple steppers if you have a endstop device for each stepper.
I have 3 steppers and 3 associated endstop devices - it homes just fine.
quick video of Z Homing 3 Steppers
When using endstops for homing you then use the Z probe (BLTouch in your case) for:
- Auto Bed Leveling (G32)
- Creating the height map(s) for Mesh Bed Compensation (G29)
- Setting the Z=0 Datum (G30)
Frederick
-
Yes it can all be a bit overwhelming.
Here's what I would use for homeall.
; homeall.g G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 X-805 Y-505 F800 ; move quickly to X and Y axis endstops and stop there (first pass) G1 X5 Y5 F1800 ; go back a few mm G1 H1 X-10 Y-10 F360 ; move slowly to X and Y axis endstops once more (second pass) G90 ; absolute positioning G1 X320 Y220 F4000 ; moves probe to approximate bed center. G30 ; home Z by probing the bed G1 X0 Y0 Z5 F4000 ; return to origin position
Removed the H2 from the XY moves.
Removed the G92 to force a position. The position will be determined by the M208 minima value set in config.g
Changed the probe position to match your homez.In bed.g you need to specify two points close to the lead screws to probe and a command in config.g to tell the firmware where those lead screws are located.
Example here shows what you need.
Final bed.g would look something like this (with your actual positions)
; bed.g M561 ; clear any bed transforms G28 ; home all G30 P0 X20 Y100 Z-99999 ; probe near a leadscrew, half way along Y axis G30 P1 X180 Y100 Z-99999 S2 ; probe near a leadscrew and calibrate 2 motors G1 X320 Y220 F4000 ; moves probe to approximate bed center. G30 ; probe the bed G29 ; create a mesh grid G1 X0 Y0 Z5 F4000 ; return to origin position
@wingtip said in Another mesh bed leveling thread...:
And still wondering what spacing you guys suggest on the probing. Currently i have it set to 20mm. On a bed thats nearly 800x500 that could be a lot of probes??
You're limited to 441 points, so if you set a very low spacing in your m557 command and send it in the gcode console (like 1mm) it will tell you what your minimum spacing would be to stay within the limit.
It's also possible to use number of points to probe and it will figure out the spacing to get that number of points.
M557 X15:630 Y15:415 P10
for example will probe a 10x10 grid.