CNC Path Analyzer

G90 absolute and G91 incremental coordinates: the moment the same number means a different position

Explains the difference between G90 absolute and G91 incremental commands, repetitive machining where incremental mode is useful, and accidents caused by not switching the mode back, using a rectangle example and a coordinate-tracking table.

The difference in one sentence

In G90 (absolute), X20. means "go to the position 20 in X from the work origin"; in G91 (incremental), X20. means "go 20 further in X from where you are now". The same letter and number become completely different destinations depending on the mode.

The two codes are modal commands of the same group, so once commanded they stay in effect until the other appears. Even if a block contains no G90/G91, the mode last commanded somewhere above applies.

Example and coordinate tracking

Drawing a 20×15 rectangle in G91 incremental mode and returning to G90

O3004
T1 M6
G21 G90 G17 G94
G54
S3000 M03
G00 X10. Y10. Z5.
G01 Z-1. F100
G91 X20. F300
Y15.
X-20.
Y-15.
G90 G00 Z50.
M30
Drawing a 20×15 rectangle in G91 incremental mode and returning to G90 — XY pathXY
Dashed light blue is G00 rapid traverse; solid orange is cutting motion. Arcs are expanded into calculated static curves.

The figure above is the CNC Path Analyzer result for this program (rapid 2 segments, linear cutting 5 segments).

Following the position line by line

The four blocks of the incremental section draw a 20×15 rectangle regardless of where they start. If you change the start point from (10,10) to (40,30), the rectangle moves with it. This is the greatest advantage of incremental commands.

BlockModeMovementPosition after the move (X, Y, Z)
G00 X10. Y10. Z5.G90-(10, 10, 5)
G01 Z-1. F100G90-(10, 10, -1)
G91 X20. F300G91X +20(30, 10, -1)
Y15.G91Y +15(30, 25, -1)
X-20.G91X -20(10, 25, -1)
Y-15.G91Y -15(10, 10, -1)
G90 G00 Z50.G90-(10, 10, 50)

Using incremental coordinates for repeated features

Incremental mode is especially useful when the same shape has to be made at several positions. If you write the shape incrementally as a subprogram, the main program only has to move to each position and call it. When repeating holes or slots at a fixed pitch, you simply repeat the same line such as G91 X15., which reduces mistakes.

On the other hand, incremental errors accumulate. If rounding the end points of arcs shifts each by 0.001 mm, the error is 0.01 mm after ten repetitions. For datum holes that need precise positions, or for the final position, it is better to command absolute coordinates to break the accumulation.

The most common accident: ending without cancelling G91

If you do not return to G90 after an incremental section, the following G00 Z50. means "50 mm higher than now" instead of "to height 50", and a block such as G00 Z-5. means "5 mm lower than now" instead of "to height -5". That is how a move believed to go to the tool change position ends up heading into the workpiece.

This is why the last block of the example writes the mode change and the move together on one line, as G90 G00 Z50.. Subprograms often end in G91, so it is a safe habit to write G90 again on the first line of the main program after the call.

Which to use by default

  • Use G90 absolute as the default for the whole program. The destination is visible on every line, which makes reviews easy.
  • Use G91 only where the relative shape matters, such as repeated shapes, subprograms and fixed-pitch moves, and return to G90 as soon as the section ends.
  • Remember that on most controllers arc I/J/K are read as incremental (from the start point) regardless of the mode. Details are in the G02/G03 article.

Frequently asked questions

Can absolute and incremental be mixed in one block?
G90/G91 on a machining center is a block-level mode, so they cannot be mixed within a block. On a lathe, X/Z and U/W are address-level, so they can be mixed, as in X30. W-5..
Is there an easy way to find incremental sections in the tool?
In CNC Path Analyzer, stepping through playback one block at a time shows the end coordinates of each block. If a line starts somewhere unexpected, check whether G90/G91 changed just above it.

Next steps

Check the path in CNC Path Analyzer