GreatLight CNC Machining Factory logo
CNC Machining
Rapid Prototyping
Materials
Industries
News
About GL

Get Instant Quote

CNC programming basics

What Is a Canned Cycle in CNC Machine Control?

A canned cycle in a CNC machine is a stored block of motion the control already knows: you give hole position, depth, and retract plane, and it runs the full sequence. This page explains the mechanism, the G-code families behind it, and the part features where it saves time or costs you accuracy.

G81-G89 familyModal G-codeSpot to reamR and Q planes
what is canned cycle in cnc machine
Mechanism

How a canned cycle in a CNC machine actually runs

A canned cycle is a fixed motion sequence burned into the control. Instead of writing out every rapid, feed, retract, and return move for each hole, the programmer writes one G-code line that starts the cycle and then lists positions. The control expands each position into the full motion internally.

The word canned is old shop slang for pre-packaged. On a Fanuc-style control the cycle lives in firmware, so the same G81 behaves the same way on a lathe control, a mill, and a machining center of the same family. That predictability is the point.

Four values drive every drilling-family cycle. X and Y are hole center coordinates. Z is the final depth, measured to the tip of the tool, not the shoulder. R is the retract plane where the tool switches from rapid to feed. Q, where the cycle needs it, is the peck depth or shift distance.

One detail trips up new programmers. Z depth is not the depth of the hole. It is the final Z position of the tool tip. If you want a Ø 8 mm drill to break through a 10 mm plate, Z must be programmed past the bottom face by roughly a third of the drill point length, or the hole will not be round at the exit.

  • 1
    Modal behaviorThe cycle stays active until G80 cancels it or another cycle replaces it.
  • 2
    Initial planeThe Z value before G81 is the clearance plane the tool returns to.
  • 3
    R planeSet it 1–3 mm above the stock so chips clear before the feed starts.
  • 4
    Single-shot modeG98 returns to the initial plane between holes; G99 returns to R.
Cycle families

Which G-code belongs to which operation

G81 is the plain drill cycle. The tool feeds to Z, then rapids out. It suits shallow holes up to about three times the drill diameter, where chip evacuation is not a problem and the drill does not wander.

G83 is the deep-hole peck cycle. The tool feeds by Q, retracts fully to R, then feeds again from the previous depth. Full retract clears chips out of the flutes, which matters once depth passes three to four times diameter in aluminium and sooner in stainless.

G73 is a high-speed peck that retracts only a small amount instead of going all the way to R. It is faster on ductile materials where chips break cleanly, and a poor choice in gummy materials where chips weld to the flutes.

G82 adds a dwell at the bottom. A 0.2–0.5 s dwell at Z flattens the bottom of a blind hole and improves depth repeatability for counterbores and spotfaces. G85 and G86 cover boring, and G84 turns the same Z motion into a synchronized tap: spindle speed and feed are locked by the thread pitch.

On lathes the same idea appears as G71, G72, G70 for roughing and finishing profiles, G74 and G75 for peck drilling and grooving, and G76 for threading. The structure is identical. One block describes a whole sequence of passes that the control computes from the part profile.

Boundaries

Where canned cycles stop being the right answer

A canned cycle assumes one tool, one spindle axis, and a hole normal to the tool axis. As soon as the surface is angled, curved, or interrupted, the assumption breaks. A hole drilled on a sloped face needs a spot or flat first, or the drill walks and the entry is oval.

On a 5-axis machine, cycles still work on faces that have been indexed normal to the tool. Polar or face-milling cycles on a turned part can drive a live tool through a cross hole accurately, but they cannot compensate for a surface that changes angle during the cut. That is CAM and full interpolation territory.

High-pressure through-spindle coolant changes the economics of pecking. With 70 bar coolant and a proper through-coolant drill, a 5:1 hole may run in one G81 pass with no pecking at all, and cycle time drops sharply. Pulling coolant pressure and peck depth from a generic template is how shops leave money on the table.

The other boundary is machine-specific cycles. Pocket and face cycles from a control builder, such as a rectangular or circular pocket routine, are not portable. A program written with them will not run on a different control family without rewriting, which matters when a job moves between machines or suppliers.

There is a precision limit too. Canned cycles position at the programmed coordinate, and the control handles the motion. Final bore size, roundness, and surface finish still come from tool runout, spindle condition, and the finishing pass, not from the cycle choice.

Shop practice

What we check before a cycle goes into production

Depth-to-diameter ratio sets the peck strategy, not the drawing. A Ø 6 mm hole 40 mm deep in 17-4PH stainless behaves nothing like the same ratio in 6061 aluminium. We set Q from chip form, listen to the cut, and adjust.

R plane height is a real cost. Lifting R from 1 mm to 8 mm on a 400-hole pattern adds minutes of air time. We keep R tight, 1–3 mm above the highest point of the stock, and check that the fixture and clamps clear the rapid plane.

Retract mode saves time on large plates. G99 keeps the tool at R between holes, which is what you want when the surface is flat and clear. G98 is safer when clamps, bosses, or step-ups sit between hole positions.

Tool runout decides whether the cycle produces a round hole or an oversized one. A drill with 0.05 mm runout cuts 0.1 mm oversize on a two-flute tool. On bearing seats and dowel holes we pre-drill, then bore or ream, rather than trusting a drill cycle to hold size.

