CNC Canned Drilling Cycles: G81–G89 Complete Guide (Drill, Peck, Tap, Bore)
Canned drilling cycles simplify hole machining by combining multiple motions — approach, drill, retract — into one block of G-code.
These cycles (G81–G89) are standard across most CNC milling controls such as Fanuc, Haas, Siemens, and Heidenhain.
📌 1. Overview of Drilling Cycles
| Code | Function | Description |
|---|---|---|
| G81 | Simple drilling | Rapid → feed → rapid |
| G82 | Drilling with dwell | Adds pause at bottom |
| G83 | Peck drilling | Drills in steps |
| G84 | Tapping | Threading with tap |
| G85 | Boring (feed in & out) | Finishing bores |
| G86 | Boring with spindle stop | Feed in, stop, rapid out |
| G87 | Back boring | Bore from backside |
| G88 | Manual retract boring | Waits for operator |
| G89 | Feed in & feed out with dwell | Controlled boring with pause |
📌 2. Common Parameters
| Parameter | Description |
|---|---|
| X, Y | Hole position |
| Z | Final depth |
| R | Retract plane |
| F | Feedrate |
| P | Dwell time (G82, G89) |
| Q | Peck depth (G83) |
📌 3. G81 — Simple Drilling Cycle
%
O8001 (G81 SIMPLE DRILL)
G90 G17 G21 G40 G80 G54
T05 M06
S1500 M03
G00 X25. Y25. Z5.
G81 Z-15. R2. F200
X50.
X75.
G80
M30
%
| Motion Sequence | Description |
|---|---|
| Rapid to R plane | G00 |
| Feed to Z depth | G01 |
| Rapid retract to R | G00 |
📌 4. G82 — Drilling with Dwell
G82 Z-20. R2. P1. F200
Dwell for 1 second (P1) at the bottom to improve hole finish and chip removal.
📌 5. G83 — Peck Drilling Cycle
Peck drilling removes material in small steps to prevent chip packing.
Example:
G83 Z-30. Q5. R2. F150
| Code | Meaning |
|---|---|
| Q5. | Peck depth = 5 mm |
| Z-30. | Final hole depth |
| R2. | Retract 2 mm above surface |
Full Example:
%
O8002 (G83 PECK DRILLING)
G90 G17 G21 G40 G80 G54
T06 M06
S1200 M03
G00 X20. Y20. Z5.
G83 Z-30. Q5. R2. F150
X40.
X60.
G80
M30
%
CNC drills 5 mm deep, retracts, and continues until reaching Z = -30 mm.
📌 6. G84 — Tapping Cycle
Used for internal thread creation using rigid tapping synchronization.
G84 Z-15. R2. F1.25
| Code | Description |
|---|---|
| F1.25 | Feed = thread pitch (mm/rev) |
| M29 S500 | Rigid tap synchronization (Fanuc/Haas) |
Example:
%
O8003 (G84 TAPPING)
G90 G17 G21 G40 G80 G54
T07 M06
S500 M03
M29 S500
G00 X40. Y40. Z5.
G84 Z-15. R2. F1.25
G80
M30
%
📌 7. G85 — Boring (Feed In & Out)
G85 Z-20. R2. F100
Feeds in and feeds out at same rate for smoother bores — spindle stays ON.
📌 8. G86 — Boring with Spindle Stop
G86 Z-25. R2. F120
| Sequence | Description |
|---|---|
| Feed to Z depth | G01 |
| Stop spindle (M05) | |
| Rapid retract | G00 |
📌 9. G87 — Back Boring
G87 Z-15. R2. Q5. F150
Automatically positions tool behind the part and bores upward through the back side.
📌 10. G88 — Manual Retract Boring
Used when manual spindle retraction is required.
G88 Z-15. R2. F100
CNC stops at depth — operator manually retracts tool, then resumes.
📌 11. G89 — Feed In & Feed Out with Dwell
G89 Z-25. R2. P2. F120
| Code | Description |
|---|---|
| P2. | Dwell 2 seconds at bottom |
| Feed in/out | Controlled feed both ways |
📌 12. Haas Example — Mixed Cycle Program
%
O8010 (MULTI CYCLE EXAMPLE)
G90 G17 G21 G40 G80 G54
T05 M06
S1800 M03
G00 X10. Y10. Z5.
G81 Z-10. R2. F200
X30. Y10.
G82 Z-15. R2. P0.5 F200
X50. Y10.
G83 Z-25. Q5. R2. F150
X70. Y10.
G80
M30
%
Combines simple drill, dwell, and peck cycles in one program.
📌 13. Siemens Example
CYCLE81(DRILLING, DEPTH=20, FEED=200)
CYCLE82(DWELL, DEPTH=25, DWELL=1.0)
CYCLE83(PECK, DEPTH=30, PECK=5)
Siemens uses structured cycle definitions with named parameters.
📌 14. Heidenhain Example
CYCL DEF 200 DRILLING
Q200=+2 ; CLEARANCE PLANE
Q201=-15 ; DEPTH
Q206=+200 ; FEED
CYCL CALL
CYCL DEF 201 PECK DRILLING
Q200=+2
Q201=-25
Q202=+5 ; PECK DEPTH
Q206=+150
CYCL CALL
📌 15. Best Practices
- Always cancel with G80 after any canned cycle.
- Use proper R plane to avoid rapid crashes.
- Match feedrate (F) and spindle speed (S) to hole size.
- For deep holes, use G83 with coolant or air blast.
- For tapping, ensure rigid mode (M29) is supported.
📌 16. Common Mistakes
| Mistake | Result |
|---|---|
| Missing G80 | Next tool repeats previous cycle |
| Wrong R value | Tool rapids into part |
| Missing M29 in G84 | Tap breakage |
| Wrong Q in G83 | Tool overload or poor chip evacuation |
📌 17. Advanced Example — Full Hole Pattern Program
%
O8020 (FULL HOLE PROGRAM)
G90 G17 G21 G40 G80 G54
T08 M06
S1500 M03
(--- SPOT DRILL ---)
G81 Z-2. R2. F250
X0 Y0
X40
X80
G80
(--- DRILL ---)
G83 Z-25. Q5. R2. F150
X0 Y0
X40
X80
G80
(--- TAP ---)
M29 S600
G84 Z-15. R2. F1.25
X0 Y0
X40
X80
G80
M30
%
Fully automated drilling, pecking, and tapping sequence using G81, G83, and G84.
📌 18. Future Trends (2025–2030)
- Smart adaptive pecking — CNC adjusts Q-depth based on chip load.
- AI-driven tapping detection — automatic retraction if torque exceeds limits.
- Digital twin simulation — real-time cycle preview for hole pattern optimization.
✅ Conclusion
Canned drilling cycles (G81–G89) automate complex hole-making operations, reducing programming time while improving safety and accuracy.
By mastering each cycle’s function, parameters, and sequence, CNC machinists can perform drilling, pecking, tapping, and boring with unmatched precision and efficiency.
Leave a comment