Printed from Kezuriba (kezuriba.net/en/nc/g54-g59/)
G54–G59
Machining center, LatheModal, group 14Work coordinate systems 1–6 selection
Format and notes
G90 G54 G00 X_ Y_
- Register the offset from the machine origin to the work origin (work coordinate system offset) on the screen and call it by number
- G54 is the power-on default (Siemens ISO, Haas)
- Additional coordinate systems are written differently by builder: G54.1 P_ (FANUC-type, Siemens ISO), G110–G129/G154 P_ (Haas), etc.
- Beware of clashing numbers: G56 on FANUC-type controls is work coordinate system 3, but G56 on Okuma OSP is tool length compensation. G15 on FANUC-type controls cancels the polar coordinate command, but on Okuma G15 H_ selects the work coordinate system. This is dangerous when reusing a program from another maker's machine
Diagram: Machine zero and work zero (coordinate systems)
Full guide with examples: Machining center programming basics (practise G54, G43 and G41 in a simulator)
- Setting work zero and tool length (edge finder, probe and how to get the G54 values)
- Codes whose numbers clash (Okuma G15, G56, etc.)
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.
“One source / reference” rows were confirmed in only one source. “CAM post output / reference” rows show what a CAM post processor outputs and could not be confirmed in the control maker’s own public documents.
| Source | Machine | Item | Detail |
|---|---|---|---|
| Haas | Machining center | Group | 12 |
| NIST | Machining center | Group | 12RS274/NGC has 9 systems, up to G59.1–G59.3 |
| CAM post for Okuma (Autodesk) | Machining center | Code | Okuma OSP selects the work coordinate system with G15 H_ (1–200)CAM post output / reference |
Frequently asked questions about G54–G59
- What is G54–G59 (Work coordinate systems 1–6 selection) used for and how is it formatted in a CNC program?
- G54–G59 commands "Work coordinate systems 1–6 selection" on Machining center, Lathe. The standard program format is "G90 G54 G00 X_ Y_". Register the offset from the machine origin to the work origin (work coordinate system offset) on the screen and call it by number
- Is G54–G59 a modal code or a one-shot (non-modal) code?
- G54–G59 is a modal code (Group 14). Once commanded, it remains active across subsequent blocks until another code from the same modal group overrides it or the control is reset. Always state or cancel modal states explicitly in your safety block and at the end of a tool operation so residual modes do not cause unexpected motion when restarting mid-program.
- Does G54–G59 work differently on machining centers (mills) versus CNC lathes?
- G54–G59 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 G54–G59 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 G54–G59. 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.
- Mitsubishi Electric — The Basics of CNC Machining Programming (for Machining center) e-Learning material (PDF) mitsubishielectric.com
- 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. — 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
- National Institute of Standards and Technology (NIST), USA — The NIST RS274NGC Interpreter – Version 3 (NISTIR 6556, 2000) nvlpubs.nist.gov
- Saitama University, Faculty of Engineering, Department of Mechanical Engineering, practical training — Machining center program 2019 (training NC program O19-0101, with comments) jisshu.mech.saitama-u.ac.jp
- Autodesk — OKUMA milling post processor (okuma.cps, Fusion post library) cam.autodesk.com