G43, G44, G49: Tool Length Compensation in CNC – Prevent Z-Axis Errors
In CNC milling, tool length compensation ensures that each tool operates at the correct height, accounting for differences in tool length. Without it, the machine would treat all tools as the same length — causing crashes, miscuts, or ruined parts.
These G-codes control tool length compensation:
| Code | Meaning |
|---|---|
| G43 | Positive length compensation |
| G44 | Negative length compensation |
| G49 | Cancel length compensation |
🔧 What is Tool Length Compensation?
Each tool has a unique length. Tool length compensation allows the CNC machine to:
- Use a fixed Z reference (e.g., machine table or top of part)
- Automatically adjust Z based on the H (height) offset
- Avoid reprogramming Z values for each tool
This is critical for accurate Z-depth control.
🧪 Basic Syntax
G43 H1 Z100 ; Apply positive offset using offset #1
G44 H2 Z100 ; Apply negative offset (rarely used)
G49 ; Cancel tool length compensation
H1,H2etc. correspond to the tool length offsets stored in the offset table.- G43 is most commonly used.
📊 Tool Offset Table Example
| Tool # | H Offset | Measured Tool Length (mm) |
|---|---|---|
| T1 | H1 | 120.4 |
| T2 | H2 | 118.0 |
| T3 | H3 | 130.5 |
When you call G43 H1, the machine raises/lowers the Z-axis by 120.4 mm from the reference point.
⚙️ Typical Program Flow
%
O1000 (Tool Length Compensation)
G21 G90 G17
T1 M6 ; Select tool
G0 X0 Y0
G43 H1 Z50 ; Activate tool length offset
S1200 M3
G1 Z0 F150 ; Safe, accurate cut
G0 Z100
M30
%
🚫 Common Mistakes and Consequences
| Mistake | Result | Fix |
|---|---|---|
| Missing G43 | Tool plunges deep into part/table | Always use G43 with H-word |
| Wrong H value (e.g. H3) | Incorrect depth cut | Match H# to tool length correctly |
| Using G44 instead of G43 | Inverted compensation → crash risk | Use G43 unless specific case for G44 |
| Forgetting G49 | Compensation remains active | Cancel with G49 after last tool |
🛡️ Safety Tips
- Always use G43 + H# immediately after tool change (T# M6)
- Keep your tool length offsets accurate — use tool setters or manual measurement
- Avoid using G44 unless you’re sure — most modern machines and CAM software rely solely on G43
- Use G49 when returning to machine reference or before probing
🧠 When to Use G43 vs G44
| Code | Use Case |
|---|---|
| G43 | Standard tool height compensation |
| G44 | Rare reverse/negative offset cases |
| G49 | End of program or between tool changes |
🔍 Real-World Example: Drilling with Multiple Tools
%
O2025 (Multiple Tool Lengths)
G21 G90 G17
(--- TOOL 1 ---)
T1 M6
G0 X0 Y0
G43 H1 Z100
S1500 M3
G81 Z-20 R2 F150
X10 Y0
X20 Y0
G80
G49
(--- TOOL 2 ---)
T2 M6
G0 X0 Y0
G43 H2 Z100
S1800 M3
G81 Z-10 R2 F100
X10 Y0
X20 Y0
G80
G49
M30
%
This code correctly handles two tools with different lengths, using G43 and G49 around each tool section.
💡 Tip: Combine with Tool Radius Compensation
For best practices:
G43 H1 Z100 ; Tool length offset (Z axis)
G41 D1 ; Tool radius compensation (XY plane)
This ensures both vertical and horizontal accuracy.
🧪 Visualization
Without G43:
Z0 assumed same for all tools → CRASH!
With G43:
Z0 + H1 → correct for tool length
🔚 Final Thoughts
G43 is one of the most important and misunderstood G-codes in CNC programming. By implementing proper tool length compensation, you:
- Prevent crashes
- Improve cut depth consistency
- Enable quick tool changes with minimal setup
Respect the Z-axis — it’s where the deepest mistakes are made.
Leave a comment