G-code reference

G52: Local coordinate system

G52 is local coordinate system. Shifts the zero point temporarily inside the active work offset. It is non-modal, so it acts only on the line it is written on.

What G52 does

G52 moves the program zero by the given amounts relative to the active work offset, so the same pattern can be cut at several places. G52 X0 Y0 removes the shift. Forgetting to remove it leaves every later program shifted.

TypeG-code
MachineMill and lathe
GroupNon-modal
ModalNo: acts only on its own line

G52 example

G52 X100. Y0.

Zero moves 100 mm in X inside G54.

WordWhat it means here
G52Local coordinate system
X100.X axis target (on a lathe, the diameter)
Y0.Y axis target

Codes people confuse with G52

CodeWhat it does instead
G92 Set coordinate system (shift). Tells the control that the current position has the given coordinates.
G54 Work offset 1. Selects the first work coordinate system, where program zero is on the part.

Other codes in the non-modal group

These also act only on their own line.

  • G04 Dwell
  • G09 Exact stop (one block)
  • G10 Programmable data input
  • G28 Return to reference position
  • G30 Return to second reference position
  • G50 Maximum spindle speed (lathe)
  • G53 Machine coordinate move
  • G65 Macro call
  • G92 Set coordinate system (shift)

Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.

Quick check: G52

  1. What does G52 do? (Mill and lathe)

  2. Which code: Shifts the zero point temporarily inside the active work offset.(Mill and lathe)

  3. What does G92 do? (Mill)

Show the answers
  1. Shifts the zero point temporarily inside the active work offset.
  2. G52
  3. Tells the control that the current position has the given coordinates.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does G52 mean in CNC programming?
Local coordinate system. Shifts the zero point temporarily inside the active work offset.
Is G52 modal?
No. G52 acts only on the line where it is written; the next line goes back to whatever modal codes were already active.
What is the difference between G52 and G92?
G52 (local coordinate system): shifts the zero point temporarily inside the active work offset. G92 (set coordinate system (shift)): tells the control that the current position has the given coordinates.
What is the difference between G52 and G54?
G52 (local coordinate system): shifts the zero point temporarily inside the active work offset. G54 (work offset 1): selects the first work coordinate system, where program zero is on the part.

G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.

Free preview · no card Try G-Code Sprint