G-Code Reference for Deep Hole Drilling Cycles — G73, G83, and Custom Macros

G-code programming reference for deep hole drilling cycles on Fanuc and Haas controls. G73 chip breaking, G83 peck drilling, parameter optimization, and example programs.

Deep Hole DrillingReference3 min read

G83 — Deep Hole Peck Drilling Cycle (Full Retract)

G83 fully retracts to the R-plane after each peck, allowing complete chip clearance and coolant access to the cutting zone.

Format (Fanuc / Haas Standard)

G83 X_ Y_ Z_ R_ Q_ F_ ;
Code Meaning
X, Y Hole position
Z Final depth (from R-plane)
R Retract plane (rapid height)
Q Peck depth per increment
F Feed rate

Example

G90 G00 G54 X50 Y25 ;
G43 Z10 H01 M08 ;
G99 G83 Z-40 R2 Q8 F120 ;
G80 ;

Drills at X50 Y25 to Z-40 in 8 mm pecks, retracting to R2 after each peck.

Haas I-J-K Progressive Peck Option

G83 X_ Y_ Z_ I_ J_ K_ R_ F_ ;
Code Meaning
I First peck depth (largest)
J Reduction per pass
K Minimum peck depth

Example: G83 Z-40 I12 J3 K4 R2 F120 — first peck 12 mm, then 9, 6, minimum 4 mm.

G73 — Chip Breaking Cycle (Partial Retract)

G73 retracts a small amount (0.005–0.050 in or 0.1–1.0 mm) after each peck to break chips without fully clearing the hole.

Format

G73 X_ Y_ Z_ R_ Q_ F_ ;
Code Meaning
Q Incremental peck depth (each advance)
d Retract distance (set by machine parameter, typically ~0.5 mm)

When to Use G83 vs G73

Cycle Retract Behavior Use Case
G73 Small retract (chip break) Short holes, stringy materials, aluminum
G83 Full retract to R-plane Deep holes, poor chip evacuation, steel/Inconel

For deep hole drilling (L/D > 5), G83 is preferred to ensure complete chip clearance.

G98 vs G99 Retract Mode

Code Retract Between Holes
G98 To initial Z level (clear parts/fixtures)
G99 To R-plane only (faster, same-part repeat)

Full Program Example — G83 on Fanuc/Haas

O1000 (DEEP HOLE DRILLING)
N10 T01 M06 ;
N20 G90 G80 G17 G54 ;
N30 G00 X0 Y0 ;
N40 G43 H01 Z50.0 ;
N50 S1500 M03 ;
N60 M08 ;
N70 G99 G83 X25 Y25 Z-60.0 R3.0 Q10.0 F150 ;
N80 X75 Y25 ;
N90 X25 Y75 ;
N100 X75 Y75 ;
N110 G80 G00 Z50.0 ;
N120 M09 ;
N130 M05 ;
N140 M30 ;

Peck Strategy Recommendations

L/D Ratio q (peck depth) Retract Mode Notes
≤ 3 Full depth G73 Shallow, use chip break
3–5 2–3× D G73 or G83 Moderate pecking
5–10 1–2× D G83 Standard deep hole
10–20 0.5–1× D G83 Reduce peck for chip clearance
> 20 0.3–0.5× D G83 + pilot hole Use dedicated DHD method

Coolant Considerations in G-Code

For deep hole drilling on machining centers (per VDI 3211):

  • M07 / M08: Standard flood coolant — adequate for L/D < 3
  • Through-spindle coolant (TSC): Required for L/D > 3. Activate with M41 or M88 depending on machine
  • Minimum 40 bar recommended for L/D > 5
  • For deeper holes, consider M355 (high-pressure coolant on) if available

Custom Macro Alternative (Advanced)

#1 = -60.0  (Z final depth)
#2 = 2.0    (R-plane)
#3 = 8.0    (Q peck)
#4 = 0.5    (W clearance)
#5 = 150.0  (F feed)
#6 = #2 - #3

G01 Z#6 F2000
G01 Z#1 F#5
G00 Z#2

Source: Fanuc programming manuals; Haas programming guide; CNC Training Centre; mfgrobots.

Deep Hole Drilling Editorial Team

We provide independent, practical content for deep hole drilling and precision manufacturing professionals. Our articles are researched and reviewed to ensure technical accuracy and relevance.

Have feedback? Contact us

Stay informed

Get the latest deep hole drilling insights delivered to your inbox.