{"id":"word-s","model_id":"S","name":"LinuxCNC S (Set Spindle Speed)","summary":"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.","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_notes":["A negative S number is an error."],"sources":[{"url":"https://linuxcnc.org/docs/html/gcode/other-code.html#sec:set-spindle-speed","title":"Other Codes","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":7,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"gcode","code":"S","group":"spindle","syntax":"Sx [$n]","parameters":[{"name":"x","description":"Spindle speed in revolutions per minute (RPM)."},{"name":"$n","description":"Optional spindle number; without it the command defaults to spindle.0."}],"dialect":"LinuxCNC","related":["mcode-m03","mcode-m04","gcode-g84","gcode-g93","gcode-g95"],"standards":[]},"url":"https://machineschema.com/instruction/word-s","license":"https://creativecommons.org/licenses/by/4.0/"}