← Back to CNC Programming

Cutter Radius Compensation

Cutter compensation lets you program the part outline, not the tool center path. The controller offsets the tool by the radius stored in the D offset. This page covers G41/G42 direction, lead-in/out, and the overcut error that scraps parts.

Concept

Without compensation, you program the tool center path — manually offset by the tool radius from the part edge. If you switch from a Ø10 to a Ø12 end mill, you must recalculate every coordinate. With cutter radius compensation (G41/G42), you program the part outline exactly as drawn, and the controller automatically shifts the tool center by the radius stored in the D offset register.

G41 = left compensation (tool center is to the left of the direction of cut). G42 = right compensation. G40 cancels compensation.

Why It Matters

Getting G41/G42 backwards causes overcut: on an outer profile, the wrong compensation pushes the tool center inside the part, cutting away material it should leave. The rule (G17, viewed from +Z above the table, positive D offset): outer profile cut clockwise (CW) uses G41; outer profile cut counterclockwise (CCW) uses G42. For inner pockets, the rule flips.

How It Works

The D Offset

D selects the cutter-size compensation register. Its size entries use radius or diameter according to the control configuration; this page's numerical examples assume Haas Setting 40 = RADIUS, so a Ø10 end mill uses D = 5.000. The program calls D01 on the G41/G42 line. The offset value is a correction that lets the controller offset the tool center path; it is not necessarily the worn physical tool radius. One program can work for different tool radii by changing D, but only when the new tool still fits the internal corners, entry, and reach.

How D Changes the Pocket Size

For a programmed pocket width of 50 mm with actual tool radius r = 5 mm and compensation radius d, the resulting pocket width is 50 − 2d + 2r. In the ideal no-error model: when d = r = 5 the pocket is exactly 50. When d = 4.98 (the controller thinks the tool is smaller than it is), the tool center rides closer to each programmed wall, the larger physical tool cuts more material, and the pocket measures 50.04. When d = 5.02, the tool center rides farther from each wall, less material is removed, and the pocket measures 49.96. A cut that has already removed extra material cannot be undone by compensation; the correction applies to the next part.

Compensation dResulting pocket widthEffect
4.98050.04tool center nearer programmed wall, cuts more, pocket larger
5.00050.00nominal
5.02049.96tool center farther from wall, cuts less, pocket smaller

On the first article, leave 0.1 mm finish stock on each wall by setting d = 5.10 (radius field; diameter field = 10.20). The outer profile will be oversize and the inner pocket undersize. Measure, then adjust d to target before the finish pass. Before diagnosing a size error as tool wear, check runout, deflection, and measurement error.

Lead-In / Lead-Out

Compensation must be activated on a straight lead-in move (at least one tool radius long) before entering the contour, and canceled on a straight lead-out. Never activate G41/G42 directly on the part corner — the controller needs a straight move to ramp the offset. The lead-in should approach from outside the part.

Direction Rule with a Coordinate Table

Program this outer rectangle clockwise: (0,0) → (0,50) → (50,50) → (50,0) → (0,0). Tool radius D=5. With G41, the tool center sits 5 mm to the left of each directed edge:

EdgeDirectionTool left of directionTool center midpoint
(0,0)→(0,50)+Y (up)−X (west)X=−5, Y=25
(0,50)→(50,50)+X (right)+Y (north)X=25, Y=55
(50,50)→(50,0)−Y (down)+X (east)X=55, Y=25
(50,0)→(0,0)−X (left)−Y (south)X=25, Y=−5

In every row the tool center falls outside the rectangle [0,50]×[0,50]. That is correct outer profiling. If you instead used G42 on this same CW path, the tool would shift inside and cut the part too small.

Example: Outer CW Profile with Lead-In and Lead-Out

Putting the rules together: G21/G17/G90/G94, G54, H offset, spindle and coolant on, entry/exit extensions clear. The program starts with G40 at (0,−20), builds G41 D01 on the +Y extension, runs the CW outer rectangle, extends past the bottom-left corner on −X, then cancels G40 at (−20,0). This is a teaching fragment; verify lead-in and corner behavior on your control before running on real material.

