CNC Tool Radius Compensation (G41/G42): How It Works and When to Use It
Tool radius compensation, also known as cutter compensation, allows CNC machines to adjust toolpath based on the actual size of the cutter. This feature ensures precision in contouring and is crucial for finishing operations, tolerance adjustments, and real-world machining conditions.
📌 What Is Tool Radius Compensation?
Every end mill or cutter has a physical diameter. If G-code paths are programmed for the center of the cutter, tool radius must be considered — or parts will be undersized or oversized.
G41/G42 commands shift the cutter’s path relative to the programmed line.
| Code | Compensation | Direction (Looking along the toolpath) |
|---|---|---|
| G41 | Left | Tool stays to the left of path |
| G42 | Right | Tool stays to the right of path |
| G40 | Cancel | Cancels any compensation |
🛠️ Practical Example: Outside Square Profile
Objective: Mill a 50×50 mm square with a 10 mm endmill.
🔸 Without Compensation:
G0 X0 Y0
G1 X50 Y0
G1 X50 Y50
G1 X0 Y50
G1 X0 Y0
This moves the center of the tool, not the edge — final part will be smaller than 50 mm.
🔹 With G41 (Left Compensation):
G0 X-5 Y0
G41 D01
G1 X50 Y0
G1 X50 Y50
G1 X0 Y50
G1 X0 Y0
G40
Now the cutter edge follows the profile, cutting exact dimensions.
🧠 D01 points to tool radius offset stored in the tool table.
🧮 Tool Table Example (Fanuc-style)
| D-Code | Tool | Radius (mm) |
|---|---|---|
| D01 | T01 | 5.0 |
| D02 | T02 | 3.175 |
Tool radius is pulled from this value when using G41/G42 with D-code.
🧠 Inside vs Outside Contours
- Use G41 for outside contours (climb milling, tool left)
- Use G42 for inside pockets or slots
Wrong direction will gouge or undercut the part!
⚠️ Entry and Exit Moves
G41 and G42 require lead-in and lead-out motions to activate smoothly.
Good Example (45° entry):
G0 X-10 Y-10
G1 X0 Y0
G41 D01
G1 X50 Y0
...
Bad Example (direct start on profile):
G41 D01
G1 X50 Y0 ← May cause alarm!
Machines need space to shift cutter to the compensated path.
🧪 Real-World Use: Finishing Pass with G41
Rough profile:
G1 X50 Y0 F300 ; Rough cut
Then:
G0 X-2 Y-2
G41 D01
G1 X50 Y0 F150 ; Finish with exact offset
...
G40
By separating rough and finish passes, surface quality and tolerance improve dramatically.
🔍 Canceling Compensation (G40)
Always cancel G41/G42 before tool retract or rapid moves.
G1 X0 Y0
G40
G0 Z100
Failure to cancel can cause unexpected shifts or gouges.
🧠 CAM vs Manual Coding
- CAM software often handles G41/G42 internally
- Manual programmers must:
- Choose correct side (G41 or G42)
- Set the right D-code
- Ensure proper entry/exit moves
Understanding it is still vital for:
- Verifying post output
- Editing NC code
- Adjusting paths without re-posting
📐 Mirror Machining with G42
Want to machine the same profile mirrored? Just switch from G41 → G42, and the toolpath mirrors automatically (when programming is symmetric).
Useful for:
- Left/right hand parts
- Symmetric molds
- Dual-sided machining
🧠 Advanced Use: Dynamic Adjustment at Machine
When using tool wear or radius compensation registers, operators can tweak D-codes on the fly — no need to repost G-code.
Example:
- Tool wears from 5.000 mm to 4.980 mm
- Operator updates D01 = 4.980
- Part still cuts to spec without changing the program
✅ Summary
Cutter compensation (G41/G42) is a foundational concept in professional CNC programming. Mastering it gives you:
- Dimensional accuracy
- Flexible in-machine adjustment
- Clean finish passes
- Real-world tool management
Never overlook the importance of proper lead-in/lead-out, correct side selection, and accurate D-code usage — they are essential for precise, safe, and reliable CNC machining.
Leave a comment