CNC lathe · G-code

G71: O.D./I.D. stock removal (roughing) cycle

G71 roughs a turned profile in passes along Z, leaving a finish allowance, from the finished shape you program once. G70 then finishes it. Haas lists it as one-shot (group 00). Formats below from Haas, LinuxCNC and Fanuc, each from its maker.

On a Haas mill, G71 is the bolt hole arc.

Worked example

Rough a 1.0" shoulder from 1.5" stock, then finish (Haas). Written for this page in the Haas format.

G00 X1.6 Z0.1G71 P100 Q200 U0.02 W0.005 D0.08 F0.012N100 G00 X1.0 (profile start)G01 Z-1.0 F0.006X1.5N200 Z-1.5 (profile end)G70 P100 Q200

How each control writes it

Haas G71 P- Q- U- W- D- F- (one block)

One source: Haas Automation, the control's maker

P
Block number where the finished profile starts
Q
Block number where it ends
U
Finish allowance in X, diameter (optional)
W
Finish allowance in Z (optional)
D
Depth of cut per pass, radius (one-block notation)
I
Rough pass allowance in X, radius (optional)
K
Rough pass allowance in Z (optional)
F
Feedrate for the roughing (optional)
S
Spindle speed for the roughing (optional)
T
Tool and offset for the roughing (optional)
  • G18 (Z-X plane) must be active.
  • Type 1: X never reverses. Type 2 (pockets) is selected by giving both X and Z in the P block.
  • Z may never change direction.
  • Setting 287 sets the retract.

Source: Haas Automation, lathe G71

LinuxCNC G71 Q- X- Z- D- I- R-

One source: the LinuxCNC project, the control's maker

Q
Subroutine number holding the profile
X
Start X (optional)
Z
Start Z (optional)
D
Distance left to the profile (finish allowance) (optional)
I
Cutting increment (depth per pass), default 1 (optional)
R
Retract distance, default 0.5 (optional)
  • G71.1 skips pockets; G71.2 cuts only the pockets.
  • Z must change monotonically.
  • LinuxCNC calls these cycles "somewhat fragile".

Source: LinuxCNC documentation, "G71 G72 Lathe roughing cycles" (archived Oct 29, 2026)

Fanuc G71 U(Δd) R(e) ; G71 P(ns) Q(nf) U(Δu) W(Δw) F_ S_ T_ ; (two blocks)

One source: FANUC, the control's maker

U (first block)
Depth of each cut
R (first block)
Pull-off after each cut
P
First block of the finished shape
Q
Last block of the finished shape
U (second block)
Finish allowance in X (optional)
W (second block)
Finish allowance in Z (optional)
F, S, T
Used for the roughing in place of any in the shape blocks (optional)
  • FANUC 0i-TF (lathe), G code system A (U and W are incremental), from its operator’s manual. On another FANUC model or G code system, check that control’s manual.
  • Two blocks, where Haas takes one (G71 P Q U W D F).

Source: FANUC B-64604EN-1/01, Operator's Manual, 0i-TF (lathe), §4.2.1

How the controls differ

  • Only Haas takes K, U, W.
  • Only LinuxCNC takes R, X, Z.
  • Only Fanuc takes R (first block), U (first block), U (second block), W (second block).
  • A word two controls share can still mean different things: read each control's list above.

Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.