This cnc program example explains the use of G81 Drilling cycle but this time the tool is not positioned in the usual way (G90 absolute programming mode) but this time G91 Incremental Programming Mode is used.
This programming example code also explains the use of G81 drilling cycle parameter K (number of repeats), which is not normally used.
Contents
G81 Drilling Cycle Format
G81 X_ Y_ Z_ R_ F_ K_ ;
X_ Y_: Hole position data
Z_ : Z-depth (tool will travel with feed to Z-depth starting from R plane)
R_ : The distance from the initial level to point R level
F_ : Cutting feedrate
K_ : Number of repeats (if required)
G81 drilling cycle parameter K (number of repeats). On different cnc controls this parameter has different letter assign to it such as on,
- Fanuc uses letter K for number of repeats.
- Haas CNC uses letter L for number of repeats.
- Fagor CNC Control uses letter N for number of repeats.
Incremental motion in canned cycle is often useful as a loop count, which can be used to repeat the operation with an incremental X or Y move between each cycle.
CNC Code G81 Drilling Cycle with G91 Inremental Programming
N10 T1 M6 N20 G00 G90 X0 Y0 Z0 N30 S1450 M03 N40 G81 G99 G91 X50 Y50 Z-120 R-98 K3 F350 N50 G98 G90 G00 X500 Y500 N60 G80 N70 G90 X0 Y0 N80 M30
Explanation
N40 G81 G99 G91 X50 Y50 Z-120 R-98 K3 F350
K3 means that the G81 drilling cycle will repeat three times.
G91 Incremental mode makes the tool to move every time X50 and Y50
So first hole will be at X50 Y50
Second hole will be at X100 Y100 because
X100 = X50(previous value) + X50 (increment)
Y100 = Y50(previous value) + Y50 (increment)
Third hole will be at X150 Y150 because
X150 = X100(previous value) + X50 (increment)
Y150 = Y100(previous value) + Y50 (increment)
N50 G98 G90 G00 X500 Y500
The fourth hole position is given with G90 Absolute Programming Mode.
The above code is only possible if you use G91 Incremental Programming Mode with G81 Drilling cycle, but if you try to use G90 Absolute Programming Mode with G81 as above you will see the tool will repeat drilling at the same position.