# LinuxCNC G71

Instructions · `G71` · verification: source checked

G71 is a LinuxCNC lathe roughing cycle that removes material in layers along Z to rough-cut a profile defined in a subroutine. The subroutine number is given by Q, and optional X and Z set the starting position, D the remaining distance, I the cutting increment, and R the retracting distance. It requires the ZX plane and is intended to leave material for a finishing cycle.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | G71 |
| Group | Lathe roughing cycle |
| Syntax | G71 Q- <X-> <Z-> <D-> <I-> <R-> |
| Dialect | LinuxCNC |

### Parameters

| Name | Description |
|---|---|
| Q | The subroutine number. |
| X | The starting X position; defaults to the initial position. |
| Z | The starting Z position; defaults to the initial position. |
| D | The remaining distance to the profile; defaults to 0. |
| I | The cutting increment; defaults to 1. |
| R | The retracting distance; defaults to 0.5. |

## Connected

- Related: [LinuxCNC G02](https://machineschema.com/instruction/gcode-g02.md), [LinuxCNC G1 Linear Move](https://machineschema.com/instruction/gcode-g01.md)

## Study notes

- G71 removes layers of material while traversing in the Z direction; the profile's Z coordinate must be monotonically changing.
- The profile subroutine may contain G0, G1, G2 and G3 motion commands; all other commands, including feed and speed settings, are ignored, and G0 commands are interpreted as G1.
- An optional A number on a motion command inserts a fillet at that endpoint, and an optional C number inserts a chamfer; a too-large fillet radius can fail with a non-monotonic path error.
- In absolute mode, U (for X) and W (for Z) can be used as incremental displacements.
- D keeps a distance from the final profile to allow material to remain for finishing.
- If X or Z are used, a rapid move to that position is made before cutting; after the profile is cut, the tool stops at the end of the profile including the D distance.
- It is an error if no subroutine Q exists, if the profile is not monotonic in Z or X, if the ZX plane is not selected, or if G41/G42 cutter compensation is active.
- The document notes that the G71 roughing cycle is currently somewhat fragile; it cites issues #707 and #1146.

## Sources

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

---

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