Splindle on/off with gcode

I was wondering if anybody out there successfully made M3 & M5 work to turn their dw660 (or similar) on/off.

depends on what board you are using (I think).
It works with my arduino uno with a cnc shield running GRBL.

This is what I’m using.

https://www.amazon.com/dp/B00WV7GMA2/ref=cm_sw_r_other_apa_i_A267EbVCP0J5F

Yes. It will work with Marlin too. The easiest is to just use the fan port and use M106/M107. There is an IOT relay on amazon that makes the wiring really easy and isn’t too expensive. If you have a 5V relay, then you need to use a different pin. There is a command to turn on a specific pin though. M42 or something.

I have the Rambo board. I’ll look into the relay

Seems to be sold out everywhere

You would be better off with a zero-crossing switch as a relay can produce substantial arcing when switching inductive loads. Choose an solid state relay according to your current requirements…for a DW-660 with a rating of 5 Amps something like this would be an option.

1 Like

I’m using GRBL and CNC Shield v3. For spindle control I’m using Ryans’ PID board , but I’ve got one of these hooked to Coolant Flood and Coolant Mist and they work with M7/M8/M9. Keeping one relay in reserve for spindle on/off if I have trouble with the PID board.

Same has been working fine for air assist (aquarium pump) on my K40 laser for about 2 years.

1 Like

Do you know how these commands can be added to fusion360 so they are more automatic? or does the grbl board supposed to handle turning the spindle on and off?

In Marlin with the Guffy Post Processor for Fusion, I just had to uncheck the option for manual spindle control. With that off and the relay wired up, my DW660 starts up automatically when I start the jobs and shuts down automatically at the end. Just have to make sure that you have it wired up to respond to M3/M5 commands.

where do you set which command controls which output? I have a mks gen 1.4 board, that I flashed, i guess i need to look at the cpumap file, and get that sorted. I was also wondering where I can change the command that fusion sends, instead of m3,m5 I assume you can program whatever you want. Where can you edit that?

You dont want to change gcode you can change the pins yes but not the command

It would be great if you could change the command. M106/M107 or M42 would work just as well and not require changing the firmware at all. But the PP needs to able to let you set that gcode.

I spent an hour trying to figure out how to change the On/Off GCode, but the M3/M5 is hardcoded. Decided it was easier to just redo the wiring.

1 Like

Yes you are right I was thinking GRBL.

As others have mentioned, it depends on your board. For my setup, I am running a Duet 3 6HC board and have my spindle running with M3 (actually M3 S1 because you have to set a speed value) and M5 based on:

M563 P0 D0 F0 S"Spindle" ; define tool 0
G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets
G10 P0 R0 S0 ; set initial tool 0 active
M453 C"nil+out1+nil" T0 ; Set into CNC mode

I have the ‘out1’ port hooked up to a Crydom LND2425 SSR.

Also, not quite related to this post but I have the same setup to run my vacuum with M7 and M9 through ‘out2’.