CNC Absolute vs Incremental Programming: G90 & G91 Explained with Real Code
In CNC programming, G90 (absolute) and G91 (incremental) codes define how position commands are interpreted.
A misunderstanding between these two can cause severe crashes or dimensional errors — even in professional shops.
📌 1. G90 — Absolute Positioning Mode
G90 commands the machine to move to the exact coordinate position defined from the current work zero (G54, G55, etc.).
Example:
G90 G00 X50. Y25.
Moves directly to X = 50.0, Y = 25.0 relative to the work offset zero.
Every coordinate is absolute from the origin.
📌 2. G91 — Incremental Positioning Mode
G91 tells the control to move relative to the current position.
Example:
G91 G00 X10. Y-5.
Moves +10 mm in X and −5 mm in Y from the current tool position.
Every coordinate is relative to where the tool currently is.
📌 3. Comparing G90 and G91
| Mode | Position Type | Movement Example | Typical Use |
|---|---|---|---|
| G90 | Absolute | “Go to X50 Y25” | General machining, setup repeatability |
| G91 | Incremental | “Move +10 from here” | Looping, macros, pattern repeats |
📌 4. Fanuc Example — Switching Between G90 & G91
%
O3000 (ABSOLUTE VS INCREMENTAL)
G90 G00 X0 Y0 Z50
G01 X50. Y25. F300
G91 X10. Y10.
G90 X60. Y35.
M30
%
| Code | Explanation |
|---|---|
| G90 | Moves to X0 Y0 Z50 from origin |
| G91 | Moves +10 X, +10 Y from current position |
| G90 | Returns to absolute mode |
📌 5. Haas Example — Incremental Drilling Pattern
G90 G00 X0 Y0 Z5
G81 Z-15. R2. F150
G91 X20
G80
G90
- Drills first hole at X0
- Then moves +20 mm and drills again
- Switches back to G90 to end safely
📌 6. Siemens Example — TRAORI and G90/G91 Use
TRAFOOF
G90 L X50 Y0 Z10
G91 L X20
G90 L X70 Y20
Siemens retains motion modes in 3D transformations — TRAORI active moves are always relative, even with G90 declared.
📌 7. Heidenhain Example
L X+50 Y+25 (Absolute)
L IX+10 IY-5 (Incremental)
- L = linear motion
- IX/IY prefix defines incremental shift
📌 8. Common Mistakes
| Mistake | Result |
|---|---|
| Forgetting to return to G90 | Tool moves relative → crash |
| Mixing absolute and incremental in same cycle | Wrong hole pattern |
| Incremental retract without G90 reset | Rapid move to wrong position |
📌 9. Safe Programming Practices
- Always define
G90in your safe start block. - Use
G91only in short, controlled loops. - Cancel
G91withG90immediately after use. - Comment lines where G91 is activated.
Example:
G90 G17 G40 G80 G21
...
(Drilling pattern)
G91 (Incremental loop start)
X20 (Next hole)
G90 (Return to absolute mode)
📌 10. Macro Example — Pattern with G91 Loop
#100=0
G90 G00 X0 Y0
WHILE[#100LT5]DO1
G91 X20
G81 Z-10. R2. F120
G80
#100=#100+1
END1
G90
This creates five holes, each spaced 20 mm apart, using incremental motion in a macro loop.
📌 11. Future (2025–2030)
- AI safety modes — automatic G91 detection before motion.
- Simulation-driven checks — warning pop-up if G91 left active.
- Hybrid coordinate modes — blending absolute and incremental control in 5-axis machining.
✅ Conclusion
Mastering G90 and G91 is critical for safe, predictable CNC programming.
By clearly controlling absolute and incremental modes, you prevent crashes, ensure dimensional accuracy, and maintain professional programming standards.
Leave a comment