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.

FeatureG73 (High-Speed Peck)G83 (Deep Hole Peck)
Retract typeSmall retract (~0.25 mm / 0.01")Full retract to R-plane
Chip evacuationMinimal — chips stay in flutesComplete — hole clears each peck
Cycle timeFast — less retractionSlow — full retract each peck
Coolant accessPoor — chip packing riskGood — coolant reaches cutting edge
Best forShallow to moderate depthDeep 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_
ParameterDescriptionExample
X, YHole positionX50 Y25
ZFinal hole depth (from R-plane)Z-40.0 (40 mm deep)
RR-plane (retract plane position)R2.0
QDepth per peck (positive incremental)Q5.0 (5 mm per peck)
FFeed rateF150 (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_
ParameterDescriptionExample
X, YHole positionX50 Y25
ZFinal hole depthZ-40.0
RR-planeR2.0
QDepth per peckQ5.0
PDwell at hole bottom (milliseconds)P500
FFeed rateF150

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

CodeBehaviorUse When
G98Retract to initial plane after each holeClearing clamps, fixtures, or tall parts
G99Retract to R-plane after each holeDrilling 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

MaterialQ as % of Drill DiameterNotes
Low-carbon steel75–100%Standard peck depth
Alloy steel50–75%Reduce for harder grades
Stainless steel30–50%Small pecks prevent work hardening
Aluminum100–200%Deep pecks possible; good chip evacuation
Cast iron100–150%Powdered chips evacuate easily
Titanium30–50%Small pecks; coolant critical

Q Value by Depth Ratio

Depth RatioRecommended Q (% of Diameter)Cycle Type
< 3:1No pecking neededG81 (straight plunge)
3:1 to 8:175–100%G73 or G83
8:1 to 15:150–75%G83 required
15:1 to 20:130–50%G83 with reduced peck
> 20:1Gun drilling recommendedSpecialized 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:

TechniqueHow It WorksBest For
Standard peck (G83)Full retract clears chipsHoles up to 15:1
High-speed peck (G73)Short retract breaks chipsShallow holes, short chips
Dwell at bottomPause to break chip before retract (P parameter)Stringy materials
Variable peckDecreasing Q at depthDeepest holes on standard machines
Spring passesRapid down to last Z-1mm before feedingPrevents recutting chips

Common Programming Mistakes

MistakeConsequenceFix
Q value too largeChip packing; tool breakageReduce Q to 50–75% of diameter
Wrong retract mode (G98/G99)Tool hits clamp; crashVerify clearance above part
No dwell at breakthroughBurr on hole exit; chipped cornerAdd P200–P500 on final hole
G73 for stringy materialChip packing in flutesSwitch to G83
Pecking carbide drillsEdge chipping; reduced tool lifeUse G81 (no peck) for carbide
No G80 cancelUnexpected tool movement on next operationAlways cancel with G80

Comparison: Standard CNC vs. Specialized Deep Hole Drilling

AspectStandard CNC + G83Gun Drilling / BTA
Max practical depth10–20× diameter100–300× diameter
Depth ratioLimited by chip evacuationDesigned for extreme depths
Cycle typePecking (interrupted cut)Continuous feed
CoolantFlood coolantHigh-pressure through-tool
Surface finishModerate (peck marks)Excellent (continuous)
Hole straightnessModerateExcellent (guide pads)
Machine utilizationMulti-purposeDedicated

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.