Back to GSM Code List

G90: absolute coordinate programming

G90 makes every X, Y and Z dimension measured from the active work offset (G54-G59) and not from where the tool happens to be. It is modal and it is the normal way to work on a mill, because you can copy the print dimensions straight across. Watch out on a Fanuc lathe with the A code set: there G90 is not absolute mode, it is the straight turning cycle, and absolute is told apart by using X and Z instead of U and W.

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.

See the full data sheet for the family

Syntax by control

Fanuc / Haas (milling)

G90 G54 G00 X100. Y50.

This is the typical safety block at the start of every tool: absolute mode, work offset and positioning. Writing it in every tool keeps you from inheriting a G91 from the previous operation.

Fanuc (turning, A code set)

G90 X40. Z-50. F0.2

Here G90 is the single pass straight turning cycle, not absolute mode. In that format, absolute is programmed with X and Z and incremental with U and W inside the same block. Do not mix the two up when converting programs.

Siemens 840D / 828D

G90 G54 G0 X100 Y50

Siemens also lets you give a single absolute dimension inside an incremental block with AC(): X=AC(100). That way you do not have to change mode for one axis.

Heidenhain TNC (Klartext)

L X+100 Y+50 R0 FMAX

In Klartext dimensions are absolute by default and there is no G90 to write. An I in front of the axis (IX+10) makes that particular dimension incremental.

Address letters used with it

LetterWhat it setsUnit
X Y ZCoordinate of the destination point measured from the active work offset. Under G90 they are print dimensions; under G91 they would be increments.mm / in
Z and R in canned cyclesUnder G90 the Z of a canned cycle is the bottom coordinate and the R is the coordinate of the reference plane; under G91 they become distances.mm / in
G90.1 / G91.1On the controls that support it, G90.1 makes the I, J and K arc centers absolute and G91.1 returns them to incremental, which is the normal behavior.modal, no units

Worked example

An L-shaped slot in an aluminum plate with an 8 mm cutter. The three points of the path are dimensioned on the print from the same corner, so in absolute you copy them straight across. The comments say what each block would have to be if the same path were programmed in G91.

G21 G17 G40 G49 G80
( Millimeters, XY plane and a clean state. )
G91 G28 Z0.
( Z to the reference point in incremental: this particular block is done in G91 on purpose. )
T2 M06
( 8 mm cutter. )
G90 G54 G00 X10. Y10.
( Back to absolute and position. Under G90, X10 Y10 is a fixed point on the part; under G91 it would be 10 mm past wherever the cutter was. )
G43 H02 Z50. M03 S3800
( T2 length offset and spindle on. )
G00 Z2. M08
( Approach and coolant on. )
G01 Z-4. F200
( Goes in 4 mm below the face. In G90 it is a coordinate; in G91 it would be a 6 mm plunge from Z2. )
G01 X70. F450
( First leg of the slot out to X70. In G91 this block would be X60. )
Y45.
( Second leg out to Y45. In G91 it would be Y35. )
X30.
( Third leg out to X30. In G91 it would be X-40, with the sign giving the direction. )
G00 Z50. M09
( Retract and coolant off. )
G91 G28 Z0. M05
( Here incremental is what you want: it goes up from wherever it is to the reference point. Under G90 the block would go through the part Z0 first. )
G90
( Puts the control back in absolute before the end, so no later block inherits the G91. )
M30
( End of program. Many controls restore the default modals on M30, but that depends on machine parameters. )
Open the simulator to check the example

Practical keys to using G90 in the workshop

When you program in G90

Practically always on a mill: prints are dimensioned from a common origin and in absolute you copy the numbers with no arithmetic. On top of that, in absolute an error in one block affects only that block, while in incremental it drags everything that follows. The cases where you switch to incremental are few and well known: the safe retract G91 G28 Z0., repeated patterns with K or L, and geometry subprograms positioned from the calling block. Outside of that, the healthy thing is to write G90 in the safety block of every tool.

How it works with G54, canned cycles and arcs

G90 and G54 are different and complementary: G54 says what point you measure from and G90 says you measure from that point and not from the tool. In canned cycles the mode changes the meaning of two words: under G90 the Z is the bottom coordinate and the R the coordinate of the reference plane, while under G91 the Z is the depth from R and the R a distance from the current position. The I, J and K arc centers, on the other hand, stay incremental on Fanuc and Haas unless you turn G90.1 on.

What G90 does not do

It cancels nothing. It does not clear a G92 or a G52 left active: the origin is still shifted and the absolute dimensions are measured from that shifted origin, which is exactly why a correct program can cut in the wrong place. It does not guarantee the control powers up in absolute either: the default mode at power-on depends on a machine parameter. And on a lathe with the A code set it does not mean absolute at all, it is a turning cycle that drives the tool to the programmed diameter.

Mistakes that cost you a part (or a tool)

  • Assuming the control powers up in G90: the default mode at power-on depends on a parameter. Write G90 in the safety block of every tool.
  • Leaving a G91 active from the previous block, typically after a G91 G28 Z0., and carrying on with print dimensions: every following move adds to the current position.
  • On a Fanuc lathe with the A code set, writing G90 thinking of absolute mode: it launches the turning cycle and the tool drives to the programmed diameter at cutting feed.
  • Mixing G90 with the Z and the R of a canned cycle without recalculating: in absolute they are coordinates and in incremental they are distances, so the same cycle drills to a different depth.
  • Believing that G90 cancels an active G92 or G52: they are different groups and the origin shift stays in place even though the dimensions are absolute.
  • Writing a repeated pattern subprogram in G90: if the pattern is repeated at several positions it has to be in incremental and positioned from the calling block.

Frequently Asked Questions (FAQ)

Can G90 and G91 live in the same program?

Yes, and that is the norm: you work in G90 and switch to G91 for specific blocks, such as the retract G91 G28 Z0. or a repeated pattern. The important thing is to go back to G90 right afterwards. On Siemens and Heidenhain you can even mix them inside a block with AC() and I.

Does G90 mean the same on a lathe as on a mill?

Not always. On a mill G90 is absolute mode. On a Fanuc lathe with the A code set, G90 is the straight turning cycle and absolute is expressed by using X and Z against U and W. Before reusing a mill block on a lathe, check the code set of the control.

How do I know whether G90 or G91 is active?

On the modal code screen of the control, which shows the state of every group. It is the thirty second check worth doing before starting a program part way through or after jogging the machine by hand.

Does G90 affect the I, J and K of arcs?

On Fanuc and Haas, no: arc centers are incremental from the start point even in G90. They only change if the control supports G90.1 and you turn it on; G91.1 puts them back to normal.

And what about the drilling canned cycles?

Yes, on two words: under G90 the Z is the bottom coordinate and the R the coordinate of the reference plane. Under G91 the Z becomes the depth measured from R and the R a distance from the current position, so the same cycle makes a different hole.

Related codes

Related tools