🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Manufacturing & Marine › CNC Machining › G-Code Programming for CNC Mills and Lathes › Lesson 6
MFG-CNC14-04 · Lesson 6 · 16 clock hours · demo

Canned Cycles: Drilling, Boring, Tapping, and Pocketing

Objective. Students write G-code programs using standard canned cycles (G81 drill, G84 tap, G85 bore, G83 peck drill) with correct R-plane and Z-depth parameters for a multi-hole pattern on a mill.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by a licensed engineer or certified journey-level tradesperson or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

What Is a Canned Cycle?

A canned cycle is a pre-programmed, single-block shortcut that tells the CNC control to perform a fixed sequence of moves — rapid down to the R-plane, feed into the workpiece, and return — without you writing every motion line by line. On a Haas mill, canned cycles live in the G80–G89 range. Once a canned cycle is active, it repeats at every XY position you list until you cancel it with G80. This saves dozens of lines of code and eliminates transcription errors on multi-hole patterns.

The R-Plane and Z-Depth

Every canned cycle uses two critical depth parameters:

Both R and Z are modal: they stay active at every subsequent XY position until you change them or cancel with G80.

Common Canned Cycles

G81 — Standard Drill

Feed straight to Z-depth, then rapid out. Use for short holes where chip evacuation is not a concern.

```

G81 X__ Y__ Z__ R__ F__

```

G83 — Peck Drill (Full Retract)

Drills in increments (pecks), fully retracts to the R-plane between each peck to clear chips, then rapids back to just above the previous depth before feeding again. The peck increment is set with Q (always a positive value in inches). Use G83 for holes deeper than approximately three times the drill diameter, for difficult-to-machine alloys, or whenever chip packing is a risk.

```

G83 X__ Y__ Z__ R__ Q__ F__

```

G84 — Right-Hand Tapping

Feeds to Z-depth at the calculated pitch feed rate, then reverses spindle direction and feeds back out. The feed rate must equal spindle RPM × pitch (inches per revolution). Getting this wrong strips threads or breaks taps — double-check every time.

```

G84 X__ Y__ Z__ R__ F__

```

G85 — Boring (Feed In, Feed Out)

Feeds to Z-depth, then feeds back out. The feed-out prevents the boring bar from dragging a witness mark on retract. Use for finish-bored holes where surface finish matters.

```

G85 X__ Y__ Z__ R__ F__

```

The L Word

L specifies the number of times a canned cycle repeats at the same XY position (or used with incremental positioning to step through a pattern). L1 is default. L0 loads the cycle parameters without executing — useful for setting up before the first hole position.

Bolt-Circle Patterns

A bolt circle is a set of holes evenly spaced around a center point at a fixed radius. To find each hole's XY coordinates, use:

For 6 holes equally spaced, the angles are 0°, 60°, 120°, 180°, 240°, and 300°. Calculate all six positions before you write a single line of G-code and record them on your worksheet — errors here cause scrap.

Tapping Feed Rate

For G84, the feed rate in inches per minute is:

F = RPM × (1 ÷ TPI)

where TPI is threads per inch. For example, a ¼-20 tap at 300 RPM needs F = 300 × (1/20) = 15.0 in./min. Using any other feed rate risks a broken tap or stripped thread.

Program Structure for a Canned Cycle Sequence

A safe sequence for a center-drill → peck-drill → tap operation looks like this:

1. Tool change and spindle start (center drill)

2. G81 — spot all hole positions, then G80

3. Tool change and spindle start (tap drill)

4. G83 with Q peck increment — drill all positions, then G80

5. Tool change and spindle start (tap)

6. G84 with calculated F — tap all positions, then G80

7. G28 or G91 G28 Z0 — return to home

Always verify R-plane clearance after every tool change; a longer tool can crash into a clamp that a shorter center drill cleared.

Safety Points

Key terms10

