CNC Feedrate & Spindle Control: G96, G97, G98, G99 Explained with Real Examples
Controlling spindle speed and feedrate correctly is essential for surface finish, tool life, and overall machining efficiency.
The G96–G99 G-codes define how feed and spindle speeds behave in CNC lathes and mills under different conditions.
📌 1. Overview of Feedrate and Spindle Control
| Code | Function | Description |
|---|---|---|
| G96 | Constant surface speed (CSS) | Spindle speed changes with diameter |
| G97 | Fixed spindle speed | Constant RPM |
| G98 | Feed per minute | Used mostly in milling cycles |
| G99 | Feed per revolution | Used mostly in turning |
📌 2. G96 — Constant Surface Speed (CSS)
G96 maintains a constant surface speed at the cutting point by automatically adjusting spindle RPM as the tool moves closer or farther from the workpiece center.
Formula:
RPM = (1000 × Cutting Speed) / (π × Diameter)
Example (Fanuc Lathe):
%
O6001 (G96 EXAMPLE)
G50 S2500
G96 S180 M03
T0101
G00 X60. Z2.
G01 Z-40. F0.25
G00 X100. Z100.
M30
%
| Code | Description |
|---|---|
| G96 S180 | Constant surface speed = 180 m/min |
| G50 S2500 | Max spindle limit = 2500 RPM |
| M03 | Spindle ON clockwise |
As diameter decreases, the CNC increases RPM to maintain constant cutting speed.
📌 3. G97 — Fixed Spindle Speed
G97 disables CSS and runs the spindle at a constant RPM.
Example:
G97 S800 M03
Used for drilling, tapping, and operations where consistent RPM is required.
📌 4. G96 vs G97 Comparison
| Feature | G96 (CSS) | G97 (Fixed RPM) |
|---|---|---|
| Speed Control | Automatically adjusts RPM | Manual / Fixed |
| Best For | Turning, facing | Drilling, tapping |
| Tool Life | Better | Moderate |
| Finish | Consistent | Variable |
| Programming Complexity | Higher | Lower |
📌 5. G98 and G99 — Feedrate Modes
Feedrate modes control how the F value is interpreted in CNC cycles.
| Code | Function | Units |
|---|---|---|
| G98 | Feed per minute | mm/min or inch/min |
| G99 | Feed per revolution | mm/rev or inch/rev |
📌 6. Lathe Example: G99 (Feed per Revolution)
%
O6002 (G99 LATHE EXAMPLE)
G97 S800 M03
T0202
G99
G00 X50. Z2.
G01 Z-30. F0.25
G00 Z2.
M30
%
Feed = 0.25 mm per spindle revolution.
If spindle runs at 800 RPM → feedrate = 0.25 × 800 = 200 mm/min.
📌 7. Milling Example: G98 (Feed per Minute)
%
O6003 (G98 MILLING EXAMPLE)
G90 G17 G21 G40 G80 G54
T05 M06
S2500 M03
G98 G81 X50. Y50. Z-20. R2. F200
G80
M30
%
| Code | Description |
|---|---|
| G98 | Feed = 200 mm/min |
| G81 | Drilling cycle |
| Z-20. | Drills to depth |
| R2. | Retract plane 2 mm above part |
📌 8. G99 in Drilling (Feed per Revolution)
G99 G81 X50. Y50. Z-20. R2. F0.25
Feed = 0.25 mm/rev × spindle RPM
Automatically adapts feed to speed for consistent chip load.
📌 9. Haas Example — CSS with Max Limit
G50 S3000
G96 S200 M03
G99
G01 X30. Z-40. F0.25
The Haas controller will never exceed 3000 RPM, even if G96 demands more.
📌 10. Siemens Example
G96 S200 LIMIT=3000
G99
L X30 Z-50 F0.25
Siemens allows direct “LIMIT” definition instead of separate G50 command.
📌 11. Heidenhain Example
SPOS=FADAPT(200, MAX=3000)
FADAPT MODE=REVOLUTION
Heidenhain uses adaptive speed and feed commands instead of G-codes.
📌 12. Best Practices
- Always pair G96 with a G50 spindle limit.
- Use G97 for tapping, drilling, and tool changes.
- Apply G99 in turning and G98 in milling.
- Never switch between G96 and G97 mid-cut.
- Avoid extremely small diameters at high CSS — spindle overspeed alarm risk.
📌 13. Common Mistakes
| Mistake | Result |
|---|---|
| No G50 with G96 | Spindle overspeed and possible crash |
| Wrong mode (G98 vs G99) | Incorrect feedrate and poor surface |
| G96 in drilling | Drill burns due to variable speed |
| Forgetting G97 before tool change | Sudden RPM surge |
📌 14. Advanced Example — Full Program Integration
%
O6010 (FULL SPEED & FEED CONTROL)
G50 S2500
G96 S200 M03
T0101
G99
G00 X60. Z2.
G01 Z-30. F0.25
G00 X100. Z100.
G97 S800
G98 G81 X50. Z-15. R2. F200
G80
M30
%
G96 used for turning, then switched to G97 for drilling cycle.
Feedrate automatically changes from G99 (mm/rev) to G98 (mm/min).
📌 15. Future Trends (2025–2030)
- AI adaptive speed control — CNC adjusts RPM based on tool wear & temperature.
- Smart feed optimization — Real-time feed tuning to prevent chatter.
- Digital twin integration — Feed and RPM predicted before machining for perfect results.
✅ Conclusion
Understanding G96, G97, G98, and G99 is essential for mastering spindle and feed control in CNC machining.
By applying these codes correctly, machinists achieve smoother finishes, longer tool life, and optimized production speed across all materials and machines.
Leave a comment