Skip to content

G70 / G71 / G72 / G73: the roughing and finishing family

These four codes are the heart of turning on Fanuc and Haas: you describe the finished profile of the part once and the cycle generates all the roughing passes on its own. G71 roughs in the longitudinal direction, parallel to the Z axis; G72 roughs in the facing direction, parallel to X; G73 repeats the profile while shifting it, which is what works for forged or cast parts where the stock already looks like the part; and G70 takes the finish pass following exactly the same profile. All four rely on the profile blocks marked off by P and Q.

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 equivalences
Machine
Turning, Mill-turn
Risk
High
Example
G71 ... / G70 P... Q...

Syntax by control

Fanuc with two-line format (series 0, 16, 18, 21, 30)
G71 U2. R0.5 ; G71 P10 Q20 U0.4 W0.1 F0.25
The first line defines the depth of cut and the retract, the second which blocks make up the profile and how much finish stock to leave. It is the most common format in shops.
Fanuc with one-line format (series 10, 11, 15)
G71 P10 Q20 I0.4 K0.1 D2000 F0.25
Same cycle with different letters and not split into two blocks. Your control accepts one of the two formats, not both: check which one in the G-code list in the manual before you copy a program from another machine.
Haas (lathe)
G71 P10 Q20 D2. U0.4 W0.1 F0.25
Haas accepts both the two-block format and this form with D for the depth of cut. It is not identical to Fanuc in every parameter, so a program that came from a Fanuc should be reviewed block by block before you press cycle start.
G70 (finishing, all controls)
G70 P10 Q20 F0.12
G70 runs the same blocks from P to Q and leaves the part at size, taking the feed and speed in those blocks if they have them. That is why it is common to write the finishing F and S inside the profile itself.
Siemens 840D / 828D
CYCLE95("PERFIL",2,0.4,0.1,,0.25,0.12,,9,,,)
Siemens has no G71: the equivalent cycle is CYCLE95, which takes the name of the subprogram with the contour and a machining type number that decides whether it roughs longitudinally or on the face and whether it finishes. The parameters change with the version.

Address letters used with it

LetterWhat it setsUnit
PBlock number where the description of the finished profile starts. The first block of the profile can only move in one axis, depending on the cycle: only X in G71 and only Z in G72.N block number
QBlock number where the description of the profile ends. Everything between P and Q is used as geometry and is not run as written during the roughing.N block number
U (first line of G71) / W (first line of G72)Depth of each roughing pass. In G71 it is U, on the radius; the first line of G72 is G72 W... R..., and W is the depth in Z. This is the parameter that sets how many passes the cycle will take and how hard the insert works.mm, on the radius (U in G71) or in Z (W in G72)
R (first line)Amount the tool retracts from the material at the end of each pass before going back to the start. A small value saves time; too small and the insert rubs on the profile on the way back.mm
U (second line)Finish stock left in X, measured in diameter and signed: positive for outside work and negative for inside work. This is the sign that causes the most mistakes.mm, in diameter
W (second line)Finish stock left in Z. It is usually quite a bit smaller than the X value because faces finish with less material.mm
F / S / TFeed, speed and tool for the roughing. In G71 and G72, any F and S written inside the profile blocks are ignored during roughing and only apply in the G70 finishing cycle.mm/rev, rpm or m/min, number
R / U / W in G73In the pattern repeating cycle, U and W are the total amount of material to remove on each axis and R is the number of divisions, that is, of repeats of the profile. The logic is different from G71, even though the letters are the same.mm and integer

Worked example

Roughing and finishing the outside profile of a stepped steel shaft, starting from Ø50 mm bar stock. The profile has a lead-in chamfer, a Ø30 section, a taper and a Ø45 section. It is roughed with a roughing insert and finished with a small-radius insert, reusing the same profile description for both operations.

