If you program a machine to move a 0.500"12mm end mill exactly along the edge of a 2.0"50mm square, your final part will end up undersized. Why? Because the machine drives the center of the spindle. Half of the tool is biting into your part. To fix this, we use Cutter Radius Compensation (G41/G42).
1. The Power of "Comp"
Cutter compensation allows the programmer to write G-code that perfectly matches the actual blueprint dimensions of the part. The machine's controller does the heavy lifting, automatically offsetting the toolpath by the radius of the cutter.
G41: Cutter Comp Left
The tool is shifted to the left of the programmed path (looking in the direction of travel).
Note: If you are cutting the outside of a part in a clockwise direction, G41 results in Climb Milling (the standard for CNC).
G42: Cutter Comp Right
The tool is shifted to the right of the programmed path.
Note: If you are cutting the outside of a part in a clockwise direction, G42 results in Conventional Milling.
2. The 'D' Word: Where the Machine Looks
When you call G41 or G42, the machine needs to know *how much* to offset the tool. It gets this information from the tool offset table, specifically the D register.
G41 D01 X0.0 Y0.0 F20.0
If Tool 1 is a 0.500"12mm end mill, the value in the machine's D01 Geometry table should be 0.250"6mm (the radius). The machine will now keep the edge of the tool perfectly aligned with your programmed coordinates.
3. The Real Magic: Wear Offsets
Cutter comp isn't just for making programming easier; it's essential for hitting tight tolerances. Tools deflect, materials push back, and end mills wear down over time. If a part comes out 0.002"0.05mm too big, you don't need to re-program the CAM file.
Dialing it in at the Control
Instead of changing the code, you go to the Wear Offset page on the CNC controller.
If your part is 0.002"0.05mm oversize, you enter -0.001"-0.025mm into the D-Wear register (you only need to adjust by the radius). The next time the machine runs that tool, it mathematically shrinks the cutter, moving it closer to the part and cutting it perfectly to size.
4. The Golden Rule: Lead-In and Lead-Out
You cannot simply turn Cutter Comp on while the tool is touching the part. The machine needs "running room" to move from the uncompensated centerline position to the compensated offset position.
The Lead-In Move
The move where G41 or G42 is called must be a linear move (G00 or G01), and the length of that move must be greater than the radius of the cutter.
- If you try to turn on comp during an arc (G02/G03), the machine will alarm out.
- If your lead-in line is shorter than the tool's radius, the machine will alarm out with a "Cutter Comp Interference" error because it physically cannot make the shift without gouging the part.
G00 X-1.0 Y-1.0 (Safe starting position)
G01 Z-0.5 F30.0 (Plunge into air)
(Turn on G41 during a linear move toward the part edge)
G41 D01 X0.0 Y-1.0 F20.0 (Lead-in move)
Y2.0 (Cut left side)
X2.0 (Cut top side)
Y0.0 (Cut right side)
X0.0 (Cut bottom side)
5. G40: Canceling Cutter Comp
Just as important as turning it on is turning it off. G40 cancels cutter compensation.
Don't Forget G40!
Like the lead-in, the G40 cancel command must be accompanied by a linear lead-out move that is larger than the tool radius. If you pull the tool straight up in Z without canceling comp, the machine stays offset, and your next toolpath will be wildly out of position.
(Turn off comp while moving away from the part)
G40 X-1.0 Y-1.0 F30.0 (Lead-out move)
G00 Z1.0 (Safe retract)
Visualize Your Toolpath
Want to see how cutter compensation offsets the toolpath? Copy the profiling code above and paste it into our interactive G-Code Viewer to instantly see the programmed path versus the compensated path.
Open G-Code ViewerConclusion
Cutter compensation transforms a CNC machine from a simple point-to-point router into a precision manufacturing tool. By mastering G41/G42, proper lead-ins, and wear offsets, you gain the ability to hold micron-level tolerances right at the machine control, saving you endless trips back to your CAM software.