Assume G21/G17/G90/G94, G54 and H offset established, spindle and coolant on, safe Z set, and the entry/exit extensions are clear of material and clamps. The example below builds compensation on the extension of the first edge (a straight line collinear with it), keeps compensation while touching the contour, then extends past the corner before canceling. It is a teaching fragment; verify the exact lead-in/turn-in rules on your control.

BlockProgrammed pointStable offset sideMaterial side / clearance
G40 start(0,−20)noneclear below part
G41 D01(0,−10)left of +Y = −X, center X=−5still in clear air
keep G41(0,0)center X=−5, touches left walltangent to first edge
contour(0,50)→(50,50)→(50,0)→(0,0)G41 outercut CW outer profile
keep G41(−10,0)center Y=−5, extends past cornerclear left of part
G40(−20,0)nonecancel in clear air
G00 X0. Y-20.             (G40, clear air below part, at cut Z)
G01 G41 X0. Y-10. D01 F300.  (build comp on +Y extension; center X=-5)
G01 Y0.                   (approach corner, comp already stable)
G01 Y50.                  (left edge up)
G01 X50.                  (top edge right)
G01 Y0.                   (right edge down)
G01 X0.                   (bottom edge left)
G01 X-10.                 (extend past corner, comp held)
G01 G40 X-20.             (cancel in clear air)

Inner vs Outer Profiles

The left/right rule depends on whether you are cutting an outer profile or an inner pocket. For an inner pocket (e.g., a rectangular cavity), the "air" is inside the pocket. If you cut the pocket CW, the tool needs to be on the inside wall — which means G42, not G41. The safe way: trace the directed edge and ask "which side of the edge is the open air where the tool should be?" That side determines G41 (left) or G42 (right).

D Offset Units: Radius or Diameter

The D register holds a cutter-size value. On Haas mills, Setting 40 selects whether D entries are read as radius or diameter. With Setting 40 = RADIUS, a Ø10 tool uses D = 5.000; with Setting 40 = DIAMETER, D = 10.000. The program never changes; only the offset value and the setting do. Confirm the setting on the screen before entering numbers. Getting this wrong doubles the offset and cuts the part twice as far off as intended.

Lead-In and Lead-Out Geometry

The lead-in should be a straight move at least one tool radius long, approaching from outside the part, ending tangent to the first contour edge. Tangent lead-in (along the direction of the first wall) leaves no witness mark. A radial lead-in that points straight at the corner leaves a small step; it is acceptable for roughing but not for finish. Lead-out mirrors lead-in: straight, tangent, away from the contour, then G40.

Compensation and Arcs

G41/G42 works on arcs too: the controller offsets the arc center path by the tool radius, producing a parallel concentric arc. Internal arcs and external arcs offset in opposite directions. The controller handles this automatically, but lead-in must still be straight. Never engage or cancel compensation on an arc block.

What Happens If You Forget G40

Compensation stays active into the next move. If the next block is a rapid XY move away from the part, the tool center is still offset by D — it may drift into a clamp or leave a tool mark. Always cancel compensation on a deliberate straight lead-out. The startup block includes G40 to clear any leftover compensation from the previous program.

Compensation and Tool Changes

When the tool changes, the D register for that tool is loaded with the next G41/G42 block. The old compensation must be cancelled (G40) before the tool change, otherwise the machine tries to ramp the offset during a move that has no part to reference. Standard sequence: G40 lead-out, retract Z, Txx M06, then G41/G42 on the next lead-in with the new D.

Limitations of Cutter Compensation

On a G17 mill, cutter compensation offsets the tool center in XY by a constant radius. It does not correct Z depth; that is the tool-length offset's job. It does not know about multi-flute radial runout. On a lathe (G18), the nose radius and orientation are separate T-offset fields.

Verifying Compensation on the First Part

After the first part, measure the critical XY dimensions. If the whole contour is uniformly oversized or undersized, the D offset is off. If only one wall is off, the geometry or fixture is off. If the tool gouged into a corner, the lead-in was too short or the direction was wrong. Diagnose by wall, not by overall size.

Stable cutter offset: tool center one radius from programmed edge programmed edge tool center path, 25 px = r = 5 mm r = 5 mm tool center moves +Y Material below edge (y>180). Schematic, not to scale.

