Tool Length Offsets vs Work Offsets in CNC: Understanding G43, H Values, and G54–G59
In CNC programming, understanding the difference between tool length offsets and work coordinate systems is essential for proper machine setup, collision avoidance, and accurate machining.
🔍 What Are Tool Length Offsets?
Tool length offset compensates for the difference in length between tools. Without it, every tool change would require redefining Z-zero.
🧰 Example:
- Tool 1: 50mm long
- Tool 2: 80mm long
Without offsets, Tool 2 would cut 30mm deeper!
🧠 G43 and H Values Explained
G43 H01
G43= Activate tool length compensation (positive direction)H01= Use tool length offset from table position #1
🔁 H vs T Numbers
| T (Tool Number) | H (Offset Number) |
|---|---|
| T1 | H1 |
| T2 | H2 |
| T5 | H5 |
✅ It’s best practice to match T and H numbers.
🔧 Tool Table Example
| Tool # | Length (mm) | Description |
|---|---|---|
| 1 | 50.000 | Ø10 End Mill |
| 2 | 80.000 | Ø12 Face Mill |
| 3 | 65.000 | Spot Drill |
In G-code:
T1 M6
G43 H1 Z100 ; Applies +50mm compensation
📌 G44 – Negative Compensation (Rarely Used)
G44 H1 Z100 ; Moves Z to 100 - tool length
❌ G44 is rarely used. Most machines and programmers stick to G43 for simplicity and compatibility.
📍 What Are Work Offsets (G54–G59)?
Work offsets shift the entire coordinate system to align with the part zero.
🧭 Typical use:
G54 ; Select workpiece coordinate
G0 X0 Y0 Z0 ; Move to part zero
Work offsets allow:
- Multiple parts/fixtures
- Consistent part zero without editing code
- Quick part setups
🧪 Combined Example: Tool + Work Offset
G17 G21 G40 G49 G90
T1 M6 ; Select Tool 1
G54 ; Select Work Offset
G0 X0 Y0
G43 H1 Z100 ; Tool length compensation
G1 Z-5 F200 ; Start cutting
This program:
- Uses G54 to locate the part
- Uses G43 H1 to apply tool length
- Cuts with proper depth, regardless of tool size
🧱 Visual Explanation
Machine Z Zero
|
|-- Tool Length Offset (H1) --> Tool tip
|
|-- Work Offset (G54 Z0) ----> Top of part
|
|-- Actual Cut Depth --------> Z-5
🚦 Safety Tips
- ✅ Always call
G43 H__after tool change - ✅ Use
G49to cancel tool offset if needed - ✅ Match T and H numbers (T1 → H1)
- ❌ Never use tool offset without verifying in tool table
- ✅ Simulate your code in CAM or with a G-code simulator
🧼 Best Practices
| Tip | Why It Matters |
|---|---|
| Match T and H numbers | Simplifies programming |
| Use separate work offsets per fixture | Avoids errors in setups |
| Always define Z0 on part surface | Standardizes depth references |
| Probe each tool with tool setter | Ensures accurate Z compensation |
| Simulate toolpaths before running code | Prevents crashes |
🔁 Tool Offset vs Work Offset: Summary
| Feature | Tool Offset (G43 H__) | Work Offset (G54–G59) |
|---|---|---|
| Purpose | Compensates for tool length | Defines part zero |
| Affects | Z-axis only | X, Y, and Z axes |
| Stored in | Tool Table (H values) | Work Offset Table (G54–G59) |
| Changes with tool? | Yes | No |
| Changes with part? | No | Yes |
✅ Quick G-Code Template
G17 G21 G40 G49 G90
T2 M6 ; Select Tool 2
G54 ; Work coordinate
G43 H2 Z100 ; Tool length offset
M8 ; Coolant on
G0 X0 Y0
G1 Z-2 F150 ; Cutting move
...
G0 Z100
M9 ; Coolant off
G49 ; Cancel length offset
🔚 Final Thoughts
By mastering Tool Length Offsets (G43, H) and Work Offsets (G54–G59), you unlock the ability to:
- Reuse programs across jobs
- Safely switch tools
- Precisely control depth and alignment
Tool offsets define how long your tool is.
Work offsets define where your part is.
Understanding both is the foundation of accurate, repeatable CNC machining.
Leave a comment