CNC Drilling Cycles (G81–G89): Complete Guide with Real G-Code Examples
Canned drilling cycles simplify repetitive hole-making operations. Instead of writing multiple lines of G-code, you can program drilling, pecking, tapping, and boring with a single block.
This guide covers G81–G89 with real-world examples for Fanuc, Haas, Siemens, and Heidenhain.
📌 1. G81 — Simple Drilling Cycle
Basic drilling cycle: rapid to R-plane, feed to Z-depth, retract.
G81 R2.0 Z-15.0 F200
G80
- R2.0 = clearance plane
- Z-15.0 = final depth
- F200 = feedrate
📌 2. G82 — Drilling with Dwell
Adds dwell at bottom of hole to improve accuracy.
G82 R2.0 Z-20.0 P500 F150
G80
- P500 = dwell time in milliseconds
📌 3. G83 — Peck Drilling (Deep Hole)
Retracts between pecks for chip breaking.
G83 R2.0 Z-40.0 Q5.0 F180
G80
- Q5.0 = peck depth
- Z-40.0 = final depth
📌 4. G84 — Tapping Cycle
Rigid tapping synchronized with spindle.
M29 S1000 (Rigid Tap Enable – Haas/Fanuc)
G84 R2.0 Z-20.0 F1.25
G80
- F1.25 = pitch per revolution (mm/rev)
📌 5. G85 — Boring Cycle (Feed In/Out)
Smooth boring cycle, feeds in and out.
G85 R2.0 Z-30.0 F120
G80
📌 6. G86 — Boring Cycle (Feed In, Rapid Out)
Feeds in, rapid retracts.
G86 R2.0 Z-25.0 F120
G80
📌 7. G87 — Back Boring Cycle
Used for boring from the back side of hole (requires special tooling).
G87 R2.0 Z-15.0 F120
G80
📌 8. G88 — Boring Cycle with Dwell
Feeds in, dwells, then manual retract.
G88 R2.0 Z-20.0 P1000 F100
G80
📌 9. G89 — Boring Cycle with Dwell + Feed Out
Feeds in, dwells, then feeds out.
G89 R2.0 Z-20.0 P500 F100
G80
📌 10. Siemens & Heidenhain Equivalents
- Siemens → CYCLE81 (drill), CYCLE82 (drill+dwell), CYCLE83 (peck), CYCLE84 (tap), CYCLE85–89 (boring)
CYCLE83(DEPTH=-40, PECK=5, RET=2, F=200)
- Heidenhain → CYCL DEF 200 (drilling), CYCL DEF 205 (peck), CYCL DEF 207 (tapping), CYCL DEF 209 (boring)
CYCL DEF 205 PECKING
Q200=+2 ; SAFETY HEIGHT
Q201=-20 ; DEPTH
Q206=+150 ; FEEDRATE
Q202=+5 ; PECK
📌 11. Best Practices
- Use G98 (return to initial plane) or G99 (return to R-plane) carefully.
- Always apply coolant before drilling deep holes.
- For tapping, verify rigid tapping support on control.
- Peck cycles prevent chip packing and tool breakage.
📌 12. Advanced Example — Bolt Circle Drilling
#100=0
WHILE[#100LT360]DO1
G81 X[50*COS[#100]] Y[50*SIN[#100]] Z-15. R2. F150
#100=#100+60
END1
G80
This macro drills 6 holes on a 50 mm bolt circle.
📌 13. Future of Drilling Cycles (2025–2030)
- Adaptive peck cycles — spindle load determines Q-value dynamically.
- Smart tapping cycles — auto-adjust feed for pitch correction.
- AI-driven drilling optimization — reduces cycle time and improves tool life.
✅ Conclusion
Drilling cycles (G81–G89) are essential for efficient CNC machining.
By mastering these cycles, you reduce program length, improve safety, and extend tool life — making your shop more productive and reliable.
Leave a comment