Lathe Multiple Repetitive Cycles: G71 (OD/ID Roughing) + G70 (Finishing), G72 (Facing), G73 (Pattern Repeating) and G76 (Threading)
Write the finish shape once, and the NC makes the roughing passes for you. Watch out for the two different U's!


When turning a stepped shaft on an NC lathe, are you still writing every roughing pass line by line? Multiple repetitive cycles let you write the finish shape just once, and the NC automatically generates the roughing passes, retracts and even the finishing. This article explains OD/ID roughing G71 and finishing G70, facing G72, casting/forging G73, and threading G76 with example drawings and programs, plus tool-path diagrams drawn from the numbers. At the end, there is a calculator for checking the number and depth of G76 infeed passes.
This article is based on the FANUC-compatible 2-block format (G code system A). FANUC's manuals are not publicly available, so the code was checked against the public manuals of the Siemens ISO dialect[1] / Mitsubishi Electric[2], which document the FANUC-compatible format. Differences from Haas[3] / LinuxCNC[10] are noted as they come up. Always check your own machine's manual before use.
Single-type (G90, G92, G94) vs multiple-type cycles
Lathe canned cycles come in two kinds: Single-type cycles do 4 motions in one line (infeed → cut → retract → return), and Multiple-type cycles generate the roughing passes automatically from the finish profile[1][2].
| Code | Type | Code | Best for |
|---|---|---|---|
| G90 | Single-type | G90 X(U)_ Z(W)_ F_ (taper: R_) | Straight OD/ID cut in several passes |
| G92 | Single-type | G92 X(U)_ Z(W)_ F_ (F = lead) | Threads. Line up blocks with different X to cut deeper step by step |
| G94 | Single-type | G94 X(U)_ Z(W)_ F_ | Facing in several passes |
| G71+G70 | Multiple-type | G71 U_ R_ G71 P_ Q_ U_ W_ F_ | Shafts and bores with steps, tapers and arcs (cut lengthwise) |
| G72 | Multiple-type | G72 W_ R_ G72 P_ Q_ U_ W_ F_ | Short parts with a large diameter difference, such as flanges |
| G73 | Multiple-type | G73 U_ W_ R_ G73 P_ Q_ U_ W_ F_ | Castings, forgings and other blanks whose stock follows the shape |
| G76 | Multiple-type | G76 P_ Q_ R_ G76 X(U)_ Z(W)_ R_ P_ Q_ F_ | Threads. The NC works out how to split the infeed |
For example, with the single-type G90, if N11 G90 X80. W-42. F0.3; is followed by X70.; X60.; , changing only X, it cuts in 3 passes[1]. With only one step, a single-type cycle is enough, but as steps, tapers and chamfers increase, the number of lines and the calculations balloon. That is where multiple-type cycles come in. Note that the lathe G90 and G94 are completely different from G90 (absolute command) and G94 (feed per minute) on machining centers, so don't mix them up (list of canned cycles).
How to specify a taper depends on the control. The FANUC-compatible Siemens ISO dialect uses R for G90, G92 and G94; Haas uses I for G90 and G92, and K for G94[1][8]. In G code systems B and C, the code numbers themselves are different.
G71 + G70: OD roughing and finishing
G71 is a pair of two lines. Line 1 sets the roughing depth of cut and retract; line 2 sets the range of the finish profile (P–Q) and the finishing allowance[1][2].
| Line | Address | Meaning | Notes |
|---|---|---|---|
| Line 1 | U | Depth of cut per pass Δd | Radius value, unsigned |
| R | Retract amount e | Distance retracted at 45° after each pass | |
| Line 2 | P, Q | First and last sequence numbers (N) of the finish profile | Write the finish profile between P and Q |
| U | Finishing allowance in X, Δu | Diameter value. The sign sets the side where stock is left (+ for OD, − for ID) | |
| W | Finishing allowance in Z, Δw | The sign sets the side where stock is left | |
| F, S, T | Roughing feed, spindle speed and tool | F, S and T inside P–Q are not used during roughing |
The same U means different things in line 1 and line 2In line 1, U is the depth of cut (radius); in line 2, with P and Q, U is the finishing allowance (diameter).[1]. Swap U2. and U0.4 and you get an absurd roughing cycle with a 2 mm finishing allowance and a 0.4 mm depth of cut.
Example: roughing and finishing a stepped shaft
Turn a stepped shaft with φ20, a taper, φ36 and φ48 from φ50 stock. Roughing uses a 2 mm depth of cut (radius), the finishing allowance is X 0.4 mm (diameter) and Z 0.1 mm, and finishing is done by G70 with a separate tool.
O1000 (G71 G70 OD) G28 U0. W0. T0101 (roughing tool) G50 S2500 (max spindle speed) G96 S180 M03 (constant surface speed) G00 X52. Z2. M08 (start point A: outside stock, before face) G71 U2. R0.5 (line 1: depth of cut 2 mm, retract 0.5 mm) G71 P100 Q200 U0.4 W0.1 F0.25 (line 2: finish profile N100-N200) N100 G00 G42 X18. (P: move X only -> type I) G01 Z0. F0.12 (this F and S apply only in G70) X20. Z-1. (C1 chamfer) Z-20. X28. X36. Z-35. (taper) Z-45. X46. X48. Z-46. (C1 chamfer) Z-55. N200 G40 X52. (Q: exit outside the stock) G00 X100. Z100. M09 T0303 (finishing tool) G96 S220 M03 G00 X52. Z2. M08 G70 P100 Q200 (finish: trace N100-N200) G00 X100. Z100. M09 M30
G70 only needs the same P, Q as G71 to trace the N100–N200 shape once and finish it. Here, the F, S and T written inside P–Q take effect , and the F0.25 in the G71 line is not used. Conversely, during G71 roughing, F, S and T inside P–Q are ignored[1][4]. To use different feeds for roughing and finishing, remember: roughing feed goes in line 2 of G71, finishing feed goes inside P–Q. When G70 ends, the tool returns to the start point by rapid[4].
Diagram: How G71 (lathe) cuts
Diagram: How G70 (lathe) cuts
Rules for P–Q: Type I and Type II
The finish profile written in P–Q has rules. The most important is which axes you write in the P block (the first line), which decides how G71 moves (its type)[1][3].
- Type I: the finish profile must be monotonic in both X and Z (always increasing or always decreasing). Pockets (recesses) cannot be cut[1]
- Type II: can cut pockets in X, but Z must still be monotonic. Whether Type II is available depends on options and the control[1][3]
- Start the P block with G00 or G01 . Inside P–Q, you cannot call subprograms (M98, M99). On some controls, ending the last move with a chamfer or corner R command causes an alarm[1]
- If the last block (Q) is made to exit outside the stock as in the example, the end of roughing is clear-cut
ID roughing: reverse the sign of U
ID work uses the same G71. The differences are the sign of the finishing allowance U and the start point position. The finishing allowance tells the NC which way the finish profile is shifted for the roughing stop line: U+ leaves stock on the +X side (outside), U− leaves it on the center side. On ID work the cut surface faces the center, so U is negative[1][3].
(after drilling a φ20 pilot hole) T0202 (ID roughing tool) G96 S150 M03 G00 X18. Z2. M08 (start point: inside pilot hole, before face) G71 U1.5 R0.5 G71 P300 Q400 U-0.4 W0.1 F0.2 (ID: U is negative) N300 G00 X42. (P: X only -> type I) G01 Z0. F0.1 X40. Z-1. (C1 chamfer) Z-15. X30. Z-30. N400 X18. (Q: exit into the pilot hole) G00 Z100. (pull out of the hole in Z first) X100. M09
On ID work, watch the retract and return directionsOn ID work, the 45° retract after each pass (R in line 1) goes toward the center. If the pilot hole is small and the gap between the back of the tool and the bore wall is smaller than the retract amount, the retract hits the opposite wall. The start point X must also be smaller than the pilot hole, or the first rapid move will hit the wall. When machining is done, as in the example, pull out of the hole in Z first , then move X.
G72: Face roughing
G72 is G71 turned sideways: it makes passes in the X direction (toward the center) while stepping in along Z a little at a time. It suits short parts with a large diameter difference, such as flanges[1][5].
G00 X84. Z2. (start point) G72 W2. R0.5 (line 1: Z depth of cut 2 mm, retract 0.5 mm) G72 P500 Q600 U0.4 W0.2 F0.25 N500 G00 Z-12. (P: move Z only) G01 X60. F0.12 Z-6. X30. Z-1. X28. Z0. (C1 chamfer) N600 X0. (Q) G70 P500 Q600 (finish)
The differences from G71: the depth of cut in line 1 is W , only Z goes in the P block, and the finish profile runs from the outside toward the center in the program[1]. As in G71, U and W in line 2 are the finishing allowances.
Diagram: How G72 (lathe) cuts
G73: Pattern repeating (closed loop) for castings and forgings
G73 is a cycle that traces along the shape many times, shifting the finish profile a little each time. For castings and forgings, where the blank is already close to the final shape with even stock all over, back-and-forth passes like G71 involve a lot of air cutting, so G73 is used instead[1][6].
| Line | Address | Meaning |
|---|---|---|
| Line 1 | U | Total relief in X, Δi (radius) = offset of the first traced shape |
| W | Total relief in Z, Δk | |
| R | Number of repetitions d (number of divisions) | |
| Line 2 | P Q U W F | Same as G71 (finish profile range, finishing allowance, feed) |
(same shape as the G71 example, from a forging with about 3 mm stock on each face) G00 X60. Z5. (start point: outside the blank shape) G73 U2.8 W2.8 R3 (line 1: split the 2.8 mm offset into 3 passes) G73 P100 Q200 U0.4 W0.1 F0.25 (N100-N200 same as the G71 example) G70 P100 Q200
As a guide, Δi and Δk are the blank's stock minus the finishing allowance; the shape moves inward by that amount divided by the R count on each pass. U in line 1 is a radius value, and U in line 2 is a diameter value. Haas uses a 1-block format, written as G73 P Q U W I K D , where D is the count (a decimal point causes an alarm) and I and K are the offsets[6].
Diagram (lathe): how G73 (lathe) cuts
G76: Threading cycle
With G76 you specify only the thread height and the first depth of cut, and the NC works out how many passes to make and how deep each one goes. It cuts with one flank of the tool (single-flank cutting), which eases the load on the tool tip, and it reduces the depth of cut so that each pass removes a constant amount[1][2].
| Line | Address | Meaning | Example callout |
|---|---|---|---|
| Line 1 | P | 6 digits, 2 at a time: m finishing passes, r chamfer (pull-out) at the thread end (in units of 0.1 × lead), a tool angle | P011060 |
| Q | Minimum depth of cut Δdmin (radius). If the calculated depth of cut gets smaller than this, this value is used | Q100 (0.1 mm) | |
| R | Finishing allowance d | R0.05 | |
| Line 2 | X(U), Z(W) | Thread end point (X = root diameter) | X16.93 Z-30. |
| R | Taper amount i (radius; 0 or omitted for straight threads) | — | |
| P | Thread height k (radius) | P1534 (1.534 mm) | |
| Q | First depth of cut Δd (radius) | Q450 (0.45 mm) | |
| F | Thread lead (for multi-start threads, pitch × number of starts) | F2.5 | |
| P, Q and R mean completely different things in line 1 and line 2 | |||
Example: M20×2.5 external thread
T0505 (threading tool 60°) G97 S800 M03 (constant rpm for threading) G00 X22. Z5. M08 (start point: about 2x lead before) G76 P011060 Q100 R0.05 (1 finish pass, chamfer 1.0L, 60°, min 0.1, finish allow. 0.05) G76 X16.93 Z-30. P1534 Q450 F2.5 (root dia., end point, thread height 1.534, 1st cut 0.45, lead 2.5) G00 X100. Z100. M09
P and Q in line 2 are integers with no decimal pointIn the FANUC-compatible format, P and Q of G76 are written as integers in the least input increment (usually 0.001 mm). The Siemens example G76 X60640 Z25000 P3680 Q1800 F6.0 also has no decimal points[1]. Whether a number without a decimal point is read as mm or as 0.001 mm depends on machine settings, so it is safer to write X and Z with a decimal point as in the example. Haas, on the other hand, uses a 1-block format and writes the thread height K and the first depth of cut D as decimal values[7].
Why the infeed gets shallower: the constant-area idea
A threading tool has a V-shaped tip, so the deeper it goes, the longer the cutting edge in contact with the material. If every pass cut the same depth, the area removed per pass (the cutting force) would grow in later passes, causing chatter and chipped tips. So G76 sets the depth of pass n to Δd × √n . The cross-section of a V groove is proportional to the square of its depth, so if the depth grows with √n, the area grows in proportion to n, and the area cut per pass stays nearly constant[1][2][7]. However, as passes increase, each depth of cut gets ever thinner, so the minimum depth of cut Δdmin (Q in line 1) sets a lower limit[2][1].
Diagram (lathe): G76 (lathe), multiple threading cycle
LinuxCNC's G76 is written completely differently, in a single line: G76 P(pitch) Z I J K R Q H E L . R sets how the depth decreases: R2 is constant area (√n) and R1 is the same depth every pass. Q is the infeed angle (usually 29–30°) and H is the number of spring passes[10].
Infeed angle: along one flank or straight in
Setting a (tool angle) in line 1 to 60 makes the tool go in at an angle along one flank of the thread (flank infeed). Setting it to 0 makes it go straight in radially (radial infeed). According to a tool maker's technical guide, "modified flank infeed," with a slightly shallower angle, is the first choice: chips flow to one side and tool life is longer. Radial infeed produces stiff V-shaped chips and tends to heat the tip, so it suits fine pitches[11]. For large pitches, alternating flank infeed, using the left and right flanks in turn, can also spread out the wear[11][14].
| Infeed method | Action | Best for | How to specify (examples) |
|---|---|---|---|
| Radial (straight in) | Both flanks cut at once. V-shaped chips | Fine pitches, soft materials | FANUC-compatible a = 00, Haas A0 |
| Flank / modified flank | One flank cuts; the other just touches lightly | Most threads (first choice) | a = 60; Haas recommends A59 for 60° threads[7], LinuxCNC Q29.5 |
| Alternating flank | Left and right flanks used alternately each pass | Large pitches, trapezoidal threads, difficult-to-cut materials | Haas P2, P4 (both flanks)[7]. On FANUC-type controls, depends on options and model |
In experiments on thread milling (not turning), too, modified flank infeed gave about 2× and alternating infeed about 4× the tool life of radial infeed[15]. For thread turning as well, there is a patent on splitting the infeed between roughing and finishing tools to reduce wear on the finishing tool[16]. The infeed method is a choice that directly affects tool life and thread quality.
Calculator: number and depth of G76 passes
Using the same logic as the FANUC-compatible G76 (depth of pass n = Δd × √n, a lower limit from the minimum depth of cut, and the finishing allowance at the end), this gives the depth and X of each pass and the two G76 lines. For the thread height k, 0.6134P for external threads and 0.5413P for internal threads are entered as common rules of thumb (0.5413P for internal threads is the JIS basic thread engagement height H1 = 0.541266P)[13]. Set the actual depth while checking with a thread gauge. Thread dimensions are in Thread dimensions and tap drill sizes.
As a guide to the number of threading passes, a tool maker's technical guide gives an example of pitch 1.5 mm (depth 0.94 mm) in 6 passes, with the depth of cut decreasing from 0.23 mm to 0.10 mm[12]. The number of passes varies with material, tool and machine rigidity, so use the calculator's result as a starting point.
Differences between controls
| FANUC-compatible (Siemens ISO dialect, Mitsubishi Electric) | Haas | LinuxCNC | |
|---|---|---|---|
| G71 | G71 U_ R_ G71 P_ Q_ U_ W_ F_ | G71 P_ Q_ U_ W_ D_ (I_ K_) F_ D = depth of cut (1 block) | G71 available, but an error during tool nose radius compensation[10] |
| G73 | G73 U_ W_ R_ (R = count) | G73 P_ Q_ U_ W_ I_ K_ D_ D is the count | — |
| G76 | G76 P(m r a) Q R G76 X Z R P Q F | G76 X Z K D F A P I Q K thread height, D 1st cut, A tool angle, P infeed method, Q start angle | G76 P Z I J K R Q H E L P = pitch, no X |
| G76 decimal points | P, Q: integers in least input increment | K, D with decimal point; A, Q without | decimal |
| Min. depth of cut, finishing allowance | Q, R in line 1 (also settable by parameter)[2] | Setting 99 (min. depth of cut), Setting 86 (finishing allowance)[7][9] | — |
The same "P" and "Q" mean different things by makerIn the FANUC-compatible G76, P in line 1 is a 6-digit combination; Haas's P is the infeed method; LinuxCNC's P is the pitch. Haas's Q is the thread start angle, not the same as the FANUC-compatible Q (depth of cut)[7][10]. When using CAM post-processors or reusing programs from other machines, always rewrite them.
Common mistakes
- Mixing up the U's in the two G71 lines: line 1 is the depth of cut (radius), line 2 is the finishing allowance (diameter)[1]
- Leaving U positive for ID work: no allowance is left on the center side, and roughing cuts into the finished size. Use U− for ID
- Writing Z in the P block too: it runs as Type II (or alarms if Type II is not available). For Type I, put only X in P[1][3]
- Non-monotonic profile: a pocket in a Type I profile causes an alarm (handling varies by control). Cut pockets in a separate operation or with Type II
- Writing without deciding how to handle tool nose radius compensation (G41, G42): handling differs by control. Mitsubishi Electric uses the compensated shape even for roughing (switchable by parameter)[2]; the Haas example writes G42 in the P block and G40 in the Q block so compensation applies in both G71 and G70[9]. The Siemens ISO dialect does not compensate inside G71–G76[1]. On machines that do not compensate, tapers and arcs are undercut or overcut by the nose radius
- Putting decimal points on P and Q in G76 line 2 / forgetting them on X and Z: P and Q are integers (0.001 mm units). Write X and Z with decimal points[1]
- Starting threading still in constant surface speed (G96): use G97 for constant rpm when threading. Give the start point a Z run-up distance so the feed can catch up (2× the lead in the example)
- Writing the pitch in F (multi-start threads): F is the lead. For a 2-start thread, it is 2× the pitch
- Running a Haas program as-is on a FANUC-compatible machine (or vice versa): 1-block vs 2-block format, and P, Q and D mean different things
FAQ
- Should I use the 1-block or the 2-block format?
- Use the format your machine accepts. The 2-block format is now standard on FANUC-compatible NCs, and the Siemens ISO dialect accepts both[1]. Haas writes G71 and similar cycles in the 1-block format (D for depth of cut)[3]. Check the G71 format in your manual: one line or two.
- When should I use G71 versus G90?
- For a simple OD with one step, G90 is enough. If there are steps, tapers, chamfers or arcs and you want to separate roughing and finishing, G71 + G70 is shorter to write, and when dimensions change you only need to edit the shape in P–Q.
- Can I change tools before G70?
- Yes. As in the example, the usual way is to run G71 with the roughing tool, then switch to the finishing tool and write G70. G70 refers to P–Q in the same program, so use the same numbers as in G71.
- What is the G76 chamfer amount (r) for?
- It is how far the tool pulls out at an angle at the end of the thread. It is written in units of 0.1 × lead; 10 means the tool pulls out over 1.0 × lead[1][2]. If there is a relief groove at the end of the thread, check that the pull-out fits in the groove.
- How should I choose Δd (the first depth of cut)?
- The easy way is to work back from the number of roughing passes. For N roughing passes, Δd = (k − d) ÷ √N (the minimum depth of cut may add passes). Try it with "Set Δd from the number of roughing passes" in the calculator above.
For the meaning of each G and M code, see the G and M code dictionary, machining-center drilling cycles in the list of canned cycles, and programs using variables and calculations in Custom Macro Basics.
Sources
- Siemens: SINUMERIK 840D sl/840Di sl ISO Turning Programming Manual (ISO dialect, 2007)
- Mitsubishi Electric: 700/70 Series Programming Manual (Lathe System), IB-1500057
- Haas Automation, "G71 O.D./I.D. Stock Removal Cycle"
- Haas Automation, "G70 Finishing Cycle"
- Haas Automation, "G72 End Face Stock Removal Cycle"
- Haas Automation, "G73 Irregular Path Stock Removal Cycle"
- Haas Automation, "G76 Threading Cycle, Multiple Pass"
- Haas Automation, "G90 O.D./I.D. Turning Cycle"
- Haas Automation: Lathe Programming Workbook (PDF)
- LinuxCNC: G-Codes (G71, G72, G76)
- Tool maker's technical guide: How to choose infeed method in thread turning operations
- Tool maker's technical guide: Threading formulas and definitions
- Red Seal (Canada): Machinist formulas (PDF)
- Evaluation of infeed strategies for turning of large thread profiles (University of Belgrade, Faculty of Mechanical Engineering repository)
- Ghogha et al., study of infeed methods and tool wear in thread milling, Amirkabir Journal of Mechanical Engineering 53 (2021)
- JP 2000-117543 A: Method for threading steel pipes
More articles
GaugesCentering with a dial indicator: four-jaw chuck, bores and bosses on a machining center, and the tailstock, by moving “half the runout”
IndustryHow a metalworking company can enter medical device parts machining: common parts and materials, market trends, major makers, the PMD Act, ISO 13485 and the hurdles
Gears