G-code
Supported G-code

G81 - G89 (Canned Cycles)

23min
the canned cycles g81 through g89 have been implemented as described in this section two examples are given with the description of g81 below all canned cycles are performed with respect to g17, g18, g19 (plane selection) docid\ uo pghd6gwtj4p9xj2nzp any of the three planes (xy, yz, and zx) may be selected throughout this section, most of the descriptions assume the xy plane has been selected the behavior is always analogous if the yz or xz plane is selected rotational axis words are allowed in canned cycles, but it is better to omit them if rotational axis words are used, the numbers must be the same as the current position numbers so that the rotational axes do not move all canned cycles use x, y, r, and z numbers in the nc code these numbers are used to determine x, y, r, and z positions the r (usually meaning retract) position is along the axis perpendicular to the currently selected plane (z axis for xy plane, x axis for yz plane, y axis for xz plane) some canned cycles use additional arguments for canned cycles, we will call a number "sticky" if, when the same cycle is used on several lines of code in a row, the number must be used the first time, but is optional on the rest of the lines sticky numbers keep their value on the rest of the lines if they are not explicitly programmed to be different the r number is always sticky in incremental distance mode when the xy plane is selected, x, y, and r numbers are treated as increments to the current position and z as an increment from the z axis position before the move involving z takes place; when the yz or xz plane is selected, treatment of the axis words is analogous in absolute distance mode, the x, y, r, and z numbers are absolute positions in the current coordinate system the l number is optional and represents the number of repeats l=0 is not allowed if the repeat feature is used, it is normally used in incremental distance mode, so that the same sequence of motions is repeated in several equally spaced places along a straight line in absolute distance mode, l > 1 means "do the same cycle in the same place several times," omitting the l word is equivalent to specifying l=1 the l number is not sticky when l>1 in incremental mode with the xy plane selected, the x and y positions are determined by adding the given x and y numbers either to the current x and y positions (on the first go around) or to the x and y positions at the end of the previous go around (on the repetitions) the r and z positions do not change during the repeats the height of the retract move at the end of each repeat (called "clear z" in the descriptions below) is determined by the setting of the retract mode either to the original z position (if that is above the r position and the retract mode is g98, old z), or otherwise to the r position it is an error if x, y, and z words are all missing during a canned cycle, a p number is required and a negative p number is used, an l number is used that does not evaluate to a positive integer, rotational axis motion is used during a canned cycle, inverse time feed rate is active during a canned cycle, cutter radius compensation is active during a canned cycle when the xy plane is active, the z number is sticky, and it is an error if the z number is missing and the same canned cycle was not already active, the r number is less than the z number when the xz plane is active, the y number is sticky, and it is an error if the y number is missing and the same canned cycle was not already active, the r number is less than the y number when the yz plane is active, the x number is sticky, and it is an error if the x number is missing and the same canned cycle was not already active, the r number is less than the x number preliminary and in between motion at the very beginning of the execution of any of the canned cycles, with the xy plane selected, if the current z position is below the r position, the z axis is traversed 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 repeat, the following one or two moves are made a straight traverse parallel to the xy plane to the given xy position, a straight traverse of the z axis only to the r position, if it is not already at the r position if the xz or yz plane is active, the preliminary and in between motions are analogous g81 cycle the g81 cycle is intended for drilling program g81 x y z a b c r l preliminary motion, as described above move the z axis only at the current feed rate to the z position retract the z axis at traverse rate to clear z example suppose the current position is (1, 2, and 3) and the xy plane has been selected, and the following line of nc code is interpreted g90 g81 g98 x4 y5 z1 5 r2 8 this calls for absolute distance mode (g90) and old z retract mode (g98) and calls for the g81 drilling cycle to be performed once the x number and x position are 4 the y number and y position are 5 the z number and z position are 1 5 the r number and clear z are 2 8 old z is 3 the following moves take place a traverse parallel to the xy plane to (4,5,3) a traverse parallel to the z axis to (4,5,2 8) a feed parallel to the z axis to (4,5,1 5) a traverse parallel to the z axis to (4,5,3) example suppose the current position is (1, 2, and 3) and the xy plane has been selected, and the following line of nc code is interpreted g91 g81 g98 x4 y5 z 0 6 r1 8 l3 this calls for incremental distance mode (g91) and old z retract mode (g98) and calls for the g81 drilling cycle to be repeated three times the x number is 4, the y number is 5, the z number is 0 6 and the r number is 1 8 the initial x position is 5 (=1+4), the initial y position is 7 (=2+5), the clear z position is 4 8 (=1 8+3), and the z position is 4 2 (=4 8 0 6) old z is 3 the first move is a traverse along the z axis to (1,2,4 8), since old z < clear z the first repeat consists of 3 moves a traverse parallel to the xy plane to (5,7,4 8) a feed parallel to the z axis to (5,7, 4 2) a traverse parallel to the z axis to (5,7,4 8) the second repeat consists of 3 moves the x position is reset to 9 (=5+4) and the y position to 12 (=7+5) a traverse parallel to the xy plane to (9,12,4 8) a feed parallel to the z axis to (9,12, 4 2) a traverse parallel to the z axis to (9,12,4 8) the third repeat consists of 3 moves the x position is reset to 13 (=9+4) and the y position to 17 (=12+5) a traverse parallel to the xy plane to (13,17,4 8) a feed parallel to the z axis to (13,17, 4 2) a traverse parallel to the z axis to (13,17,4 8) g82 cycle the g82 cycle is intended for drilling program g82 x y z a r l p preliminary motion, as described above move the z axis only at the current feed rate to the z position dwell for the p number of seconds retract the z axis at traverse rate to clear z g83 cycle the g83 cycle (often called peck drilling) is intended for deep drilling or milling with chip breaking the retracts in this cycle clear the hole of chips and cut off any long stringers (which are common when drilling in aluminum) this cycle takes a q number which represents a "delta" increment along the z axis program g83 x y z a r l q preliminary motion, as described above move the z axis only at the current feed rate downward by delta or to the z position, whichever is less deep rapid back out to the clear z rapid back down to the current hole bottom, backed off a bit repeat steps 1, 2, and 3 until the z position is reached at step 1 retract the z axis at traverse rate to clear z it is an error if • the q number is negative or zero g73 cycle the g73 cycle (often called peck drilling) is intended for deep drilling or milling with chip breaking the retracts in this cycle clear the hole of chips and cut off any long stringers (which are common when drilling in aluminum) this cycle takes a q number which represents a "delta" increment along the z axis program g73 x y z a r l q preliminary motion, as described above move the z axis only at the current feed rate downward by delta or to the z position, whichever is less deep rapid back out but only with increment q, this is the difference with g83 above rapid back down to the current hole bottom, backed off a bit repeat steps 1, 2, and 3 until the z position is reached at step 1 retract the z axis at traverse rate to clear z it is an error if • the q number is negative or zero g84 cycle the g84 cycle is intended for right hand tapping program g84 x y z a b c r l preliminary motion, as described above move the z axis only at the current feed rate/per revolution to the z position so assume the spindle is running m3 s600 then an f value of f1 will give a feed of 600 /minute the feed starts synchronized with the spindle pulse allowing it to tap the same hole again when the z position is reached, reverse spindle m4 (waits until spindle ramp up and a new measurement of spindle speed) retract the z axis at the current feed rate to clear z g74 cycle the g74 cycle is intended for left hand tapping program g74 x y z a b c r l preliminary motion, as described above move the z axis only at the current feed rate/per revolution to the z position so assume the spindle is running m3 s600 then an f value of f1 will give a feed of 600 /minute the feed starts synchronized with the spindle pulse allowing it to tap the same hole again when the z position is reached, reverse spindle m4 (waits until spindle ramp up and a new measurement of spindle speed) retract the z axis at the current feed rate to clear z g85 cycle the g85 cycle is intended for boring or reaming but could be used for drilling or milling program g85 x y z a b c r l preliminary motion, as described above move the z axis only at the current feed rate to the z position retract the z axis at the current feed rate to clear z g86 cycle the g86 cycle is intended for boring this cycle uses a p number for the number of seconds to dwell program g86 x y z a b c r l p preliminary motion, as described above move the z axis only at the current feed rate to the z position dwell for the p number of seconds stop the spindle turning retract the z axis at traverse rate to clear z restart the spindle in the direction it was going the spindle must be turning before this cycle is used it is an error if the spindle is not turning before this cycle is executed g87 cycle the g87 cycle is intended for back boring program g87 x y z a r l i j k the situation, as shown in the figure below, is that you have a through hole and you want to counterbore the bottom of the hole to do this you put an l shaped tool in the spindle with a cutting surface on the upper side of its base you stick it carefully through the hole when it is not spinning and is oriented so it fits through the hole, then you move it so the stem of the l is on the axis of the hole, start the spindle, and feed the tool upward to make the counterbore then you stop the tool, get it out of the hole, and restart it this cycle uses i and j numbers to indicate the position for inserting and removing the tool i and j will always be incremented from the x position and the y position, regardless of the distance mode setting this cycle also uses a k number to specify the position along the z axis of the controlled point top of the counterbore the k number is a z value in the current coordinate system in absolute distance mode and an increment (from the z position) in incremental distance mode preliminary motion, as described above move at traverse rate parallel to the xy plane to the point indicated by i and j stop the spindle in a specific orientation move the z axis only at traverse rate downward to the z position move at traverse rate parallel to the xy plane to the x, y location start the spindle in the direction it was going before move the z axis only at the given feed rate upward to the position indicated by k move the z axis only at the given feed rate back down to the z position stop the spindle in the same orientation as before move at traverse rate parallel to the xy plane to the point indicated by i and j move the z axis only at traverse rate to the clear z move at traverse rate parallel to the xy plane to the specified x, y location restart the spindle in the direction it was going before when programming this cycle, the i and j numbers must be chosen so that when the tool is stopped in an oriented position, it will fit through the hole because different cutters are made differently, it may take some analysis and/or experimentation to determine appropriate values for i and j g88 cycle the g88 cycle is intended for boring this cycle uses a p word, where p specifies the number of seconds to dwell program g88 x y z a r l p preliminary motion, as described above move the z axis only at the current feed rate to the z position dwell for the p number of seconds stop the spindle turning stop the program so the operator can retract the spindle manually restart the spindle in the direction it was going g89 cycle the g89 cycle is intended for boring this cycle uses a p number, where p specifies the number of seconds to dwell program g89 x y z a r l p preliminary motion, as described above move the z axis only at the current feed rate to the z position dwell for the p number of seconds retract the z axis at the current feed rate to clear z