Complete Guide to Canned Cycles in CNC: G81–G89 for Drilling, Pecking, Boring & Tapping
Canned cycles are predefined motion patterns in CNC programming that simplify repetitive machining tasks like drilling, tapping, and boring.
Rather than writing multiple lines of G-code for each step, you call a canned cycle with a single line and execute it at multiple locations.
🧮 Why Use Canned Cycles?
- Reduces code size
- Simplifies multi-hole operations
- Ensures consistent behavior
- Supports parameters like dwell time, depth, feedrate
📘 Standard Drilling & Boring Canned Cycles
| G-Code | Cycle Type | Description |
|---|---|---|
| G81 | Drilling | Simple plunge and retract |
| G82 | Drilling with Dwell | Pause at bottom of hole |
| G83 | Peck Drilling | Step down in pecks to break chips |
| G84 | Right-Hand Tapping | Tap into hole, reverse, retract |
| G85 | Boring (Feed In/Out) | In and out at same feed |
| G86 | Boring (Spindle Stop) | Spindle stops at bottom before retract |
| G87 | Back Boring | Used with subprogram or reverse tools |
| G88 | Boring with Dwell | Stop and wait for manual continuation |
| G89 | Boring with Dwell | Stops for programmed dwell |
📐 G-Code Structure
G81 X... Y... Z... R... F...
| Parameter | Meaning |
|---|---|
| X/Y | Hole location |
| Z | Final drilling depth |
| R | Retract (clearance) plane |
| F | Feedrate |
| P | Dwell time (in milliseconds) |
🧰 Example: G81 – Simple Drilling
G90 G17 G21
G00 X10 Y10
G81 Z-15.0 R2.0 F120
X30 Y10
X50 Y10
G80
✅ Drills 3 holes at X10, X30, X50 to a depth of -15 mm, retracting to R2.0 each time.
🔂 Canceling Canned Cycles
Always cancel an active cycle with:
G80 ; Cancels any active canned cycle
⛏️ G83 – Peck Drilling Example
Used for deeper holes to clear chips and avoid tool breakage.
G83 Z-20.0 R2.0 Q5.0 F120
X0 Y0
X20 Y0
G80
| Q | Peck depth (mm) |
|---|---|
| Z | Total depth |
| R | Retract height |
This drills in 5 mm pecks until reaching -20 mm.
🔩 G84 – Tapping Cycle Example
G84 Z-12.0 R1.0 F1.25
X10 Y10
X30 Y10
G80
Feedrate must match thread pitch! Example: M10x1.25 → F1.25
⛔ Use rigid tapping or tapping head depending on your spindle capabilities.
🔍 G82 – Drilling with Dwell
G82 Z-10.0 R1.0 P1000 F120
| P1000 = Dwell time = 1 second |
Machine pauses at the bottom of hole for chip evacuation or burnishing.
🔬 Boring Cycle Examples
| Code | Action |
|---|---|
| G85 | Feed in, feed out |
| G86 | Feed in, spindle stop, rapid out |
| G88 | Feed in, dwell, manual out |
| G89 | Feed in, dwell, feed out |
Example:
G85 Z-12.0 R2.0 F80
X0 Y0
X30 Y0
G80
🧠 Tips for Using Canned Cycles
- ✅ Always define
Rplane high enough to clear clamps/fixtures - ✅ Cancel with
G80before changing tools or cycles - ✅ Use
G98orG99to define return mode (initial or R-plane) - ✅ Use appropriate
FandQvalues based on tool and material - ✅ Simulate the cycle to ensure it behaves as expected
🔁 G98 vs G99 – Return Modes
| Code | Return Position |
|---|---|
| G98 | Initial point (usually Z before cycle) |
| G99 | R-plane (faster, closer retract) |
Example:
G98 G83 Z-20 R2.0 Q5.0 F100
Machine retracts to the starting Z (not just R).
🧪 Practical Drilling Setup Example
G90 G21 G17
T1 M06
G00 G54 X0 Y0
G43 H01 Z100.0
G98
G83 Z-25.0 R2.0 Q5.0 F120
X20 Y0
X40 Y0
G80
M30
✅ 3 holes drilled to 25 mm deep with 5 mm pecks, retracting to initial Z (via G98).
🛠️ Which Cycle Should I Use?
| Task | Recommended Cycle |
|---|---|
| Simple drilling | G81 |
| Deep drilling | G83 |
| Drill + dwell | G82 |
| Tapping | G84 |
| Boring | G85 / G86 / G89 |
📌 Final Thoughts
Canned cycles like G81–G89 bring simplicity, consistency, and safety to hole-making operations in CNC.
- Save programming time
- Reduce human error
- Enable repeatable, precise machining
Canned cycles are not just shortcuts — they are tools of professional efficiency.
Leave a comment