Numeryx Home > User/Programmer

Drilling Canned Cycles

An-101, Copyright © by Gil Hagiz
Last updated Apr-15-2005
For version 5.11
(For version 6.00 and later)


This application note describes the available drilling cycles.
While programming of these cycles is based upon the standard, they offer a few enhancements and they work the same with 5-axis TCP (Tool Center Point) programming.
Since these cycles are external to Ncplus they may be updated as the need arises.

Canned Cycles

Currently the following cycles are implemented:

g80 - Canned cycles cancel
g73 - Peck drilling with periodic chip breaking
g74 - Right hand rigid tapping
g81 - Drilling
g82 - Drilling with dwell (counter boring)
g83 - Peck drilling with periodic withdrawal
g84 - Right hand flexible tapping
g85 - Boring
g86 - Boring with spindle stop

The drilling data is given as follows:

R - Reference plane - Z at beginning of drill
Z - Z at bottom
Q - Step for peck drilling
D - Dwell at bottom

R1- An internal value for the R-plane.

R1 = R + Clearance

The Clearance is 1 mm (0.04") and can be set in cnx-116.
With this automatic clearance the value entered for R is the actual Z where the drilling begins.
The drilling is always in the Z axis and the positioning in the X,Y axes.
Plane select mode (g17 - g19) is ignored for drilling.
A cycle is called from a user program by a positioning block in Cartesian or Polar.
The standard format is [square brackets denote optional]:

n1 g x.. y.. z.. f... g81 r...z...[q...] [d...] [g90|g91] [g98|g99]

- or in 2 lines:

n1 g x.. y.. z.. f..
n2 g81 r... z... ... ... ... 

Subsequent lines require only a new position.

n3 x... y... [z...]

For the explanation below, g80 is the non-active mode while g81 stands for any active mode.
Whenever Z is read from a positioning block current Z is saved into variable Zi and used as the initial Z.
When R,Z,Q,D are entered after g81 in the same block they are redirected to internal variables and the corresponding NC addresses do not change. D is set to zero when a fresh cycle begins.
A fresh g81 begins with with g90 active. Also as long as g81 is active, g90/g91 do not affect the regular Absolute/Incremental for X and Y (until g80).
G98/G99 can be programmed any time, but g80 cancels g99, so the next g81 begins with g98 active.

To modify the drilling variables in the middle, e.g., the drilling depth, g81 must be written again, but this doesn't reset the defaults, as is the case with a fresh g81.

With g98 (default), the tool retracts to the initial Z in Zi..
With g99, the tool retracts to the R1 plane.

With g90 (default), R (R-plane) and Z at the bottom of the hole are given as absolute positions.
With g91, R is the relative distance from the initial Z to the reference plane and Z is the depth of the drilling from R-plane.
In this case both R and Z are expected to be negative for normal drilling.

For all cycles, the sequence is as follows:

Note: the drilling variables are saved in the unit they were given (inch-mm) therefore after they are defined scale is allowed but not inch/metric switching.


Rigid Tapping.


A rigid tapping is possible with a mill that has a closed loop servo spindle. Such a spindle has an encoder and its position is known to the NC at all times. To make the spindle turn it is constantly advanced by a programmed displacement at the axes update time (1-2 msec), therefore its speed accuracy is as accurate as the linear axes.

Rigid tapping cycle moves the Z synchronized with the spindle. The tap can be safely repeated (at the same setup).
In contrast, in flexible tapping the NC assumes that the spindle speed is as programmed, but since speed deviations of 5% are acceptable, the Z is not synchronized with the spindle and a flexible tool holder is required to compensate for the differences. Repeating the same tap will most likely destroy the thread.
The problem with traditional tension-compression holders is that they can cause large variations in tapping depth, which is very critical with blind holes.

Tapping cycle

G84 is used for flexible tapping and either g84 or g74 for rigid tapping.
For R-tap, no M3 is required. The spindle is at rest until the cycle begins. The R-plane should be high enough for the spindle to accelerate.
To estimate acceleration distance, let's assume a typical spindle with acceleration of 2000 rpm/sec; at 2000 rpm the accel time is 1 sec or 16 revolutions. Multiply 16 by the pitch to get the accel distance.
Note that acceleration distance is proportional to the square of the Rpm, therefore at 1000 rpm it is 4 revolutions and at 500 it is just one revolution.

In short: at 500 Rpm you need about one pitch for acceleration.

The spindle reverses at the exact programmed bottom of the hole, then the tool goes up to The R-plane or the initial Z where the spindle stops.

The display shows the spindle RPM under S and the Z-feed under F. The ratio between the two is the pitch.
Feed override can be used as it affects both S and Z. Spindle override is ignored since the spindle is controlled by feed rather than speed.

Tapping info

Examples of pitch programming:
Inch system

Pitch = 0.125"		f125
Thread per inch = 13	f=1000/13
Pitch = 1.25 mm		f=1250/25.4

Metric system

Pitch = 0.125"		f=125*25.4
Thread per inch = 13	f=25400/13
Pitch = 1.25 mm		f1250
G84 can be set to accept TPI for F in Inch and pitch in metric.
Pitch can be set as either units (inch or mm) or thousandths.

Hole Pattern


This function is used inside a For loop to drill holes in a fixed distance along a line or a circle.
It returns the proportional value within the range xo to xn, for every repetition of the loop.
For example, if the loop runs from 0 to 4, and the range is 50 to 150, the function returns:
50, 75, 100, 125, 150.

For holes on a slope, given as a range x0 to x7, y0 to y7 (8 holes in this example):

for #1=0 to 7
g x=gil(x0,x7) y=gil(y0,y7) z.5 g81 r z-.3 f8
next #1 g80

Use polar coordinates if the slope is given in degrees (30 deg in this example):

for #1=0 to 7 
g10 i j p30 r=gil(r0,r7) z.5 g81 r z-.3 f8
next #1 g80

For a bolt circle use a loop (13 holes in this example):

for #1=1 to 13
g10 i j r4 p=gil(0,360) z.5 g81 r z-.3 f8
next #1 g80

If the hole pattern is rotated by 2.5 deg use:


Note that we start from hole 1 and not 0 because there are 13 holes and hole 0 is the same as hole 13.