Canned Cycles in CNC: What They Are and How They Repeat

Canned Cycles in CNC: What They Are and How They Repeat
— · 0 votes

Canned cycles are built-in G-code routines that perform a repeating machining operation, such as drilling a hole, from one short block of programming. You set the hole position, depth, feed rate and retract plane once, and the control runs the full sequence of moves at each commanded location. The cycle stays active until a G80 cancel or another cycle replaces it.

  • A canned cycle packs a full sequence of machine moves into one G-code block.
  • The cycle stays active as a modal state, so later X and Y moves repeat it at new holes.
  • The L parameter repeats a cycle a set number of times along the active axis.
  • G80 cancels the cycle and returns the machine to normal motion.
  • Cycle choice depends on hole depth, chip control and the material being cut.

What a canned cycle does

A canned cycle is a fixed sequence of machine motions stored in the control under one G-code. Drilling a hole by hand takes several blocks: rapid to position, feed down, retract, and move on. The cycle compresses that sequence into a single command line.

The programmer supplies the values the control cannot know, such as hole depth, feed rate and the retract plane. The control fills in the motion between those points. This saves programming time and makes the code easier for another machinist to read.

Canned cycles are part of standard CNC programming on mills and machining centers. Related terms you will meet are fixed cycles, which some controls call them, and modal G-codes, meaning a code that stays active until changed or canceled.

The main drilling cycles compared

G81 is the basic drilling cycle, feeding to depth and retracting in one pass. A machinist reaches for G81 when the hole is shallow enough that chips clear without help. It is the shortest cycle to write and the quickest to run.

G83 is peck drilling, which feeds a set distance, retracts to clear chips, then feeds again until it reaches depth. G73 is chip breaking, which retracts only a small amount to break the chip without leaving the hole. Both suit deep holes where a single plunge would clog the flutes.

The choice among these cycles depends on hole depth, material and chip behavior rather than on preference. A deep hole in a gummy material behaves differently from a shallow hole in free-machining stock. Test the cycle on a scrap part when the job is new.

CycleMotionWhere it fits
G81Feed to depth, rapid retractShallow holes with easy chip clearing
G83Peck feed with full retract between pecksDeep holes that need chip evacuation
G73Peck feed with short retractChip breaking in deep holes

How the cycle repeats at new holes

A canned cycle in CNC programming is modal by design, so it repeats without being rewritten. After the first cycle block, each new X and Y coordinate runs the same drilling sequence at the new location. The control keeps the depth, feed and retract values from the original block.

This repetition is why operators say canned cycles are repeated. A row of holes on even spacing may need one cycle block and a series of position moves. Changing a depth or feed means editing the cycle block, not every hole.

Watch the order of moves after the cycle is active. A Z move in a positioning block can be read as a new cycle depth on some controls. Keep the retract plane clear of clamps and fixtures before you let the cycle run.

Repeating a cycle with the L parameter

Canned cycle repetition with the L parameter runs the cycle a set number of times along the active axis. The L word counts repeats, and the control moves the tool by the programmed increment between each one. On many controls L sits in the cycle block with the first position.

A cycle block with L and an incremental position produces a line of evenly spaced holes from one programming line. This suits patterns such as bolt circles laid out in a straight run or a grid of mounting holes. The spacing comes from the incremental value, not from separate coordinates.

The L parameter depends on the control and on whether the machine is in incremental or absolute mode. Check the programming manual for the control in front of you before you rely on it. A wrong increment moves every hole in the pattern.

Where the cycle starts and returns

Each canned cycle has a reference plane, sometimes called the R plane, where the feed motion begins. The tool rapids down to the R plane, then feeds from there to depth. Set the R plane above the part surface but below any obstacle in the approach path.

The retract behavior differs between cycles. G81 and G83 return the tool to the initial plane or to the R plane, depending on how the control is set. G73 retracts a short distance to break the chip. Read the cycle definition for your control rather than assuming.

The initial plane matters on a part with clamps, vises or fixtures standing above the work. A rapid move from the initial plane to the R plane can strike an obstacle. Program the clearance height above the tallest feature in the path.

Canceling a cycle with G80

G80 cancels the active canned cycle and returns the control to normal positioning motion. Without a cancel, a later X or Y move would drill another hole where you wanted a rapid move. The cancel is short and costs nothing to write.

Place G80 after the last hole and before any move that should not drill. A tool change or a return to the tool change position is a natural place for the cancel. Leaving a cycle active into a new operation invites an unplanned hole.

G80 is also a safe habit at the end of a program block that switches to a different operation type. Clear the cycle, then call the next tool or motion mode. The control then starts the new work from a known state.

Mistakes that spoil hole patterns

A missing G80 is the mistake that shows up first, because the next positioning move drills where it should not. The fix is to cancel the cycle as soon as the last hole is done. Read the program through once with that check in mind.

A wrong R plane or clearance height is the second trap on parts with fixtures above the work. An incorrect incremental value in an L repeat shifts the whole pattern. Neither error announces itself until the tool is in the cut.

Verify the program with a dry run above the part before cutting metal. Step through the first cycle block and the first repeat at reduced feed to confirm the depth and spacing. Where the operation is unusual or the part is costly, have a trained programmer check the code.

Questions about CNC canned cycles

What are canned cycles in CNC?

Canned cycles are built-in G-code routines that run a complete machining sequence from one block. The programmer sets depth, feed and retract values, and the control supplies the motion between them. They save programming time and make the code easier to read.

How are canned cycles in CNC repeated?

An active canned cycle repeats whenever a new X or Y position is commanded, because the cycle is modal. The L parameter can also run the cycle a set number of times along the active axis. G80 cancels the cycle when repetition should stop.

What does the L parameter do in a canned cycle?

The L parameter tells the control how many times to repeat the cycle. The control shifts the tool by the programmed increment between each repeat. Always confirm how your control reads L before relying on it for a hole pattern.

What is the difference between G81 and G83?

G81 feeds to depth and retracts in one pass, which suits shallow holes. G83 peck drills, retracting to clear chips between pecks, which suits deep holes. The choice depends on depth, material and chip behavior.

Why do I need G80 after a canned cycle?

G80 cancels the active cycle and restores normal positioning motion. Without it, a later X or Y move would drill another hole instead of moving the tool. Place G80 after the last hole and before any non-drilling move.

Can a canned cycle damage the machine or part?

A canned cycle can strike a clamp or cut an unplanned hole when the R plane, clearance height or cancel is wrong. Verify the program with a dry run above the part before cutting metal. Have a trained programmer review code for costly or unusual parts.

Read next

Latest articles