Everything you need to know about

G71 roughing cycle on a CNC Lathe

The G71 roughing cycle enables us to remove material quickly on a CNC Lathe while also writing the cutter path as a subroutine that can be reused during the finishing cycle (G70)

The above video lesson is covered in much greater detail in my CNC Lathe programming course available here

G71 roughing cycle

G71 roughing cycle

Before we look at an example program of the G71 roughing cycle, let's take a look at the G71 line of G-Code and what each part does. Below is a brief explanation of how we can control this cycle.

Feel free to download the infographic here as a reference.

G71 U(1) R;
G71 P Q U(2) W F

G71 - ROUGHING CYCLE
U(1) - DEPTH OF CUT
R - RETRACT VALUE
P - FIRST LINE OF SUBROUTINE
Q - LAST LINE OF SUBROUTINE
U(2) - AMOUNT LEFT ON FOR FINISHING IN X
W - AMOUNT LEFT ON FOR FINISHING IN Z
F - FEED RATE

G71 is our G-Code that lets the controls know that we wish to use a roughing cycle and that the following information applies to that.

The U on the first line of code is the depth of cut of each roughing pass. The R refers to how far the tool will retract from the part in X when returning in rapid to the start of the cycle.

The 'P' and 'Q' values define the start and end point of our subroutine respectively. These values can be any 3 digit value as long as it matches the 'N' numbers of the subroutine. This is easier to explain with examples.

N100;
SUBROUTINE OF PROFILE;
N200;

In the above example, 'P' would be P100 and 'Q' would be Q200 so they match the 'N' numbers.

The 'U' on the second G71 line tells the machine the amount we wish to leave on for a finishing pass in X while the 'W' is the finishing allowance in Z.

Finally 'F' is our feed rate.


G71 Program example

G71 Program example

G71 U1.0 R1.0;
G71 P100 Q200 U0.2 W.05 F0.2;
N100 G00 X19.0;
G01 G42 Z0.0 F0.2;
X20.0 Z-0.5;
Z-20.0;
X40.0 Z-30.0;
Z-65.0 ,R5.0;
X60.0;
N200 G40 X70.0 Z5.0 F200;


G71 U1.0 R1.0;

This first line tells us that we are taking 1.0mm cuts (U) and the tool is retracting 1.0mm after each cut (R)

G71 P100 Q200 U0.2 W.05 F0.2;

We state the beginning of the subroutine profile that we wish our roughing tool to follow, P100 tells the controls to look for N100 and start reading from that point. Q200 tells the machine to stop reading the subroutine when it reads N200.

N100 G00 X19.0;

N defines the first line of the subroutine, the following code is the profile of the part that we wish to cut. G00 X19.0 moves the tool into the start position to machine the 45 degrees chamfer at the front of the part. (The Z position is assumed to be already given in the program at a previous point)

G01 G42 Z0.0 F0.2;

G01 selects linear feed rate movement, G42 turns on tool nose radius compensation, Z moves the tool to the front of the part (We are assuming the datum or zero point is at the front face of the job) and finally, we give a feed rate of 0.2mm per revolution.

X20.0 Z-0.5;
Z-20.0;
X40.0 Z-30.0;
Z-65.0 ,R5.0;
X60.0;

These blocks of G-Code tell the machine the shape of the profile that we wish to cut.

N200 G40 X70.0 Z5.0 F200;

We finish the block off by giving the 'N' number that we have chosen to designate the end point of the subroutine. G40 turns off our tool nose radius compensation, Z5.0 moves our tool to 5mm away from the front face of our part so that it is clear for when we rapid away to the home position and a fast feed rate. This line can also be programmed using a G00 rapid move.


G71 Single-line roughing cycle

G71 Single line roughing cycle

Some older machines don't understand the two-line G71 cycle. When programming these machines, we would use the single-line version. Let's take a look at how we work with the single line cycle.

G71 P Q D U W I K F

G71 - ROUGHING CYCLE
P - FIRST LINE OF SUBROUTINE
Q - LAST LINE OF SUBROUTINE
D - DEPTH OF CUT
U - AMOUNT LEFT ON FOR FINISHING IN X
W - AMOUNT LEFT ON FOR FINISHING IN Z
I - FINAL DEPTH OF CUT IN X
K - FINAL DEPTH OF CUT IN Y
F - FEED RATE

G71 As before, we start off our cycle by issuing a G71 command to let the machine know that we are intending to use a roughing cycle.

P and Q work the same way as the two-line version, P references the start of the subroutine and Q references the end.

D is the depth of cut of each pass, this is the amount of material that we remove on each pass of our tool over the surface of the part.

U is our finishing allowance in X, the amount of material we leave on for our finishing tool to remove from the diameters in the finishing operation.

W is our finishing allowance in Z, the amount of material we leave on for our finishing tool to remove from the lengths in the finishing operation.

I This cycle allows us to take a smaller cut on the final pass, we set this for the X-axis by using the I word.

K allows us to take a smaller final depth of cut in Y.

F defines the roughing feed rate.


G70 finishing cycle, calling the subroutine

G70 finishing cycle subroutine

Because we used a subroutine during writing our roughing cycle, writing the finish pass is extremely simple

G70 P100 Q200;

It's as easy as that.

This single line of code tells the machine that we wish to use a finishing cycle (G70) and that the tool should follow the path of the subroutine that can be found between the N100 and N200 within our program. We can even call a separate program instead of a subroutine, but that's a lesson for another article.





Share this article

For a complete tutorial on CNC Lathe Programming check out my course.

The quickest way to learn CNC Programming