M05 stops spindle rotation. It is called before tool changes, before retracting out of a part by hand, and as part of a safe program ending.
Format
How it works
- The spindle decelerates to a stop; motion commands can continue once stopped.
- Always stop the spindle before a tool change (M06 usually forces this anyway).
- It pairs with M03 or M04 that started rotation.
Example
M30 (end program)
FAQ
Does M05 also stop coolant? No, M05 only stops spindle rotation. Coolant is controlled separately with M08 (flood on) and M09 (coolant off), so a program typically calls M09 alongside or before M05 rather than relying on M05 to shut off coolant automatically.
Should M05 be called before or after a tool change? Before, generally as part of the same sequence that also retracts the tool. Most tool change cycles include an implicit or explicit spindle stop, since changing tools with the spindle running would be unsafe.
Related: M03 Spindle On and the M-Code Reference.