Canned cycleA single G-code block that commands the control to execute a fixed multi-step motion sequence (rapid to R, feed to Z, return), repeating at each programmed XY location until cancelled by G80.
R-planeThe Z-axis reference height, programmed with the R address, where the tool transitions from rapid travel to feed rate during a canned cycle; must clear all workholding and part features.
G83 (peck drill)A canned cycle that drills in Q-increment steps, fully retracting to the R-plane between each peck to evacuate chips; required for deep holes or difficult materials.
Q (peck increment)The depth of each individual peck in a G83 or G73 cycle, always entered as a positive value; controls how aggressively chips are broken.
G84 (rigid tapping)A canned tapping cycle that feeds the tap to depth, then reverses spindle rotation to feed back out; requires a feed rate equal to RPM divided by TPI to match thread pitch exactly.
G80The canned-cycle cancel code; must be programmed after a canned cycle group is complete to prevent the cycle from executing at subsequent XY moves.
Bolt circleA set of holes equally spaced around a common center point at a fixed radius; hole coordinates are calculated using the radius and evenly divided angular increments.
Tap drill sizeThe drill diameter used before tapping; chosen to produce approximately 75% thread engagement, found on a standard tap-drill chart (e.g., a #7 drill for a ¼-20 thread).
G85 (bore feed-out)A boring canned cycle that feeds both into and out of the hole, preventing the boring bar from dragging a scratch mark on rapid retract.
Modal codeA G-code or parameter that remains active for all subsequent blocks until changed or cancelled; R and Z values inside canned cycles are modal across multiple XY positions.

Worked examples4

1. Calculate the XY coordinates of six equally spaced holes on a bolt circle with a 2.500 in. radius centered at X0, Y0.
  1. Divide 360° by 6 holes = 60° spacing. Angles are 0°, 60°, 120°, 180°, 240°, 300°.
  2. Hole 1 (0°): X = 2.500 × cos(0°) = 2.500 × 1.0000 = 2.5000; Y = 2.500 × sin(0°) = 2.500 × 0.0000 = 0.0000
  3. Hole 2 (60°): X = 2.500 × cos(60°) = 2.500 × 0.5000 = 1.2500; Y = 2.500 × sin(60°) = 2.500 × 0.8660 = 2.1650
  4. Hole 3 (120°): X = 2.500 × cos(120°) = 2.500 × (−0.5000) = −1.2500; Y = 2.500 × sin(120°) = 2.500 × 0.8660 = 2.1650
  5. Hole 4 (180°): X = 2.500 × cos(180°) = −2.5000; Y = 0.0000
  6. Hole 5 (240°): X = 2.500 × cos(240°) = −1.2500; Y = 2.500 × sin(240°) = −2.1650
  7. Hole 6 (300°): X = 2.500 × cos(300°) = 1.2500; Y = 2.500 × sin(300°) = −2.1650
Answer: Six hole centers: (2.5000, 0.0000), (1.2500, 2.1650), (−1.2500, 2.1650), (−2.5000, 0.0000), (−1.2500, −2.1650), (1.2500, −2.1650) — all in inches from the bolt-circle center.
2. A ¼-20 UNC tap will be run at 250 RPM. What feed rate (in./min) must be programmed in the G84 block?
  1. Identify pitch: ¼-20 means 20 threads per inch (TPI), so pitch = 1/20 = 0.050 in./rev.
  2. Apply the tapping feed rate formula: F = RPM × pitch = 250 × 0.050.
  3. F = 12.5 in./min.
Answer: F12.5 must be programmed in the G84 block. Any other value will mismatch the thread pitch and risk a broken tap.
3. A hole must be drilled 1.500 in. deep with G83. The peck increment is 0.100 in. and the R-plane is at Z0.100. How many pecks will the cycle make, and what is the Z value of the deepest peck?
  1. Total depth below part surface = 1.500 in. (Z−1.500 with part top at Z0).
  2. Number of full pecks = floor(1.500 ÷ 0.100) = 15 full pecks of 0.100 in. each = 1.500 in. total, so exactly 15 pecks with no partial peck needed.
  3. Z depth after peck 15: starting from Z0, each peck adds 0.100 in.: after peck 15, Z = −1.500 in.
Answer: The cycle executes 15 pecks; the final peck reaches Z−1.500. After each peck the tool retracts to Z+0.100 (the R-plane) before the next peck.
4. A programmer forgot to cancel the G83 cycle with G80 and wrote a G00 rapid move to a tool-change position (X12.0 Y0). What will the control do?
  1. G83 is modal; without G80, the control treats the next XY block as another hole location.
  2. At X12.0 Y0 the control will rapid to that XY position, then execute a full peck-drill cycle (rapid to R-plane, peck to Z-depth, retract to R-plane) even though no hole is intended there.
  3. If a clamp, vise jaw, or the machine table is at that position, a collision or tool crash will result.
Answer: The machine will attempt to drill a hole at X12.0 Y0, likely causing a crash or a gouge in the fixture. Always program G80 immediately after the last hole in any canned cycle group.

The math in this lesson2

Learners compute tapping feed as RPM ÷ threads per inch and count peck cycles.
6.RP.3G-SRT.8
Brush up in the math halls at newSchoolWorks.com:
In class: Instructor demonstrates G81 and G83 with live parameter changes in CNCSimulator Pro while students annotate a reference sheet showing each address word (X, Y, Z, R, F, L) and its meaning. · Students write a program that drills a 6-hole bolt-circle pattern using G81, then modify it for deep holes using G83 with a 0.100 in. peck increment; run both in simulation and compare simulated chip-break behavior. · Using a provided tapped-hole drawing, write a complete sequence: center drill (G81), drill to tap drill size (G83), tap (G84) for a specified thread; submit the program printout with hand-written parameter justifications.
Materials: CNCSimulator Pro; bolt-circle coordinate worksheet; tapped-hole drawing; Haas canned-cycle reference pages; tap-drill size chart; Smid Chapter 9
Check: Simulation must complete without collision alarm; all six hole positions within 0.002 in. of calculated bolt-circle coordinates; tapping program reviewed by instructor confirming correct pitch feed-rate calculation (≥80% of parameters correct).

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

CNC Programming — Canned Cycles
1. What is the purpose of the R address in a canned cycle block?
CNC Programming — Canned Cycles
2. Which canned cycle fully retracts to the R-plane between each depth increment to evacuate chips from deep holes?
CNC Programming — Tapping & Feed Rate Calculation
3. A 10-32 UNF tap (32 TPI) is run at 400 RPM. What feed rate should be programmed in the G84 block?
CNC Programming — Canned Cycles
4. After completing a six-hole G81 drilling cycle, the programmer moves to a rapid tool-change position without programming G80. What is the most likely consequence?
CNC Programming — Canned Cycles
5. In a G83 peck-drill cycle, the Q address must always be programmed as:
CNC Programming — Boring Operations
6. Which cycle is best for a finish-bored hole where a witness mark on the bore wall must be prevented during retract?
CNC Programming — Coordinate Calculation
7. Six holes are equally spaced on a 3.000 in. radius bolt circle centered at X0, Y0. What is the Y coordinate of the hole at 90°?
Shop Safety — Lockout/Tagout
8. Before reaching into the CNC mill to adjust a clamp position between operations, the correct safety procedure is to:
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.