G-code reference
G52 G-Code: Local Coordinate System
Local Coordinate System — Shifts the zero point temporarily inside the active work offset. It is ideal for repeating features at several positions on one fixture.
| Property | Value |
|---|---|
| Code | G52 |
| Function | Local Coordinate System |
| Modal group | 00 |
| Type | One-shot (non-modal) — active only in its own block |
| Used on | Mills and lathes |
| Syntax | G52 X_ Y_ Z_ / G52 X0 Y0 Z0 (cancel) |
What does G52 do?
Shifts the zero point temporarily inside the active work offset. It is ideal for repeating features at several positions on one fixture.
G52 is a one-shot code: it only acts in the block where it is written, and the previously active modal codes take over again afterwards.
Syntax and parameters
G52 X_ Y_ Z_ / G52 X0 Y0 Z0 (cancel)| Address | Meaning |
|---|---|
X Y Z | Shift from the current work offset zero |
G52 example program
G54
G52 X100.0 Y0 (second part)
M98 P1000
G52 X0 Y0 (cancel shift)▶ Open this example in the G-code viewer
Tips and common mistakes
- Always cancel with G52 X0 Y0 Z0; a reset may not clear it on every control.
- Works inside every work offset (G54–G59).
Controller compatibility
G52 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.