Skip to content

G71: automatic longitudinal roughing on the lathe

G71 roughs along the Z axis with passes parallel to the axis, removing material until it gets close to the profile you describe just once and leaving the finish stock you specify. You write the final contour between two block numbers and the control works out on its own how many passes it needs, where it goes in and where it retracts. It is the most widely used cycle on the lathe and also one of the most control-dependent: the two-block Fanuc format is not the same as the one on older controls or on a Fagor.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Lathe cycles
Machine
Turning, Mill-turn
Risk
High
Example
G71 U2 R0.5

Syntax by control

Fanuc (two-block format, the most common)
G71 U2. R0.5 / G71 P100 Q200 U0.4 W0.1 F0.25
The first block carries the depth of cut in radius and the retract; the second, the start and end blocks of the profile and the finish stock. It is the format of the 0i series and compatibles, and the one nearly every modern post processor writes.
Fanuc (one-block format, older controls)
G71 P100 Q200 I0.4 K0.1 D2000 F0.25
In this format the finish stock values are called I and K and the depth goes in D. If you copy a program between machines without checking the format, the same figures mean something else. Your control's manual has the last word: there is no single way to write G71.
Haas (lathe)
G71 P100 Q200 U0.4 W0.1 D2. F0.25
Haas accepts the two-block format just like Fanuc, and also a single block with D as the depth. D takes a decimal point, D2. in this case; confirm it in the manual for your model before you run it.
Siemens 840D / 828D
CYCLE62(...) + CYCLE952(...)
Siemens does not use G71: roughing to a contour is done with the ShopTurn and programGUIDE cycles, where the contour is declared separately with CYCLE62 and the roughing is called with CYCLE952. The parameters go by name and position, not as single letters.
Fagor 8055 / 8065
Z roughing cycle in the cycle editor
Fagor offers longitudinal roughing as a cycle in the conversational editor, with its own fields. The functional equivalence with G71 is complete, but the syntax looks nothing like it: see the lathe canned cycles manual for your version.

Address letters used with it

LetterWhat it setsUnit
U (first block)Depth of each roughing pass, measured in radius. U2. is two millimeters in radius, which means four in diameter per pass.mm / in, in radius
R (first block)Tool retract at the end of each pass, so the insert does not rub on the way back. Half a millimeter is a normal value.mm / in
P and QNumber of the first and the last block of the profile that describes the finished part. Block P can only carry movement in X, and block Q is where the contour ends.N block number
U (second block)Finish stock in X, measured in diameter and signed: positive for outside work, negative for inside work. It is the same letter as in the first block with a different meaning, and that is where half the shop gets confused.mm / in, in diameter
W (second block)Finish stock in Z. It is usually smaller than the X value, or even zero when the facing is already done.mm / in
F, S, TFeed, RPM and tool for the roughing. Any F, S and T you write inside the P-Q profile are ignored by the roughing and used only by the G70 finishing cycle.mm/rev, rpm, integer

Worked example

Roughing and finishing a stepped steel shaft starting from Ø50 bar stock. The finished profile has a 1 mm chamfer, a Ø30 section 25 mm long, a taper up to Ø40 and a final Ø40 section. It leaves 0.4 mm of finish stock in diameter and 0.1 mm in Z, and then G70 finishes the same profile with the finishing tool.

