Skip to content

G90 and G91: the two ways to read a coordinate

G90 and G91 decide how the control reads the numbers after X, Y and Z: under G90 they are positions measured from part zero, and under G91 they are increments from wherever the tool is right now. They form a modal pair, so one of the two is always active, even when it is not written in the block. Understanding each one on its own is not the problem; the problem is knowing which one is active when the program is two hundred blocks in and has been through a subprogram, a canned cycle and a return to reference.

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.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Coordinates
Machine
Milling, Turning, Mill-turn
Risk
High
Example
G90 G54 / G91 X10

Syntax by control

Fanuc (milling)
G90 G54 G00 X50. Y30.
G90 and G91 are in the same modal group, so the last one written rules. The usual practice is to declare G90 in the header and write it again after every block that used G91.
Fanuc / Haas (turning)
G00 X50. Z-20. / G00 U-10. W-5.
On a lathe with G code list type A you do not switch modes: X and Z are always absolute and U and W are always incremental, and you can mix them in the same block. G90 and G91 mean something else there, or do not exist at all; check the G code list for your control.
Siemens 840D / 828D
G90 X50 Y30 / X=IC(10)
Besides modal G90 and G91, Siemens lets you change the mode of a single coordinate with AC() for absolute and IC() for incremental, without touching the modal state: X=IC(10) is an increment even with G90 still active.
Heidenhain TNC (Klartext)
L X+50 Y+30 R0 FMAX / L IX+10 IY+0 R0 FMAX
In Klartext there is no modal state: an increment is marked by putting an I in front of the axis letter (IX, IY, IZ). That wipes out the problem of inheriting a mode at the root, because every block says what it is.

Address letters used with it

LetterWhat it setsUnit
G90Absolute mode: coordinates are measured from the active part zero (the one in G54 or whichever offset is selected). It is the mode used to program 95% of geometry.modal, no units
G91Incremental mode: coordinates are the distance and direction of the move from the current position. X10. means ten millimeters more in X, not the position X10.modal, no units
U W (lathe)Incremental X and Z on lathes with G code list type A. They coexist with absolute X and Z in the same program and even in the same block.mm / in
AC() / IC() (Siemens)Force absolute or incremental on one specific coordinate without changing the modal state. Handy for a one-off increment inside an absolute program.mm / degrees
I before the axis (Heidenhain)Marks the coordinate as incremental block by block in Klartext: IX+10. It is not modal, so it is never inherited.mm

Worked example

Four holes in a line, 25 mm apart, drilled with a canned cycle. The example shows the three things you need to be clear on with the G90/G91 pair: incremental is convenient for repeating a pitch, inside a canned cycle R and Z also change meaning with the mode, and you have to get back to G90 before the next absolute position.

O0190 (CUATRO AGUJEROS: ABSOLUTO E INCREMENTAL)
( Program header. )
G21 G17 G40 G49 G80
( Millimeters, XY plane and a clean state. Note that neither G90 nor G91 has been declared yet here: whatever was left from before is in charge. )
G91 G28 Z0.
( Z to the reference point in incremental. This is the block that leaves G91 active, and it is the source of half the scares in the shop. )
T7 M06
( Loads the Ø8 drill. )
G90 G54 G00 X20. Y40.
( Back to G90 in the same block as the positioning move. Without that G90, X20. Y40. would be twenty and forty millimeters more from the reference point. )
G43 H07 Z50. M03 S2200
( T7 length offset and spindle on. )
M08
( Coolant on. )
G99 G81 Z-15. R3. F180
( First hole in absolute: Z-15 is the bottom coordinate and R3 the height of the approach plane, both measured from part zero. )
G91 X25. K3
( Switches to incremental and repeats the cycle three more times, each one 25 mm to the right of the last. With K, the control runs the cycle at each position without you writing them out. )
(EN G91 LA R Y LA Z DEL CICLO SE MIDEN DESDE LA POSICION ACTUAL, NO DESDE EL CERO DE PIEZA)
( Important warning: if the cycle had been programmed under G91 from the start, Z-15 would be a depth of fifteen millimeters counted from R, not the coordinate Z-15. )
G90 G80 G00 Z50. M09
( Back to absolute, cancels the cycle and retracts. The order within the block has no effect: what matters is that G90 is in this block, so that Z50. is a coordinate and not a jump. )
G91 G28 Z0. M05
( Z to the reference point, again in incremental, now with the spindle stopped. )
G90 M30
( Last return to absolute and end of program. This G90 is what leaves the machine in a known state for the next program. )
Open the simulator to check the example

