G97 hands the spindle math back to you. In constant surface speed mode the control recalculates RPM continuously as the diameter changes; in G97 the spindle turns at exactly the S value you wrote, no more, no less, for as long as the mode holds. That makes one formula non-negotiable for lathe work, because every G97 line is only as good as the number you computed for it.
The formula, both unit systems
Surface speed is the real cutting quantity, how fast the work surface streams past the tool edge, published per material and tool in every manufacturer’s cutting data and explained in any speeds and feeds reference. RPM is just that speed translated to a rotation rate at a specific diameter:
| Units | Formula | Worked example |
|---|---|---|
| Inch | RPM = (SFM x 12) / (pi x D) | 400 SFM on a 2.0 in bar: (400 x 12) / (3.1416 x 2.0) = about 764 RPM |
| Metric | RPM = (Vc x 1000) / (pi x D) | 120 m/min on a 50 mm bar: (120 x 1000) / (3.1416 x 50) = about 764 RPM |
| Sanity check | Same physics, same answer | A 2 in bar and a 50 mm bar at matched data land within a few RPM |
The program line is then plain: G97 S764 M03 turns the spindle clockwise at 764 RPM and holds it there. Walkthroughs of the same pair of modes with more program context are at Helman CNC, and the mode words themselves are standard across dialects, documented in references like LinuxCNC’s.
The diameter decision
D is where G97 calculations actually go wrong, because a lathe part has many diameters and a locked RPM can only be right at one of them. The working rules: compute at the diameter where the cutting happens, and when a single G97 pass spans several diameters, compute at the largest one, which keeps surface speed at or under target everywhere in the cut (smaller diameters then run slower than optimal, which wastes a little time and hurts nothing). For drilling and center work the answer flips to the tool: a drill’s cutting speed lives at its own periphery, so a 12 mm drill gets its RPM from 12 mm regardless of whether the bar is 30 or 80 mm around.
Misjudging this is rarely catastrophic in the G97 direction, too-slow surface speed mostly costs finish and time. The catastrophic direction belongs to G96 near centerline, where the control chases an impossible RPM unless G50 caps it, a failure with its own post.
When G97 is the right mode
G96 exists because profiles and facing cuts cross many diameters, and holding surface speed constant across them is exactly what it does well. G97 takes over wherever a varying RPM would cause trouble:
Threading is the absolute case: thread lead depends on a fixed relationship between spindle revolutions and Z travel, and an RPM that drifted mid-pass would smear the pitch, so threading cycles run under locked speed; the same synchronization is what makes re-chasing a damaged thread possible at all. Drilling, center drilling, and tapping on centerline are diameter-independent by nature, the work diameter at center is zero, so constant surface speed is meaningless there and G97 with the tool-diameter calculation is correct. Small-diameter finishing near center avoids the G96 RPM chase. And interrupted cuts, fragile workholding, or out-of-balance parts often simply run safer at one chosen, modest speed.
A practical lathe program therefore alternates: G96 for the turning passes, G97 with a computed S for the drill, the threading cycle, the parting operation. Watching for those mode switches is part of reading a lathe program correctly, and the arithmetic itself is the same two-formula card that covers all shop-floor cutting math, one more reason that card earns its tape on the toolbox.
The trio worth drilling
G96, G97, and G50 work as a family: vary RPM to hold surface speed, lock RPM outright, cap whatever varies. Lathe fluency means the three answer instantly, including which one a threading pass demands and why a facing cut wants the first. That is recall material, and the free 60-second rounds on the G-code practice page drill the family with the rest of the turning core, repeating misses until the modes stop costing a thought. Then G97’s math is the only work left, and it is one division.
Sources
Frequently asked questions
How do you calculate spindle speed for a G97 lathe program?
Take the surface speed for your material and tool from the cutting data, then divide: RPM = (SFM x 12) / (pi x D) in inch units, or RPM = (Vc x 1000) / (pi x D) in metric, where D is the diameter at the cut. A 2-inch bar at 400 SFM works out to about 764 RPM.
What diameter do you use in the G97 calculation?
The diameter where cutting actually happens. For a pass spanning several diameters, calculate at the largest; for drilling on center, use the drill’s own diameter.
When should a lathe program use G97 instead of G96?
Threading, where RPM must stay locked for the lead; drilling and center work, where part diameter is irrelevant; very small diameters near centerline; and interrupted or fragile setups. Profiling across changing diameters is G96 territory.
What is a good way to memorize the G96, G97 and G50 family for lathe work?
Drill them as a trio until the relationships are automatic: G96 varies RPM to hold surface speed, G50 caps it, G97 locks it. The free G-Code Sprint app includes this family in its 60-second recall rounds.