LinuxCNC G81 Drilling Cycle

G81 is a canned drilling cycle in LinuxCNC G-code. It moves to the programmed position in the selected plane, feeds the tool along the perpendicular axis to the programmed depth, then rapids to the clear Z position. The L word repeats the cycle.

Source checked20/20 values · 2026-10-26

Specification

1 source
Languagegcode
CodeG81
Groupcanned cycles
SyntaxG81 (X- Y- Z-) or (U- V- W-) R- L-
DialectLinuxCNC

Parameters

NameDescriptionData type
XX position in the selected plane.
YY position in the selected plane.
ZZ position for drilling depth in the XY plane.
UU position when a UVW-family plane is selected.
VV position when a UVW-family plane is selected.
WW position when a UVW-family plane is selected.
RRetract position along the axis perpendicular to the selected plane.
LNumber of repeats; L=0 is not allowed.positive integer

Study notes

  • G81 is intended for drilling.
  • Preliminary motion: if the current Z position is below R, Z rapids to R; then a rapid move parallel to the XY plane goes to the programmed XY position, and Z rapids to R if not already there.
  • The cycle feeds Z to the Z position, then the Z axis rapids to clear Z.
  • The R number is always sticky; in the XY plane the Z number is sticky and is an error if missing when the same canned cycle was not already active.
  • L repeats the cycle; L=0 is not allowed and L is not sticky. Omitting L is equivalent to L=1.
  • In incremental distance mode, L>1 repeats at successive XY increments; R and Z do not change during the repeats.
  • In absolute distance mode, L>1 performs the same cycle in the same place several times.
  • Clear Z follows G98/G99: G98 returns to the prior Z if it is higher than R, otherwise to R; G99 returns to R.
  • G80 cancels canned cycle modal motion; programming another modal group 1 G-code also cancels the canned cycle.

Safety

  • Canned cycles error if rotary axis motion is used, inverse time feed is active, cutter compensation is active, or XYZ and UVW axis groups are mixed.
  • If the XY plane is active, it is an error if the R number is less than the Z number.
↑↓ navigate↵ openesc close