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

    Changing G-Code To Control 6 Stepper Motors

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    2
    7
    634
    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.
    • mattling9undefined
      mattling9
      last edited by

      I am using a DuetWifi and Duet 2X Board to connect 6 stepper motors for a robotic arm project. So far i can control the X, Y and Z axis as usual but i want to be able to control the other 3 stepper motors in the same way without treating them as extruders.

      Can someone please explain how i am able to do this?

      Here is my current Config.g

      ; generated by RepRapFirmware Configuration Tool v2 on Thu Feb 21 2019 16:57:55 GMT+0000 (Greenwich Mean Time)

      ; General preferences
      G90 ; Send absolute coordinates...
      M83 ; ...but relative extruder moves

      ; Network
      M550 P"RoboticArm Firmware 1.1" ; Set machine name
      M551 P"<my password name>." ; Set password
      M552 S1 ; Enable network
      M587 S"BTHub3-F8KX" P"<my password name>" ; Configure access point. You can delete this line once connected
      M586 P0 S1 ; Enable HTTP
      M586 P1 S0 ; Disable FTP
      M586 P2 S0 ; Disable Telnet

      ; Drives
      M569 P0 S1 ; Drive 0 goes forwards
      M569 P1 S1 ; Drive 1 goes forwards
      M569 P2 S1 ; Drive 2 goes forwards
      M350 X16 Y16 Z16 I0 ; Configure microstepping without interpolation
      M92 X200.00 Y200.00 Z200.00 ; Set steps per mm
      M566 X50.00 Y50.00 Z50.00 ; Set maximum instantaneous speed changes (mm/min)
      M203 X1000.00 Y1000.00 Z1000.00 ; Set maximum speeds (mm/min)
      M201 X10.00 Y10.00 Z10.00 ; Set accelerations (mm/s^2)
      M906 X2000.00 Y2000.00 Z2000.00 I30 ; Set motor currents (mA) and motor idle factor in per cent
      M84 S30 ; Set idle timeout

      ; Axis Limits
      M208 X-300 Y-300 Z-300 S1 ; Set axis minima
      M208 X300 Y300 Z300 S0 ; Set axis maxima

      ; Endstops
      M574 X1 Y1 Z1 S1 ; Set active high endstops

      ; Z-Probe
      M558 P5 H5 F120 T6000 ; Set Z probe type to switch and the dive height + speeds
      G31 P500 X0 Y0 Z2.5 ; Set Z probe trigger value, offset and trigger height
      M557 X-285:85 Y-285:10 S20 ; Define mesh grid

      ; Heaters
      M140 H-1 ; Disable heated bed

      ; Fans

      ; Tools

      ; Automatic saving after power loss is not enabled

      ; Custom settings are not configured

      1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators
        last edited by

        You can create up to 6 additional axes using M584, see https://duet3d.dozuki.com/Wiki/Gcode#Section_M584_Set_drive_mapping.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        mattling9undefined 1 Reply Last reply Reply Quote 0
        • mattling9undefined
          mattling9 @dc42
          last edited by

          @dc42 Thanks so much for your help! this is exactly what i need!

          M584 U0 V1 W2 X3 Y4 Z5 would do the trick??

          dc42undefined 1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @mattling9
            last edited by

            @mattling9 said in Changing G-Code To Control 6 Stepper Motors:

            M584 U0 V1 W2 X3 Y4 Z5 would do the trick??

            Yes, except you should add something like E10 to that command to prevent drivers 3 4 and 5 being assigned to extruders as well as axes (see the Important Note in the M584 description). Or you can use M584 X0 Y1 Z2 U3 V4 W5 E10. Or any other axis-to-driver assignment you want.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            mattling9undefined 1 Reply Last reply Reply Quote 0
            • mattling9undefined
              mattling9 @dc42
              last edited by

              @dc42 said in Changing G-Code To Control 6 Stepper Motors:

              M584 X0 Y1 Z2 U3 V4 W5 E10

              Adding the E10 does make a lot of sense! I didn't think it would be that easy to get it working!

              Thanks so much for your help 🙂

              1 Reply Last reply Reply Quote 0
              • mattling9undefined
                mattling9
                last edited by

                One last question, Is there a way to bypass the homing?

                i understand motors will not move until homed, so can i just leave the homex.g files blank or does there have to be some sort of movement to make it a valid home?

                1 Reply Last reply Reply Quote 0
                • dc42undefined
                  dc42 administrators
                  last edited by

                  You can use a G92 command to bypass homing. For example, if you don't yet have a U axis homing switch, you can put G92 U0 in homeu.g and in homeall.g, to tell the firmware that the U axis is assumed to be at coordinate 0.0.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA