Fundamentals · machining
Work offsets (G54–G59) and tool lengths, without mistakes
Machine coordinates, work zero, G54–G59, G43 tool length: how they stack up, how to set a work zero, and the mistakes that break tools.
A CNC machine knows its own position (machine coordinates, set by homing). Your program is written from a point on the part (work zero). The work offset links the two. Understanding how offsets stack up prevents most crashes.
What stacks up
| Layer | Code | Who sets it |
|---|---|---|
| Machine coordinates | G53 | Homing (switches or index) |
| Work offset | G54…G59 (more on some controls) | The operator, by probe or edge |
| Tool length | G43 H… | Presetter, tool setter or operator |
| Tool radius (if compensating) | G41/G42 D… | Tool table |
| Temporary offset | G92 | Avoid, or cancel explicitly |
Actual tool position = programmed position + work offset + tool length (and radius). LinuxCNC documents this stack precisely on its Coordinate systems page.
Setting a work zero (mill or router)
- Home the machine at power-up, before any offset.
- Pick the zero point the programmer chose in CAM (corner, centre, top of part). It must be on the setup sheet.
- X and Y: 3D probe, edge finder or tool-and-paper on two faces; account for the probe or tool radius.
- Z: on top of the part (or the table, per convention), with a probe, gauge block or touch plate of known height.
- Store in the right offset (
G54for example) — not in another register by mistake. - Verify: in MDI,
G54 G0 X0 Y0, then step Z down slowly with feed override to a safe height above zero.
Tool lengths: two philosophies
- True length measured from the spindle face (presetter or tool setter): the
G54Z is measured once, tools are interchangeable. - Length relative to a master tool: simpler without a presetter, but everything depends on the master tool.
Do not mix both on the same machine without documenting it.
Several parts: G54, G55, G56…
One vise per offset lets you run the same program on several stations. CAM assigns one offset per setup; the control stores them. On a router, G54 often refers to the top of the sheet and G55 to the spoilboard top (for through cuts) — document it.
Lathe and plasma
- Lathe: Z zero is usually the finished face; X is spindle centre (diameter). Tool offsets carry both.
- Plasma: Z is generally handled by initial height sensing (IHS) at each pierce; X/Y zero is often a sheet corner set by jogging.
Common mistakes
- Setting zero before homing: the offset has no reliable reference.
- Storing zero in
G55while the program callsG54. - Forgetting the probe or cutter radius when picking up X/Y.
- Leaving a
G92active from a previous session.
Pre-cycle checklist
- Machine homed
- Offset called by the program = offset set
- Tool lengths current,
H=T - No
G92active - First move checked slowly at a safe height
FAQ
What is the difference between G53 and G28?
G53 moves in absolute machine coordinates for one line. G28 goes through an intermediate point then to a stored reference position; order and G90/G91 mode matter.
How many offsets are there?
G54 to G59 everywhere; many controls add extended offsets (G59.1–G59.3 on LinuxCNC, G54.1 P… on Fanuc-style controls).
Sources
- LinuxCNC — Coordinate systems, consulted November 26, 2026.
- LinuxCNC — Tool compensation.
- LinuxCNC — G-codes (G43, G53, G54–G59, G92).
One guide a week, French-first
New guides, used equipment in Quebec and price moves. No third-party ads.