NC

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!

Chips, the Kezuriba mascot
Lathe Multiple Repetitive Cycles: G71 (OD/ID Roughing) + G70 (Finishing), G72 (Facing), G73 (Pattern Repeating) and G76 (Threading)

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].

CodeTypeCodeBest for
G90Single-typeG90 X(U)_ Z(W)_ F_ (taper: R_)Straight OD/ID cut in several passes
G92Single-typeG92 X(U)_ Z(W)_ F_ (F = lead)Threads. Line up blocks with different X to cut deeper step by step
G94Single-typeG94 X(U)_ Z(W)_ F_Facing in several passes
G71+G70Multiple-typeG71 U_ R_
G71 P_ Q_ U_ W_ F_
Shafts and bores with steps, tapers and arcs (cut lengthwise)
G72Multiple-typeG72 W_ R_
G72 P_ Q_ U_ W_ F_
Short parts with a large diameter difference, such as flanges
G73Multiple-typeG73 U_ W_ R_
G73 P_ Q_ U_ W_ F_
Castings, forgings and other blanks whose stock follows the shape
G76Multiple-typeG76 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].

LineAddressMeaningNotes
Line 1UDepth of cut per pass ΔdRadius value, unsigned
RRetract amount eDistance retracted at 45° after each pass
Line 2P, QFirst and last sequence numbers (N) of the finish profileWrite the finish profile between P and Q
UFinishing allowance in X, ΔuDiameter value. The sign sets the side where stock is left (+ for OD, − for ID)
WFinishing allowance in Z, ΔwThe sign sets the side where stock is left
F, S, TRoughing feed, spindle speed and toolF, 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
ChuckStart point A (X52. Z2.)N100 (P)N200 (Q)φ20φ36φ48Stock φ50━ Roughing (2 mm per pass)━ Final pass along the shape┅ Finish allowance (×5 for clarity)
Roughing for the program above, drawn from calculated values (upper half of the section; chuck on the left, the tool cuts from the upper right on the +X side). From X52. at start point A, it cuts 7 levels along Z, each 4 mm smaller in diameter (2 mm in radius). When it reaches the line that leaves the finishing allowance (orange dotted), it retracts 0.5 mm at 45° and returns by rapid. Finally it traces once along the allowance line (blue), and G70 cuts to the finish profile (thick black line).

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

ZXΔdFinish allowance (orange dotted)Start pointFinish profile (P–Q)
Cuts with Z-direction passes by Δd each, down to the line that leaves the finish allowance on the finish profile (P–Q). At the end of each pass it backs off a little (e) at 45° and returns by rapid; a final pass follows the profile once. Finish with G70.

Diagram: How G70 (lathe) cuts

ZXCuts the finish allowance (dotted)Start pointFinish profile (P–Q)
Traces the finish profile written in P–Q once to finish the allowance left by G71–G73. When done, it returns to the start point by rapid.

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 IType IIPocketX and Z each change in one direction only (no pockets)Pockets in X OK (Z in one direction only)N100 G00 X18.← X only in PN100 G00 X18. Z2.← X and Z
Writing only X in the P block gives Type I; writing both X and Z gives Type II (per the Siemens and Haas manuals)[1][3]. To get Type II even when Z does not move, the Siemens manual says to write W0, and Haas says to write the current Z value.
  • 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].

OD, toward chuckU+ W+OD, toward faceU+ W−ID, toward chuckU− W+ID, toward faceU− W−
The thick black line is the finish profile, the orange dotted line is where roughing stops (the profile plus the finishing allowance), and the green arrow is the cutting direction. The green area is material (OD) and the beige area is material (outside the bore). The dash-dot line is the centerline. The finishing allowance is the profile shifted parallel to X and Z, so the signs of U and W give 4 directions (based on the Siemens manual's figure and Haas's explanation)[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

ZXΔdFinish allowance (orange dotted)Start pointFinish profile (P–Q)
Same as G71 but in the other direction: cuts with passes in the X direction (toward center) by Δd each. Suited to shapes with more stock on the face side. At the end of each pass it retracts at 45°. Finish with G70.

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].

LineAddressMeaning
Line 1UTotal relief in X, Δi (radius) = offset of the first traced shape
WTotal relief in Z, Δk
RNumber of repetitions d (number of divisions)
Line 2P Q U W FSame 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

