CNC Milling | Canned Cycles

Canned Cycles Introduction

Canned cycles are special codes that act like a macro. They are used for hole making and allow one compact block of code to command many moves. For example, a hole can be created using a peck drill cycle with two lines of code whereas the same move would require maybe twenty or more lines of code if each motion was commanded separately.

G81 Simple Drill Cycle

This cycle makes holes by feeding to depth at a programmed feed rate and then retracting at rapid rate. It is accompanied by G98 or G99, XYZ coordinates, feed rate, and R. R is the feed plane and Z is final depth of the tool tip.

All drill cycles are accompanied by G98 or G99 that determine how high the tool retracts between holes.

G0 Z1. G43 H1
G98 G81 X.5 Y.5 Z-1. R.1 F9.5

G82 Spot Drill Cycle

This cycle is identical to G81 except it includes a dwell value, P (in seconds). P is used to pause the tool feed rate at the final depth to create a clean countersink or counterbore finish.

G0 Z1. G43 H1
G98 G82 X.5 Y.5 Z-.0925 P.1 R0.1 F9.5

G83 Peck Drill

This breaks the chip, clears material out of the hole, and allows coolant to cool the drill and flush out the hole, reducing the chance of the tool breaking and producing a better quality hole. The simplest form of this cycle is shown in Figure 8. Another version of this cycle, called a “deep drill cycle”, uses I,J,K parameters to reduce the amount of peck as the hole gets deeper.

G0 Z1. G43 H1
G83 X.5 Y.5 Z-1.R0.1 Q.25 F9.

G84 Tap Cycle

Most modern machines support rigid tapping, which eliminates the need to use special tapping attachments. Rigid tapping precisely coordinates the spindle speed and feed to match the lead of the thread. It then stops and reverses the spindle at the bottom of the cycle to retract the tap. The parameters for the tap cycle are identical to simple drilling (G81).

G0 Z1. G43 H1
G84 X.5 Y.5 Z-1.5 R0.1 F20.


G90 Code (Absolute)

This code commands the machine to interpret coordinates as absolute position moves in the active Work Coordinate System. All programs are written in absolute coordinates.

G90 G0 X1. Y1.

G91 Code (Incremental)

This code commands the machine to interpret coordinates as incremental position moves. G91 is used by subprograms but most programming done with CAD/CAM software and does not use subprograms.

The only common use of G91 is in combination with G28 to send the machine back to its home position at the end of the program. The machine must be set back to G90 mode in the next block as a safety measure.

G91 G28 Z0.

Return Height in Cycles

G98 Code (Return to Initial Rapid Height)

This code is used in drill cycles to retract the tool to the clearance plane (set in the next previous block) between holes to avoid clamps.

G0 Z1. G43 H1
G98 G81 Z-0.325 R0.1 F12.

Figure 11: G98 (Return to Clearance Plane)

G99 Code (Return to R-Plane)

This code is used in drill cycles to retract the tool to the rapid plane (R) between holes. G99 mode is the machine default and is used when clamp clearance between holes is not an issue.

G0 Z1. G43 H1
G99 G81 Z-0.325 R0.1 F12.

Figure 12: G99 Motion (Return to R-Plane)