LinuxCNC M3

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.

Source checked7/7 values · 2026-10-26

Specification

1 source
Languagegcode
CodeM3
GroupSpindle Control
SyntaxM3 [$n]
DialectLinuxCNC

Parameters

NameDescription
$nSpindle to operate on. If $ is omitted the command defaults to spindle 0; $-1 operates on all active spindles.
SSpindle speed word; the selected spindle starts clockwise at this speed.

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.

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.
↑↓ navigate↵ openesc close