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…

By cnccode · Updated
PropertyValue
CodeG50
FunctionMax Spindle Speed Clamp (Lathe) / Scaling Cancel (Mill)
Modal group00
TypeOne-shot (non-modal) — active only in its own block
Used onMills and lathes
SyntaxLathe: 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

Format
Lathe: G50 S_  /  Mill: G50
AddressMeaning
SMaximum spindle speed (RPM) during G96

G50 example program

Example
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.

Frequently asked questions

Is G50 modal?
No. G50 is a one-shot (group 00) code and only acts in the block where it appears.
What does G50 mean in CNC?
G50 means 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 scaling (G51).
What is the difference between G50 and G96?
G50 is Max Spindle Speed Clamp (Lathe) / Scaling Cancel (Mill), while G96 is Constant Surface Speed (CSS). See the G96 page for its syntax and examples.
Can I use G50 on a lathe?
Yes, G50 is used on both mills and lathes, although some parameters differ between them.