We verify every cycle program on a first article against the drawing, then hold 100% inspection before shipment across the run. Tolerances down to ±0.005 mm (±0.0002 in) and finishes from Ra 0.2–0.8 μm are held with the right tool and pass, not with the cycle alone.

  • 1
    Material mattersAluminium breaks chips at high speed; stainless needs shorter pecks.
  • 2
    Fixture clearanceCheck clamps against the G98 initial plane, not just the part.
  • 3
    Coolant routeThrough-spindle coolant can remove the peck where the drill allows.
Workflow

Writing and proving a drill cycle in five steps

The sequence we follow for a new pattern on a 3-axis or 4-axis machine.

  • 1
    Define the geometryList hole coordinates, diameter, and true depth from the model. Add the drill point allowance, roughly one third of the point length, to the Z value.
  • 2
    Pick the cycleUnder 3:1 depth-to-diameter, use G81. From 3:1 to 6:1, use G83 with Q at one to two times diameter. Add G82 dwell only for flat-bottom features.
  • 3
    Set R and retract modeR at 1–3 mm above the stock. G99 for flat, clear surfaces; G98 where clamps or bosses sit between holes.
  • 4
    Run a dry passSimulate or run with the spindle off and the tool offset lifted, then single-block the first two holes at reduced feed override.
  • 5
    Cut the first articleCheck diameter, depth, and position with a pin gauge and height gauge. Adjust Q and feed before releasing the rest of the pattern.
Selection

Cycle selection by feature, not by habit

Pick the cycle that matches depth-to-diameter ratio and bottom requirement.

CycleBest forDepth / diameterWatch out for
G81 drillThrough holes, shallow patternsUp to 3:1Chip packing on deep holes
G82 drill, dwellCounterbores, spotfacesUp to 3:1Dwell too long burns the corner
G73 chip-breakDuctile steel, cast iron3:1 to 6:1Poor chip breaking in aluminium
G83 deep peckDeep holes, hard materialsOver 4:1Slow; many retracts add cycle time
G84 tapSynchronized threadsThread depthFeed must equal pitch × rpm
G85 / G86 boreBearing seats, alignment boresAnyNeeds a pre-drilled or cored hole
Judgement

Canned cycle or CAM toolpath: quick decision table

SituationUse canned cycleUse CAM toolpath
Flat face, normal holesYesNo
Thread milling a large boreNoYes
Sloped or curved surface entryNoYes
400-hole pattern on one faceYesRarely justified
Pocket with islandsNoYes
Program moving between control brandsOnly ISO cyclesDepends on post

The short version

If your holes are normal to a flat face and repeat across a pattern, a canned cycle is the fastest reliable option. If the surface is curved, the feature needs interpolation, or the program must run on any control, use CAM instead.

FAQs

Questions engineers ask about canned cycles

Does a canned cycle affect hole tolerance?

The cycle controls motion, not the finished size. Diameter and roundness come from tool runout, rigidity, coolant, and the finishing operation. A drill cycle after a spot drill will land within a few hundredths of a millimeter on location, but a bearing seat still needs boring or reaming to hold a tight tolerance.

For a Ø 20 mm bore held to ±0.005 mm with Ra 0.8–1.6 μm, we pre-drill, then semi-finish and finish bore. The cycle only handles the pre-drill.

Why does my G83 take so long on a deep hole?

Every peck retracts to R, and the air time adds up. A 60 mm deep hole at Q2 needs around 30 retracts. Reducing Q to the smallest value that still breaks chips, or switching to a through-coolant drill that removes pecking entirely, usually cuts cycle time by half.

If chips clear well, a high-speed peck such as G73 retracts only a small amount and runs faster. Test it on one hole before changing the whole program.

Can I use a canned cycle on a 5-axis machine?

Yes, once the face is indexed normal to the tool axis. The cycle then behaves exactly as it does on a 3-axis machine. This is common on aerospace and automotive parts where a hole pattern sits on several faces and the table rotates between them.

What a cycle cannot do is follow a surface whose angle changes during the cut. That requires full interpolation from CAM.

What is the difference between G98 and G99?

G98 returns the tool to the initial Z plane between holes. G99 returns it only to the R plane, which is closer to the part and therefore faster. Use G99 on flat, unobstructed faces and G98 whenever a clamp, boss, or step-up could collide with a rapid move at R height.

Are control-specific pocket cycles safe to use?

On one machine, yes. Across machines, no. Pocket and face routines from a control builder are not part of the ISO standard, so a program written with them needs rewriting for a different control family. When a job may move between suppliers or machines, keep to standard cycles and let CAM handle the pockets.

Send us the drawing, get a manufacturable answer

Upload your part and we return a quotation with free DFM analysis within 12 hours. No minimum order quantity, from one prototype to 10,000+ parts, with 100% inspection before shipment.

12-hour quoteNo minimum order100% inspectionNDA on request

Follow

More CNC machining notes from our shop

We publish setup notes, tooling trials and inspection data from the factory floor.

FacebookTikTokYouTubeLinkedInInstagramThreadsPinterest

Trusted by engineers and manufacturers worldwide

Tesla Ford Motor Company BYD Auto Denso Magna International Boeing Airbus Medtronic KUKA FANUC