A programmer verifies a profile on a machine at the bench, sets the cutter compensation value from the tool label, runs the first production part, and it comes out 0.4 mm oversize with a gouge on one corner. The program was correct on the previous job. What changed is that the control now has to construct a geometric offset from the tool's real radius — and the result depends on moves that were never part of the design intent.

Cutter radius compensation (G41 left, G42 right, G40 cancel) is the only common G-code feature where the control invents motion the program does not contain. Everywhere else the program states a target and the machine goes there. Inside compensation, the control solves a geometry problem: given the programmed contour and a tool radius, where must the tool centre travel so the tool edge touches the programmed path?

That solve is why compensation is simultaneously indispensable and dangerous. It is indispensable because it lets one program cut with any tool of the same nominal type, adjusting for regrind and wear at the machine instead of reposting the CAM file. It is dangerous because the failure modes are geometric and silent in the listing: nothing in the program text looks different when the lead-in is too short.

What the control actually computes

Inside G41/G42, the programmed coordinates describe the finished part edge, not the tool centre. The control offsets every programmed path normal to the direction of travel by the value in the compensation register (D word on FANUC-family controls, _cutter_radius-class variables elsewhere). On straight sections this is trivial: the offset is perpendicular.

Engineering diagram showing a programmed part edge and the offset tool centre path for G41 with an offset equal to the tool radius, a lead-in of at least one tool radius, and three corner cases: an outside corner where the tool swings an arc of tool radius, an inside corner where the control trims to the offset intersection, and an inside radius smaller than the tool radius where no valid solution exists
Figure 1: The offset construction, the lead-in that establishes it, and the corner cases where geometry, not the program, decides whether the part is cut.

At every intersection the control must decide how the offset tool-centre path joins. For an outside corner, the tool must swing around the corner, producing an arc whose radius equals the tool radius. For an inside corner, the two offset lines intersect and the control trims to that intersection. Where the inside corner radius is smaller than the tool radius, there is no valid intersection at all — the tool physically cannot cut the shape, and the correct response is an alarm rather than motion.

The lead-in block is where geometry is established. The control needs the approach vector to determine which side the tool is on and to build a valid starting offset. On FANUC-family controls this means the lead-in must be a move of at least the tool radius, perpendicular to (or collinear with) the first compensated path, and free of arcs. Nineteen out of twenty "compensation gouged my part" incidents start with a lead-in that violated one of those three conditions.

Lead-in and lead-out rules that actually hold

The rules below are the shared subset across FANUC 0i/30i, Siemens 840D, Heidenhain TNC and LinuxCNC. They are conservative, which is what a production program needs:

  • Cancel compensation outside the material. G40 belongs on a move away from the part, never at the end of the contour. G40 on the last profile block leaves a witness step where the tool returns to nominal path while still in contact.
  • Make the lead-in at least one tool radius long, and ideally 1.5–2 radii. A 0.4 mm lead-in with a 6 mm cutter has no room to construct the vector.
  • Enter perpendicular or tangent, not diagonally into a corner. A diagonal approach to the first corner asks the control to resolve two offset directions simultaneously, and the resolution becomes control-specific.
  • Never change D while compensation is active. Compensation value is read at the block where G41/G42 takes effect; a mid-contour change is ignored on some controls and produces a step on others.
  • Keep every compensated segment longer than the compensation value. Segments shorter than the radius make the offset path self-intersect, which is exactly the condition that produces the "interference" alarm or, worse, an uncut gouge on older controls.
  • Do not use G53 inside compensation. Machine-coordinate moves are non-modal and bypass the offset frame the compensation was computed in.

A lead-in that satisfies all six looks like a plain move: position clear of the part with G40 active, select the register, then feed into the contour along the approach direction. The pattern is boring, and boring is the point.

The D register: radius or diameter

The single most common setup error is that the register holds the wrong quantity. Whether the D value is a radius or a diameter depends on a machine parameter (RAD-style setting), and it is not visible from the offset screen. A shop that switches between machines without checking this will produce parts that are consistently correct, consistently oversize by one radius, or consistently gouged — and the diagnosis "the machine is inaccurate" will be wrong every time.

Three habits remove the ambiguity:

  1. Put the parameter setting in the setup sheet, next to the tool list, with the date it was last verified.
  2. Hold a known reference: cut a test slot with the tool, measure the actual width, and compare with 2 × D (radius convention) or D (diameter convention). A single 30-second cut settles it for that machine permanently.
  3. Store wear in a separate register from nominal radius where the control supports it, so regrind adjustments do not overwrite the nominal value that the CAM post assumed.

Tool length compensation (G43) is a different register chain and must be active before compensation matters — a machine that is correct in radius but wrong in length produces the same visual symptom (a gouge) for a completely different reason.

Reading the failure modes

SymptomMost likely cause
Part oversize by roughly one tool radiusD = 0, or wrong register called, or comp never took effect
Gouge at the first corner after entryLead-in shorter than tool radius, or diagonal approach
Untouched stock on an inside cornerCorner radius smaller than tool radius; control trimmed instead of alarming
Step or witness mark at the end of the contourG40 cancelled while still in contact
Alarm "interference in G41/G42"Compensated segment shorter than the offset value, or a self-intersecting path
Part correct on the bench, wrong after restartComp reset by G40 and never re-established on resume

The last row is the dangerous one and it is not a compensation problem at all: it is a modal state problem. Any restart inside a compensated contour is unsafe on nearly every control, because block search reconstructs the modal state by reading codes backwards but never executes the approach move that physically established the geometry. The control believes compensation is active at a vector position the tool never reached.

Verifying a compensated cut before the first part

The sequence below costs about four minutes and catches nearly all geometric failures:

  1. Air cut at reduced rapid. Run the program with work offset moved clear of the stock, feed override at 25%. Watch the position display for the first compensated block: the distance from the approach point to the contour should equal the lead-in length, and the axis should not jump.
  2. Single block through the first corner. Outside corner: verify the display shows an arc of tool radius. Inside corner: verify no reversal.
  3. Cut a short test feature, ideally the sharpest inside radius in the job, in scrap material or on a stock allowance.
  4. Measure the test feature, then compute the correction and write it into the wear register — not into the nominal value, and not into the program.
  5. Record the register values and the parameter state on the setup sheet so the next shift starts from a known configuration.

Compensation is worth using in production specifically because it makes tool wear a machine-side adjustment. The cost is that the program's correctness now depends on a register value and a geometric precondition that the program text does not show. Treat both as first-class setup data and the feature stops being a source of scrap.