Help configuring rc servo for spindle
-
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"
-
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# -
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
-
https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M280_Set_servo_position
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?
-
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.