Incremental vs Absolute Positioning in G-Code (G90 vs G91) Explained
One of the most fundamental — and most misused — concepts in CNC programming is the difference between absolute and incremental positioning. Controlled by G90 and G91, this affects how your machine interprets movement commands.
Misunderstanding this concept leads to:
- Lost part zero
- Overcuts
- Collisions
- Unpredictable toolpaths
🧭 G90 — Absolute Positioning
G90
G0 X50 Y25
The machine moves to X=50, Y=25 from the active origin (usually part zero or machine zero).
✅ Always goes to a specific point in space.
🔁 G91 — Incremental Positioning
G91
G0 X10 Y-5
Moves +10 mm in X and –5 mm in Y from current position.
✅ Think in terms of steps or deltas.
📊 Comparison Table
| Feature | G90 (Absolute) | G91 (Incremental) |
|---|---|---|
| Reference Point | Fixed origin (e.g. part zero) | Current position |
| Code Interpretation | To coordinate | By movement amount |
| Safer for complex parts | ✅ | ❌ (can accumulate error) |
| Preferred for loops | ❌ | ✅ |
🛠️ Real Example: Drilling Holes in a Line
🔸 With G90:
G90
G0 X0 Y0
G81 Z-10 R1 F100
X20
X40
X60
G80
Each X is an absolute coordinate from origin.
🔹 With G91:
G91
G0 X0 Y0
G81 Z-10 R1 F100
X20
X20
X20
G80
Each X move is +20 mm from previous — total movement accumulates.
📌 Best Use Cases
| G-Code | Use Case |
|---|---|
| G90 | Precise contouring, safe return paths |
| G91 | Drilling grids, repetitive moves, loops |
⚠️ Common Mistake: Forgetting Mode
This will go wrong:
G91
G0 X10 Y0
...
G0 X50 Y0 ← Not 50 mm from zero, but 50 mm from current!
Always set mode explicitly (G90 or G91) to avoid confusion.
🔄 Switching Modes Mid-Program
Programs often toggle between modes:
G90 ; Start with absolute
...
G91 ; Do an incremental drill loop
M98 P1000 L5
G90 ; Return to absolute
Good practice: always reset to G90 before program end.
🧪 Parametric Example: Incremental Looping
G91
#100=0
WHILE [#100 LT 5] DO1
G0 X20
G81 Z-10 R1 F100
#100=#100+1
END1
G90
This drills 5 holes spaced 20 mm apart using incremental logic.
🔧 G90/G91 with Z-Axis
G90 Z-10→ go to Z = -10 from zeroG91 Z-10→ move down 10 mm from current Z
⚠️ Always be cautious — with Z-axis, an incorrect mode may cause crashes.
🧠 Machine vs Work Coordinate System
- G90/G91 work within the current G54–G59 coordinate system
- If using machine coordinates (
G53), G90 mode is required
G53 G0 Z0 ; Go to machine Z zero (absolute only)
✅ Summary
Understanding G90 vs G91 is critical for safe, efficient, and accurate CNC programming:
- Use G90 for precision, safety, and clarity
- Use G91 for loops, repetitive moves, and compact code
- Always reset to G90 after incremental operations
- Document mode switches to avoid ambiguity
By mastering positioning logic, you can prevent programming errors, reduce crashes, and build bulletproof CNC routines.
Leave a comment