LinuxCNC S (Set Spindle Speed)

S sets the spindle speed in revolutions per minute. An optional $ selects which spindle the speed applies to; without it the command defaults to spindle.0. The spindle turns at that speed when M3 or M4 is in effect.

Source checked7/7 values · 2026-10-26

Specification

1 source
Languagegcode
CodeS
Groupspindle
SyntaxSx [$n]
DialectLinuxCNC

Parameters

NameDescription
xSpindle speed in revolutions per minute (RPM).
$nOptional spindle number; without it the command defaults to spindle.0.

Study notes

  • S may be programmed whether the spindle is turning or not.
  • The spindle turns at the programmed speed only when M3 or M4 is active.
  • If the speed override switch is enabled and not at 100%, the actual speed differs from the programmed value.
  • S0 is permitted and the spindle will not turn.
  • If a G84 tapping cycle is active and the speed and feed potentiometers are enabled, the lowest setting is used; rotational speed and feed rate remain synchronized, so the speed may differ from the programmed value even with the speed potentiometer at 100%.
  • The G93/G94/G95 feed rate modes change how feed rate is interpreted, not the S word.

Safety

  • A negative S number is an error.
↑↓ navigate↵ openesc close