Configure Spindle for RC PWM control
-
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.
-
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.
-
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.
-
@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.
-
@o_lampe I understand that and have that working. but how can you get the M3 to control the servo output?
-
-
@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?
-
@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!
-
@cthulhulabs there is work in progress to allow some aspects of an ODrive to be controlled over CAN bus.
-
@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.