ZXBlank shape (stock follows the contour)Start pointFinish profile (P–Q)
Traces the finished shape offset from the part, reducing the offset each pass for the specified number of passes. For castings and forgings where the stock follows the contour. Finish with G70.

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].

LineAddressMeaningExample callout
Line 1P6 digits, 2 at a time: m finishing passes, r chamfer (pull-out) at the thread end (in units of 0.1 × lead), a tool angleP011060
QMinimum depth of cut Δdmin (radius). If the calculated depth of cut gets smaller than this, this value is usedQ100 (0.1 mm)
RFinishing allowance dR0.05
Line 2X(U), Z(W)Thread end point (X = root diameter)X16.93 Z-30.
RTaper amount i (radius; 0 or omitted for straight threads)—
PThread height k (radius)P1534 (1.534 mm)
QFirst depth of cut Δd (radius)Q450 (0.45 mm)
FThread 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
Read the P in line 1 as 6 digits split into pairs. The Siemens manual's example P012055 means "1 finishing pass, chamfer 2.0 × lead, tool angle 55°"[1]. Zeros cannot be omitted either[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

Each passInfeed method (enlarged)Threaded sectionAEEnds with an angled pull-out1234Finish (d)ΔdkDepth of pass n = Δd × √n
Infeeds along one flank of the thread (flank infeed). The depth of pass n is Δd × √n, so the infeed shrinks and each pass removes about the same amount; the finishing allowance d is cut last. k is the thread height.

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 methodActionBest forHow to specify (examples)
Radial (straight in)Both flanks cut at once. V-shaped chipsFine pitches, soft materialsFANUC-compatible a = 00, Haas A0
Flank / modified flankOne flank cuts; the other just touches lightlyMost threads (first choice)a = 60; Haas recommends A59 for 60° threads[7], LinuxCNC Q29.5
Alternating flankLeft and right flanks used alternately each passLarge pitches, trapezoidal threads, difficult-to-cut materialsHaas 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.

Set Δd from the number of roughing passes: passes

PassDepth (radius)This pass's cutX (diameter)Area cut (1st pass = 100)

Depth of pass n = Δd × √n (if this pass's cut is smaller than Δdmin, Δdmin is used). When the roughing depth reaches k − d, the thread is finished to k at the end (m passes). External thread X = d − 2 × depth; internal thread X = (d − 2k) + 2 × depth. Area is (depth² − previous depth²) relative to the first pass

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)HaasLinuxCNC
G71G71 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]
G73G73 U_ W_ R_ (R = count)G73 P_ Q_ U_ W_ I_ K_ D_
D is the count
—
G76G76 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 pointsP, Q: integers in least input incrementK, D with decimal point; A, Q withoutdecimal
Min. depth of cut, finishing allowanceQ, 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

  1. 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]
  2. 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
  3. 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]
  4. 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
  5. 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
  6. 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]
  7. 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)
  8. Writing the pitch in F (multi-start threads): F is the lead. For a 2-start thread, it is 2× the pitch
  9. 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

  1. Siemens: SINUMERIK 840D sl/840Di sl ISO Turning Programming Manual (ISO dialect, 2007)
  2. Mitsubishi Electric: 700/70 Series Programming Manual (Lathe System), IB-1500057
  3. Haas Automation, "G71 O.D./I.D. Stock Removal Cycle"
  4. Haas Automation, "G70 Finishing Cycle"
  5. Haas Automation, "G72 End Face Stock Removal Cycle"
  6. Haas Automation, "G73 Irregular Path Stock Removal Cycle"
  7. Haas Automation, "G76 Threading Cycle, Multiple Pass"
  8. Haas Automation, "G90 O.D./I.D. Turning Cycle"
  9. Haas Automation: Lathe Programming Workbook (PDF)
  10. LinuxCNC: G-Codes (G71, G72, G76)
  11. Tool maker's technical guide: How to choose infeed method in thread turning operations
  12. Tool maker's technical guide: Threading formulas and definitions
  13. Red Seal (Canada): Machinist formulas (PDF)
  14. Evaluation of infeed strategies for turning of large thread profiles (University of Belgrade, Faculty of Mechanical Engineering repository)
  15. Ghogha et al., study of infeed methods and tool wear in thread milling, Amirkabir Journal of Mechanical Engineering 53 (2021)
  16. JP 2000-117543 A: Method for threading steel pipes

More articles