CNC mill · G-code

G52: local coordinate shift

G52 shifts the work coordinates by a set amount, so the same program runs at a second spot without a new work offset. Haas lists it as one-shot (group 00). Formats below from Haas and LinuxCNC, each from its maker.

Worked example

Run the same pocket on a second part 4" over. Written for this page in the Haas format.

G54 M98 P1001 (first part)G52 X4. (shift 4" in X)M98 P1001 (second part)G52 X0 (cancel the shift)

How each control writes it

Haas G52 X- Y- Z- A- B-

One source: Haas Automation, the control's maker

  • Setting 33 (Fanuc or Haas style) decides how G52 works.
  • Fanuc style: the G52 values are added to every work offset, and are cleared at power-on, reset, a mode change, the program end, M30, G92 or G52 X0 Y0 Z0 A0 B0.

Source: Haas Automation, mill G52

LinuxCNC G52 axes

One source: the LinuxCNC project, the control's maker

  • A temporary local offset inside the current work coordinate system.
  • How it combines with G92 is in LinuxCNC’s “Local and Global Offsets”.

Source: LinuxCNC documentation, "G52 Local Coordinate System Offset" (archived Oct 29, 2026)

No Fanuc row yet: that chapter of the 0i manual has not been read.

Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.