Bed leveling with 2 independent Z motors

  • As already discussed on Github:

    I'm running DuetWifi with FW 1.19.2 and a CoreXY setup.
    I want to do bed leveling with G32 with two independent Z motors, and two leadscrews on the center-left & center-right of my bed.
    I followed this guide: Wiki:

    My config:

    M584 X0 Y1 Z2:4                                 ; Drive mapping: 0=A, 1=B, 2 and 4 are individual Z steppers
    M671 X-52:296 Y142:142 S15                      ; Define positions of Z leadscrews
    M667 S1

    My bed.g:

    M561                        ; clear any existing bed transform
    G28                         ; home
    G30 P0 X10 Y142 Z-99999
    G30 P1 X230 Y142 Z-99999 S2
    G28 Z
    ```This gives me: `Error: probe points P0 to P1 must be in clockwise order starting near X=0 Y=0`. I suppose there is some math trickery involved, so I change Y to be 1mm more:

    M561 ; clear any existing bed transform
    G28 ; home
    G30 P0 X10 Y142 Z-99999
    G30 P1 X230 Y143 Z-99999 S2
    G28 Z

    Ok, now I get this error: `Bed calibration error: 2 points provided but only 3, 4 and 5 supported`
    Which is weird, because why would I want to probe 3 points on my 2-leadscrew setup?
    As far as I can tell, there is no code for a 2-point calibration: [](
    Just for the sake of completeness, I added a third point (back-center). Now I finally get a bed map and some offset information. But still no auto-correction.
    I think I want to somehow trigger this ([](, but fail for unknown reasons.
    Thanks for the help!

  • administrators

    I got that error when M671 was not set correctly in my config. You can enter M671 in the console to check that it is set correctly. That was on a cartesian not on a CoreXY though.

  • administrators

    The M671 command needs to come after the M667 command. I'll add this to the documentation.

  • Thanks! That did the trick!
    Now my bed is leveling correctly.

    It would be nice if such G-code inter-dependencies would raise an error or something to make users aware of potential problems.

Log in to reply