Back to GSM Code List

G52 and G92: local coordinate system and coordinate preset

G52 and G92 both shift the part zero, but in two different ways. G52 adds a local shift to whatever work offset is active: with G54 on and G52 X90., the program X0 moves 90 mm and everything after it is measured from there. G92 adds nothing: it declares what coordinate the tool has at the position it is standing in right now, and the control works out the shift needed for that to be true. Both stay active until they are cancelled, and both are invisible unless you know where to look.

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
G52 X10 Y0 / G92 X0

Syntax by control

Fanuc (G52)

G52 X90. Y0. Z0.

The shift is added to the active work offset and it stays even if you go from G54 to G55. You cancel it by writing G52 X0. Y0. Z0., not with end of program and not with reset. The value is the total shift from the work offset, not an increment on the previous G52.

Fanuc (G92)

G92 X0. Y0. Z0.

It declares that the current tool position is the point you write. There is no motion: what moves is the coordinate system. On many controls the shift survives M30 and reset, and it only shows up on a separate screen. G92.1 X0 Y0 Z0 clears it without moving anything.

Haas

G52 X90. Y0.

On Haas the behavior of G52 depends on Setting 33, which selects the Fanuc or Yasnac coordinate system: in one of the modes G52 works as a global shift added to every work offset. Worth looking at before using it on a machine you do not know.

Siemens 840D / 828D

TRANS X90 / ATRANS X90

Siemens does not use G52: TRANS defines a programmable shift that replaces the previous one and ATRANS adds to the one already there. A TRANS with no values cancels it. The conceptual equivalent of G92 is PRESETON, little used and with the same precautions.

Heidenhain TNC (Klartext)

TRANS DATUM AXIS X+90 Y+0

The programmable shift is done with TRANS DATUM (in old programs, cycle 7 DATUM SHIFT) and cancelled with TRANS DATUM RESET. The fixed part datums live in the preset table, not here.

Address letters used with it

LetterWhat it setsUnit
X Y Z (with G52)How far the local zero is shifted from the active work offset, with its sign. It is a number you work out and the control adds.mm / in
X Y Z (with G92)What coordinate the position the tool is standing in right now takes on. The shift is deduced by the control, and therefore depends on where the machine was when the block ran.mm / in
G52 X0. Y0. Z0.The cancellation of the local shift. It is not optional: until it is written, the shift stays on for the following tools and for the following program.mm / in
G92.1On Fanuc, it clears the shift created by G92 without moving the axes and returns the coordinates to the offset table system. It is the clean way to leave the machine as it was.no units

Worked example

Four identical parts clamped in a row on a plate, 90 mm apart in X. The G54 work offset is picked up on the first one; the other three are machined with the same subprogram by shifting the local zero with G52. This is the clean use of this code: it is set, used and cancelled inside the same program that created it.

