Fundamentals · G-code
Drilling canned cycles (G81, G82, G83, G84…): R planes, G98/G99 and pitfalls
How drilling, tapping and boring canned cycles work, the difference between G98 and G99, cancelling with G80, and the mistakes that break tools.
Canned cycles pack repetitive Z moves into one line: drilling, tapping, boring. Once called, the cycle is modal: it repeats at each new X/Y position until G80. The examples follow the Haas/Fanuc dialect; check details in your control’s manual.
The five steps of a cycle
- X and Y positioning (rapid).
- Rapid to the R plane.
- Drilling, tapping or boring depending on the cycle.
- Action at the bottom of the hole (dwell, spindle stop…).
- Return to the R plane (
G99) or the starting point (G98).
Common cycles
| Code | Motion | Use |
|---|---|---|
G81 | Feed in, rapid out | Plain drilling |
G82 | Feed in, dwell, rapid out | Spot drilling, counterboring |
G83 | Feed in pecks (Q), rapid out | Deep drilling |
G73 | Short peck (chip break) | High-speed drilling |
G84 | Feed in, spindle reverse, feed out | Right-hand tapping (see Tapping and thread milling) |
G85 | Feed in and out | Reaming |
G86 | Feed in, spindle stop, rapid out | Boring |
G80 | — | Cancels the cycle |
G98 or G99?
- G99: return to the R plane between holes. Faster; use it when nothing sticks up between holes.
- G98: return to the starting Z. Use it to clear a jaw, clamp or shoulder.
T3 M06 (6.8 DRILL)
G90 G54 G00 X10. Y10. S1800 M03
G43 H03 Z25. M08
G83 G99 Z-20. R2. Q3. F150.
X30.
X50.
G98 X50. Y40. (back to initial Z before clearing the clamp)
X10. Y40.
G80 G00 Z25. M09
Common mistakes
- Forgetting
G80: the next X/Y move drills an extra hole. G99with a clamp between two holes: crash.- Forgetting the drill point length (118° or 135°) in the depth.
- R plane computed in incremental by mistake.
Checklist
- R plane above the part, not in the material
G98to clear clamps and jaws- Peck
Qsuited to diameter and material G80before any non-cycle moveZdepth includes the drill point if the hole must go through
FAQ
Do I start the spindle before G84?
On Haas, the G84 cycle starts the spindle itself. On other controls, check the manual.
How do I repeat a hole at a fixed pitch?
In G91 with an L count (Haas): each repeat moves one pitch and runs the cycle again.
Sources
- Haas — Mill Programming Workbook (PDF): five steps of a cycle, G98/G99, G81–G89 table,
Lrepeat, G84. Consulted November 26, 2026. - LinuxCNC — G-codes (G81–G89 cycles).
One guide a week, French-first
New guides, used equipment in Quebec and price moves. No third-party ads.