Complete Guide to G-Code Tool Radius Compensation (G41 & G42)
Meta Description: Learn how to use G41 and G42 for tool radius compensation in CNC G-code programming. Discover the differences, real examples, diagrams, and pro tips to avoid programming mistakes and crashes.
🧠 What is Tool Radius Compensation?
Tool radius compensation allows the CNC machine to offset the cutter’s radius from the programmed path. Instead of adjusting the toolpath in CAD/CAM, compensation is handled in the controller using G41 or G42.
- G41: Cutter comp LEFT of the programmed path
- G42: Cutter comp RIGHT of the programmed path
- G40: Cancels cutter compensation
🖼️ Tool Compensation Diagram

The cutter position changes based on climb or conventional milling and the direction of tool travel.
⚙️ G41 / G42 Code Example
% O1000 (Tool Radius Compensation Example) G21 G90 G17 G40 T1 M06 G0 X0 Y0 G43 H01 Z100 S1200 M03 G0 Z5 G1 Z-5 F100 G41 D01 (Apply cutter comp left) G1 X50 Y0 G1 Y50 G1 X0 G1 Y0 G40 (Cancel compensation) G0 Z100 M30 %
Notes:
D01refers to tool offset register 1 (must match with tool table entry)- Always enter compensation with a linear move (G1), not G0
- Exiting with
G40should also be a linear move
📊 Tool Table Sample
| Tool # | Diameter | Offset D# | Description |
|---|---|---|---|
| 1 | 10.00 mm | D01 | Flat End Mill |
| 2 | 6.00 mm | D02 | Ball Nose |
🧰 Common Mistakes with G41 & G42
| Mistake | Result | Fix |
|---|---|---|
| Entering comp with G0 | Controller error or crash | Use G1 feed move |
| No D offset value | No compensation | Assign correct Dxx |
| Wrong G41/G42 side | Overcut or gouge | Check tool direction |
📐 Practical Rule of Thumb
- Climb Milling (recommended): Use G41 when tool travels clockwise around part
- Conventional Milling: Use G42
It depends on whether the cutter should offset to the left or right relative to motion.
📦 Real-World Tip
Use cutter compensation only when the CAM output is not adjusting for tool diameter. If CAM has already offset the toolpath, G41/G42 may cause overcompensation.
🔚 Summary
G41 and G42 are powerful tools in G-code programming for precise machining and adaptability. They allow quick adjustment of tool diameters without modifying toolpaths. Mastering their use avoids crashes and ensures tolerance control, especially when working with multiple tools or worn cutters.
Leave a comment