This is an educational explanation of a lathe spindle hazard, not operating instructions for your specific machine. Always follow your machine’s manual and shop safety procedures, and treat chuck speed limits as hard limits.
On a lathe, G50 S sets the maximum spindle speed, a cap the control will not exceed. It looks like a minor setup line, but with constant surface speed active it is a genuine safety device. Leaving it out is one of the ways a part gets thrown from the chuck.
Constant surface speed is the reason
Lathe work usually runs in G96, constant surface speed. You program a surface speed and the control varies RPM to hold it, because cutting quality depends on how fast the material passes the tool, not on RPM. The catch is the relationship behind it: surface speed equals RPM times diameter, as the G96 and G97 references explain.
That means as the tool moves toward the center and the diameter shrinks, the control has to raise RPM to keep the surface speed constant:
| Diameter | RPM to hold the same surface speed |
|---|---|
| 100 mm | low |
| 50 mm | about double |
| 10 mm | about ten times |
| near 0 (facing to center) | climbs steeply |
How that becomes a crash
Without a cap, facing to the center or turning a small diameter under G96 lets the RPM run away. Push past the chuck’s rated speed and clamping force drops, so the part can be flung out, or the machine trips an overspeed alarm. The G50 spindle-speed-limit references describe G50 S as the clamp that prevents exactly this, and the general spindle and chuck hazards are covered in the Wikipedia lathe article.
The fix: cap the speed first
Set G50 S before any G96 work, picking a limit at or below the chuck’s rated speed (the operation that lives closest to this physics is parting, where the diameter genuinely goes to zero, and the cutoff-nub post covers how the cap, a G97 switch, and the endpoint work together at the moment of separation):
G50 S2000 (cap the spindle at 2000 RPM)
G96 S200 (constant surface speed of 200)
The control now raises RPM as the diameter drops but never passes 2000. When you no longer need constant surface speed, G97 switches back to a plain RPM command. Setting the right S value for the spindle is the same idea as the spindle codes in M03, M04, and M05, just with a safety ceiling on top.
How to pick the cap
The G50 S value is not a guess either. The hard ceiling is the lowest of three numbers: the chuck’s rated maximum speed, the machine’s maximum spindle speed, and any limit set by the workholding or an unbalanced part. The chuck rating almost always wins, because grip force falls as RPM rises and a large or heavy part loses clamping force sooner. Long or out-of-balance work, soft jaws, and light clamping all call for a lower cap. When in doubt, set the limit conservatively: a slightly slower finish near the center is a fair trade for keeping the part in the chuck.
A note on the dual meaning
On some older lathe controls, G50 also sets a coordinate system or work shift, similar to G92 on a mill. So the same code can mean two different things depending on the control. That is one more reason to confirm what a code does on your machine when you read the program, rather than assume, the same caution that prevents a G00 crash or a boring bar crashing into the back of the part. Building that habit is what a practice routine on the G-code practice hub is for.
Bottom line
G50 S caps lathe spindle RPM. It matters because G96 constant surface speed raises RPM as the tool nears the center, where small diameters demand very high speeds. Without the cap the spindle can overspeed and throw the part, so set a sensible G50 S limit before any G96 work, and remember the code can mean a coordinate shift on older controls.
Sources
- HelmanCNC: G50 spindle speed limit for CNC lathe
- HelmanCNC: lathe G96 and G97 constant surface speed
- Wikipedia: Lathe
Frequently asked questions
What does G50 do on a lathe?
G50 S sets the maximum spindle speed, a cap the control will not exceed. It is used with G96 constant surface speed so that as RPM rises near the center it is clamped to a safe limit. On some older controls G50 also sets a coordinate system.
Why does my lathe overspeed near the center?
Because G96 holds constant surface speed, which equals RPM times diameter. As the diameter shrinks toward the center, the control raises RPM to keep surface speed constant, so without a cap the RPM can climb to unsafe levels.
How do you set a max spindle speed?
Command G50 with an S value before constant surface speed, for example G50 S2000, then G96 S200. The control raises RPM as the diameter drops but never passes the G50 limit.
What is the best way to learn lathe G-codes safely?
Drill them with active recall so G50, G96, and G97 are second nature. A free app like G-Code Sprint quizzes the spindle and surface-speed codes and repeats whichever ones you miss.
G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.