O0401 (DESBASTE G71 + ACABADO G70)
( Program header. )
G21 G18 G40 G99
( Millimeters, the lathe's XZ plane, no compensation and feed in millimeters per revolution. )
T0101
( Outside roughing insert with offset 1. )
G50 S3000
( RPM limiter at 3000, ahead of G96, so the spindle does not run away as the tool nears the center. )
G96 S220 M03
( Constant surface speed at 220 m/min, with the G50 cap already in place. )
G00 X52. Z2. M08
( Approach to the start point of the cycle: two millimeters outside the stock and two ahead of the face. )
G71 U2. R0.5
( First block: two millimeters of depth in radius per pass (four in diameter) and half a millimeter of retract. )
G71 P100 Q200 U0.4 W0.1 F0.25
( Second block: the profile runs from N100 to N200, leaves 0.4 mm of finish stock in diameter and 0.1 in Z, and roughs at 0.25 mm per revolution. )
N100 G00 X28.
( First block of the profile. It only allows movement in X: put a Z here and the control throws a cycle format alarm. )
G01 Z0. F0.12
( Reaches the face. G71 ignores this F and G70 will use it. )
G01 X30. Z-1.
( 1 x 45 degree chamfer at the start of the shaft. )
G01 Z-25.
( Ø30 cylindrical section up to 25 mm from the face. )
G01 X40. Z-40.
( Taper from Ø30 to Ø40 over 15 mm of length. )
G01 Z-60.
( Ø40 cylindrical section. )
N200 G01 X52.
( Last block of the profile: goes out to the stock diameter and closes the contour. )
G00 X200. Z100. M09
( Retract to the tool change position and coolant off. )
T0303
( Finishing insert with its offset. )
G96 S280 M03
( More cutting speed for the finishing. )
G00 X52. Z2. M08
( Back to the same start point: G70 starts where G71 started. )
G70 P100 Q200
( Finishes the same N100-N200 profile, this time with the F0.12 written inside the contour. )
G00 X200. Z100. M09
( Retract and coolant off. )
M05
( Spindle stop. )
M30
( End of program. )
Open the simulator to check the example

Practical keys to using G71 in the workshop

The start point governs the whole cycle

Before you write G71 you have to place the tool at a clear point, outside the stock in X and ahead of the face in Z. From there the control calculates all the passes and also how far it retracts the insert between them. If you start too close to the material, the first pass goes in deeper than you asked for; if you start too far away, the cycle wastes time cutting air. A reasonable figure is two millimeters outside in diameter and two ahead in Z, and that same point is the one the G70 finishing cycle has to use afterward.

You write the profile once and it serves for roughing and finishing

Between blocks P and Q you describe the finished part, not the roughing: the cycle takes care of removing layers until it gets there. That means G70 reuses the same profile blocks for the finish pass, which is why the F and S you write inside the contour only take effect in the finishing. Another practical consequence is that the profile has to be monotonic, meaning it always grows or always shrinks in the same direction in X. If it has an undercut or a back relief, standard G71 cannot handle it, and G72 has the same limitation: pockets are done with G71 Type II where the control allows it, with G73, or by machining them separately.

The two U's and the sign of the finish stock

The classic G71 confusion is that the letter U means two things depending on the block: in the first it is the depth of cut measured in radius, and in the second it is the finish stock measured in diameter. And that second U is signed: positive when roughing an outside, because the part has to stay fatter than final size, and negative when roughing an inside, because the hole has to stay smaller. A wrong sign does not trigger an alarm: it lets the roughing eat the finish stock, and the part turns up undersize without anyone knowing why.

Mistakes that cost you a part (or a tool)

  • Putting a Z dimension in the P block of the profile: in the Fanuc format that first block only allows movement in X, and the control throws a cycle format alarm.
  • Giving the U in the second block the opposite sign: on inside work it has to be negative, and with a positive sign the roughing eats the finish stock.
  • Mixing up the U in the first block (depth in radius) with the U in the second (finish stock in diameter): a 2 mm pass in radius is 4 in diameter.
  • Describing a profile with back reliefs or undercuts: standard G71 only handles monotonic contours, and so does G72; for everything else there is G71 Type II where the control allows it, G73, or machining it separately.
  • Starting the cycle right up against the stock: the first pass goes in much deeper than programmed and breaks the insert.
  • Repeating N block numbers in the program: the control looks for the first one it finds and roughs a contour that is not the one you wanted.
  • Copying the cycle between controls without checking the format: on older controls the finish stock values are I and K and the depth is D, and the same figures mean something else.

Frequently asked questions

What is the difference between G71, G72 and G73?

G71 roughs with passes parallel to the Z axis, which is the normal choice for shafts and cylinders. G72 does the same with passes parallel to the X axis, in other words facing, and it suits short, large-diameter parts. G73 repeats the profile while shifting it, and it is the one you use when the stock already has roughly the right shape, as in a casting or a forging.

Do I have to write G70 after G71?

Only if you left finish stock. A G71 with U and W at zero leaves the part at size, but with whatever finish a roughing insert gives you. The normal approach is to rough leaving a few tenths, change tools and call G70 with the same P and Q for the final pass.

Why is the feed I write inside the profile ignored?

Because the roughing cycle uses the F in its own block and saves the F, S and T in the contour for when G70 runs. It is more of an advantage than a problem: it lets you leave the gentle finishing feed written in the same contour without it affecting the roughing.

Can I use G71 for an inside diameter?

Yes, with a boring bar and the start point inside the existing hole. What changes is the sign of the U finish stock, which goes negative, and you have to watch chip evacuation and the bar's overhang, which is what really limits the depth of cut.

What depth of cut should I use?

It depends on the insert, the material and the rigidity of the workholding, not on the cycle. For steel with a normal roughing insert, 1.5 to 3 mm in radius is common, and always below the maximum depth the manufacturer gives for that nose radius. With a long part overhanging, quite a bit less.

Related codes

Other codes in Lathe cycles

See the full list of G and M codes

Related apps