The Ultimate Guide to CNC Canned Cycles: G81 to G89 with Real-World Applications
Canned cycles are powerful CNC commands that simplify common machining tasks like drilling, tapping, and boring. Instead of writing long sequences of G-code for each operation, you can use a single line to automate:
- Drilling
- Peck drilling
- Tapping
- Boring
- Reaming
- Back boring
They improve code clarity, reduce errors, and boost efficiency — especially for parts with multiple holes.
📚 Basic Format of Canned Cycles
G81 X... Y... Z... R... F...
| Code | Description |
|---|---|
| X/Y | Hole position |
| Z | Final drilling depth |
| R | Retract level (safe Z before drill) |
| F | Feed rate |
🔁 After calling a canned cycle once, you can repeat it on different X/Y positions without re-specifying Z/R/F.
🔧 G81 – Simple Drilling Cycle
G81 X50 Y20 Z-10 R2 F200
- Rapid to X50 Y20
- Rapid to R2 (above part)
- Feed down to Z-10
- Rapid retract to R2
🦷 G83 – Peck Drilling (for Deep Holes)
Breaks the drilling into multiple smaller plunges to clear chips.
G83 X0 Y0 Z-20 R2 Q3 F150
Q3= peck depth (3 mm per cut)- Avoids tool breakage and chip buildup
🔩 G84 – Tapping Cycle
Synchronous spindle speed and feed, reverses spindle to retract.
G84 X30 Y40 Z-15 R2 F1.25
- F = thread pitch (e.g., M8 × 1.25 → F1.25)
- Requires rigid tapping capable machine
🔄 Canned Cycle Types Summary
| Code | Cycle Name | Description |
|---|---|---|
| G81 | Drilling | Standard drill-in/retract |
| G82 | Drilling + dwell | Pauses at depth |
| G83 | Peck drilling | Incremental deep-hole drilling |
| G84 | Tapping | Forward tap, retract |
| G85 | Boring | Feed in/out (no dwell) |
| G86 | Boring + spindle stop | Spindle stops at depth |
| G87 | Back boring | Opposite side boring |
| G88 | Manual retract | Operator retracts after boring |
| G89 | Boring + dwell | Waits at depth before retract |
🔁 How to Cancel a Canned Cycle
Use G80 to cancel any active canned cycle.
G80
Always use it after drilling cycles before moving to another plane or contouring.
🧩 Complete G-Code Example
T2 M06 ; Drill tool
G90 G54 G00 X0 Y0
G43 H02 Z50.0
S1200 M03
G00 X20 Y20
G83 Z-15.0 R1.0 Q3.0 F200
X40 Y20
X60 Y20
G80
G00 Z100.0
- This drills 3 holes using G83 at different positions
- Cancels the cycle with
G80
🧠 Best Practices
- ✅ Always use
G80after canned cycles - ✅ Check machine-specific parameters (dwell, retract)
- ✅ Use proper
Qvalues in G83 to match material hardness - ✅ For tapping (G84), make sure rigid tapping is enabled
- ❌ Don’t use canned cycles on unsupported planes (e.g., G18/G19 on older machines)
📏 Parameters Reference
| Parameter | Meaning | Example |
|---|---|---|
| Z | Final depth | Z-10.0 |
| R | Retract height | R2.0 |
| Q | Peck increment (G83) | Q2.5 |
| F | Feed rate (or pitch) | F150 or F1.0 |
⚠️ Machine-Specific Behavior
Canned cycles behave slightly differently on Fanuc, Haas, Siemens, etc.
- Fanuc: Standard G81–G89 support, requires
G80cancel - Haas: Similar to Fanuc, but with optional rigid tapping via G84.1
- Siemens: Uses different syntax (
CYCLE81,CYCLE82, etc.)
🛠️ Always refer to your controller’s manual before using advanced cycles.
🚀 Final Thoughts
Canned cycles are your CNC program’s shortcut to efficiency. Mastering G81–G89 can:
- Save you hundreds of lines of code
- Reduce programming and machining time
- Increase consistency and reliability
Write less, drill more — that’s the power of canned cycles.
Leave a comment