Tool-Length & Cutter Compensation
A CNC program describes where the edge of the part should be, but the machine only knows where its spindle face and axis centerline are. Tool compensation is the bridge. Two independent systems do the work: tool length compensation (G43/G44/G49) tells the control how far the cutting tip sticks out below the spindle, and cutter radius compensation (G40/G41/G42) tells it how far the tool center sits from the finished surface. Get either one wrong and you crash, air-cut, or machine the part oversize. This page covers both from the ground up, the classic Fanuc offset memory types, tool-nose-radius comp on lathes, and how each major control stores the numbers.
Left: each tool’s H offset is measured from the spindle gauge line to the tip, so a long and a short tool both land on the same programmed Z. Right: with G41, the cutter center rides one radius (D) to the left of the programmed path.
Tool Length Compensation (G43 / G44 / G49)
Every tool in the carousel is a different length. A stub drill might stick out 60 mm below the spindle gauge line; a long end mill 180 mm. Without compensation you would have to re-post the program for every tool. Instead, each tool’s length lives in a numbered offset register, and one code — G43 H__ — shifts the entire Z coordinate system so that programmed Z values refer to the tip of the tool rather than the spindle.
The gauge line and what the offset measures
The gauge line is the reference plane on the spindle (or the toolholder taper) from which every tool length is measured. The tool length offset is the distance from that gauge line to the cutting tip. There are three common ways to establish it: a tool presetter (an off-machine optical or contact gauge that measures the assembly and prints a number you type into the offset table), a manual touch-off (jog the tip down to a known surface — a gauge block or the part top — and let the control compute the offset), or an in-machine tool-setting probe (a table-mounted touch trigger the tool touches automatically, writing the measured length straight into the register).
How H selects the offset, and why G43 is needed
The H address is the offset number, not the tool number — though by near-universal convention operators set them equal (tool 1 uses H01). G43 applies the offset in the positive direction (the normal case: the tool is longer, so Z is shifted up and away from the part). G44 applies it negative and is rarely used. G49 cancels length compensation entirely. Until you command G43 H__, the control assumes the tool has zero length — so a programmed Z0 puts the spindle gauge line at the part surface, driving the tool deep into the part. This is the single most common length-comp crash.
Geometry vs wear
Most controls split each length offset into two parts. The geometry value is the physically measured length from setup — the “normal” condition. The wear value is a small deviation added on top: for actual tool wear, for a resharpened tool, or to nudge a hole a few microns deeper. The rule of thumb from the shop floor is to touch geometry only at setup and make all running adjustments in wear — that way the original measured number is never lost. The control adds geometry + wear internally to get the active offset.
Worked snippet
T01 M06 (LOAD TOOL 1 - SPINDLE AT GAUGE LINE, NO LENGTH YET)
G90 G54 G00 X0 Y0 (ABSOLUTE, WORK OFFSET, RAPID TO XY)
G43 H01 Z25.0 M08 (APPLY TOOL 1 LENGTH, RAPID TO Z25 ABOVE PART, COOLANT ON)
G01 Z-5.0 F250.0 (FEED TO DEPTH - Z NOW MEANS THE PART SURFACE)
...
G00 Z25.0 (RETRACT CLEAR)
G49 (CANCEL TOOL LENGTH OFFSET BEFORE THE NEXT TOOL)
Note that G43 and the H word appear together on the first Z motion after the tool change — the control applies the offset as it makes that move. Many programmers also put G49 in the safe-start line at the top of the program so no leftover offset from a previous run is active before the first tool is set.
Cutter (Radius) Compensation (G40 / G41 / G42)
An end mill removes material a full radius away from its centerline. If you program the tool center along the part outline, you machine the part undersize by one radius all the way around. Cutter compensation solves this: you program the finished contour, tell the control which side of the line the tool rides on, and it automatically offsets the toolpath by the radius stored in the D register. The huge practical benefit is that one program runs correctly with a 10 mm cutter or a resharpened 9.8 mm cutter — you only change the offset value.
Left, right, climb, and conventional
G41 offsets the tool to the left of the programmed direction of travel; G42 offsets it to the right. Which one you want depends on whether the tool is inside or outside the contour and on the spindle direction. For a standard right-hand (clockwise) cutter, G41 generally produces climb milling (the preferred finish cut on rigid machines) and G42 produces conventional milling. The reliable way to decide: stand behind the tool looking in the direction it moves — G41 shifts it to your left hand. G40 cancels compensation.
Lead-in, lead-out, and why comp needs a linear move
Compensation cannot switch on or off instantaneously — the control needs a move to ramp the tool from the programmed line out to the offset line. That activating move must be a straight line (G00/G01) of at least one tool radius, made off the part, called the lead-in. Cancelling works the same way in reverse: the lead-out is a linear move clear of the finished surface where G40 ramps the tool back to center. Activating or cancelling comp on an arc (G02/G03) is illegal on most controls and throws an alarm, because the geometry is ambiguous.
Geometry vs wear on the radius
Just like length, the radius offset splits into geometry (the nominal cutter radius, typically half the diameter) and wear (a small adjustment). Dialing a few thousandths into the diameter/radius wear is how an operator sizes a finish pass to print without re-posting — add to wear to leave more stock, subtract to cut closer.
Worked contour snippet
G00 X-10.0 Y-10.0 (RAPID TO A START POINT OFF THE PART)
G01 G41 D01 X0 Y0 F300.0 (LEAD-IN: COMP ACTIVATES ON THIS LINEAR MOVE, TOOL LEFT)
Y50.0 (UP THE LEFT SIDE - EDGE HELD ONE RADIUS OFF THE LINE)
X50.0 (ACROSS THE TOP)
Y0 (DOWN THE RIGHT SIDE)
X0 (BACK ALONG THE BOTTOM)
G01 G40 X-10.0 Y-10.0 (LEAD-OUT: CANCEL COMP ON A LINEAR MOVE CLEAR OF THE PART)
Common cutter-comp alarms
| Symptom | Cause | Fix |
|---|---|---|
| Interference / “would gouge” alarm | A concave feature is smaller than the tool radius, so the offset path folds back on itself | Use a smaller cutter or program the feature to suit the tool |
| Activation/cancel on an arc | G41/G42/G40 commanded on a G02/G03 block | Move the comp on/off command onto a linear lead-in/lead-out |
| No lead-in room | Comp switched on with a move shorter than the radius, or directly onto the contour | Add a linear approach move of at least one radius, off the part |
| Gouged corner on first/last move | Comp left active into a rapid, or cancelled while still on the part | Cancel with G40 on a lead-out clear of the finished surface |
Offset Memory Types A / B / C
Fanuc controls store length and radius offsets in one of three memory layouts, chosen by the machine builder. The type decides how many columns the offset screen shows and whether length and radius can share an offset number — and it changes how you write a macro that reads or edits offsets. This is abstract, so the table below is the clearest way to see it.
| Type | Columns on screen | Geometry / Wear | Length vs radius numbering |
|---|---|---|---|
| A | One column, shared by length and radius | Combined into a single value | Length and radius must use different offset numbers (often shifted by 25 or 50); both may have to use the H address |
| B | Two columns (geometry, wear) | Separated — operator can adjust wear without disturbing geometry | Still one shared number per tool, so length and radius need different offset numbers |
| C | Four columns (H geometry, H wear, D geometry, D wear) | Separated, independently for length and radius | Length (H) and radius (D) may use the same offset number — H01 and D01 for tool 1 |
Type A is the oldest and survives on limited controls (e.g. Fanuc 0). Most modern machining centers run Type B or Type C. The practical upshot for programmers: on A/B you must keep a separate numbering scheme for radius offsets, while on C you can keep everything on one number per tool. A macro that writes offsets is not portable between types — the system-variable ranges differ, so a robust macro either targets a known control or branches on the memory type. Those exact variable ranges are laid out in Tool Offset Variables.
Tool-Nose-Radius Compensation (Turning)
On a lathe there is no tool length offset in the milling sense, but the insert has a rounded nose radius that causes exactly the same undersize/oversize problem on tapers and arcs that a mill’s radius causes on a contour. Tool-nose-radius compensation (TNRC) corrects it, and it uses the same words — G41 (tool left of travel), G42 (tool right), G40 (cancel). Straight turning and facing along X or Z don’t strictly need it; angled and radiused cuts do.
TNRC needs two extra pieces of data the control stores per turning offset: the nose radius (the letter R) and the imaginary tool tip / tip orientation number (the letter T, a value 0–9). Because the control tracks a single “imaginary” tip point rather than the true rounded edge, the tip number tells it which way the insert faces — front turning, back turning, boring, etc. — so the offset is applied in the correct direction. Turning offsets, like milling, split into geometry and wear (Fanuc lathes use memory Type A or B only; there is no Type C). Lathe programming, tip-orientation numbers, and G-code-per-move details are covered more fully in a future turning-specific article.
How Each Control Handles It
The concept is identical everywhere; the vocabulary and storage differ. This table maps the essentials, with links to the per-control system-variable references.
| Control | Length comp | Radius comp | Where the value lives |
|---|---|---|---|
| Fanuc / Haas | |||
| Fanuc & Haas | G43 H__ apply, G44 negative, G49 cancel | G41/G42 D__, G40 cancel | Type A length #2001–, radius #2401–; Type B length geometry #11001– / wear #10001–, radius geometry #13001– / wear #12001– — see Tool Offset Variables and Fanuc System Variables |
| Siemens SINUMERIK | |||
| Sinumerik 828D / 840D | Automatic once a D edge is active (no G43/H); D0 deactivates | G41/G42 (no D word — radius comes from the active D edge), G40 cancel | Tool data array $TC_DP__[t,d]: length geometry $TC_DP3, radius geometry $TC_DP6, wear in $TC_DP12+ — see Sinumerik System Variables |
| Heidenhain | |||
| Heidenhain TNC 640 | Length column L in TOOL.T, applied at TOOL CALL; delta DL per call | Radius column R; delta DR; path comp RL/RR/R0 in Klartext | TOOL.T columns L/R/DL/DR (plus R2/DR2 for toroids) — see TNC 640 Tables & System Data |
| Okuma OSP | |||
| Okuma OSP | Length applied via the active tool offset number | Radius from the D offset; nose-R comp on lathes via VNOSER/VNOSEP | Named system variables VTOFH[n] (length) and VTOFD[n] (diameter/radius) — see Okuma Variable Types |
The biggest conceptual difference is Siemens and Heidenhain treating tool data as one record consumed at the tool call, versus Fanuc/Haas/Okuma’s explicit G43/D registers. On Siemens a cutting edge (D) carries both its length and its radius, so there is no separate length-apply code to forget.
Reading & Writing Offsets From a Macro
Because offsets are system variables, a macro can read and update them — the backbone of automated tool-breakage detection (measure the tool, compare its length to an expected value, alarm on a large deviation) and automatic wear update (probe the machined feature and push the measured deviation into the wear register, not geometry). For example, on a Type B control #[10000+#4120] addresses the length-wear register of the currently active tool (#4120 = current T number). The full variable ranges, indirect-addressing patterns, and ready-to-adapt examples are in Reading & Writing System Variables and Tool Offset Variables.
Gotchas
| Mistake | What happens | Guard against it |
|---|---|---|
Forgetting G43 H__ | Control assumes zero length — a programmed Z0 drives the spindle nose into the part (crash), or Z is wildly off (air-cut) | Always pair the tool change with G43 H__ on the first Z move; put G49 in the safe-start line |
| Comp not cancelled before a rapid | The offset path carries into the G00 retract and gouges the corner or the part edge | Cancel with G40/G49 on a controlled linear move clear of the part before rapiding away |
| Wear vs geometry confusion | Adjusting geometry overwrites the physically measured setup value — lost forever, and macros that expect the original number misbehave | Make running adjustments in wear; leave geometry as the measured setup value |
| Wrong radius-comp direction | G41 where G42 was needed offsets the tool to the wrong side — part comes out oversize/undersize by a full diameter, or climb becomes conventional | Sight down the direction of travel: G41 = tool to the left. Verify against inside/outside of the contour |
| Activating comp on an arc or with no lead-in | Alarm, or the tool ramps onto the finished surface and leaves a witness mark | Switch comp on/off only on linear moves of at least one radius, made off the part |
See also: Tool Offset Variables for the exact Fanuc offset registers, Modal & Position Data for the active-TLC variables (#5081–#5086) and the modal group that reports G43/G49, and the per-control references linked in the table above.
References
- Peter Smid, Fanuc CNC Custom Macros, Industrial Press, 2005.
- Fanuc, Operator’s Manual / Parameter Manual, FANUC Corporation.
Have a question or want to contribute?
Contact us with corrections, additions, or topics you'd like covered.
Get in Touch