G80 to G89: Complete Guide to CNC Drilling and Boring Canned Cycles
Canned cycles simplify repetitive machining operations like drilling, boring, tapping, and retract moves. Instead of writing multiple G-code lines for each operation, you can use a single canned cycle block.
📋 G-Code Overview
| Code | Operation | Description |
|---|---|---|
| G80 | Cancel cycle | Deactivates all canned cycles |
| G81 | Drilling | Simple drilling with single depth |
| G82 | Drilling with dwell | Pauses at bottom of hole |
| G83 | Peck drilling | Breaks chips and retracts between pecks |
| G84 | Tapping | Synchronized tapping cycle |
| G85 | Boring | Feed in, feed out |
| G86 | Boring (spindle stop) | Feed in, spindle stop, rapid out |
| G87 | Back boring | Requires custom parameters |
| G88 | Boring with dwell | Feed in, dwell, manual retract |
| G89 | Boring with dwell | Feed in, dwell, feed out |
🧠 Common Parameters (Fanuc-style)
G8x X__ Y__ Z__ R__ F__ Q__ P__
| Parameter | Meaning |
|---|---|
| X/Y | Hole location |
| Z | Final depth |
| R | Retract/start plane |
| F | Feedrate |
| Q | Peck depth (for G83) |
| P | Dwell time (for G82, G88, G89) |
🔨 G81 – Simple Drilling
G81 X50 Y50 Z-10 R2 F100
- Drills to Z-10 from retract plane R2
- At 100 mm/min feedrate
- No dwell or pecking
Cancel with: G80
⏱️ G82 – Drilling with Dwell
G82 X50 Y50 Z-12 R2 P300 F120
- Same as G81, but dwells for 0.3 sec at bottom
P300= 300 milliseconds
🪓 G83 – Peck Drilling (Chip Breaking)
G83 X30 Y30 Z-15 R2 Q5 F90
- Peck depth: 5mm (goes down in steps)
- Ideal for deep holes or chip-prone materials
Peck sequence:
Z-5 → retract → Z-10 → retract → Z-15 → retract
🔩 G84 – Tapping Cycle
G84 X60 Y60 Z-12 R2 F1.25
- Performs synchronized tapping with pitch = 1.25mm
- Feedrate must match spindle speed × pitch
🛑 Make sure your machine supports rigid tapping
🔁 G85 – Boring (Feed In/Out)
G85 X40 Y40 Z-10 R2 F80
- Bores in at feedrate, and returns at same feedrate
- Unlike drilling, this is smoother and used for finishing
🔄 G86 – Boring with Spindle Stop
G86 X25 Y25 Z-10 R2 F80
- Enters at feedrate
- Spindle stops at bottom
- Retracts at rapid speed
Good for older lathes or rigid boring setups
⏸️ G89 – Boring with Dwell + Feed Out
G89 X20 Y20 Z-10 R2 P500 F80
- Adds 0.5 sec dwell at the bottom
- Exits using feedrate, not rapid
- Used when surface finish is critical
🛑 G80 – Always Cancel After Use
Every canned cycle remains active until canceled. Before any rapid movement or tool change:
G80
This resets the modal cycle mode.
🧪 Example – Peck Drilling Multiple Holes
%
O6001 (G83 Peck Drilling)
G21 G90 G54
G0 Z5
G83 R2 Z-15 Q5 F120
X0 Y0
X20 Y0
X40 Y0
G80
G0 Z100
M30
%
🔍 Troubleshooting Canned Cycles
| Problem | Cause | Fix |
|---|---|---|
| Hole not drilled fully | Too large Q value in G83 | Use smaller peck (Q) value |
| Drill breaks | Feed too high or no chip break | Reduce F or use G83 with Q |
| Surface roughness | Rapid retraction from boring | Use G85 or G89 instead of G81 |
| G-code errors | Forgetting to cancel with G80 | Always insert G80 after cycles |
💡 Pro Tips
- Use G83 for holes deeper than 3× drill diameter
- For aluminum or brass, G81 is often sufficient
- Set
R-planeat least 1–2mm above the part surface - Use P dwell values to improve tap bottom thread depth
- Always cancel with G80 before tool changes
🔚 Final Thoughts
Canned cycles like G81–G89 are powerful tools to simplify your code, reduce errors, and standardize hole machining.
Why write 10 lines of code for every hole when 1 will do?
Once mastered, canned cycles will drastically boost your productivity while reducing tool wear and crash risks.
Leave a comment