Spindle Control on 6HC
-
@xamation you need to declare the spindle using M950 before you create the tool, then when you create the tool using M563 include the R spindle number parameter. After selecting the tool using T0 you should be able to control the spindle.
-
@dc42 Hi,
I updated the code so you suggested me.
The config file is updated with the M950 and then M563 commands.
Everything still doesn't work. I also changed the string M568 P0 F0 with
M568 P0 F1000 but it does not go.; CNC Mode (Firmware 3.3) M453 ; CNC Mode ;Configure Tool 0 as the CNC Spindle M950 R0 C"OUT9+!io4.out+out7" Q2000 L0:25400 ; Create spindle index 0, PWM frequency 2KHz, max rpm = 25.4K ( tweaked to yield 24K) ; and the following connections: ; spindle speed PWM pin : exp.9 pin ; spindle run pin : exp.4 ; spindle direction pin : exp.7 M563 P0 R0 S"Spindle" ; Create Tool 0 with Spindle 0 and call it Spindle G10 P0 X0 Y0 Z0 ; Set Tool 0 axis offsets M568 P0 F0 ; Set Tool 0 to default RPM of 0 T0 ; Select Tool 0 G54 M564 S H0 M575 P1 S1 B57600
Where am I wrong?
-
@xamation said in Spindle Control on 6HC:
Where am I wrong?
Can you send M98 P"config.g" to check the syntax?
-
-
@xamation this is my spindle section from my config.
M453 M950 R0 C"e0heat+e1heat+e2heat" Q100 L6000:24000 ; CNC mode and spindle settings ; Tools M563 P0 R0 S"Spindle" ; define tool 0
and i can control the spindle ok using M3 etc.
sendingm3 s6000
turns the spindle on at 6000 RPM. -
@xamation said in Spindle Control on 6HC:
in the config file I have not entered any M98 command.
You misunderstand me. What I want you to do is send
M98 P"config.g"
in the gcode console in DWC and copy and paste the response you get here so we can see if there are any syntax errors in your config. -
@phaedrux I solved the promise. I installed the update to version 3.4 and it seems to work. I updated some commands but it reports the error: Error: bad drive number
-
@xamation said in Spindle Control on 6HC:
. I updated some commands but it reports the error: Error: bad drive number
Can you be more specific? Show us what you changed.
-
Hi @xamation,
Would you be kind enough to explain why you have three pin names in the M950 line for the spindle like this so I can understand why, please
M950 R0 C"e0heat+e1heat+e2heat" Q100 L6000:24000I'm very new to 'programming' the Duet3, but I'm wondering if this (which I haven't tested yet because my milling motor hasn't arrived) will work:
; AMB spindle configuration
M950 R0 C"out9" L0:25000 Q1000 ; create spindle with index 0
M563 P1 S"Spindle 1" R0 ; create tool 1 with spindle 0 and name it "Spindle 1"
M453 ; set machine to CNC mode
T1 ; select tool 1
M3 S0
M5 ; stop spindleThank you.
-
@nightowl999 the first pin sets the speed using PWM, second one sets the spindle to forward, 3rd one sets the spindle to reverse
-
Thanks, @jay_s_uk.
OK, so I'm guessing (assuming everything's configured correctly) the g-code file sends an M3 S2000 command, for example, and the first configured pinout would signal that to the spindle to turn on and run at 2000rpm.
I don't envisage (!) ever using the spindle to rotate in any direction other than its default rotational direction, so I shouldn't need to use the other two pinouts, should I?
-
@nightowl999 the second pin enables the spindle
-
@jay_s_uk Got it, thanks.