Fanuc Turning Programming (Fanuc-T)
On a lathe the spindle holds the part, not the tool, and that one fact reshapes nearly everything a mill programmer knows. X values become diameters, the default working plane is two axes (X and Z, with Z along the spindle), spindle speed becomes a surface-speed servo loop (G96) rather than a fixed RPM, and every turret station carries its own tool geometry — including a nose radius and a tip orientation that the control must know before it can compensate correctly. This page walks a Fanuc-trained mill programmer through the turning side of the control (the “Fanuc-T” command set on 0i-TF, 30i/31i-B, and their ancestors): diameter programming, the three G-code systems, constant surface speed, the multiple repetitive cycles G70–G76, threading, nose-radius compensation, and the T-word. For the milling-side fundamentals these comparisons lean on, see CNC G-Code Basics.
The disorientation, condensed:
| Mill habit | Lathe reality |
|---|---|
| X/Y/Z, tool spins | X/Z only by default (X = radial, Z = along the spindle); the part spins. Live tooling adds C and Y axes on mill-turn machines |
S = RPM, set once per tool | S = surface speed under G96; RPM changes continuously with X. Clamp it with G50 S_ first |
F in mm/min | F in mm/rev (G99) as the working default |
T_ M06, then G43 H_ | T0101 does it all: turret index + geometry offset + wear offset in one word |
G90 = absolute | In G-code system A, G90 is an OD turning cycle; absolute vs incremental is X/Z vs U/W |
| Cutter comp: radius in a D register | Nose-radius comp needs the radius and a tip-direction number 0–9 per tool |
Diameter Programming
On nearly every production lathe, an X word is a diameter, not a distance from centerline. X50. puts the tool tip 25 mm from the spindle centerline; X0 is dead center. This is a parameter choice per axis (diameter vs. radius programming, bit 3 DIA of parameter No. 1006), but diameter mode is the near-universal factory setting because prints dimension turned parts in diameters. Incremental moves in G-code system A (below) use dedicated addresses instead of G91: U is incremental X (a diameter change) and W is incremental Z. U-2.0 reduces the diameter by 2 mm — the tool physically moves 1 mm.
Three consequences trip up mill programmers:
- Depth of cut is half the X word. A
U0.4finishing allowance leaves 0.2 mm of material on the surface. Cycle words follow the same split: inG71, the per-pass depthUin the first block is a radius value, but the X stock allowanceUin the second block is a diameter value. The manual is consistent about which is which; intuition is not. - Radii and chamfers are programmed as-is, but arc words are not doubled. An arc radius
R5.is a true 5 mm radius even though the X endpoints around it are diameters.I/Karc centers are radius values too. - Macro math sees diameters. A
#-variable holding an X position — a#1passed as an argument, or the system variables for current X position — contains a diameter in diameter mode. Any trig or clearance calculation must divide by 2 to get to centerline geometry, then multiply by 2 to come back to an X word. Forgetting one of those doublings is the classic lathe-macro bug. See Fanuc Turning System Variables for the lathe-side variable map.
A concrete taste of the macro pitfall — splitting stock into equal roughing passes when the stock and target are both diameters:
#1 = 60. ; stock diameter (a DIAMETER)
#2 = 44. ; target diameter
#3 = [#1 - #2] / 2 ; total depth ON THE RADIUS = 8.0
#4 = FUP[#3 / 2.5] ; passes at max 2.5 mm radial depth = 4
#5 = #3 / #4 ; actual radial depth per pass = 2.0
#6 = #1 - 2 * #5 ; X word after pass 1: DOUBLE it back = 56.0
Every mistake in that snippet is a factor-of-two mistake, and it cuts either air or a scrap part. The same discipline applies when reading position system variables into a lathe macro — the X value arrives as a diameter.
One more default worth internalizing: lathes normally run in feed per revolution (mm/rev or in/rev), not feed per minute. F0.25 means 0.25 mm advance per spindle revolution — a sensible unit when speed is constantly changing under G96. In G-code system A that pairing is G99 (per rev, the usual lathe default) and G98 (per minute).
G-Code Systems A, B, C
Fanuc lathe controls ship configured (by parameter) for one of three G-code systems — A, B, or C — that assign different code numbers to the same functions. System A is the classic and by far the most common in the field; system B looks more like a machining center; system C is rarer. The trap for a mill programmer is brutal: in system A, G90 is not “absolute” — it is a one-line OD/ID turning canned cycle. Drop a habitual G90 into a system-A lathe program and the next motion block becomes a four-move box cycle into the part. System A has no absolute/incremental G-codes at all: absolute is X/Z, incremental is U/W, and they can be mixed in one block (X50. W-30.).
| Function | System A | System B | System C |
|---|---|---|---|
| Absolute / incremental input | By address: X Z abs, U W incr | G90 / G91 | G90 / G91 |
| OD/ID turning canned cycle | G90 | G77 | G20 |
| Threading canned cycle | G92 | G78 | G21 |
| Facing canned cycle | G94 | G79 | G24 |
| Feed per minute / per revolution | G98 / G99 | G94 / G95 | G94 / G95 |
| Inch / metric input | G20 / G21 | G20 / G21 | G70 / G71 |
Note the knock-on collisions: in system A, G98/G99 mean feed-per-minute/feed-per-rev — not the canned-cycle return levels they mean on a mill — and in system C even G20/G21 and G70/G71 are reassigned. Everything else on this page is written in system A. The selection lives in bits 6 (GSB) and 7 (GSC) of parameter No. 3401 — both 0 = system A, GSB = 1 → system B, GSC = 1 → system C — the same bits from the 16i/18i-B generation through 30i-B Plus, and a control without the system-B/C option runs system A regardless of the setting. Before running anything on an unfamiliar lathe, check that parameter.
Spindle Control: G96/G97 and G50
G96 S200 commands constant surface speed (CSS): 200 m/min under G21, 200 sfm under G20. The control continuously recomputes RPM from the tool’s current X position so the cutting speed at the tool stays constant — RPM rises as the tool feeds toward center. This is what gives faced surfaces a uniform finish and inserts a predictable life. G97 S1500 is the mill-style mode: a fixed 1500 RPM regardless of position.
Switch back to G97 whenever CSS would misbehave:
- Threading. Thread lead is synchronized to spindle rotation; a changing RPM through the pass distorts the lead. Always thread under G97.
- Drilling and any work at center. As X approaches 0, CSS asks for infinite RPM. Center drilling, drilling, tapping, and reaming on centerline run at a fixed G97 speed.
- Interrupted or fragile setups where an RPM sweep would excite chatter or unbalance.
Because CSS will happily spin a chuck to its commanded maximum as X shrinks, clamp the spindle before enabling G96. In system A that is G50 S_ — a maximum-RPM limit that G96 may not exceed (in systems B/C the clamp is G92 S_). Skipping the clamp on a facing cut with heavy jaws is how parts leave chucks:
G50 S2000 ; never exceed 2000 rpm, whatever CSS asks for
G96 S220 M03 ; constant surface speed 220 m/min, spindle CW
G00 X62. Z2. ; approach
G01 X-1.6 F0.2 ; face to (slightly past) center - rpm rises, capped at 2000
G97 S800 ; back to fixed rpm before center drilling
Historical footnote: on older lathes G50 X_ Z_ also sets the coordinate system (the pre-G54 workshift method). A stray G50 with axis words on such a control rewrites where the control thinks the tool is — more on this under tool offsets below.
Multiple Repetitive Cycles G70–G76
The heart of Fanuc lathe programming. Instead of posting every roughing pass, you describe the finished profile once, between two sequence numbers (P and Q), and a multiple repetitive cycle generates all the roughing passes against it. One profile definition serves both the roughing cycle and the G70 finish pass — edit the profile, and both update.
| Cycle | Name | What it does |
|---|---|---|
| Profile cycles (use a P–Q profile) | ||
G70 | Finishing cycle | Traces the P–Q profile once at finish size, using the F/S programmed inside the profile blocks (which the roughing cycles ignore) |
G71 | Stock removal in turning | Roughs an OD or ID profile with axial (Z-direction) cuts; the workhorse cycle |
G72 | Stock removal in facing | Same idea with radial (X-direction) cuts — for parts that are mostly face |
G73 | Pattern repeating | Offsets the whole profile inward a fixed number of times — for castings/forgings already near shape |
| Grooving / drilling cycles (no P–Q profile) | ||
G74 | End face peck drilling | Peck drilling on centerline, or face grooving with an X word |
G75 | OD/ID grooving | Pecked radial grooving, with optional Z stepover for wide grooves |
G76 | Multiple threading cycle | Complete thread in one command — all passes, depth degression, infeed angle (next section) |
On modern controls (0i, 16i/18i/21i, 30i-series) G71 is a two-block command: the first block sets the per-pass depth U (radius value) and retract R; the second names the profile P/Q, the stock allowances U (X, diameter) and W (Z), and the roughing feed F. The same address U means two different things in the two blocks — the manuals say the control tells them apart “by the presence of addresses P and Q.” The two-block form is older than it looks: the Series 0 lathes of the late 1980s already used it. The one-line format — G71 P_ Q_ U_ W_ I_ K_ D_ F_, with D for the depth of cut and I/K for a roughing allowance — belongs to the Series 10/11/15 lineage, and survives on modern controls only as the “Series 15 (FS15) tape format” option; if you inherit tapes in that shape, that is where they came from. Two profile rules: the first profile block (the P block) must be a G00/G01 move (alarm PS0065 otherwise), and in the basic Type I form it moves in X only — the profile must then be monotonic (steadily increasing or decreasing) in both axes. Type II, selected by putting both X and Z in that first block (W0 if there is no Z motion), permits pockets/valleys in the X direction as long as Z still changes monotonically. Type II was a separate add-on option on the Series 0 era (“multiple repetitive cycle addition”); the 16i/0i/30i manuals document both types as standard.
A complete worked program — roughing and finishing a stepped shaft with a taper and a corner radius from 60 mm bar:
O0071 (G71 ROUGH + G70 FINISH, 60MM BAR)
G21 G40 G99 ; metric, comp cancel, feed per rev
T0101 ; station 1, offset 1 - OD rough tool
G50 S2200 ; spindle clamp before CSS
G96 S220 M03 ; 220 m/min constant surface speed
G00 X62. Z2. M08 ; start point: clear of bar OD and face
G71 U2. R0.5 ; 2.0 mm depth per pass (RADIUS), 0.5 retract
G71 P10 Q20 U0.4 W0.1 F0.3
; profile N10-N20; leave 0.4 on X (DIAMETER),
; 0.1 on Z; rough at 0.30 mm/rev
N10 G00 X20. ; profile start (X only = Type I)
G01 Z-25. F0.15 ; turn 20 dia; this F is used by G70, not G71
X30. Z-40. ; taper up to 30 dia
Z-55. ; turn 30 dia
G02 X40. Z-60. R5. ; 5 mm corner radius
G01 X58. ; face up to 58 dia
N20 X62. Z-64. ; chamfer out past stock - profile end
G00 X150. Z100. ; retract for tool change
T0303 ; station 3, offset 3 - finish tool
G96 S260 ; faster surface speed for finishing
G00 X62. Z2. ; same start point
G70 P10 Q20 ; finish pass traces N10-N20 at F0.15
G00 X150. Z100. M09
M30
Points to notice: the cycle start point (X62. Z2.) defines where every pass begins and returns — it must clear the stock in both axes. Feeds and speeds written inside N10–N20 are ignored during G71 and honored during G70. And nose-radius compensation, if used, is armed before the cycle call and cancelled with G40 after the profile — never inside the N10–N20 blocks (on the 30i series a comp command inside the profile raises alarm PS0325). What the cycles do with it is generation-dependent: the 16i/18i-B and 0i-B manuals state flatly that tool-nose-radius compensation cannot be applied to G71–G76, so only the G70 finish pass is compensated, while the 30i series compensates G70–G73 — roughing passes included. G74/G75/G76 take no compensation on any generation.
The other three follow the same two-block pattern. G72 mirrors G71 with the depth-per-pass and allowance roles rotated 90° (cuts run in X, the profile’s first block moves in Z only). G73 U(i) W(k) R(d) / G73 P Q U W F offsets the entire P–Q profile by the total relief U/W and closes in over R repetitions — efficient only when the blank already resembles the part, wasteful air-cutting on bar stock. G74 and G75 need no profile at all. Peck-drilling on centerline with G74:
T0707 ; drill on centerline
G97 S600 M03 ; fixed rpm - work at center, never G96
G00 X0 Z3. ; on centerline, clear of face
G74 R0.5 ; retract 0.5 between pecks
G74 Z-45. Q8000 F0.12 ; drill to Z-45, 8.0 mm pecks (Q in microns)
G00 Z100.
And a plunge groove with G75 — same grammar rotated into X, and stable across every generation from the Series 0 manuals through 30i-B Plus: G75 R(e), then G75 X(U)_ Z(W)_ P(Δi) Q(Δk) R(Δd) F_. X is the groove bottom, P the X-direction peck; for a groove wider than the insert, add Z for the far wall and Q as the Z stepover between plunges. The second R is a relief at the bottom — leave it out unless you know why you want it (with Z/Q omitted it becomes a signed escape move). Single-plunge form:
T0909 ; 3 mm grooving tool
G97 S900 M03
G00 X52. Z-20. ; above the groove position
G75 R0.3 ; retract between pecks
G75 X40. P2000 F0.08 ; plunge to 40 dia in 2.0 mm pecks
G00 X150. Z100.
Note the recurring convention: in G74/G75/G76, the peck and depth words P/Q are unsigned values in least input increments — microns on a standard metric control — and the manuals are explicit that they take no decimal point (the 16i/18i-B manual lists it as a restriction; the 30i-B Plus format tables mark these words “decimal point input: not allowed”). Q8000 is 8 mm; Q8. out of mill habit is rejected.
Threading with G76 and G92
G76 cuts a complete single- or multi-start thread — every pass, with decreasing depth per pass and an angled (flank) infeed — from two blocks. The first block packs three two-digit values into one P word; the second describes the thread itself. All depths in P/Q here are radius values in microns (no decimal point):
| Word | Block | Meaning |
|---|---|---|
P□□□□□□ | 1st | Three packed pairs: finish-pass repeat count (01–99 spring passes), chamfer/pull-out amount in 0.1×lead units (10 = 1.0×lead; 00 = square shoulder exit), tool/thread angle (60, 55, 30, 29, 80, or 00 for straight-plunge infeed) |
Q | 1st | Minimum cutting depth, microns — the degression floor so late passes still cut a real chip |
R | 1st | Finishing allowance (removed by the spring passes), mm with decimal point |
X Z | 2nd | Thread end point: X = final minor diameter (OD thread), Z = end of thread |
R | 2nd | Taper: X offset (radius) between thread start and end; R0 or omitted = straight thread; negative for a typical OD pipe taper |
P | 2nd | Thread height (crest to root), microns, radius value |
Q | 2nd | Depth of the first pass, microns — subsequent passes degress so each removes roughly constant area |
F | 2nd | Thread lead, mm (= pitch for a single start; lead = pitch × starts for multi-start) |
A complete M20 × 2.5 external thread, using the common practical thread height of 0.613 × pitch ≈ 1.534 mm (minor dia ≈ 16.93):
O0076 (M20 X 2.5 EXTERNAL THREAD)
T0505 ; 60-deg external threading insert
G97 S800 M03 ; FIXED rpm - never thread under G96
G00 X22. Z6. M08 ; start: above OD, >2 leads ahead of the
; thread so the spindle can synchronize
G76 P021060 Q100 R0.05 ; 02 spring passes, chamfer 1.0 x lead,
; 60-deg infeed; min pass 0.10; 0.05 finish
G76 X16.933 Z-28. P1534 Q400 F2.5
; minor dia 16.933, thread to Z-28,
; height 1.534 mm, first pass 0.40, lead 2.5
G00 X150. Z100. M09
M30
That command produces roughly a dozen degressing passes (0.40, then progressively shallower, floored at 0.10) plus two spring passes — all from one call. Keep the RPM low enough that the servo can hold lead through acceleration at the start of each pass; the several-leads air gap before Z0 exists for exactly that.
G92 (system A) is the simpler alternative: one threading pass per block. You choose every depth yourself — more typing, but total control over the pass schedule, and easier to restart mid-thread:
G00 X22. Z6.
G92 X19.2 Z-28. F2.5 ; pass 1 - cycle: infeed, thread, out, return
X18.6 ; pass 2 (G92 stays modal; one word per pass)
X18.1
X17.7
X17.3
X17.05
X16.933 ; final pass at minor diameter
X16.933 ; spring pass
G00 X150. Z100.
Multi-start threads: program F as the lead (pitch × number of starts), then cut each start separately — either by shifting the Z start point one pitch between calls, or with the start-angle word Q (0.001° units, no decimal point, 0–360000: Q180000 for the second of two starts) so every start begins from the same Z. The Q word is documented on G32 and G92 from the 16i/18i generation onward — it is non-modal, so respecify it on every pass — but G76 accepts a start angle only in the Series 15 (FS15) tape format, and the Series 0-era manuals have no Q at all: on those controls, shift the Z start point.
Underneath both cycles is G32 (G33 in G-code systems B and C — the same number the machining-center Fanucs use), the longhand single-motion threading move — one synchronized pass per block with your own approach and retract moves. You will meet it in multi-start work, thread milling posts, and old programs. For tapped holes on centerline (rigid tapping) rather than single-point threads, see Threading & Rigid Tapping.
Nose-Radius Compensation and the Imaginary Tool Tip
A turning insert’s tip is not a point — it is an arc (typically 0.2–1.2 mm radius). When you touch a tool off on a diameter and a face, you actually measure the imaginary tool tip: the sharp corner where the two tangent lines of the nose arc would meet. On straight cuts parallel to X or Z that fiction is exact. On tapers and radii it is wrong — the true contact point walks around the nose arc, leaving tapers under- or over-cut and blending radii out of tolerance by up to the nose radius. A 45° chamfer cut with a 0.8 mm nose and no compensation is off by roughly 0.33 mm on the surface: small enough to miss on a roughing pass, big enough to scrap a fit.
The fix is tool-nose-radius compensation: G41 (tool left of the path, seen along travel direction) / G42 (tool right) / G40 (cancel) — the lathe counterpart of cutter comp. For the usual rear-turret setup, OD turning toward the chuck takes G42 and boring toward the chuck takes G41. Arm it on an approach move before the profile, cancel it on the way out — never mid-profile.
Unlike a mill, the radius alone is not enough. The control must also know which way the tip points — where the imaginary tip sits relative to the nose-arc center — via the tip-direction number 0–9 stored with the tool:
| Tip No. | Imaginary tip points toward… | Typical tool |
|---|---|---|
3 | X− and Z− — tip below-left of the arc center: toward the centerline and toward the chuck | OD turning / facing tool, rear turret — the most common by far |
2 | X+ and Z− — away from centerline, toward the chuck | Boring bar cutting toward the chuck |
4 | X− and Z+ — toward centerline, toward the tailstock | OD back-turning tool (cutting away from the chuck) |
1 | X+ and Z+ — away from centerline, toward the tailstock | ID back-boring toward the tailstock |
5 | Squarely +Z only — straight toward the tailstock | Grooving, parting, and face-grooving tools touched off on one edge: the number is the single axis direction from the nose-arc center to the measured edge. Per the manual’s chart: 5 = +Z, 6 = +X, 7 = −Z, 8 = −X — e.g. a rear-turret OD grooving tool touched on its tip diameter is an 8 |
6 | Squarely +X only — straight away from the centerline | |
7 | Squarely −Z only — straight toward the chuck | |
8 | Squarely −X only — straight toward the centerline | |
0 / 9 | No direction — the measured point IS the arc center | Tools touched off at the radius center (round inserts, some probed setups) |
Both values live in the tool geometry offset table: the nose radius in the R column and the tip number in the T column of the offset page. A correct radius with a wrong tip number is worse than no compensation — the control offsets confidently in the wrong direction. The number-to-direction chart above is drawn identically in the lathe manuals from the Series 0 through 30i-B Plus, so it is safe to memorize — but it is defined in the control’s +X/+Z sense, so on a front-turret machine (X positive toward the operator) the physical picture mirrors. One related trap on machines with separate geometry and wear offset numbers: bit 7 (WNP) of parameter No. 5002 decides whether the geometry or the wear offset number supplies the tip direction.
Tool Offsets and the T-Word
There is no M06 and no G43 on a typical lathe. The T-word does everything: T0101 indexes the turret to station 01 and activates offset pair 01 — first two digits station, last two the offset number. The offset number activates both a geometry offset (where the tool tip is, X and Z, set at touch-off) and the matching wear offset (small corrections the operator dials in as inserts wear and parts drift). Convention is offset number = station number, but they need not match — T0111 runs station 1 with offset 11, a standard trick for using one tool with two different touch-off references. T0100 (offset 00) indexes station 1 and cancels offsets — which is also how you safely cancel geometry before a tool change on some setups.
The touch-off workflow, per turret station: cut (or touch) the OD, measure the diameter, enter it as the tool’s X measured value on the geometry page (the control back-computes the offset — in diameters, of course); touch the face that will be Z0, enter Z0 (or the stock-to-remove value). Repeat per tool. Nose radius R and tip number T go on the same geometry line, as above.
Where does the part zero itself live? Two schemes coexist in the Fanuc lathe world:
- Geometry-offset-centric (traditional). Each tool’s geometry offset carries the full distance to the part zero; there is no separate work offset in play, plus optionally a single common work shift value (a Z shift on the work-shift page) that moves the zero for the whole tool set when the facing stock changes. Older programs may also carry the pre-offset-table
G50 X_ Z_coordinate-set method — recognize it, do not imitate it. - G54–G59 (mill-style). Modern controls (0i, 30i-series) support the standard work coordinate systems on the turning side too. Shops standardizing across mills and lathes increasingly put the part zero in
G54and keep tool geometry purely about the tool. Both schemes work; mixing them without understanding doubles-up offsets and crashes turrets.
A typical safe per-tool skeleton ties the pieces of this page together — index with offsets active, set the spindle mode for the operation, and return to a known tool-change position (lathes generally use an absolute clearance position rather than a mill-style G28 before every index):
(PER-TOOL BLOCK TEMPLATE)
G00 X150. Z100. ; known clearance position for turret index
T0303 ; index station 3, activate geometry+wear 3
G50 S2500 ; rpm clamp (before G96, every tool)
G96 S240 M03 ; or G97 S_ for center work / threading
G00 X_ Z_ M08 ; approach the work
... ; cutting moves / cycles
G00 X150. Z100. M09 ; back to clearance before the next T-word
▶ Try the math in the Macro Playground — the playground’s Fanuc control runs the same #-variable macro arithmetic used in lathe macros. Prototype the diameter/radius conversions (halve an X, compute a pass depth, double it back) and watch the variables update live before trusting them at the machine.
See also: Fanuc Turning System Variables for the lathe-side #-variable map, Threading & Rigid Tapping for tapped holes and thread-milling, CNC G-Code Basics for the shared ISO foundation, and Fanuc System Variables for the milling-side variable reference these lathes descend from.
References
- FANUC, Series 30i/31i/32i-MODEL B Plus Operator’s Manual, B-64724EN/01 (Common; G-code system A/B/C table) and B-64724EN-1/01 (Lathe System volume; G70–G76, threading, tool-nose radius compensation).
- FANUC, Series 30i/31i/32i-MODEL B Plus Parameter Manual, B-64730EN/01 (Nos. 1006, 3401 GSB/GSC, 5002 WNP, 5004 ORC).
- FANUC, Series 16i/18i-TB Operator’s Manual, B-63524EN/01, and Series 0i-TB Operator’s Manual, B-63834EN/01 (legacy-generation cycle restrictions, start-angle Q).
- GE Fanuc, Series 0 Operator’s Manual (Lathe), GFZ-61394E/08, and Series 15-B Programming Manual (Lathe), GFZ-62554E/01 (two-block vs. one-block G71 formats).
- Peter Smid, CNC Programming Handbook, 3rd ed., Industrial Press, 2008.
Have a question or want to contribute?
Contact us with corrections, additions, or topics you'd like covered.
Get in Touch