G71 Rough Turning Cycle Simulator and NC Code Generator (FANUC Lathe)

14 July 2026

Mentor CNC Editör Ekibi

G71 Type I / Type II Rough Turning Simulator

V3: separate radius / chamfer / straight options at the entry and exit of every stage. The profile no longer tapers by mistake; square shoulders stay square.
MENTOR CNC • TRAINING TOOL
Detected profile
Pocket / neck
0
local concave region
Rough cuts
0
0 radial levels
Status
waiting for input
Cutting simulationReady
Raw / remaining stockFinish profileCutting moveRapid move
FANUC G71 sample program
What changed in this version? The simulation now treats the profile section as a linear contour + stock section, closer to CAM logic. Square shoulders no longer look tapered, a radius breaks only the intended corner of the shoulder, and regions that must not be cut are protected more accurately.
Disclaimer: This tool is for training and toolpath visualisation. Before the generated sample program is used on a real machine it must be checked by a qualified person against the control model, machine builder options, tool orientation, offsets and clamping conditions, and proven in single block, at low feed, with graphics and a dry run.

With this free G71 rough turning simulator and NC code generator you can enter the raw stock diameter, profile stages, depth of cut and finish allowances, watch the live toolpath simulation and instantly generate FANUC 0i-TC compatible ready-to-run G-code (G71 + G70). For the theory see our G71 Rough Turning Cycle guide, for castings and forgings the G73 Pattern Repeating Simulator, and for facing the G72 Face Roughing Simulator. For the fundamentals behind the cycles also see our G0/G1 Basic Moves Simulator.

What the G71 rough turning cycle does and when to use it

G71 is the FANUC longitudinal (Z-direction) rough turning cycle. You define the finished profile once; the control removes everything between the stock and that profile in Z-parallel layers of the depth you set, retracts at 45° after each pass and steps down to the next level. G70 then traces the same profile blocks once more at the finishing feed. It is the most used canned cycle in CNC lathe programming: every shaft, stepped spindle and bush whose length exceeds its diameter is roughed with it.

G71 (longitudinal)G72 (facing)G73 (pattern)
Cutting directionAlong ZAlong XParallel to the profile
Depth addressG71 U(Δd)G72 W(Δd)G73 U(Δi) W(Δk) R(d)
Typical partShafts longer than their diameterShort, large-diameter flanges and discsCastings and forgings close to final shape
Tool on this siteThis simulatorG72 SimulatorG73 Simulator

How to use the simulator step by step

  1. Control group and G71 type: pick "0i-D and newer" for a current control, or "0 / 00 / 0i-C / 21i" for an older one; the difference shows up in Type II support and the pocket limit. Leave the G71 type on "Auto detect" and the simulator tells you from the profile whether Type I or Type II is needed.
  2. Stock diameter and machining length limit: the stock diameter sets the cycle start X (the tool starts at stock + 4 mm). The length limit is the maximum the stage lengths may add up to; enter the safe distance to the chuck jaws.
  3. U depth, R retract, F: U is the radial depth of each layer; 1.5–2.5 mm in steel on a mid-size lathe, up to 3 mm in aluminium. R is the 45° retract at the end of each pass (0.5–1 mm). F is the roughing feed in mm/rev; 0.2–0.3 is typical.
  4. Finish allowance on diameter U and on length W: U is a diameter value: U0.5 leaves 0.25 mm on the radius. W is usually 0–0.2 mm. If you set both to zero, G70 is not needed; the tool still writes it, so delete that line.
  5. Part profile (stage table): each row is one stage; equal start and end diameters make a cylinder, different ones a taper. Every stage can have its own radius or 45° chamfer at the entry and at the exit. Add rows with "+ Add stage", delete with ×. The three presets (Type I shaft, Type II spool, radius + chamfer) are a good starting point.
  6. Read the message box: a red box stops the simulation (profile larger than the stock, stage lengths over the limit, Type I forced on a profile that reverses). A yellow box is information (Type II option warning, W0 reminder). When the box turns green the program is ready to copy.
  7. Start the simulation: red lines are completed roughing passes, the dashed orange line is a rapid move, the blue contour is the finish profile. The "Rough cuts" counter at the top right shows how many radial levels are opened; change the depth of cut and watch that number move.

Type I or Type II? How the simulator decides

There is one rule: if the X diameter changes in one direction only along the profile (monotonic) it is Type I; if it reverses anywhere it is Type II. On the spool profile the diameter drops from Ø70 to Ø38 and rises back to Ø70, so X reverses; the simulator reports "1 X direction change, Type II". On the shaft profile the diameter only grows, so Type I is enough.

Type IType II
Pockets / necks in the profileNot allowedAllowed (max 10 on 0i-C)
Move in the P blockX only (e.g. N100 G0 X28)X and Z together, with W0 (e.g. N100 G0 X70 W0)
Finish allowance WFreeMust be zero, otherwise stock is left on pocket walls
Control supportAll FANUCStandard from 0i-D; an option on 0i-C and older series
ToolStandard roughing toolA tool with side clearance that can cut the pocket wall (e.g. 35° insert)

The parameter-level details of Type I/II and the differences between control generations are in the G71 Rough Turning Cycle guide; this page covers only what you need to understand the simulator's behaviour.

Stage logic: how to fill in the profile table

The simulator takes the profile stage by stage from the face towards the chuck, as on the drawing. Z zero is the face; as stage lengths add up, Z goes negative. The example spool:

StageStart ØEnd ØLengthEntryExitZ range
1707010StraightStraight0 → −10
2383840Radius 2Straight−10 → −50
3707015StraightStraight−50 → −65

