Need help with M584 to sync 3 z-motors.



  • I have 3 z motors each with its own driver.

    I want to be able to home them to Z-MAX and sync the motors using limit-switches.

    I have made a virtual U-Axis which is identical to my Z-max, except Z home to Minium using a probe, and U to MAX.

    The Z axis is using Drive 2, 3 and 4. I have them working very well, but I just can't crack the 3-way individual homing. (I previously did it with 2)

    Min and Max for axes

    [[language]]
    M208 X0 Y0 Z-2 U-2 V0 W0 S1                              ; Set axis minima
    M208 X225 Y225 Z220 U220 V220 W220 S0                        ; Set axis maxima
    
    

    Endstops

    [[language]]
    M574 X1 Y2 U2 V2 W2 S1           		; 1 = Home to Min. 2 = Home to Max. S1 NC/Active High
    M574 Z1 S2					; Define Z to use Sensor. Home to Min
    M558 P5 H5 F120 T2000 X0 Y0 Z1 U0 V0 W0 	; Set Z probe type/mode 5\. H=Dive Height. XYUVWA not using probe. Z uses probe.  
    
    

    ; Drive Mapping

    [[language]]
    M584 X0 Y1 Z2:3:4 U2:3:4 V3 W4 E5:6:7:8 P6	; Custom drive mapping
    
    

    Motion Setup with microstepping, steps and all that is setup pr physical and virtual axis.
    How much is really needed for the virtual axes here, ie should I define motor current?

    homeu.g file
    My homing file looks like this right now.
    Issues:

    • I've tried using the G92 to define Z and U max, but the commands does nothing? (I commented them out after I realized they didn't do anything)

    • The axes home fine via the U240 but it will not move back up afterwards, so had to use Z-2 instead..

    • Using M584 to split the axes. I did originally split them into 3 seperate, ie V, W, A, but that didn't work at all, so using U V and W.

    • At this point I can move the U up using G1…

    • What does the S2 mean? When looking in the Wiki it's listed as being explained in notes, but there is no explanation?

    • It seems to be working somewhat, but not entirely. I can see my second Z motor is behaving odd somehow (P3 drive. V axis)

    [[language]]
    ; Homeing file to home all 3 Z.motors to max and sync them
    ; U:2:3:4
    
    G91            		; relative mode
    G1 U240 F500 S1		; Move U to Z-max stop at endstop
    ;G92 Z240		; Define Z positions
    ;G92 U240
    G1 z-2 F500		; Move U 5mm away from limit switches
    
    M584 U3           	; split U into 3 (U+V+W)
    G1 U2 V2 W2 F5000 S1 	; Move up to _2_mm in the +U direction, stop if endstop is triggered
    G1 U-2 V-2 W-2 F500 S2	; move 2mm in the -Z direction - S2?;
    G1 U2 V2 W2 F500 S1	;Move slowly 5mm in the +Z direction. Stop when endstop is triggered
    M584 U2:3:4             ; join U to Z again - Driver 2,3,4
    G90                     ; back to absolute mode
    
    

  • administrators

    Are your M208 and M574 commands in config.g after the M584 command that creates the additional axes? They need to be.



  • This page explains how to get individual Z-motors to work:
    https://www.duet3d.com/wiki/Bed_levelling_using_multiple_independent_Z_motors

    I used the example and modified to my setup ( I have 2 leadscrews for Z). Worked right away.

    /Thom



  • Got it working.. irks me I don't exactly know WHY it's doing what it's doing though

    [[language]]
    ; Homeing file to home all 3 Z.motors to max and sync them
    ; U:2:3:4
    
    G91            		; relative mode
    G1 U240 F500 S1		; Move U to Z axis and stop at endstop - First Pass
    G1 U-2 F500		; Move U 2mm away from limit switches
    
    M584 U3           	; Split U into 3 (U+V+W)
    G1 U2 V2 W2 F500 S1	; Move up to _2_mm in the +U direction. Stop at endstop pr axes - Second Pass
    G1 U-2 V-2 W-2 F500 S2	; Move 2mm in the -Z direction - S2?;
    M584 U2:3:4             ; join U to Z again - Driver 2,3,4
    G92 Z240		; Define Z positions
    G90                     ; Back to absolute mode
    
    


  • @Captain_sq:

    This page explains how to get individual Z-motors to work:
    https://www.duet3d.com/wiki/Bed_levelling_using_multiple_independent_Z_motors

    I used the example and modified to my setup ( I have 2 leadscrews for Z). Worked right away.

    /Thom

    Thom, that one is for using a probe to bed level. This is not what I'm trying to do here 🙂



  • @dc42:

    Are your M208 and M574 commands in config.g after the M584 command that creates the additional axes? They need to be.

    No. Should they be?

    My order is:
    M208
    M574
    M584

    But I got it working (see just above).. I just don't know what is going on exactly, which irks me. Like what the "S2" switch is doing (I found that when I originally started doing this way back) but there is a reference to a note to explain it in wiki, but the note does not exist, so I don't know why it's needed.


  • administrators

    Yes, M584 must come before M208 and M574. Otherwise any new axis names created by M584 are ignored in the M208 and M574 commands.

    The S2 commands means do a raw motor move. On a Cartesian printer the main effect is to ignore any X or Y axis mapping specified in the definition of the current tool.



  • @dc42:

    Yes, M584 must come before M208 and M574. Otherwise any new axis names created by M584 are ignored in the M208 and M574 commands.

    The S2 commands means do a raw motor move. On a Cartesian printer the main effect is to ignore any X or Y axis mapping specified in the definition of the current tool.

    Ok. I’ll swap them around tomorrow, but it is working now, which is odd, as the order is incorrect.
    I do have he stop sign displayed when moving mouse over the Home U button though. But it still works.

    Regarding S2. It means its irrelevant to the z axes, or did you just use x and y as examples?

    Sounds like you say I target the drive and not the letter (same as extruding using a drive and not a tool in the webgui), but how does the targeting work I practice? Pretend I’m very dumb and slow please!

    The note on S2 is entirely missing under endstop and move description in The Gcode page/wiki.



  • @dc42:

    Yes, M584 must come before M208 and M574. Otherwise any new axis names created by M584 are ignored in the M208 and M574 commands.

    The S2 commands means do a raw motor move. On a Cartesian printer the main effect is to ignore any X or Y axis mapping specified in the definition of the current tool.

    Great! 🙂 After positioning the M584 in the right place, above all other definitions, it works.

    Had to change the S2 to the S1, as it caused issues now the axes are defined properly. I had the S2 from my original source, who used it. Even though I didn't know what it did, I ended up doing the same, as it didn't work without it. Now I know why!

    The stop sign above Home U also went away!

    I'll be updating my Blog-post on 2x Z axis and write a new one when doing it using 3 motors 🙂


Locked
 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.