# LinuxCNC M3

Instructions · `M3` · verification: source checked

M3 starts the selected spindle rotating clockwise at the speed set by the S word. The optional $ argument selects which spindle the command acts on; if $ is omitted the command acts on spindle 0, and $-1 acts on all active spindles. It is valid to program M3 when the spindle is already turning.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | M3 |
| Group | Spindle Control |
| Syntax | M3 [$n] |
| Dialect | LinuxCNC |

### Parameters

| Name | Description |
|---|---|
| $n | Spindle to operate on. If $ is omitted the command defaults to spindle 0; $-1 operates on all active spindles. |
| S | Spindle speed word; the selected spindle starts clockwise at this speed. |

## Connected

- Related: [LinuxCNC S (Set Spindle Speed)](https://machineschema.com/instruction/word-s.md)

## Safety

- If M3 is programmed while the S speed is zero, or while the speed override switch is enabled and set to zero, the spindle does not start turning; if the spindle speed is later set above zero, or the override switch is turned up, the spindle will start turning.
- M2 and M30 program end stop the spindle (like M5).
- Spindle status (M3/M4/M5 on/off and direction) is part of the modal state saved by M70 and restored by M72 or by M73 autorestore.

## Study notes

- Within one program, speeds can be set per spindle before a single M3, e.g. S100 $0, S200 $1, S300 $2, then M3 $-1 to start spindles 0, 1 and 2 simultaneously at different speeds.
- M4 starts the selected spindle counterclockwise and M5 stops the selected spindle; M3/M4/M5 are described as spindle control commands, with M19 orient spindle belonging to modal group 7 like M3, M4 and M5.
- M19 orient spindle is cleared by any of M3, M4, M5.

## Sources

1. [M-Codes](https://linuxcnc.org/docs/html/gcode/m-code.html#mcode:m3-m4-m5) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/mcode-m03  
JSON: https://machineschema.com/instruction/mcode-m03.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
