Complete Guide to Tool Radius Compensation: G41 and G42 Explained with Real CNC Examples
Tool radius compensation allows the CNC machine to offset the programmed toolpath by the actual radius of the cutting tool, ensuring precise part dimensions even if the tool size varies.
This is especially critical for:
- Contour milling
- Profiling operations
- Roughing vs. finishing passes
🔍 What Is Tool Radius Compensation?
Without compensation, your program must account for the exact tool diameter. If the tool changes, you’d need to recalculate all toolpaths.
With G41/G42:
- Program the part geometry directly
- Let the machine offset based on the actual tool radius in the offset table
This saves time, reduces errors, and allows quick tool changes without reprogramming.
📘 G-Code Overview
| Code | Meaning |
|---|---|
| G40 | Cancel tool compensation |
| G41 | Compensate left of path |
| G42 | Compensate right of path |
📐 Which One to Use: G41 vs. G42?
Think of tool movement direction and cutting side:
- G41 = Tool stays to the left of the path (climb milling on outside)
- G42 = Tool stays to the right of the path (conventional milling on outside)
💡 Rule of thumb:
- Climb milling = G41 for outside, G42 for inside
- Conventional milling = opposite
🔧 Tool Radius Compensation Example
G17 G90
T1 M06 ; Ø10mm end mill
G00 G54 X0 Y0
G43 H01 Z100.0
S1200 M03
G00 Z2.0
G41 D01 ; Enable left compensation using D01 (tool offset)
G01 Z-5.0 F200
G01 X50.0 Y0
G01 X50.0 Y50.0
G40 ; Cancel compensation before retracting
G00 Z100.0
D01refers to offset entry where the tool radius is stored- Compensation starts before entering material
G40is used before exiting the part
🔄 Entry and Exit Moves
Tool compensation requires lead-in and lead-out moves — otherwise the machine won’t know how to shift the tool correctly.
G41 D01
G01 X5.0 Y-5.0 ; lead-in move
G01 X50.0 Y0.0 ; start cutting edge
❗ Never start G41/G42 on the exact geometry — always use a move into the path.
🧠 Tool Table Setup (Fanuc-style)
| Offset # | Tool | Radius (mm) |
|---|---|---|
| D01 | T01 | 5.0 |
| D02 | T02 | 3.0 |
The machine reads the radius from this table when you use G41 D01, for example.
🔎 G41 vs. G42 Visualization
G41 (left)
-------->
+----------+
| | Cutter stays LEFT of programmed path
| PART |
| |
+----------+
G42 (right)
-------->
+----------+
| | Cutter stays RIGHT of path
| PART |
| |
+----------+
🧩 Common Mistakes
- ❌ Starting compensation without a lead-in
- ❌ Forgetting to cancel with G40
- ❌ Using wrong D-number (mismatched tool offset)
- ❌ No radius value in tool table → compensation error
🛠️ Full G-Code Sample with Radius Compensation
T1 M06
G90 G17 G21
G00 G54 X-10 Y-10
G43 H01 Z50
S1800 M03
G00 Z2.0
G41 D01 ; Cutter comp left using radius in D01
G01 Z-2.0 F150
G01 X0 Y0
G01 X100 Y0
G01 X100 Y100
G01 X0 Y100
G01 X0 Y0
G40 ; Cancel compensation
G00 Z50.0
M30
This outlines a square profile using tool radius compensation.
✅ Best Practices
- ✅ Always use lead-in and lead-out moves
- ✅ Double-check D-number and tool offset radius
- ✅ Use G40 before retracting
- ✅ Test on air cut or simulation first
- ✅ Know your controller’s specific rules (e.g. Haas vs. Fanuc)
📏 When to Avoid Compensation
Some CAM software outputs code with tool already compensated, in which case:
- Toolpath is offset by tool radius in CAM
- You must not use G41/G42 — use G40 only
🚀 Final Thoughts
Tool radius compensation is one of the most powerful yet misunderstood features in CNC programming. Mastering G41/G42 gives you:
- Flexibility to change tools without reprogramming
- Higher accuracy for contours
- Easier fine-tuning on the machine
Don’t fight your cutter — program with confidence using G41 and G42.
Leave a comment