Practical keys to using G90/G91 in the workshop

Which mode is active when the machine starts up

The modal state at power-up is not a constant of the language: a control parameter sets it, and the builder leaves it configured one way or another. The vast majority of mills start up in G90, but some do not, and on some controls power-up and the state after reset are configured separately. The same goes for the plane, the units and the feed mode. That is why every serious program starts with a safety line that explicitly declares G90, G17, G21, G40, G49 and G80: nothing is inherited, everything is stated.

What stays active after M30

M30 ends the program and sends the pointer back to the start, and it also resets the modal state to whatever the machine configuration says. Once again, a parameter decides that, not the standard. Some controls go back to G90 when the program ends and others stay exactly as they were in the last block. If the previous program ended in G91 and the next one does not declare G90 in the header, the first positioning move of the second program is a blind jump. The habit of writing G90 both on the first line and right before M30 covers both cases without depending on how the machine is set up.

When incremental really pays off

Absolute has one huge advantage: an error in one block does not carry into the next ones, because every coordinate is measured from part zero. In incremental, an error adds to everything that follows. Even so, incremental wins in three places: in repeated patterns with a fixed pitch, especially combined with the K in canned cycles and with subprograms; in returns to reference like G91 G28 Z0, where not depending on part zero is exactly the point; and in jumps from one part to the next on a multi-part fixture. Outside those cases, stay absolute.

Mistakes that cost you a part (or a tool)

  • Leaving G91 active after a G91 G28 Z0. and writing the next positioning move without G90: the coordinates turn into increments and the tool ends up where nobody expected it.
  • Trusting that the machine starts up in G90 because the one next to it does: the modal state at power-up depends on a control parameter, and you declare it in the header precisely so you do not depend on it.
  • Dropping a subprogram written in incremental into an absolute program without restoring the mode before M99: the next part comes out shifted.
  • Programming the Z and R of a canned cycle under G91 thinking they are still absolute coordinates: in incremental, Z is the depth counted from R and R is the distance from the current position.
  • Forgetting G90 in the block that carries the coordinate when coming out of incremental: the order within the block has no effect, what matters is that G90 is in that block.
  • Starting a program from an intermediate block with block search without checking which modal state the control restores.
  • On a lathe, trying to switch between absolute and incremental with G90/G91 on a type A list control, where the correct way is to write X/Z or U/W.

Frequently asked questions

What is the difference between G90 and G91?

G90 measures coordinates from part zero and G91 measures them from wherever the tool is at that moment. In G90, X50. is position fifty; in G91, X50. is a move of fifty millimeters in the positive direction, wherever it starts from.

Can I mix absolute and incremental in one program?

Yes, and it is the normal thing: returns to reference are written in incremental and geometry in absolute. The practical rule is to go back to G90 in the same block where you pick up an absolute coordinate, so you never leave a G91 hanging.

What mode does the machine start up in?

It depends on a control parameter and how the builder left it. G90 is the most common, but you cannot take it for granted. That is why the first line of the program declares the mode instead of inheriting it.

Does M30 put the control back in G90?

On many machines, yes, but that is also decided by the configuration. A program that ends in G91 can leave the control that way for the next one. Writing G90 before M30 and again in the header of the next program solves the problem without depending on the machine.

How do you do absolute and incremental on a Fanuc lathe?

With different letters instead of modal codes: X and Z are absolute and U and W are incremental, and they can appear together in the same block. This is the G code list type A system, the most widespread one on lathes.

Related codes

Risk: G90/G91G28/G30G52/G92G00G54-G59

Detailed data sheet for each code

Syntax by control, address letters, a commented program and the typical mistakes for each one.

Other codes in Coordinates

See the full list of G and M codes

Related apps