Bed Levelling using multiple Z motors
-
I have built a customized 3D printer using multiple Z axis. To perform the bed levelling using 4 Z axis motors, have input the following commands in the config.g and bed.g file
config.g file
M584 X1.0 Y1.1:1.2 Z0.0:0.1:0.2:0.3
M671 X5:5:545:545 Y70:455:455:70 S5.0bed.g file
M561 ; clear any bed transform
G28 ; home
G90 ; set to absolute positioning
G30 P0 X5 Y80 Z-99999 ; probe near a leadscrew
G30 P1 X5 Y455 Z-99999 ; probe near a leadscrew
G30 P2 X545 Y455 Z-99999 ; probe near a leadscrew
G30 P3 X545 Y80 Z-99999 S4 ; probe near a leadscrew and calibrate 4 motors
M400 ; wait for current moves to finishEarlier in the bed.g file, Z cordinate was just -1.0 for all the points. So there was actually no gantry up down movement and the message was displayed in the console the deviation before & after (-1.000,0.000)
However after changing the z cordinate to -99999 (as per the example in documentation) my gantry actually started moving down to check at the lead screws.
Now should I emply my z-probe (which is a microswitch and to be manually deployed) for measuring at the lead screws?
And as per the exapmple in documentation after the M671 command there is an M208 which for the axis max travel and is to set the minimia and maxima with the s parameter. Is the M208 command required and where it has to be placed?
M584 X0 Y1 Z2:3:4:5 E6;
M671 X-15:-15:215:215 Y-10:190:190:-10 S0.5
M208 X-5:205 Y0:200 -
Your config.g file should already have the M208 which is a very basic element of printer configuration. Whatever the settings are they may work fine for bed leveling.
Regards the M671 command in your config.g file:
While this is a common place for that command to appear I always put it in the bed.g file. That way any changes I find I need to make the to the settings in the M671 take effect the next time I run bed.g.
M671 is only used for bed leveling and I see no reason to have it appear in the config.g file.
Regards your Z probe:
Yes, you Z probe must be mounted and working for bed leveling to succeed.
Here is an example of how to do bed leveling with four Z steppers. The actual leveling process is done in a loop which checks the results and tries again if the results are not satisfactory
; ------------------------------------------------------------------ ; --- example of bed.g to do auto bed leveling with 4 Z steppers --- ; ------------------------------------------------------------------ M290 R0 S0 ; clear baby stepping G29 S2 ; cancel mesh bed compensation ; --- specify where Z leadscrews are --- ; M671: Define positions of Z leadscrews ; Xnn:nn:nn:nn... list of 4 X coordinates of the pivot points of the gantry where it connects to the Z axis ; Ynn:nn:nn:nn. list of 4 Y coordinates of the pivot points of the gantry where it connects to the Z axis ; Snn maximum correction allowed for each leadscrew in mm (optional, default 1.0) ; Fnn fudge factor, default 1.0 ; *** important *** ; Xaaa and Yeee are for the 1st Z stepper in your M584 command ; Xbbb and Yfff are for the 2nd Z stepper in your M584 command ; Xccc and Yggg are for the 3rd Z stepper in your M584 command ; Xddd and Yhhh are for the 4th Z stepper in your M584 command M671 Xaaa:bbb:ccc:ddd Yeee:fff:ggg:hhh ; replace the letters with the actual values for your machine ; --- level bed --- while true ; run leveling pass ; --- probe near bed corners --- again replace the letters with the actual values for your bed G30 P0 Xaaa Ybbb Z-99999 ; probe near LF corner G30 P1 Xccc Yddd Z-99999 ; probe near LR corner G30 P2 Xeee Yfff Z-99999 ; probe near RR corner G30 P2 Xggg Yhhh Z-99999 S4 ; probe near RF corner ; check results - exit loop if results are good if move.calibration.initial.deviation < 0.02 set var.success = true break ; check pass limit - exit loop if pass limit reached if iterations = 5 set var.success = false break ; --- end of while loop --- ; --- set the Z=0 Datum --- G90 G1 Xaaa Ybbb F6000 ; use the correct values for aaa and bbb for the center of your bed G30
If you have any questions don't hesitate to ask.
Frederick
-
Thanks Frederick
I would be mounting the Z-probe for Levelling as well.
Regarding the M208, yes it is available in the config.g file under the Axis limit section for defining the axes travel limit. However I was wondering for the M208 command after the M671, which i think may not be necessary
-
It's possible to have a printer with "excess" travel on the X and/or Y axis. By "excess" I mean the nozzle can be moved outside the printing area without colliding with something.
For probes like inductive or BL-Touch type they are offset from the nozzle by some amount. For that type of probe to be able to move to the anywhere on the printing area the nozzle is going to end up outside the printing - assuming the design of the printer allows that.
So let's assume your printable area is 300mm x 200mm but each axis can safely travel beyond it's limits at each end by 50mm. With a probe that has a X offset of 0 and a Y offset of +25 the probe could reach the entire 300mm by 200mm area IF the M208 limits allowed for that.
But let's also assume to prevent inadvertent printing outside the 300mm by 200mm area your M208 is M208 X-150:150 Y-100:100 (this puts 0,0 at bed center - my preference).
To allow the probe to reach anywhere in the 300mm by 200mm area you either need to change you M208 settings for the duration of the probing operation OR you could use M564 S0 to allow movement outside the M208 limits during the probing operation and then M561 S1 to prevent it again.
Or you could decide to do neither and simply accept the limits of probe movement imposed by your normal M208 settings.
Some folks would simply set M208 to allow movement over the max area possible and run the chance of printing outside the print area.
Frederick
-
@SANJR Order dependencies are listed in the Gcode dictionary, where relevant.
M208Order dependency
If this command refers to any axes other than X, Y and Z then it must be later in config.g than the M584 command that creates those additional axes.
Order dependency
M671 must come later in config.g than any command that changes the kinematics, e.g. M667 or M669.
So it shouldn't matter if M208 is before M671, or vice versa.
Your M671 does look a bit strange, though.
M671 X5:5:545:545 Y70:455:455:70 S5.0
This effectively says that the leadscrews are within the bed area, at (X,Y) 5,70 and 5,455 and 545,455 and 545,70. As it says in M671:
M671 is used to define the pivot points of the bed or gantry where it connects to the Z axis. These pivot points are often at each leadscrew, but may also be offset from the leadscrews, if the bed/gantry rests on a carriage extending out from the leadscrew, for example on a kinematic mount.
Generally with 4 Z axis motors, I'd expect the pivot points to be where the leadscrews are, rather than on Kinematic mounts under the bed.
Ian