G90 and G91 — Absolute vs Incremental Positioning in CNC Milling

Every position command in a G-code program is interpreted in one of two ways: as an absolute coordinate (measured from the work zero) or as an incremental distance (measured from wherever the tool currently is). G90 selects absolute mode; G91 selects incremental mode.

Getting these modes wrong is one of the most common causes of unexpected machine movement — and one of the easiest mistakes to prevent once you understand how each mode works.

G90 — Absolute Positioning

In G90 mode, every axis value is a coordinate measured from the active work zero (typically G54). If you program X50., the machine moves the X axis to position 50mm from the part datum — regardless of where the tool currently is.

G90 G54          (absolute mode, work offset 1)
G0 X0. Y0.       (move to part zero)
G0 X50. Y30.     (move to X50, Y30 from part zero)
G0 X80. Y30.     (move to X80, Y30 — moves 30mm in X)

Absolute mode is the default for most milling programs and is the clearest way to define part geometry — every position is unambiguous because it always refers to the same fixed origin.

G91 — Incremental Positioning

In G91 mode, every axis value is a distance to travel from the current position. If the tool is at X50 and you program X30., the machine moves 30mm in the positive X direction and arrives at X80.

G91              (incremental mode)
G0 X30.          (move 30mm in +X from current position)
G0 Y-20.         (move 20mm in -Y from current position)
G0 X-10. Y10.    (move diagonally)

Incremental mode is useful when the distance matters more than the destination — bolt circle patterns, equally spaced holes, or returning a fixed distance from the current position.

Mixing G90 and G91

You can switch between modes within a program. This is common when using G28 (reference return), which is almost always programmed in G91:

G0 Z50.          (absolute — retract to Z50)
G91 G28 Z0.      (incremental — move zero distance, then go home)
G90              (return to absolute for next operation)

G91 G28 Z0. is a standard idiom: the Z0. means "move zero incremental distance first, then go home from here." This is safer than G90 G28 Z0. which would command the machine to move to the absolute position Z0 before going home — potentially crashing into the part if Z0 is the part surface.

Common Application: Equally Spaced Holes

Incremental mode simplifies programming repeated features at equal spacing without calculating absolute positions:

G90 G0 X10. Y10.     (absolute — move to first hole)
G91                   (switch to incremental)
G81 Z-15. R3. F200   (drill first hole)
X20.                  (drill second hole, 20mm right)
X20.                  (third hole)
X20.                  (fourth hole)
G80 G90              (cancel cycle, return to absolute)

The same result in absolute mode requires calculating X10, X30, X50, X70 — more work with no benefit.

Why Most Programs Stay in G90

Absolute mode is safer for general milling because every position is independent. If a block is skipped, the machine still goes to the correct absolute position. In incremental mode, skipping a block shifts all subsequent positions — a single missed block can cascade into every following move being wrong.

For this reason, most post-processors output purely in G90, switching to G91 only for G28 calls and occasionally for drilling patterns.

G90/G91 and Canned Cycles

Inside canned cycles (G81, G83, G84, etc.), the behavior of G90/G91 applies to the XY positioning moves between holes, not to the Z depth parameter. The Z and R values in a canned cycle are always interpreted relative to the R-plane and the work zero — the G90/G91 mode affects only the hole position moves.

Some controllers handle this differently. On Fanuc, G91 inside a canned cycle makes the XY hole positions incremental while the Z and R remain absolute-like. Always verify with a simulation when combining incremental mode with canned cycles.

The Most Dangerous Mistake

Leaving G91 active accidentally after an incremental section is one of the most common causes of crashes. If you forget to return to G90 after an incremental move, the next positioning command — which the programmer intended as absolute — becomes incremental, and the machine moves an unexpected distance.

G91 G0 X20.      (incremental — intended)
                 (programmer forgets G90 here)
G0 X50.          (programmer intended: move to X50 absolute)
                 (machine executes: move 50mm in +X from current position)
                 (CRASH if outside travel limits)

The fix: always restore G90 immediately after any G91 section, and include G90 in your program's safety header.

Simulate Before Running

Absolute/incremental errors produce large, unpredictable movements that are visually obvious in simulation but completely invisible in the G-code listing. Load your program into Eureka3X to watch the actual tool path — a position error caused by a wrong modal mode will show up immediately on the 3D machine model.

Try Eureka3X free for 30 days →

Related Articles

Start verifying your real G-code today.

Ensure your programs are safe and accurate with Eureka 3X Pro.

Start 30-Day Free Trial