CNC Tool Length Compensation Explained: G43, G44, H-Offsets, and Automatic Tool Measurement
Tool length compensation ensures that the CNC knows exactly how long each tool is, allowing the control to adjust Z-axis motion so every tool tip reaches the correct depth — regardless of tool length differences.
This guide covers G43, G44, and H-offsets with real G-code examples, plus automatic probing, tool wear updates, and AI-based adaptive compensation for modern CNC systems.
📌 1. What Is Tool Length Compensation?
Every cutting tool has a different length.
Tool length compensation (TLC) tells the machine how far the tool extends from the spindle nose so that Z movements remain accurate.
| Code | Function |
|---|---|
| G43 | Apply tool length offset (positive direction) |
| G44 | Apply reverse compensation (negative direction, rarely used) |
| G49 | Cancel tool length compensation |
In 99% of cases, G43 is used for standard milling and drilling.
📌 2. Basic Example — G43 with H Offset
T01 M06
G00 G90 G54 X0 Y0
G43 H01 Z100. S3000 M03
G01 Z-15. F200
G00 Z100.
M30
| Code | Description |
|---|---|
| H01 | Calls tool offset #1 from tool table |
| Z100. | Move to safe height including offset |
| G43 | Activates tool length compensation |
Without G43, Z-15 might crash into the part — always apply the correct H-offset!
📌 3. H-Offset Number Must Match Tool Number
| Tool | Offset | Command |
|---|---|---|
| T01 | H01 | G43 H01 |
| T02 | H02 | G43 H02 |
| T05 | H05 | G43 H05 |
⚠️ Mismatch Example (Wrong):
T03 M06
G43 H01
➡️ May cause incorrect Z height or part damage.
✅ Correct:
T03 M06
G43 H03
📌 4. G44 — Reverse Compensation (Rare)
G44 H02 Z100.
Used in rare cases (inverted heads, special attachments).
Normally, G43 is the standard and safer option.
📌 5. G49 — Cancel Tool Length Compensation
G49
G00 Z200.
Cancels active tool offset — typically called before tool change or retract.
📌 6. Haas Example — Safe Start Block
G90 G17 G40 G49 G80 G54
T01 M06
G43 H01 Z100. M08
Resets all modes before applying new tool length compensation.
📌 7. Fanuc Example — Multi-Tool Program
%
O3001 (MULTI-TOOL EXAMPLE)
G90 G17 G40 G49 G80 G54
T01 M06
G43 H01 Z100. M08
G01 Z-10. F200
G00 Z100.
T02 M06
G43 H02 Z100. M08
G01 Z-8. F250
M30
%
Automatically applies new offset for each tool — safe, precise, and modular.
📌 8. Siemens Example — Tool Length Definition
TOOL CALL 1 Z S3000
L Z+100 FMAX
L Z-10 F200
Siemens automatically links tool number and length data through the
TOOL CALLcommand.
📌 9. Heidenhain Example — Tool Table Offsets
TOOL DEF 1 L+125.0 R+5.0
TOOL CALL 1 Z S2500
L Z+100 FMAX
L Z-10 F200
L+125.0= tool length,R+5.0= radius.
Control adjusts Z automatically based on stored tool data.
📌 10. Tool Length Measurement with Probe (Fanuc Macro)
G65 P9832 Z-300. F200. (TOOL LENGTH PROBE MACRO)
G43 H#4120
| Code | Description |
|---|---|
| G65 P9832 | Calls tool measurement cycle |
| #4120 | Automatically reads current tool number |
The machine touches off the tool probe, calculates the length, and updates H-offset automatically.
📌 11. Haas Automatic Tool Setting Example
M59 P2 (ENABLE TOOL PROBE)
G65 P9853 (AUTO TOOL LENGTH SET)
M59 P3 (DISABLE TOOL PROBE)
Haas systems store measured values directly in the tool offset table.
📌 12. G10 — Programmatic Offset Input
G10 L10 P1 R125.36
| Parameter | Meaning |
|---|---|
| L10 | Tool length offset |
| P1 | Offset number |
| R125.36 | Length value (mm) |
Automatically writes offset value into H01.
📌 13. Tool Wear Compensation Example
#100 = #100 + 0.02
G10 L10 P1 R[#100]
Adds +0.02 mm to the tool length offset after wear is detected.
Perfect for automated tool life control.
📌 14. Dynamic Tool Measurement with Renishaw O9814
G65 P9814 Z-300. F200.
#500 = #5063
G10 L10 P[#4120] R#500
Measures tool tip position and stores actual length automatically.
📌 15. Safe Retract Using Machine Coordinates
G53 G00 Z0.
T02 M06
G43 H02 Z100.
Combines machine coordinate retract (G53) with tool length offset activation for maximum safety.
📌 16. Combined Length + Radius Compensation
G43 H01 Z100.
G41 D01 G01 X100. Y0. Z-10. F400
G40 G49
Applies both tool height and cutter radius correction for 3D contouring.
📌 17. Real Example — Tool Change and Measurement Cycle
T03 M06
G43 H03 Z100.
G65 P9832 (MEASURE TOOL 3)
#100 = #5063
G10 L10 P3 R#100
Automatically calibrates the new tool and updates the offset table.
📌 18. Troubleshooting Guide
| Error | Cause | Fix |
|---|---|---|
| Tool too deep | Wrong H-number | Verify H = tool number |
| Offset not applied | Missing G43 | Add after tool change |
| Wrong sign | G44 instead of G43 | Use standard G43 |
| Offset stacking | G43 used twice | Use G49 before next tool |
| Probing error | Tool not in spindle | Verify #4120 matches tool in use |
📌 19. AI-Based Tool Length Control (2025–2030)
- Smart probes detecting tool wear in real time
- AI prediction of thermal drift on Z-axis
- Automatic offset tuning per tool material and spindle speed
- Cloud-synced tool databases for networked CNC cells
- Self-calibrating H-offsets for 24/7 lights-out machining
The future of CNC tool management is autonomous precision.
📌 20. Best Practices
| Goal | Method |
|---|---|
| Prevent Z crashes | Always call G43 before motion |
| Change tools safely | Use G49 or G53 retract |
| Automate setup | Integrate probing macros |
| Manage wear | Update offsets via G10 |
| AI-ready machining | Log offset data in MES systems |
✅ Conclusion
Tool length compensation is the backbone of Z-axis accuracy.
By mastering G43, H-offsets, and probing automation, you ensure consistent depths, flawless finishes, and safe tool changes.
As Industry 4.0 evolves, tool offsets will become self-learning parameters, maintained automatically by smart sensors and AI algorithms — precision without manual intervention.
Leave a comment