Back to GSM Code List

G53: moving in machine coordinates

G53 runs the move in its block in machine coordinates, that is, measured from machine zero and not from part zero: in that block the control ignores the G54 and any active shift. It is not modal, so it only counts for the block it is written in and the next one goes back to whatever work offset was there. Its everyday use is retracting the Z axis to a safe position that does not depend on the part, and taking the table to a fixed load position.

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.

Family
Coordinate system
Machine
Milling, Turning, Mill-turn
Risk
High
Example
G53 G00 Z0

Syntax by control

Fanuc

G90 G53 G00 Z0.

G53 requires absolute mode: under G91 the control either ignores it or alarms, depending on the model. And since it is not modal, the move goes in the same block, with its own G00 or G01.

Haas

G53 G00 Z0.

This is the retract Haas recommends instead of G28: it takes Z to machine zero, which on a vertical mill is the highest point of the head travel. It pays to know how your machine behaves with the length offset active; if you want pure machine coordinates, cancel it first and prove the move out dry the first time.

Siemens 840D / 828D

G53 G0 Z0

Siemens also has G53 and suppresses the zero offset non-modally. G153 suppresses the basic frames as well, and SUPA suppresses everything, including shifts made with the handwheel.

Heidenhain TNC (Klartext)

L Z+0 R0 FMAX M91

M91 refers the coordinates of the block to machine zero and M92 to a fixed point defined by the builder. Like G53, they work block by block and change nothing that comes afterwards.

Address letters used with it

LetterWhat it setsUnit
X Y ZCoordinates in the machine system, measured from machine zero. On a vertical mill with zero at the top and at the back, nearly all of them are negative and Z0 is the highest point.mm / in
G00 / G01The type of move goes in the same block, because G53 is not modal and only changes that block. With G01 you also have to give a feedrate.modal, no units
G90G53 only makes sense in absolute. In incremental the control either ignores it or alarms, depending on the model.modal, no units

Worked example

End of an operation on a vertical mill with a tall fixture on the table. The tool retracts to the highest position with G53, and then the table comes out toward the operator to a fixed load position that does not depend on where the part zero is. The equivalent G28 block is included as a comment, to show they do not do the same thing.

O0153 (RETIRADA Y POSICION DE CARGA CON G53)
( Program header. )
G21 G17 G40 G49 G80
( Clean starting state. )
G90 G54 G00 X10. Y10.
( Work offset active: from here on the coordinates belong to the part. )
G43 H01 Z50. M03 S3000
( T1 length offset and spindle on. )
G00 Z2. M08
( Approach. )
G01 Z-4. F150
( Enters the material. )
G01 X95. F600
( Cutting pass. )
G00 Z10. M09
( Comes out of the cut. That Z10 is still a part coordinate: its real height depends on the G54 and on how tall the fixturing is. )
G40 G80 M05
( Cancels compensation and cycles, and stops the spindle before retracting. )
G90 G53 G00 Z0.
( The real retract: in machine coordinates, Z0 is the top of the head travel, so the tool goes all the way up whatever happens with the work offset or the height of the part. The block carries its own G00 because G53 is not modal. )
G53 G00 Y-380.
( With Z already up, the table comes out toward the operator to a fixed machine coordinate, the load position of the fixture. That coordinate is always the same even if the part or the work offset changes. )
(G91 G28 Z0. HARIA ALGO PARECIDO EN Z, PERO PASANDO POR UN PUNTO INTERMEDIO Y DEPENDIENDO DE G90/G91)
( The difference matters when somebody starts the program halfway through and the active modal is not the one that was assumed. )
G54 G90
( The next block goes back to part zero on its own: G53 has changed nothing permanent. This block is only here to make that explicit. )
M30
( End of program. )
Open the simulator to check the example

Practical keys to using G53 in the workshop

What machine coordinates are

Machine zero is set by the builder and the machine finds it when the axes are homed after power up: it is the origin of everything else. On a vertical mill it usually sits at the back right corner and at the top of the travel, so the machine coordinates of X, Y and Z are nearly always negative and Z0 is the highest point the head reaches. The work offset table stores precisely the distance between that zero and the part zero. G53 is the only instruction that lets you talk to the control in that system without touching any table.

Why it is used to retract

A safe height written in part coordinates depends on the work offset and on how tall the fixturing is: the same Z50 can be comfortable clearance or a crash depending on how the part was picked up or whether somebody changed the fixture. G53 G00 Z0. is always exactly the same spot on the machine, whatever happens to the offset table. On top of that it is not modal, it goes through no intermediate points and it does not depend on the previous G90 or G91, so it is the most predictable block you can write. It works just as well for taking the table to a fixed load or clean-up position.

What to keep in mind when you use it

G53 is always written with its move in the same block, in absolute mode, and with cutter compensation cancelled. With the length offset active some controls apply it and some do not, so the first time you prove it out dry and, if you want pure machine coordinates, you cancel it first with G49. The coordinates have to fall inside the axis travel: asking for a positive value on a machine whose zero is at the top throws an immediate overtravel alarm. And since it is not modal, the next block goes back to part zero with nothing needed.

Mistakes that cost you a part (or a tool)

  • Believing G53 X0. Y0. takes the table to part zero: it goes to machine zero, which is normally at one end of the travel.
  • Moving in XY with G53 without having taken Z up first: the tool crosses the whole table at whatever height it was.
  • Writing G53 in a block on its own expecting the rest of the program to stay in machine coordinates: it is not modal and only affects its own block.
  • Using G53 with G91 active: depending on the control it is ignored or it alarms, and in no case does it do what you expected.
  • Asking for positive coordinates on axes whose travel is negative: overtravel alarm the moment the block runs.
  • Running a G53 with cutter compensation on, without cancelling first with G40.
  • Blindly replacing every G28 in a program with G53 on a machine whose changer demands the exact reference position.

Frequently Asked Questions (FAQ)

What is the difference between G53 and G54?

G54 selects a work offset stored in the table and it is modal: everything that follows is measured from there. G53 ignores that offset and works in machine coordinates, and only during its own block. One says where the part is and the other speaks the language of the machine.

G53 or G28 to retract?

For an ordinary retract in Z, G53 G00 Z0. is more predictable: a direct move, no intermediate point and no dependence on G90 or G91. G28 is used when the builder or the tool changer demands the axis end up exactly on the reference point.

Why do G53 coordinates come out negative?

Because on most milling machines machine zero sits at one end of the travel, up and to the back, and the whole working envelope is on the negative side. That is also why the values in the work offset table usually come out negative in X, Y and Z.

Is G53 modal?

No. It only affects the block it is written in, and the next one goes back automatically to the active part coordinate system. That is one of its advantages: it leaves no state behind for somebody to inherit without noticing.

Does G53 take the tool length into account?

It depends on the control and on how the machine is set up. That is why, if you need pure machine coordinates, you cancel compensation first with G49, and in any case you prove the first G53 out dry on a machine you do not know.

Related codes

Other codes in Coordinate system

See the full list of G and M codes

Related tools