CNC Deep Hole Drilling: Programming and G-Code Guide
Standard CNC machines (lathes and machining centers) can drill holes up to approximately 10–20× diameter using peck drilling cycles. Beyond that, specialized methods like gun drilling or BTA drilling are required, but understanding the G-code programming for deep holes on standard equipment is essential knowledge for every CNC programmer.
This guide covers G73 and G83 peck drilling cycles, parameter selection, and best practices for programming deep holes on standard CNC machines.
G73 vs G83: Choosing the Right Cycle
The two primary deep hole drilling cycles are G73 (high-speed peck) and G83 (deep hole peck) . The key difference is how much the drill retracts between pecks.
| Feature | G73 (High-Speed Peck) | G83 (Deep Hole Peck) |
|---|---|---|
| Retract type | Small retract (~0.25 mm / 0.01") | Full retract to R-plane |
| Chip evacuation | Minimal — chips stay in flutes | Complete — hole clears each peck |
| Cycle time | Fast — less retraction | Slow — full retract each peck |
| Coolant access | Poor — chip packing risk | Good — coolant reaches cutting edge |
| Best for | Shallow to moderate depth | Deep holes needing chip clearance |
When to Use G73
- Hole depth < 10× diameter
- Materials that produce short, broken chips (cast iron, brass)
- Cycle time is critical
- Flood coolant is sufficient to clear chips
When to Use G83
- Hole depth > 10× diameter
- Materials that produce long, stringy chips (steel, aluminum, stainless)
- Chip evacuation is essential for tool life
- Through-spindle coolant is available
G73 Programming Syntax
G73 X_ Y_ Z_ R_ Q_ F_
| Parameter | Description | Example |
|---|---|---|
| X, Y | Hole position | X50 Y25 |
| Z | Final hole depth (from R-plane) | Z-40.0 (40 mm deep) |
| R | R-plane (retract plane position) | R2.0 |
| Q | Depth per peck (positive incremental) | Q5.0 (5 mm per peck) |
| F | Feed rate | F150 (mm/min) |
G73 Cycle Operation
1. Rapid to X,Y position
2. Rapid to R-plane
3. Feed down by depth Q
4. Rapid retract by small d distance (typically 0.25 mm)
5. Feed down by next Q
6. Repeat until Z depth reached
7. Rapid retract to initial plane (G98) or R-plane (G99)
G73 Example
; Drill Ø10 mm × 40 mm deep in mild steel, G73 peck cycle
T1 M06 ; Select drill
G90 G54 G00 X0 Y0 ; Absolute positioning, work offset
S2000 M03 ; Spindle on
G43 H01 Z50.0 ; Tool length offset
M08 ; Coolant on
G99 G73 X25.0 Y0 Z-40.0 R2.0 Q5.0 F200 ; G73 peck cycle
G80 ; Cancel cycle
G00 Z50.0 ; Retract
M09 ; Coolant off
M30 ; End program
Retract distance d: The small retract distance in G73 is controlled by a machine parameter:
- Fanuc: Parameter 5114
- Haas: Setting 73 (typically 0.01" / 0.254 mm)
G83 Programming Syntax
G83 X_ Y_ Z_ R_ Q_ P_ F_
| Parameter | Description | Example |
|---|---|---|
| X, Y | Hole position | X50 Y25 |
| Z | Final hole depth | Z-40.0 |
| R | R-plane | R2.0 |
| Q | Depth per peck | Q5.0 |
| P | Dwell at hole bottom (milliseconds) | P500 |
| F | Feed rate | F150 |
G83 Cycle Operation
1. Rapid to X,Y position
2. Rapid to R-plane
3. Feed down by depth Q
4. Rapid retract fully to R-plane (clears chips)
5. Rapid down to previous depth minus clearance (d)
6. Feed down by next Q
7. Repeat until Z depth reached
8. Rapid retract to initial plane (G98) or R-plane (G99)
G83 Example
; Drill Ø12 mm × 60 mm deep in 4140 steel, G83 deep hole cycle
T1 M06
G90 G54 G00 X0 Y0
S1500 M03
G43 H01 Z50.0
M08
G99 G83 X50.0 Y0 Z-60.0 R2.0 Q4.0 P200 F180
G80
G00 Z50.0
M09
M30
G98 vs G99 Retract Mode
| Code | Behavior | Use When |
|---|---|---|
| G98 | Retract to initial plane after each hole | Clearing clamps, fixtures, or tall parts |
| G99 | Retract to R-plane after each hole | Drilling multiple holes in same plane (faster) |
Best practice: Use G99 for all holes except the last one. Then use G98 for the final retract to clear the part.
Peck Depth (Q) Selection
Q Value by Material
| Material | Q as % of Drill Diameter | Notes |
|---|---|---|
| Low-carbon steel | 75–100% | Standard peck depth |
| Alloy steel | 50–75% | Reduce for harder grades |
| Stainless steel | 30–50% | Small pecks prevent work hardening |
| Aluminum | 100–200% | Deep pecks possible; good chip evacuation |
| Cast iron | 100–150% | Powdered chips evacuate easily |
| Titanium | 30–50% | Small pecks; coolant critical |
Q Value by Depth Ratio
| Depth Ratio | Recommended Q (% of Diameter) | Cycle Type |
|---|---|---|
| < 3:1 | No pecking needed | G81 (straight plunge) |
| 3:1 to 8:1 | 75–100% | G73 or G83 |
| 8:1 to 15:1 | 50–75% | G83 required |
| 15:1 to 20:1 | 30–50% | G83 with reduced peck |
| > 20:1 | Gun drilling recommended | Specialized process |
Variable Peck Depth
More advanced strategies use variable peck depths:
; Variable peck: first peck deeper, subsequent pecks shallower
; First peck: 150% of normal (gets tip fully engaged)
; Normal pecks: 100%
; Final pecks: 50% (reduced to control breakthrough)
This is typically implemented through custom macro programming rather than a standard canned cycle.
Using G73 and G83 on a CNC Lathe
On a lathe, the same G73 and G83 cycles work on the Z-axis (drilling with a live tool or tailstock drill):
; G83 on a CNC lathe — drilling along Z-axis
T0101 M42 ; Select drill, low gear range
G97 S1200 M03 ; Spindle speed
G00 X0 Z5.0 ; Position to hole center, 5 mm from face
G01 Z0.0 F0.2 ; Touch face, establish Z zero
G00 Z2.0 ; Back off
G83 Z-80.0 R1.0 Q3.0 F0.12 ; Deep hole cycle
G80
G00 Z5.0
Chip Breaking Techniques
For deep holes on standard CNC machines without through-spindle coolant:
| Technique | How It Works | Best For |
|---|---|---|
| Standard peck (G83) | Full retract clears chips | Holes up to 15:1 |
| High-speed peck (G73) | Short retract breaks chips | Shallow holes, short chips |
| Dwell at bottom | Pause to break chip before retract (P parameter) | Stringy materials |
| Variable peck | Decreasing Q at depth | Deepest holes on standard machines |
| Spring passes | Rapid down to last Z-1mm before feeding | Prevents recutting chips |
Common Programming Mistakes
| Mistake | Consequence | Fix |
|---|---|---|
| Q value too large | Chip packing; tool breakage | Reduce Q to 50–75% of diameter |
| Wrong retract mode (G98/G99) | Tool hits clamp; crash | Verify clearance above part |
| No dwell at breakthrough | Burr on hole exit; chipped corner | Add P200–P500 on final hole |
| G73 for stringy material | Chip packing in flutes | Switch to G83 |
| Pecking carbide drills | Edge chipping; reduced tool life | Use G81 (no peck) for carbide |
| No G80 cancel | Unexpected tool movement on next operation | Always cancel with G80 |
Comparison: Standard CNC vs. Specialized Deep Hole Drilling
| Aspect | Standard CNC + G83 | Gun Drilling / BTA |
|---|---|---|
| Max practical depth | 10–20× diameter | 100–300× diameter |
| Depth ratio | Limited by chip evacuation | Designed for extreme depths |
| Cycle type | Pecking (interrupted cut) | Continuous feed |
| Coolant | Flood coolant | High-pressure through-tool |
| Surface finish | Moderate (peck marks) | Excellent (continuous) |
| Hole straightness | Moderate | Excellent (guide pads) |
| Machine utilization | Multi-purpose | Dedicated |
Summary
G73 and G83 peck drilling cycles are the primary tools for deep hole drilling on standard CNC machines. G73 is faster but does not fully clear chips; use it for short-chip materials and moderate depths. G83 fully clears chips on each peck; use it for deep holes and stringy materials. Select peck depth (Q) based on material and depth ratio. For holes beyond 15–20× diameter, transition to specialized deep hole drilling methods like gun drilling or BTA.
For control-specific programming, see CNC drilling cycles by control system. For machine limits and retrofits, see deep hole drilling on standard CNC machines. For a complete overview, visit the CNC deep hole drilling guide.