CNC Canned Cycles — Drilling, Tapping, and Boring on Machining Centers

Canned cycles are pre-defined machining sequences stored in the controller that handle the repetitive logic of hole-making operations. Instead of programming every plunge, dwell, retract, and re-position manually, a single G-code activates the cycle and the controller handles the sequence internally.

Once a canned cycle is active, only the hole position needs to change between holes — the cycle parameters repeat automatically.

How Canned Cycles Work

Every canned cycle follows the same six-step sequence:

  1. Position — rapid to the XY hole location in the current plane
  2. Approach — rapid from current Z to the R-plane (clearance above hole)
  3. Operation — execute the cutting action (drill, tap, bore, etc.)
  4. Dwell — optional pause at the bottom (P word, milliseconds)
  5. Retract — return to R-plane (G99) or initial plane (G98)
  6. Repeat — move to next XY position and repeat from step 1

This sequence repeats for every hole position until G80 cancels the cycle.

G81 — Standard Drilling

The simplest canned cycle. Plunges to depth at feed rate, then retracts at rapid.

G81 X_ Y_ Z_ R_ F_
T2 M6
G0 G90 G54 X20. Y20. S2500 M3
G43 H2 Z50.
M8

G99 G81 Z-20. R3. F250    (drill 20mm deep)
X50. Y20.
X80. Y20.
X80. Y50.
G80

G0 Z50.
M9 M5
G28 G91 Z0.
M30

Use G81 for through holes and shallow blind holes in materials that don't produce problematic chips.

G82 — Drilling with Dwell

Identical to G81 but adds a programmable dwell at the bottom of the hole before retracting. The dwell (P word, in milliseconds) lets the spindle clean up the hole bottom — useful for flat-bottomed holes and when using a spotting drill.

G82 Z-15. R3. P500 F200    (drill, dwell 500ms at bottom)

G83 — Peck Drilling (Full Retract)

For deep holes where chip evacuation is critical. The drill advances by Q each peck, then fully retracts to the R-plane before the next peck.

G83 Z_ R_ Q_ F_
G99 G83 Z-50. R3. Q5. F180    (5mm pecks, full retract each time)

Q is always positive. The cycle continues until the cumulative peck depth reaches Z.

See the full G73 and G83 guide for material-specific recommendations.

G73 — Chip-Break Peck Drilling

Like G83 but the retract is only a short distance (not back to R-plane) — enough to break the chip without evacuating it. Faster than G83; suitable for aluminum and short holes in mild steel.

G99 G73 Z-40. R3. Q6. F350    (6mm pecks, chip-break retract)

G84 — Rigid Tapping

Synchronized spindle and Z-axis movement for tapping. The feed rate must equal spindle speed × thread pitch. At the bottom of the hole the spindle reverses and the tap retracts.

G84 Z_ R_ F_ P_
S600 M3
G99 G84 Z-18. R3. F600    (M10×1.0 tap at 600 RPM: F=600×1.0=600)

See the full G84 tapping cycle guide for feed rate calculation and common errors.

G85 — Boring (Feed In, Feed Out)

Bores the hole at feed rate, then retracts at feed rate. The feed-rate retract prevents the boring bar from dragging and leaving a witness mark on the hole wall.

G85 Z-30. R3. F80    (bore in and out at feed rate)

Use G85 for precision bores where surface finish matters. The slow retract adds cycle time but produces a cleaner bore than rapid retract.

G86 — Boring (Feed In, Spindle Stop, Rapid Out)

Bores at feed rate, stops the spindle at the bottom, then retracts at rapid. Faster than G85, but the non-rotating retract can leave a light drag mark on the bore wall.

G86 Z-30. R3. F80    (bore, stop spindle, rapid retract)

G76 — Fine Boring Cycle

The highest-quality boring cycle. At the bottom, the spindle orients to a specific angle (M19), the boring bar shifts away from the bore wall by a small amount, then retracts at rapid without contact. Leaves no witness mark.

Requires a spindle orient function (M19) and machine support for the shift direction. The shift amount and direction are controller-parameter-dependent.

G76 Z-30. R3. Q0.1 F60    (bore, shift 0.1mm, retract without contact)

G80 — Cancel Canned Cycle

Cancels any active canned cycle. Always program G80 after the last hole in a sequence.

G80    (cancel cycle — tool stays at current Z)
G0 Z50.    (manually retract to safe height)

G80 does not move the tool — it only deactivates the cycle. Add an explicit retract move after G80.

Cycle Parameter Summary

ParameterMeaning
X, YHole position
ZFinal depth (absolute or incremental depending on G90/G91)
RR-plane height (clearance above part)
QPeck depth (G73, G83) or shift amount (G76)
PDwell at bottom in milliseconds
FFeed rate

Verify Every Canned Cycle in Simulation

Canned cycle behavior depends heavily on the controller — the same G83 block can behave differently on Fanuc vs Haas vs Siemens, particularly in how the re-entry clearance is calculated and how G98/G99 interacts with multiple surface levels. Eureka3X simulates canned cycles as your specific controller interprets them, showing the complete retract-and-plunge sequence on the 3D machine model.

Try Eureka3X free for 30 days →

Related Articles

Start verifying your real G-code today.

Ensure your programs are safe and accurate with Eureka 3X Pro.

Start 30-Day Free Trial