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

    Configure Spindle for RC PWM control

    Scheduled Pinned Locked Moved
    CNC
    4
    10
    696
    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.
    • CthulhuLabsundefined
      CthulhuLabs
      last edited by CthulhuLabs

      I am finally switching out the main board of my CNC from a GRBL controller to a Duet3 6HC board. My spindle is a Brushless Dewalt Trim Router that is being controlled by an ODrive. Currently I have been connecting to the ODrive over USB to configure the RPM, but I would like this to be automatic. The ODrive can take a RC PWM signal (1ms to 2ms pulse widths) to control the motors speed. I am just not sure how to configure a Spindle to use this sort of PWM signal in RRF. If it is not possible I can configure the ODrive's ADC and pass a normal PWM signal through an RC Circuit, but if RRF can do the RC PWM standard that would be ideal.

      1 Reply Last reply Reply Quote 0
      • CthulhuLabsundefined
        CthulhuLabs
        last edited by CthulhuLabs

        So I think this is how it should be configured:

        ; Tools
        M950 R0 C"io6.out" L40000 Q50               ; Spindle acts like a 3.3V RC Servo on io6.out
        M563 R0 F0 S"Spindle"                       ; define tool 0 as controllable spindle
        G10 P0 X0 Y0 Z0                             ; set tool 0 axis offsets
        T0                                          ; select tool 0
        

        Any help would be greatly appreciated.

        o_lampeundefined 1 Reply Last reply Reply Quote 0
        • darenundefined
          daren
          last edited by

          Following this post

          I have a similar set up with a Milwaukee brushless router with a rc brushless esc. but i cannot change the inputs on my esc.

          I set up the heater3 pin to a servo port and then used the m280 commend and this works to control rpm of spindle. but it would be nice to be able to use the M3 and proper spindle tool commands.

          any help would be appreciated.

          1 Reply Last reply Reply Quote 1
          • o_lampeundefined
            o_lampe @CthulhuLabs
            last edited by o_lampe

            @cthulhulabs
            For a Servo you can't use the 'L' and 'Q' parameter in M950.
            It's just:

            M950 S0 C"io6.out" ; create servo 0 
            M280 P0 S[1000-2000] ; control servo 0 with 1000-2000 microseconds
            

            You have to figure out, what servo value leads to which RPM.

            darenundefined CthulhuLabsundefined 2 Replies Last reply Reply Quote 1
            • darenundefined
              daren @o_lampe
              last edited by

              @o_lampe I understand that and have that working. but how can you get the M3 to control the servo output?

              1 Reply Last reply Reply Quote 1
              • CthulhuLabsundefined
                CthulhuLabs @o_lampe
                last edited by

                @o_lampe Like @daren said, I want to be able to control the Spindle speed with the M3 commands.

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

                  @cthulhulabs I'm sorry, RRF is not written to generate servo-style pulses to control spindle RPM. Does the Orive not allow a conventional PWM input to control RPM?

                  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

                  CthulhuLabsundefined 1 Reply Last reply Reply Quote 1
                  • CthulhuLabsundefined
                    CthulhuLabs @dc42
                    last edited by

                    @dc42 It does. That was my backup option. The servo-style pulses are just more accurate. Now that you have confirmed that is not an option I will configure it to use the ADC and setup an RC Circuit. Some day I would love to be able to control a BLDC Spindle powered by an ODrive over the CAN 2.0 bus you just enabled in 3.4beta1, but I know that is probably a long ways off. Thanks for the help!

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

                      @cthulhulabs there is work in progress to allow some aspects of an ODrive to be controlled over CAN bus.

                      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

                      CthulhuLabsundefined 1 Reply Last reply Reply Quote 0
                      • CthulhuLabsundefined
                        CthulhuLabs @dc42
                        last edited by

                        @dc42 Is there any way to trigger a macro when M3 / M4 / M5 commands are issued? If not I would like to suggest adding a method of doing so. It would allow me to use execonmcode to send commands to the ODrive and give me extremely precise control over my RPM. It would also allow people who have spindles that require the RPM to be set manually to be prompted with M291 messages to change the RPM appropriately. Many hobby CNCs use off the shelf palm routers for their spindle.

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