CNC Path Analyzer

The G71 OD roughing cycle: how the U, R, P, Q, U and W values change the path

Explains the G71 OD roughing cycle of FANUC-family lathes in its two-block format: depth of cut, retract amount, finishing allowance, the rules for writing profile blocks and common alarm causes, together with the actual path drawing.

What does G71 do for you?

To turn thick stock to the desired profile on a lathe, the same kind of cut has to be repeated dozens of times, because the depth that can be cut in one pass is limited. Writing every repetition as G01 makes the program long, and changing a single dimension means editing many lines.

With the G71 OD roughing cycle, you write the final profile once and the controller builds the roughing path itself, repeatedly feeding in along X and cutting along Z based on that profile. All you have to tell it is "how deep to cut", "how much to leave" and "where the profile starts and ends".

The addresses of the two-block format

Since the FANUC 0i, most controllers write G71 in two blocks. The most confusing point is that the same letter U means something completely different in the first and second blocks.

BlockAddressMeaningExample value
First blockUDepth of cut per pass (radius value): how far it feeds in X each time1.5 → diameter decreases by 3 mm per pass
First blockRRetract amount after each pass0.5
Second blockP / QSequence numbers of the first and last blocks of the finishing profileN10 – N20
Second blockUFinishing allowance in X (diameter value)0.4
Second blockWFinishing allowance in Z0.1
Second blockFFeed during roughing; F inside the profile blocks is used only by G700.25 mm/rev

Example: roughing and finishing a stepped shaft

Below is a synthetic program that approaches from Ø52 and makes a stepped shaft of Ø24 × 20 mm and Ø40 × 18 mm. The profile was created for this explanation, not taken from a real part, and the drawing is the result of the CNC Path Analyzer engine interpreting this source directly.

Roughing a Ø24/Ø40 stepped shaft from Ø40 stock, then finishing with G70

O1000
T0101
G21 G90 G18 G40 G99
G50 S2500
G96 S180 M03
G00 X52. Z2.
G71 U1.5 R0.5
G71 P10 Q20 U0.4 W0.1 F0.25
N10 G00 X20.
G01 Z0. F0.12
X24. Z-2.
Z-20.
X36.
X40. Z-22.
Z-40.
N20 X52.
G70 P10 Q20
G00 X100. Z100.
M30
Roughing a Ø24/Ø40 stepped shaft from Ø40 stock, then finishing with G70 — ZX (radius) pathZX (radius)
Dashed light blue is G00 rapid traverse; solid orange is cutting motion. Arcs are expanded into calculated static curves.

The figure above is the CNC Path Analyzer result for this program (rapid 36 segments, linear cutting 18 segments).

What to check in the toolpath drawing

  • The cycle start point X52. Z2. must be outside the stock and in front of the face. If the start point is inside the profile, the controller cannot calculate the range to cut.
  • Horizontal cutting lines repeat along Z, with X decreasing by a constant amount each pass. The last pass automatically becomes shallower to match the remaining stock.
  • The short diagonal returns are the moves that back off by R0.5 and then return at rapid. If the retract amount is close to zero, the tool may drag across the machined surface on its way back.
  • The last line following the profile is the contour that leaves the finishing allowance at the end of roughing, and the G70 path on top of it is the finishing pass that removes the allowance.

Rules for writing the profile blocks (P to Q)

  • The P block (N10) normally commands only X. If Z is commanded as well, some controllers interpret it as the Type II format (pockets allowed), producing an unintended path or an alarm.
  • For Type I, the profile must make X increase or decrease in one direction only. A concave groove in the middle cannot be made with G71 Type I.
  • Do not use M98 subprogram calls or other canned cycles between P and Q.
  • It is safest to end the Q block (N20) with a move that exits beyond the stock. The example ends with X52., the same as the start diameter.

Common problems and their causes

SymptomCommon causeWhere to check
Alarm as soon as the cycle startsStart point inside the profile rangeThe positioning block just before G71
Too much stock left after finishingU in the second block mistaken for a radius valueCompare the U value with the actual finishing allowance
Excessive load on the roughing toolU in the first block mistaken for a diameter valueDepth per pass = U × 2 (diameter)
Only part of the profile is cutZ included in the P block, or X direction reversedThe N10 block and the contour direction
Finishing feed too fastNo F in the profile blocks, so the roughing F is usedThe F commands between P and Q

Differences between controllers

Older FANUC controls (10/11 format) and some other controllers write G71 in a one-block format, G71 P_ Q_ U_ W_ D_ F_; the depth per pass is then given with D, sometimes without a decimal point in units of 0.001 mm. When moving a program to another machine, check the cycle format in the manual first.

CNC Path Analyzer changes its cycle interpretation rules according to the controller selected in the machine settings, and for unconfirmed formats it shows the error line instead of inventing a plausible path. The detailed scope is available under Supported scope.

Frequently asked questions

Must G70 always follow G71?
It is not mandatory, but G71 ends with the finishing allowance left on, so it is usual to run G70 pointing to the same P/Q to reach the final dimensions. If you use a different finishing tool, put the tool change before G70.
Is ID machining also done with G71?
Yes. Place the start point inside the bore (small X) and give a negative U in the second block for ID roughing. Just remember that the sign of the finishing allowance is reversed.

Next steps

Check the path in CNC Path Analyzer