G-code reference
G50 G-Code: Max Spindle Speed Clamp (Lathe) / Scaling Cancel (Mill)
Max Spindle Speed Clamp (Lathe) / Scaling Cancel (Mill) — On Fanuc lathes (system A), G50 S_ limits the maximum RPM during constant surface speed (G96), and G50 X_ Z_ can set a coordinate system. On mills G50 cancels…
| Property | Value |
|---|---|
| Code | G50 |
| Function | Max Spindle Speed Clamp (Lathe) / Scaling Cancel (Mill) |
| Modal group | 00 |
| Type | One-shot (non-modal) — active only in its own block |
| Used on | Mills and lathes |
| Syntax | Lathe: G50 S_ / Mill: G50 |
What does G50 do?
On Fanuc lathes (system A), G50 S_ limits the maximum RPM during constant surface speed (G96), and G50 X_ Z_ can set a coordinate system. On mills G50 cancels scaling (G51).
G50 is a one-shot code: it only acts in the block where it is written, and the previously active modal codes take over again afterwards.
Syntax and parameters
Lathe: G50 S_ / Mill: G50| Address | Meaning |
|---|---|
S | Maximum spindle speed (RPM) during G96 |
G50 example program
G50 S3000 (limit to 3000 RPM)
G96 S200 M03 (200 m/min CSS)▶ Open this example in the G-code viewer
Tips and common mistakes
- Always clamp RPM before G96 — facing toward X0 makes RPM climb toward infinity.
- Chuck and part balance set the safe limit, not just the spindle rating.
Controller compatibility
G50 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.