# LinuxCNC G81 Drilling Cycle

Instructions · `G81` · verification: source checked

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.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | G81 |
| Group | canned cycles |
| Syntax | G81 (X- Y- Z-) or (U- V- W-) R- L- |
| Dialect | LinuxCNC |

### Parameters

| Name | Description | Data type |
|---|---|---|
| X | X position in the selected plane. |  |
| Y | Y position in the selected plane. |  |
| Z | Z position for drilling depth in the XY plane. |  |
| U | U position when a UVW-family plane is selected. |  |
| V | V position when a UVW-family plane is selected. |  |
| W | W position when a UVW-family plane is selected. |  |
| R | Retract position along the axis perpendicular to the selected plane. |  |
| L | Number of repeats; L=0 is not allowed. | positive integer |

## 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.

## 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.

## Sources

1. [G-Codes](https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g81) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/gcode-g81  
JSON: https://machineschema.com/instruction/gcode-g81.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
