Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Dual X Axis Motors with Dual Endstops. Homing togethor

    Scheduled Pinned Locked Moved Solved
    Tuning and tweaking
    2
    4
    165
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Adamfilipundefined
      Adamfilip
      last edited by

      Duet 3 Mini 5+ Wifi

      my X axis has two X motors, each with its own X endstop
      I want them to both home simultaneously. and then each stop independently. to square the X axis each time.

      I have Split X2 to be U

      
      ; Drives Configuration
      M569 P0.0 S1 D2                          ; Drive 0.0 (X motor) forwards
      M569 P0.1 S1 D2                          ; Drive 0.1 (U motor) forwards
      M569 P0.2 S0 D2                          ; Drive 0.2 (Y motor) backwards
      M569 P0.3 S1 D2                          ; Drive 0.3 (Z motor) forwards
      ; M569 P0.4 S1 D2                        ; Uncomment if you have an extruder motor on drive 0.4
      
      ; Motor Idle Settings
      M906 I30                                 ; Set motor idle current to 30%
      M84 S30                                  ; Set idle timeout to 30 seconds
      
      ; Axis Mapping
      M584 X0.0:0.1 Y0.2 Z0.3 E0.4             ; Assign drives to axes (both X motors to X axis)
      ; Note: E0.4 is for the extruder; adjust if necessary
      
      ; Microstepping and Steps per mm
      M350 X16 U16 Y16 Z16 E16 I1              ; Configure microstepping with interpolation
      M92 X80 U80 Y80 Z400 E420                ; Set steps per mm
      
      ; Axis Limits
      M208 X0:400 U0:400 Y0:300 Z0:200         ; Set axis travel limits for X and U axes
      
      ; Motor Currents
      M906 X800 U800 Y800 Z800 E800            ; Set motor currents (mA)
      
      ; Accelerations and Speeds
      M566 X900 U900 Y900 Z12 E120             ; Set maximum instantaneous speed changes (mm/min)
      M203 X6000 U6000 Y6000 Z180 E6000        ; Set maximum speeds (mm/min)
      M201 X500 U500 Y500 Z20 E1000            ; Set accelerations (mm/s^2)
      
      ; Kinematics
      M669 K0                                  ; Configure Cartesian kinematics
      
      ; Endstops Configuration
      M574 X1 S1 P"io5.in"                     ; X axis endstop at min position on io5.in
      M574 U1 S1 P"io6.in"                     ; U axis endstop at min position on io6.in
      M574 Y2 S1 P"io3.in"                     ; Y axis endstop at max position on io3.in
      M574 Z1 S1 P"io4.in"                     ; Z axis endstop at min position on io4.in
      

      HomeX code

      ; homex.g
      ; called to home the X axis
      ;
      ; generated by RepRapFirmware Configuration Tool v3.5.5 on Mon Nov 11 2024 17:58:55 GMT-0500 (Eastern Standard Time)
      
      ; increase Z
      G91 ; relative positioning
      G1 H2 Z5 ; move Z relative to current position to avoid dragging nozzle over the bed
      G90 ; absolute positioning
      
      ; home X
      G91 ; relative positioning
      ; calculate how far X can travel to the max endstop
      var maxTravel = 200
      M584 X0.0 X0.1 ; split X motors for independent homing (both motors should move simultaneously)
      G1 H1 X0.0-200 X0.1-200 F600 ; coarse home both X motors simultaneously and independently
      G1 X5 F6000 ; move back 5mm
      G1 H1 X0.0-200 X0.1-200 F300 ; fine home both X motors simultaneously and independently
      M584 X0.0:0.1 ; rejoin X motors to move together
      G90 ; absolute positioning
      
      ; decrease Z again
      G91 ; relative positioning
      G1 H2 Z-5 F6000 ; move Z relative to current position
      G90 ; absolute positioning
      
      

      so far its not homing properly
      things move fine when im manually moving X. but when trying to home X and U (X2) at same time U isnt moving

      Adamfilipundefined 1 Reply Last reply Reply Quote 0
      • Adamfilipundefined
        Adamfilip @Adamfilip
        last edited by Adamfilip

        @Adamfilip ok I got it working
        hope this helps someone

        this is my revised home X

        ; homex.g
        ; called to home the X axis
        
        ; increase Z
        G91 ; relative positioning
        G1 H2 Z5 ; move Z relative to current position to avoid dragging nozzle over the bed
        G90 ; absolute positioning
        
        ; home X and U simultaneously
        G91 ; relative positioning
        M584 X0.0 U0.1 ; split X and U motors for independent homing (enable endstops)
        G1 H1 X-200 U-200 F600 ; coarse home X and U motors simultaneously
        M584 X0.0:0.1 ; rejoin X and U motors to move together
        
        G90 ; absolute positioning
        
        ; decrease Z again
        G91 ; relative positioning
        G1 H2 Z-5 F6000 ; move Z relative to current position
        G90 ; absolute positioning
        
        
        and here is my config
        
        

        code_text

        
        ; Drives Configuration
        M569 P0.0 S1 D2                          ; Drive 0.0 (X motor) forwards
        M569 P0.1 S0 D2                          ; Drive 0.1 (U motor / X2) backwards
        M569 P0.2 S0 D2                          ; Drive 0.2 (Y motor) backwards
        ;M569 P0.3 S1 D2                          ; Drive 0.3 (Z motor) forwards
        ; M569 P0.4 S1 D2                        ; Uncomment if you have an extruder motor on drive 0.4
        
        ; Motor Idle Settings
        M906 I30                                 ; Set motor idle current to 30%
        M84 S30                                  ; Set idle timeout to 30 seconds
        
        ; Axis Mapping
        M584 X0.0:0.1 Y0.2 Z0.3 E0.4             ; Assign drives to axes (both X motors to X axis)
        
        ; Microstepping and Steps per mm
        M350 X16 Y16 Z16 E16 I1                  ; Configure microstepping with interpolation
        M92 X80 Y80 Z400 E420                    ; Set steps per mm
        
        ; Axis Limits
        M208 X0:400 Y0:300 Z0:200                ; Set axis travel limits
        
        ; Motor Currents
        M906 X1100 Y1100 Z800 E800               ; Set motor currents (mA)
        
        ; Accelerations and Speeds
        M566 X900 Y900 Z12 E120                  ; Set maximum instantaneous speed changes (mm/min)
        M203 X6000 Y6000 Z180 E6000              ; Set maximum speeds (mm/min)
        M201 X500 Y500 Z20 E1000                 ; Set accelerations (mm/s^2)
        
        ; Kinematics
        M669 K0                                  ; Configure Cartesian kinematics
        
        ; Endstops Configuration
        M574 X1 S1 P"io5.in"                     ; X axis endstop at min position on io5.in
        M574 U1 S1 P"io6.in"                     ; U axis endstop at min position on io6.in
        M574 Y2 S1 P"io3.in"                     ; Y axis endstop at max position on io3.in
        M574 Z1 S1 P"io4.in"                     ; Z axis endstop at min position on io4.in
        
        ; Tools Configuration
        M563 P0 D0 H1 F0                         ; Define tool 0
        M568 P0 R0 S0                            ; Set tool 0 active and standby temperatures to 0C
        
        ; Allow Movement Without Homing
        M564 H0 S0                               ; Allow movement without homing
        oliofundefined 1 Reply Last reply Reply Quote 0
        • oliofundefined
          oliof @Adamfilip
          last edited by oliof

          @Adamfilip you also could not split the axes and set the endstops pins in one M574 in the order if the defined motors separated by + signs. See https://docs.duet3d.com/User_manual/Connecting_hardware/Z_probe_auto_levelling#axis-levelling-using-endstops

          <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

          Adamfilipundefined 1 Reply Last reply Reply Quote 1
          • Adamfilipundefined
            Adamfilip @oliof
            last edited by

            @oliof Awesome thanks for that!

            1 Reply Last reply Reply Quote 0
            • Phaedruxundefined Phaedrux marked this topic as a question
            • Phaedruxundefined Phaedrux has marked this topic as solved
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA