Fanuc (milling and turning)
G90 G54 G00 X0. Y0.It goes in the safety block of every tool, together with G90. For more than six setups, Fanuc extends the list with G54.1 P1...P48 (up to P300 depending on the option).
We use technical and security cookies and, only if you accept, analytics with no cross-site tracking. More in the Cookie policy and Privacy policy.
We use first-party cookies and technical storage to make the site work, Google reCAPTCHA security technology and, only if you accept, Vercel analytics (no cookies, no cross-site tracking). You can accept or reject analytics; both options are equivalent and you can change your choice at any time. More info: Cookie policy, Privacy policy, Legal notice and Terms and conditions.
G54 selects the first work offset: from that block on, every X, Y and Z dimension in the program is measured from the point on the part that the operator picked up and stored in the offset table. It is modal, so it stays active until another G55-G59 replaces it. What the table stores is the distance from machine zero to part zero, normally negative in X and Y.
For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.
Fanuc (milling and turning)
G90 G54 G00 X0. Y0.It goes in the safety block of every tool, together with G90. For more than six setups, Fanuc extends the list with G54.1 P1...P48 (up to P300 depending on the option).
Haas
G90 G54 G00 X0. Y0.Identical to Fanuc. The extra Haas offsets are G154 P1...P99; older machines used G110-G129 for the same thing.
Siemens 840D / 828D
G54 G90 G0 X0 Y0On Siemens, G54-G57 are settable zero offsets; G505 to G599 extend the list and G500 deactivates them. There are also the programmable offsets TRANS and ATRANS, which add on top of the settable one.
Heidenhain TNC (Klartext)
CYCL DEF 247 FIJAR ORIGEN Q339=1On Heidenhain the datum comes from the preset table or from the datum table. Cycle 247 selects the preset number from inside the program, which is the practical equivalent of switching from G54 to G55.
| Letter | What it sets | Unit |
|---|---|---|
| X Y Z (in the table) | Values stored in the offset row: distance from machine zero to part zero on each axis. They are not written in the G54 block, they are loaded into the table or with G10. | mm / in |
| P (with G54.1 or G154) | Extended offset number when you have more setups than the classic six: G54.1 P7 on Fanuc, G154 P7 on Haas. | integer |
| L2 P1 (with G10) | The way to write the offset from inside the program: G10 L2 P1 X... Y... Z..., where P1 is G54 and P6 is G59. | mm / in |
Plate clamped in a vise. The operator picks up the front left corner and the top face and stores those values in G54; here they are written from the program with G10 L2 P1 to make clear what they mean. Then a step is milled with a 16 mm cutter.
O0054 (ESCALON CON ORIGEN G54) | ( Program header. ) |
G21 G17 G40 G49 G80 | ( Millimeters, XY plane and a clean state. ) |
G90 G10 L2 P1 X-412.350 Y-215.780 Z0. | ( Writes the G54 offset (P1) from the program: the distance from machine zero to the corner that was picked up. With G90 it replaces the value; with G91 it would add to it. Plenty of shops prefer to keep this in the table only. ) |
G91 G28 Z0. | ( Z to the reference point in incremental before the change. ) |
T1 M06 | ( 16 mm cutter. ) |
G90 G54 G00 X-15. Y10. | ( Turns the offset on and positions in part dimensions: X-15 is 15 mm to the left of the corner that was picked up. ) |
G43 H01 Z50. M03 S2600 | ( T1 length offset and spindle on. With the G54 Z at zero, it is the offset length that puts Z0 on the face. ) |
G00 Z2. M08 | ( Approach and coolant on. ) |
G01 Z-3. F150 | ( Goes 3 mm below the face: Z-3 is a part dimension, not a machine one. ) |
G01 X95. F600 | ( Cut along the plate for the step. ) |
G00 Z50. M09 | ( Retract and coolant off. ) |
G91 G28 Z0. M05 | ( Z to the reference point and spindle stop. ) |
G90 G53 X0. Y-400. | ( G53 works in machine coordinates and ignores the G54: it is how you bring the table out to the load position. ) |
M30 | ( End of program. ) |
G54 is the default and the one you use when there is a single setup. The next ones, G55 to G59, are for more parts on the table, for a setup in a fourth axis chuck or for several faces of the same part. Past six setups you move to the extended offsets, G54.1 P on Fanuc and G154 P on Haas. The healthy habit is to write the offset in the safety block of every tool, so that starting the program part way through does not inherit the offset of the previous operation.
G54 says what you measure from, G90 says the dimensions are absolute and G43 says how far the tool sticks out: the three go together in the start block. G52 and G92 add on top of the active offset and stay in effect until you cancel them, so it is best to avoid them or to clear them with G52 X0 Y0 Z0. G53, on the other hand, adds to nothing: it is a move in machine coordinates that ignores the active offset, and it is the clean way to go to a load or unload position.
The G54 row stores a vector: how far you have to travel from machine zero to part zero on each axis. Since machine zero on a mill is usually at the back right corner and at the top, the X and Y values come out negative, and Z as well if you touch off the face. That vector is the only thing that changes when the part moves a few millimeters: the program stays as it is. That is why picking the part up again and correcting the row is the most common setup job in the shop.
G54 selects a row of the work offset table, which is stored data you can see on the screen. G92 redefines the origin on the fly by declaring what coordinate the current position has, and that shift stays active invisibly until it is cancelled. For repeatable work you use G54.
The classic six, G54 to G59, plus the extended ones: G54.1 P1...P48 on Fanuc (up to P300 with the option) and G154 P1...P99 on Haas. On Siemens the list grows with G505 to G599 and on Heidenhain with the rows of the preset table.
The distance from machine zero to part zero on each axis, with its sign. On a mill with machine zero at the back right corner, X and Y come out negative. It is not the probe position and not the tool height: just where the zero of the part is.
It is not required because it is modal, but it is good practice: if the operator starts the program part way through, at the block for the third tool, that block has to bring its own G90 G54 and its G43 H so the machine does not inherit the state of the previous program.
Yes, and it is the normal thing with several parts on the table: you machine the first one under G54, call the subprogram under G55, and so on. Every offset change should happen with the tool retracted and in a safe positioning block.
CNC IDE: editing with G/M tooltips, line inspector, conversion between controls and 2D/3D toolpath.
CNC Alarms and Solutions Guide. Enter the error code or symptom to find the cause and how to repair it at the machine.
Estimate CNC turning and milling cycle time from G-code. Calculate parts per hour with a breakdown of cutting, rapids, canned cycles and tool changes.