Printed from Kezuriba (kezuriba.net/en/nc/g52/)
G52
Machining center, LatheOne-shot, group 00Local coordinate system setting
Format and notes
G52 X_ Y_ Z_ (cancel with G52 X0 Y0 Z0)
- Creates a child coordinate system, shifted within the current work coordinate system (G54, etc.)
- If you forget to cancel it, all later machining positions are shifted. Always write G52 X0 Y0 at the end of a subprogram
Diagram: Machine zero and work zero (coordinate systems)
Differences between controls and machines
The same code can be written or assigned differently depending on the CNC control and the machine builder. Always check your machine’s manual.
| Source | Machine | Item | Detail |
|---|---|---|---|
| Haas | Machining center | Meaning | Global shift added to all work coordinate systemsHaas mills change behavior with a setting (Setting 33: FANUC/HAAS) and label it group 00 or 12. Returns to 0 on M30, reset, etc. |
Frequently asked questions about G52
- What is G52 (Local coordinate system setting) used for and how is it formatted in a CNC program?
- G52 commands "Local coordinate system setting" on Machining center, Lathe. The standard program format is "G52 X_ Y_ Z_ (cancel with G52 X0 Y0 Z0)". Creates a child coordinate system, shifted within the current work coordinate system (G54, etc.)
- Is G52 a modal code or a one-shot (non-modal) code?
- G52 is a one-shot (non-modal, Group 00) code. It acts only in the single block where it is written and does not carry over to the next block, so you must write G52 on every line where that action is required.
- Does G52 work differently on machining centers (mills) versus CNC lathes?
- G52 is primarily used on Machining center, Lathe. Depending on the machine type and the lathe G-code system (System A, B, or C), this code may be unavailable or assigned to a different function, so verify against your machine tool manual.
- Are there differences in G52 across FANUC, Mitsubishi, Okuma, Haas, and Siemens controls?
- Yes. Control builders such as FANUC, Mitsubishi Electric (M80/M800), Okuma (OSP), Haas, Mazak, Siemens (SINUMERIK ISO dialect), and Heidenhain can differ in argument letters, decimal-point rules, and optional parameters for G52. Review the control comparison table above and verify the exact syntax in your machine’s programming manual before proving out the program.
Sources
The meaning of this code agrees in two or more sources from different publishers. Explanations are written in our own words.
- Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Milling, 04.2007 Edition (6FC5398-7BP10-0BA0) cache.industry.siemens.com
- Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Turning, 04.2007 Edition cache.industry.siemens.com
- Haas Automation, Inc. — G-code, M-code, and Setting (per-code explanation pages) haascnc.com
- Haas Automation, Inc. — Mill Operator's Manual – 17 Mill G-Codes (online version) haascnc.com
- Haas Automation, Inc. — Lathe Operator's Manual – 16 Lathe G-Codes (online version) haascnc.com