Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Help configuring rc servo for spindle

    CNC
    2
    5
    93
    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.
    • flclkrazy
      flclkrazy last edited by

      I have a Duet 3 that I'm trying to configure as a cnc router. I have io3.out going to a relay to turn the router on and off. I also have io6.out to control a rc servo that turns the speed potentiometer of the router.

      What would be the best way to configure this setup?

      So far the code below works for the relay, but I can't figure out how to make the servo move. I've tried M280 P1 S0, M280 P1 S90, and M280 P1 S180 but no movement.

      M950 P0 C"io3.out" ;Assign P0 to control enable relay using "io3.out" 
      M950 R0 C"io6.out" L10000 Q50 ;Create spindle index 0, with PWM pin on io3 and 10000 RPM achieved at full PWM with a 50Hz PWM
      M563 P1 S"Spindle 1" R0 ; Create tool 1 with spindle 0 and call it "Spindle 1"
      
      1 Reply Last reply Reply Quote 0
      • Phaedrux
        Phaedrux Moderator last edited by

        Your M950 commands use P0 and R0 but your M280 commands are using P1.

        M950 creates a servo pin with an index P#
        M280 targets a servo pin with the same index P#

        Z-Bot CoreXY Build | Thingiverse Profile

        1 Reply Last reply Reply Quote 0
        • flclkrazy
          flclkrazy last edited by

          So what you're saying is that M563 does not map R0 to P1 the way I thought it did. So does that mean R0 and P0 are also the same?

          ;M950 P0 C"io3.out" ;Assign P0 to control enable relay using "io3.out" 
          ;M950 R0 C"io6.out" L10000 Q50 ;Create spindle index 0, with PWM pin on io6 and 10000 RPM achieved at full PWM with a 50Hz PWM
          ;M563 P1 S"Spindle 1" R0 ; Create tool 1 with spindle 0 and call it "Spindle 1"
          M950 P1 C"io6.out" Q50
          

          I commented out the lines and tried that single M950 to see if I can get the servo to move, but M280 P1 S(degrees) does nothing.

          Also of note, I am using FW 3.2.2 and here is my config.g

          1 Reply Last reply Reply Quote 0
          • Phaedrux
            Phaedrux Moderator last edited by

            https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M280_Set_servo_position

            https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M950_Create_heater_fan_spindle_or_GPIO_servo_pin

            https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M563_Define_or_remove_a_tool

            M950 P1 C"io6.out" Q50

            Try starting with P0 since it's the first servo you are defining. Then M280 P0 Sdegrees to control.

            If that doesn't work, are you sure the servo itself is working?

            Z-Bot CoreXY Build | Thingiverse Profile

            1 Reply Last reply Reply Quote 0
            • flclkrazy
              flclkrazy last edited by flclkrazy

              My problem was two fold. One is my io6.out pin doesn't work according to my scope and switching to a different pin fixed things. The other is I'm using 3.2.2 when the R argument for M563 is only available in RRF >= 3.3beta2. Same Problem with using the R argument is M950, only available in RRF >=3.3beta2.

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