Using spindle and coolant g-codes with PlanetCNC TNG software

A fundamental operation in CNC machining is controlling the spindle. It is controlled in g-code using M3, M4 and M5 commands.
M03 will start the spindle turning clockwise.
M04 will start the spindle turning counterclockwise.
Both commands turn on the spindle at the speed determined separately by the S-word. It is used to set the RPM at which the spindle will turn when turned on.
M05 will stop the spindle regardless of direction.

Other than controlling the spindle, the M03 command can also turn on a plasma cutter, laser, water jet or even a hot wire for cutting polystyrene foam. Their power is likewise set using the S-word.

When machining some materials, most often metals, it is sometimes required to use coolant. It can be supplied to the tool and on the work in different ways. There are three commands for coolant control.
M07 will turn on the mist coolant supply.
M08 will turn on the flood coolant supply.
M09 will turn both coolant supplies off.

As with M03, these commands can be used to control something else, as they just turn an output on the CNC USB controller on or off. For example one of the codes could be used to control the dust collection vacuum for a woodworking machine.

The M07, M08 and M03 commands can also be activated manually using the buttons from top toolbar:
CoolantFlood CoolantMist SpindleM3


Currently active M-codes will also show up in the machine state display.