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.
| Block | Address | Meaning | Example value |
|---|---|---|---|
| First block | U | Depth of cut per pass (radius value): how far it feeds in X each time | 1.5 → diameter decreases by 3 mm per pass |
| First block | R | Retract amount after each pass | 0.5 |
| Second block | P / Q | Sequence numbers of the first and last blocks of the finishing profile | N10 – N20 |
| Second block | U | Finishing allowance in X (diameter value) | 0.4 |
| Second block | W | Finishing allowance in Z | 0.1 |
| Second block | F | Feed during roughing; F inside the profile blocks is used only by G70 | 0.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.
M30The 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.5and 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
G70path 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
M98subprogram 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 withX52., the same as the start diameter.
Common problems and their causes
| Symptom | Common cause | Where to check |
|---|---|---|
| Alarm as soon as the cycle starts | Start point inside the profile range | The positioning block just before G71 |
| Too much stock left after finishing | U in the second block mistaken for a radius value | Compare the U value with the actual finishing allowance |
| Excessive load on the roughing tool | U in the first block mistaken for a diameter value | Depth per pass = U × 2 (diameter) |
| Only part of the profile is cut | Z included in the P block, or X direction reversed | The N10 block and the contour direction |
| Finishing feed too fast | No F in the profile blocks, so the roughing F is used | The 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?
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.