logo
Shenzhen Guanglijin Technology Co., Ltd.
Email sales5@szglj.cn TEL +86-188-22874428
Home
Home
>
News
>
Company news about Guide to G98 and G99 Codes for Milling and Turning
Events
LEAVE A MESSAGE

Guide to G98 and G99 Codes for Milling and Turning

2025-12-18

Latest company news about Guide to G98 and G99 Codes for Milling and Turning

In the world of CNC machining, two simple G-code commands—G98 and G99—present a fascinating case of contextual interpretation. Like a chameleon changing colors, these instructions take on completely different meanings when used in milling machines versus lathes. This article explores their distinct applications across machining platforms.

G98/G99 in Milling: Controlling Retraction Height

On milling machines, these commands govern tool retraction height after cycle completion, determining whether the tool returns to the initial Z-plane or the R-plane—essentially establishing a "safety clearance" to prevent collisions during rapid movements.

  • G98: Return to Initial Z-plane
    When activated, the tool retracts to the programmed starting Z-height—typically a "safe Z" position above the workpiece. This allows rapid traverse to subsequent machining locations. However, this safety isn't absolute; it depends on CAM post-processing and programming implementation.
  • G99: Return to R-plane
    This alternative positions the tool closer to the workpiece surface. Most CAM systems execute rapid movement to the R-plane before switching to cutting feed rates for subsequent operations.
Selecting the Appropriate Milling Command

The choice depends on workpiece geometry and safety considerations. G98 proves safer for parts with prominent protrusions or when significant repositioning is required between cycles. G99 offers time savings for flat surfaces requiring quick sequential operations.

G98/G99 in Turning: Defining Feed Rate Units

Lathes repurpose these commands to specify feed rate measurement units, fundamentally changing how programmed "F" values are interpreted.

  • G98: Feed per Minute
    The "F" value represents linear travel per minute (e.g., F100 = 100 units/minute in inches or millimeters).
  • G99: Feed per Revolution
    Here, "F" indicates linear advancement per spindle rotation (e.g., F0.004 = 0.004 units/revolution).
The Advantage of G99 in Turning

This mode maintains consistent chip load regardless of spindle speed variations—crucial for tool life and cutting stability during dynamic speed adjustments.

Synchronizing with G96 Constant Surface Speed

G99 pairs effectively with G96 (constant surface speed control). While G96 maintains consistent cutting speed across varying diameters, G99 preserves uniform feed per revolution, ensuring machining consistency.

Practical Applications

Milling Example - Deep Hole Drilling: G98 facilitates complete tool retraction for chip clearance in deep cavities, while G99 suits shallower holes requiring only partial withdrawal.

Turning Example - Facing: G99 maintains consistent feed per revolution under G96's variable spindle speeds during diameter changes.

Threading Application: G99 directly programs thread pitch as the feed rate (e.g., G99 F1.5 for 1.5mm pitch threads).

Programming Best Practices
  • Explicitly declare G98/G99 mode at program initiation
  • Select retraction height based on workpiece geometry
  • Choose feed mode according to cutting conditions
  • Include explanatory comments for program clarity
System Variations and Advanced Techniques

Different CNC controllers (Fanuc, Haas, etc.) may implement these commands with slight variations. Advanced programmers can employ macros for dynamic G98/G99 selection based on real-time machining conditions.

As CNC technology evolves, newer systems introduce enhanced versions of these commands, offering features like adaptive retraction heights and force-based feed adjustments—further expanding the capabilities of these fundamental programming elements.

Contact Us at Any Time

+86-188-22874428
No.21, Bulan Road, Longgang District, Shenzhen, P. R. China.
Send your inquiry directly to us