O0710 (EJE ESCALONADO CON G71 Y G70)
( Program header. )
G21 G40 G99
( Millimeters, no tool nose radius compensation and feed per revolution. )
T0101
( Outside roughing insert with its offset. )
G50 S2500
( RPM limit, essential before turning on constant surface speed. )
G96 S200 M03
( Constant surface speed at 200 m/min. The control will raise the RPM as the diameter drops, up to the limit set by G50. )
G00 X52. Z2. M08
( Start point of the cycle: outside the stock and slightly ahead of the face. From here the cycle calculates all the passes. )
G71 U2. R0.5
( First line: 2 mm depth per pass in radius and 0.5 mm of retract at the end of each one. )
G71 P10 Q20 U0.4 W0.1 F0.25
( Second line: the profile sits between N10 and N20, it leaves 0.4 mm in diameter for finishing in X and 0.1 mm in Z, and it roughs at 0.25 mm per revolution. )
N10 G00 X28.
( First block of the profile. In G71 it can only move in X: put a Z here and the control throws an alarm. )
G01 Z0. F0.12
( Reaches the face. The roughing does not use this F0.12; only the G70 finishing cycle does. )
G01 X30. Z-1.
( 1 mm lead-in chamfer at 45 degrees. )
G01 Z-25.
( Cylindrical section at Ø30. )
G01 X40. Z-40.
( Taper between the two diameters. )
G01 X45.
( Steps up to the larger diameter. )
N20 G01 Z-60.
( Last block of the profile, marked with the N that the cycle's Q points to. )
G00 X100. Z50.
( Retract to a safe position after roughing. )
T0303
( Change to the finishing insert with its own offset. )
G96 S260 M03
( Higher cutting speed for finishing. )
G00 X52. Z2.
( Back to the same start point: G70 expects to find itself there. )
G70 P10 Q20
( Finishing along the same blocks N10 to N20, this time with the F0.12 the profile carried inside. )
G00 X100. Z50. M09
( Final retract and coolant off. )
M05 M30
( Spindle stop and end of program. )
Open the simulator to check the example

Practical keys to using G70/G71/G72/G73 in the workshop

Which of the four fits each part

G71 roughs with passes parallel to the Z axis and it is the one used on most shafts and bushings, where the material comes off lengthwise. G72 does the same with passes parallel to X, and it is the right choice for large-diameter, short parts, where roughing longitudinally would mean a huge number of very short passes. G73 does not cut in parallel layers: it repeats the whole profile several times, each one shifted, which is why it suits stock that already has the approximate shape of the part, as in a forging or a casting. G70 does no roughing at all: it is the finish pass over the profile already described.

How to describe the profile between P and Q

The blocks between P and Q are not normal motion commands: they are the geometry of the finished part, and the cycle reads them to calculate the passes. That leads to several rules the control enforces. The first block can only move in one axis, the one that matches the cycle type. The profile has to be monotonic in the machining direction unless you use the variants that allow undercuts. And any F, S or T inside are ignored during roughing. It is the place to write the finishing feeds, because those are the ones G70 will apply.

The sign of U and the direction of the finish stock

The U on the second line is the finish stock in X and it goes in diameter, signed. On outside work it is positive, because you have to leave material outside the final profile; on inside work it is negative, because the extra material is on the inside. Getting the sign wrong is one of the most expensive failures with these cycles, because it gives no alarm: the cycle runs, but it leaves the finish stock on the other side and the finish pass either eats 0.8 mm too much in diameter or does not touch the part. On inside work you should also check the start point, which has to be inside the hole and not outside it.

Mistakes that cost you a part (or a tool)

  • Putting a move in Z in the first block of a G71 profile: the control throws a format alarm and the program stops before it starts.
  • Giving the U on the second line the wrong sign on inside work: the cycle leaves the finish stock on the wrong side and the finish pass wrecks the dimension.
  • Mixing up the U on the first line, which is depth of cut, with the U on the second, which is finish stock: same letter with two different meanings.
  • Writing the finishing feed outside the profile and expecting G70 to use it: the finish pass takes the F it finds inside blocks P to Q or whichever one is active.
  • Placing the start point of the cycle touching the stock instead of outside it: the first pass goes in deeper than planned.
  • Repeating the N numbers of the profile blocks elsewhere in the program: the control looks for the first matching N and can end up somewhere else.
  • Using G73 on straight bar stock and wasting time: repeating the profile in air when there is 20 mm of material to remove is much slower than G71.

Frequently asked questions

What is the difference between G71 and G72?

The direction of the passes. G71 roughs with passes parallel to the Z axis, stepping down in depth across the diameter, and it is the natural choice on long parts. G72 roughs with passes parallel to the X axis, in other words facing layer by layer, and it suits large-diameter, short parts such as a flange. The profile description is the same; what changes is how the material comes off.

Do I have to repeat the profile for finishing?

No, and that is the whole point. G70 uses exactly the same P to Q blocks the roughing used. You change the tool, set the finishing speed, go back to the same start point and call G70 with the same block numbers. If you duplicate the profile, any later correction has to be made in two places and sooner or later one will get missed.

How much finish stock do I leave in U and W?

Typical values are 0.3 to 0.6 mm in diameter for X and 0.05 to 0.15 mm for Z. You have to leave more in X because the stock is split across the two sides of the diameter and because roughing deviations are larger radially. On slender parts you should raise it, because the part deflects during roughing and the finish pass needs material to remove along the full length.

Why does the cycle ignore my F and S inside the profile?

Because during roughing the cycle runs on its own values: the profile blocks are geometry, not commands. Any F and S you put inside are kept for when that same profile is actually run with G70. It is a design decision in the cycle, not a fault, and it explains why so many people write the finishing feeds inside the contour.

Can I use them with profiles that have undercuts?

It depends on the control. Older generations demand a monotonic profile, with no diameter going backward, and they alarm if they find one. Modern ones have type II variants that allow undercuts, with conditions of their own. If your part has a groove, check in the manual which type your control supports and, if it does not support it, machine the groove separately with a grooving tool.

Related codes

Fanuc G71.7-G76.7G96/G97G50G76Haas G70/G71/G72 mill

Related apps