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:
- R (Reference plane): The Z height where the spindle switches from rapid to feed. Set R high enough to clear all clamps and workpiece features — typically 0.100 in. above the part surface when no obstacles are present.
- Z (Final depth): The bottom of the hole. Always calculate from the same datum (usually the top of the part when using G54 work offset). A Z value that is not deep enough leaves a partial hole; one that is too deep can break a tap or crash a boring bar.
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:
- X = BC_center_X + Radius × cos(angle)
- Y = BC_center_Y + Radius × sin(angle)
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
- Never reach into the machine envelope while a canned cycle is running. Pecking cycles move fast between pecks; a hand near the spindle can be struck.
- Verify your simulation shows no collision alarms before running on the machine.
- Confirm the workpiece is fully clamped and the vise handle is removed before cycle start.
- Coolant nozzles must be aimed before starting; re-aiming with the spindle turning is a laceration hazard.
- When tapping, verify spindle orientation and M29 rigid tapping mode if your control requires it — consult the machine manual.
- Apply lockout/tagout (LOTO) any time you reach inside the machine to set up, adjust clamps, or clear chips. Pressing E-stop alone is not LOTO.
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.
- Divide 360° by 6 holes = 60° spacing. Angles are 0°, 60°, 120°, 180°, 240°, 300°.
- 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
- 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
- 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
- Hole 4 (180°): X = 2.500 × cos(180°) = −2.5000; Y = 0.0000
- Hole 5 (240°): X = 2.500 × cos(240°) = −1.2500; Y = 2.500 × sin(240°) = −2.1650
- 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?
- Identify pitch: ¼-20 means 20 threads per inch (TPI), so pitch = 1/20 = 0.050 in./rev.
- Apply the tapping feed rate formula: F = RPM × pitch = 250 × 0.050.
- 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?
- Total depth below part surface = 1.500 in. (Z−1.500 with part top at Z0).
- 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.
- 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?
- G83 is modal; without G80, the control treats the next XY block as another hole location.
- 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.
- 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
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.
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.