Compensation on a Lathe

On a lathe, G41/G42 also offsets the tool, but the virtual tip, nose radius, and orientation field are separate entries in the T offset, not a mill D value. Lathe compensation is covered in the turning section; the lead-in/lead-out principle and the G40 cancellation rule are identical, but X is diameter programming and G18 is the active plane.

Inner pocket CW (0,0)→(0,50)→(50,50)→(50,0)→(0,0) pocket cavity (air) G42 (right of cut) keeps tool in cavity. Schematic, not to scale.

When Not to Use Compensation

Cutter compensation is for contours where the tool radius changes or where hand-calculating the tool center path is error-prone. For simple rectangular pockets where the tool center path is easy to compute, compensation adds a layer of indirection without benefit. For 3D surfaces or 5-axis work, CAM computes the tool center path directly and G41/G42 is not used. Compensation is a 2D finishing aid, not a universal solution.

Compensation and Program Zero

Cutter compensation offsets in the XY plane; it does not know about Z. A tool radius error does not change the drilled hole depth — that is handled by tool length offset. Do not use D to correct a Z-depth error; that is an H problem. Keep the two offset systems mentally separate.

Inner Pocket Direction Rule Worked

Use the same CW point order as the outer example but for an inner pocket: (0,0)→(0,50)→(50,50)→(50,0)→(0,0). The air is inside the rectangle. Trace each edge and ask which side is open air:

EdgeDirectionInside-pocket side (air)Compensation
(0,0)→(0,50)+Y (up)+X (right, inside)G42 (right of +Y)
(0,50)→(50,50)+X (right)−Y (down, inside)G42 (right of +X)
(50,50)→(50,0)−Y (down)−X (left, inside)G42 (right of −Y)
(50,0)→(0,0)−X (left)+Y (up, inside)G42 (right of −X)

On the bottom edge (−X, leftward), the inside pocket is above (+Y). Right of −X is +Y, so G42 keeps the tool on the pocket side. CW inner = G42; the rule is the mirror of CW outer = G41.

Compensation and Tool Nose Radius on Lathes

On a CNC lathe, the rounded insert corner uses a separate T-offset entry for nose radius and orientation; D on a mill is not the same register. The virtual tip and nose radius are covered on the tool-offsets page. The G40 cancellation and lead-in principle carry over, but lathe X is diameter programming and G18 is the active plane.

Compensation and Multiple Tools

Each tool has its own D register. When the program calls T02 M06 and then G41 D02, the controller loads D02's radius value. The startup block G40 cancels any leftover compensation from the previous tool. Do not assume D01 carries over to T02; always specify the D number on the compensation line.

Why Program the Part Outline, Not the Tool Path

Without compensation, every coordinate you type is a tool-center coordinate. A 50 mm square part cut with a Ø10 tool means the tool center path is a 60 mm square offset outward. If you change to a Ø8 tool, every coordinate changes. With compensation, you type the 50 mm square exactly as drawn; only D changes. This is why drawings and programs match — fewer transcription errors, easier verification against the print.

Common Mistakes

Practice

1. Outer rectangle cut clockwise: (0,0)→(0,50)→(50,50)→(50,0)→(0,0). G41 or G42?

Ans

G41. On the left edge going up (+Y), left is −X = outside. On the top edge going right (+X), left is +Y = outside. On the right edge going down (−Y), left is +X = outside. On the bottom edge going left (−X), left is −Y = outside. G41 keeps the tool outside on all four edges.

2. Why a lead-in move?

Ans

The controller needs a straight move to ramp the tool center from zero offset to full radius offset. Activating at a corner causes a sudden step that can gouge the part.

3. What cancels G41/G42?

Ans

G40. Must be on a straight lead-out move away from the contour.

4. You switch from a Ø10 to a Ø12 end mill. What changes in the program?

Ans

The program body is unchanged; only D01 changes. With Setting 40 = RADIUS, D01 goes from 5.000 to 6.000. With Setting 40 = DIAMETER, D01 goes from 10.000 to 12.000. Confirm the new tool still fits the internal corner radii, entry, and reach before assuming the program runs unchanged.

Sources