O0152 (CUATRO PIEZAS CON G52)
( Header of the main program. )
G21 G17 G40 G49 G80
( Clean starting state. )
G91 G28 Z0.
( Z to the reference point before the change. )
T1 M06
( 8 mm cutter. )
G90 G54 G00 X0. Y0.
( Work offset of the first part, the one picked up in the table. )
G43 H01 Z50. M03 S3000
( T1 length offset and spindle on. )
M98 P1520
( Calls the subprogram with the machining of one part, written entirely in coordinates relative to that part's zero. )
G52 X90.
( Shifts the local zero 90 mm in X. From here on, the X0 of the subprogram falls on the second part. The offset table is not touched: the G54 stays intact. )
M98 P1520
( The same subprogram, now on the second part. )
G52 X180.
( Third part. The value is the total shift from the G54, not an increment on the previous G52: writing G52 X90. again would not move anything along. )
M98 P1520
( Third part machined. )
G52 X270.
( Fourth part. )
M98 P1520
( Fourth part machined. )
G52 X0. Y0. Z0.
( Cancels the local shift. This block is mandatory: without it, the next tool and the next program would work 270 mm off while the offset table still looks correct. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop. )
G90 M30
( End of the main program. )
O1520 (SUBPROGRAMA: UNA PIEZA)
( The machining of a single part, in coordinates of its own zero. )
G00 X10. Y10.
( Positioning over the start of the step. )
G00 Z2.
( Approach. )
G01 Z-2. F150
( Enters the material. )
G01 X60. F500
( Cutting pass. )
G00 Z50.
( Retract in Z, so the next shift happens with the tool up. )
M99
( End of subprogram and return to the main one. )
Open the simulator to check the example

Practical keys to using G52/G92 in the workshop

G52 and G92 are not the same thing

G52 is a vector you know and the control adds to the active work offset: you write how far you want to shift, the value shows up on its own screen and it is cancelled by putting zeros in. G92 is a preset: you tell the control what coordinate the point the tool is standing on has right then and it deduces the shift needed. The practical difference is enormous, because the result of a G92 depends on where the machine was when it ran: the same program started from another position leaves a different zero. For repeatable work you use the offset table and, if you have to, G52.

Why G92 has a bad name

Because it stays active in silence. On many controls the shift it creates survives end of program, reset and even power down, and it does not appear in the offset table the operator looks at: the G54 looks perfect and the parts come out shifted. If on top of that the program is restarted without taking the machine back to the point where the preset was made, the zero shifts again and the error piles up run after run. That is why plenty of shops ban it in new programs and keep it only for old programs that were already written that way.

How you clean it out and how you check

G52 is cancelled by writing G52 X0. Y0. Z0. at the end of the program that used it, no exceptions. A G92 is cleared on Fanuc with G92.1 X0 Y0 Z0, which returns the coordinates to the table system without moving the axes. Before picking up a work offset it pays to check that neither of the two is active: the control has a shift screen where they show up, and the difference between the absolute position and the machine position gives them away too. When a part comes out shifted by a round number and the table is right, it is nearly always this.

Mistakes that cost you a part (or a tool)

  • Ending the program without cancelling the G52: the next operation, or the next program, is machined shifted with nothing on the screen to say so.
  • Writing G52 X90. four times thinking it accumulates: the value is the total shift from the work offset, not an increment.
  • Running a G92 with the tool in a position other than the intended one: the resulting zero is not the one you wanted, and there is no alarm to warn you.
  • Restarting a program that begins with G92 without taking the machine back to the starting point: the zero shifts again and the error piles up.
  • Picking up a new work offset with a G52 or a G92 active: the value stored in the table ends up compensated and everything else fails.
  • Going from G54 to G55 expecting to leave the local shift behind: the G52 is still on and now it adds to the new work offset.
  • Confusing the milling G92 with the Fanuc lathe G92, which in the A code system is a threading cycle and has nothing to do with it.

Frequently Asked Questions (FAQ)

What is the difference between G52 and G92?

G52 adds a shift you write to the active work offset and the control stores it as such. G92 declares what coordinate the current tool position has, and the control works the shift out from wherever the machine is. That is why G52 is repeatable and G92 depends on the moment it runs.

How do I cancel a G52 or a G92?

G52 is cancelled with G52 X0. Y0. Z0. on every axis you shifted. For G92, the clean way on Fanuc is G92.1 X0 Y0 Z0, which clears the shift without moving the axes. Neither end of program nor reset cancel them reliably.

How do I know whether a shift is active on the machine?

By looking at the control shift screen, where G52 and the G92 preset appear on their own row, and by comparing the absolute position with the machine position: if the difference does not match the value of the active work offset, there is something else in between.

Why is the part shifted if the G54 is right?

The classic cause is exactly this: a G52 that was never cancelled or a G92 inherited from another program. The offset table looks correct because the shift lives somewhere else. Check that before picking the part up again, or you will end up storing a false work offset that hides the problem.

Is there any need for G92 today?

Hardly ever. Everything G92 used to do is better handled with the offsets in the table (G54 to G59), with the extended ones (G54.1 P or G154 P) or by writing them from the program with G10. G92 survives mostly for compatibility with old programs.

Related codes

Other codes in Coordinate system

See the full list of G and M codes

Related tools