An entry radius sits on the small-diameter side of the shoulder where the stage begins; an exit chamfer or radius sits on the large-diameter side of the shoulder where the stage ends. A radius or chamfer cannot be larger than the shoulder height (half the difference of the two diameters); exceed it and the tool shows a red warning. For a taper enter different start and end diameters; the tool writes the G1 X.. Z.. block itself.

Reading the generated program

G71 U(Δd) R(e) ;
G71 P(ns) Q(nf) U(Δu) W(Δw) F(f) ;
N(ns) ...   ← profile blocks (G0/G1/G2/G3)
N(nf) ...
G70 P(ns) Q(nf) ;
AddressSimulator fieldNote
Δd (U, first block)U depth of cut (radial)radius value, mm
e (R, first block)R retract45° pull-back
ns / nfAutomatic: N100 … Nlastfirst and last profile block
Δu (U, second block)Finish allowance on diameterdiameter value; negative for bores
Δw (W, second block)Finish allowance on length0 for Type II
fF mm/revan F inside the P–Q blocks is ignored during roughing

The same letter U means two different things in the two blocks: depth of cut (radius) in the first, finish allowance (diameter) in the second. Mixing them up is the most common mistake when editing generated code by hand.

Worked example: spool from Ø84 bar, Type II

The three-stage spool above; Ø84 stock, 2 mm depth of cut, 0.8 mm retract, 0.5 mm finish allowance on diameter, 0 on length, roughing feed 0.22 mm/rev. This is what the simulator generates from the "Type II spool" preset:

O0071
G21 G18 G40 G99
G50 S2500
T0101 M08
G96 S180 M03
G0 X88 Z2.
G71 U2 R0.8
G71 P100 Q160 U0.5 W0 F0.22
( TYPE II - X AND W0 IN THE FIRST P BLOCK )
N100 G0 X70 W0.
N110 G1 Z-10
N120 G1 X42
N130 G2 X38 Z-12 R2
N140 G1 Z-50
N150 G1 X70
N160 G1 Z-65
G70 P100 Q160
G0 X124 Z100.
M09
M05
M30

Reading notes: the cycle starts at G0 X88 Z2. and returns there after every pass, so that point must be outside the stock. Stock radius 42, smallest profile radius 19 plus 0.25 allowance: (42 − 19.25) / 2 ≈ 11–12 radial levels, which the tool shows under "Rough cuts". N100 G0 X70 W0. is the Type II signature; in Type I the same block would contain X only. Because the Ø38 neck sits between two Ø70 shoulders, X reverses and the control clears the pocket with Type II logic, cleaning the neck wall with the tool's side clearance.

Typical alarms and fixes

AlarmCauseFix
PS0061 P or Q not specifiedP/Q missing in the second G71 blockWrite the ns and nf block numbers
PS0062 Depth of cut zero or negativeU0 or no U in the first blockEnter U as a positive radius value
PS0063 Sequence number not foundThe N number in Q does not exist or is written differentlyMatch Q with the N of the last profile block
PS0064 Profile not monotonicA pocket in the profile while running Type ISwitch to Type II (add W0 to the first block) or machine the pocket separately
PS0065 Improper command in the P blockThe ns block does not start with G0 or G1The first profile block must be G0 or G1
PS0066 Unallowed G code between P and QG70–G76, G96/G97, subprogram calls etc. inside the profile blocksUse only G0/G1/G2/G3 (and G41/G42) in the profile
Tool rapids into the stockCycle start point is inside the stockStart at stock diameter + 2–4 mm, Z+1–2

Six common mistakes

  • Putting Z in the ns block in Type I. N100 G0 X28 Z0 either raises PS0065 or makes the control treat the cycle as Type II. Type I: X only. Type II: X and W0.
  • Leaving U positive on a bore. For internal work the finish allowance must stay inside the hole: U-0.4. A positive value leaves the bore oversize.
  • Running G70 with the roughing tool. For a separate finishing tool retract after G71, call the new tool, return to the start point, then program G70.
  • Writing F only in the profile blocks. Roughing uses the F in the second G71 block; an F in the profile applies to G70 only. Write both.
  • No speed clamp with G96. In constant surface speed the rpm shoots up on small diameters. Every program needs a G50 S2500-type clamp; the tool writes it automatically.
  • Type II without a radius on the pocket wall. The sharp corner at the bottom of the neck does not fit the insert nose; give the stage an entry radius or clean the corner afterwards with a grooving tool.

Frequently asked questions

What happens when the stage lengths do not add up to the machining length limit?

If the total exceeds the limit the tool stops with a red warning. If it is shorter, the simulation runs only over the profile you entered and the rest of the length is left uncut; that is an information notice, not an error.

My older control has no Type II option. How do I rough a spool profile?

Split the job: rough the Ø70 outside diameter and the shoulder down to Ø38 with Type I, then clear the neck with the G75 grooving cycle. When you select the 0i-C control group the tool shows this warning in the yellow box.

Can I use this simulator for internal (bore) work?

The tool is designed for external profiles. The logic for a bore is the same; the differences are a start point smaller than the bore diameter, a negative finish allowance U, and a smaller depth of cut to suit the boring bar. Adapt the generated program at those three points by hand.

How do I choose the depth of cut?

Machine power and the insert set the limit. Check the required power with the Spindle Torque Calculator and speed and feed with the Lathe Speed and Feed Calculator. Changing U in the simulator and watching the "Rough cuts" count fall is the quickest way to estimate cycle time.