G80-G89: Canned Cycles
G-codes:
G80: Cancellation of drilling, boring, threading cycles
G81: Drilling cycle
G82: Drilling cycle with pause
G83: Deep drilling cycle
G85: Boring cycle with retract at work feed
G89: Boring cycle with pause and retract at the feed
This section describes the G81-G89 canned cycles and the G80 canned cycle cancel command.
All canned cycles are performed taking into account the currently selected plane. Any of nine planes can be selected. In the further description, it is assumed that the XY plane is selected. The behavior of the system is similar if another plane is selected, and the correct parameters must be used. For example, in the G17.1 plane, the action of canned cycles occurs along the W axis, and the positions are determined by the parameters of the U and V axes. In this case, replace X, Y, Z with U, V, W in the instructions below.
The indication of rotary axes is not permitted in canned cycles. When a plane from the X, Y, Z family is active, the use of the U, V, W axes is not allowed. Similarly, when a plane from the U, V, W family is active, the use of the X, Y, Z axes is not allowed.
The R (return) position is located along an axis perpendicular to the currently selected plane (Z axis for the XY plane, etc.).
In canned cycles, the action of some parameters, when they are indicated on one line of the cycle, is preserved for the remaining lines. This parameter is R.
In incremental positioning mode, parameters X, Y, and R are interpreted as increments relative to the current position, and parameter Z is interpreted as incrementing relative to position Z until the moment of movement along Z. In absolute positioning mode, parameters X, Y, Z, and R are absolute positions in the current coordinate system.
The L parameter is optional and represents the number of times the loop repeats.
L = 0 is not allowed.
If the loop repeat function is enabled, the incremental positioning mode is usually used so that the same sequence of movements is repeated in several places located at the same distance from each other along the straight line. The parameter L does not retain its value when moving to the next line of the G-code. In absolute positioning mode, the parameter L>1 means to repeat the same cycle in the same place several times. The absence of the parameter L is equivalent to L = 1.
The return height at the end of each cycle is determined by the return mode: either to the initial position in Z (if it is higher than position R and the return mode is G98), or to position R.
If the XY plane is selected, the Z parameter retains its value when moving to the next line.
Similarly for other selected planes.
Preliminary movement is a set of movements common to all canned cycles. If the current Z position is less than the R position, the Z axis moves quickly to the R position. This happens only once, regardless of the value of L.
In addition, at the beginning of the first cycle and each repetition, one or two movements are made:
- Rapid movement parallel to the XY plane to the specified XY position.
- The Z axis makes a quick move to position R if it is no longer in that position.
If another plane is selected, the movements occur in the same way.
There are at least two reasons for using canned cycles.
The first reason is saving code. Drilling a single hole might require several lines of code. The example below makes eight holes using five lines of code for a constant loop.
N110 G1 F10 X0 G4 P0.1
N120 G91 G81 X1 Y0 Z-1 R1 L4 (canned drilling cycle)
N130 G90 G0 X0 Y1
N140 Z0
N150 G91 G81 X1 Y0 Z-0.5 R1 L4 (canned drilling cycle)
N160 G80 (canned cycle cancel)
N170 M30 (end of program)
The following example demonstrates making 12 holes using five lines of code for a continuous loop.
N1010 G1 F50 X0 G4 P0.1
N1020 G91 G81 X1 Y0 Z-0.5 R1 L4 (canned drilling cycle)
N1030 X0 Y1 R0 L3 (repeat)
N1040 X-1 Y0 L3 (repeat)
N1050 X0 Y-1 L2 (repeat)
N1060 G80 (canned cycle cancel)
N1070 G90 G0 X0 (fast moving to the origin)
N1080 Y0
N1090 Z0
N1100 M30 (end of program)
The second reason for using canned cycles is that they all pre-move and return to height, which you can expect and control regardless of the starting position of the canned cycle.