CNCCookbook: Be a Better CNC'er


Canned Drilling Cycles

CNCCookbook's G-Code Tutorial


What are Canned Drilling Cycles?

Until this point, all our motion has been done with G00/G01 for lines and G02/03 for arcs. In this chapter, we introduce the notion of "Canned Cycles", which allow more complex types of motion aimed at simplifying the programming of certain common operations such as drilling holes. Canned cycles are often modal just like the other motions. For example, once we select the high speed peck drilling cycle with G73, subsequent coordinates on later lines specify new hole locations where more peck drilling will be done.


What is "Peck Drilling"?

A term you'll hear a lot is "peck drilling". This is the practice of drilling a little ways (the peck distance), back off some distance, and then going back down to the bottom to take another peck. Think of the motion as being not unlike a woodpecker. The reason it's done is to evacuate the chips from the bore. Recutting chips is always a bad thing for tool life. There's only enough room down in the bore for the chips that fit in the flutes of the twist drill, and the deeper the hole, the harder it is to evacuate those chips out of the hole. Peck drilling helps in two ways. First, even a very short peck where the retraction is minimal helps to break off the chip resulting in shorter chips. Shorter chips are much easier to evacuate.





Different Types of Canned Drilling Cycles and Their Uses

Since there are quite a few different types of canned drilling cycles, it's easiest to classify them in tabular form:

G Code Purpose Peck Retract Bottom of Hole
High-speed Peck Drilling for Shallow Holes
Left-hand Tapping Cycle
Dwell -> Spindle CW
Fine Boring Cycle
Oriented Stop

Drilling Cycle without Peck,
Hole Depths <= 3 Diameters

Spot Drilling Cycle
Peck Drilling for Deeper Holes
Tapping Cycle
Dwell -> Spindle CCW
Boring Cycle
Boring Cycle
Spindle Stop
Back Boring Cycle
Spindle CW
Boring Cycle
Dwell -> Spindle Stop
Boring Cycle



Anatomy of a Basic Cycle: G81

There are a lot of parameters and options associated with the drilling cycles, so let's start with a relatively simple one: G81. G81 does no pecking and has no special operation at the bottom of the hole. It just goes down at the feedrate, and then retracts.

Let's use this example G81 block:

     Z1.0 (Initial Z)

     X10Y12 (XY for first hole)

     G99 G81 R0.2 Z-0.7

     X10Y14 (XY for second hole)

     X10Y16 (XY for third hole)

     G80 (Cancel canned cycle)

Here is a schematic of how it works:

G81 Drilling Canned Cycle

Following along with the schematic:


- Second, the tool rapids straight down to the R position, established by the "R" word of the cycle. We came in at a Z of 1.0". R is 0.2", so we rapid from 1.0" down to 0.2".

- Next we feed down an amount equal to Z. In other words, Z specifies the depth, not a particular coordinate. That depth is measured from R. So, with an R of 0.2", and a depth (Z) of 0.7", we are going down to Z = -0.5". Remember to do that math carefully, as R will always be a little above material top and you have to add it to the actual hole depth to get your Z.



Modifying Retract With G98 and G99



Multiple Holes Until G80 Cancels the Cycle




Simulating to Simplify, Understand, and Verify

By now, you're probably thinking the water is deep, it's cold, and it's moving pretty fast--canned cycles are complex!

It'll seem like it until you get used to them. The complexity is there to give you all the options you need to hand a myriad of situations. There is good news though, whether you're just trying to learn, or whether you're actively developing and testing canned cycles in your g-code. You can use a g-code simulator to help make them easier to understand and work with. If you haven't already, pop over to our G-Wizard G-Code Editor/Simulator and sign up. That will put a first class g-code simulator in your hands which will make understanding and working with canned cycles a whole lot easier.

Here is a shot of the portion of the GWE screen that shows a backplot of what the machine is doing as well as what we call a "hint" that explains the canned cycle in plain English:

G81 Canned Cycle Simulation

Red lines are rapids and green lines are at feed speed...



- It tells us G81 is a simple drilling cycle.

- We know retraction will be to Z = 0.2"

- Lastly, we know the bottom of the hole is at Z = -0.5", exactly where we wanted it.

It's really helpful to have these kinds of tools at hand when you're trying to work with canned cycles.


Relative vs Absolute and Repeats



G82 - Drilling Cycle

G82 is a drilling cycle that doesn't peck, but instead dwells at the bottom of the hole. This increases the accuracy of the hole depth.

A typical G82 looks like this:


XY: Coordinates of the hole

Z: Hole bottom


P: Dwell time at bottom of hole.

F: Cutting feedrate

L: Number of repeats



G83 - Deep Hole Peck Cycle


A typical G83 looks like this:


XY: Coordinates of the hole

Z: Hole bottom


P: Dwell time at bottom of hole.

Q: Depth to increase on each peck.

F: Cutting feedrate

L: Number of repeats



G84 - Tapping Cycle


G74 - Reverse (Left-hand) Tapping Cycle


G85 - Boring Cycle


G86 - Boring Cycle


G87 - Back Boring Cycle


G88 - Boring Cycle


G89- Boring Cycle


G76 - Precision Boring Cycle




2. Configure G-Wizard Editor properly for your controller's canned cycles.






No credit card required--just your name and email.


Next Article: Custom Deep Hole Drilling Cycles




All material © 2010-2016, CNCCookbook, Inc.