Cannot turn Spindle ON using M3
-
Hi,
I am setting up a screw drive CNC and using a Duet 2 Wifi (latest FW and Workbee Controller) and BLDC (Brushless Motor Driver) to control the Spindle. The BLDC uses a 0-10V signal that controls the Spindle speed. FAN0 (on pin 20) output goes via a PWM to voltage converter to achieve the speed control.
So far I have managed to control the Spindle speed using the M106 fan PWM controller command but I wanted to utilize the CNC printer functionality namely using M3 & M5. So I can turn the Spindle OFF Ok with M5 using below command set:
M106 P0 I-1 H-1 A20 ; disable FAN0 & allocate tool 0 to pin 20
M563 P0 S"Spindle" ;
M453 S"Spindle" P20 I1 T0, Tool 0 = Spindle and invert PWM
M5 ; Successfully turn OFF the SpindleNow, if I try sending an M3 command to turn the Spindle back ON it just does NOT work. The WorkBee Controller accepts the command with a green tick but nothing happens. I also noticed that F0 appears to revert to a FAN setting again.
Any help would be appreciated.
Cheers. -
You need to include an RPM parameter in the M3 command.
-
Thank you for reply dc42.
I tried this but still no good I'm afraid.I did notice that if I re-send M106 P0 I-1 H-1 A20 again, it starts the Spindle (ie turns Spindle on again).
It appears to me that FAN0 (have not tried the other servo O/P's) resets itself to a FAN once it has received
the M5 command to stop the Spindle.
Also tried expanding the M453 S"Spindle" P20 I1 R20000 T0 (In case the SW checks M3 spindle speed on M3 20000 due to safety but that made no difference).Any other suggestions?
Cheers, -
Which firmware version are you using?
Please post your complete config.g file.
-
@dc42 On further investigation I have discovered the (syntax) error. Sorry, my bad. I overlooked the "S" before the RMP. I have tested and M3 S20000 or M3 S10000, etc work fine. So all good now. Thanks again for your help. Cheers,