G90 vs G91: Absolute and Incremental Positioning in CNC Programming
In CNC programming, G90 and G91 control how the machine interprets coordinate positions. They define whether each move is made relative to a fixed origin (G90) or relative to the current tool position (G91).
A single wrong command can cause crashes — so mastering this is essential.
🔍 G90 – Absolute Positioning
G90
G0 X50 Y30
- Moves to X50 Y30 from the machine or workpiece zero
- All future moves are interpreted as absolute coordinates
✅ When to Use G90:
- Most common in CAM-generated code
- Easy to understand and debug
- Prevents cumulative errors
- Ideal for jobs with complex toolpaths
🔁 G91 – Incremental Positioning
G91
G0 X10 Y0
- Moves +10 units in X, relative to current position
- Great for loops, repetitive spacing, patterns
✅ When to Use G91:
- Hole arrays or patterns
- Subprograms and macro loops
- Engraving repeated characters
- Manual jogging or probing
🔧 Switching Between G90 and G91
Both G90 and G91 are modal — once activated, they stay on until changed.
🧠 Example:
G90
G1 X100 Y50 F200
G91
G1 X10 Y0
G90
G1 X0 Y0
This moves:
- To X100 Y50 from zero (absolute)
- 10mm further in X (relative)
- Back to X0 Y0 from origin
⚙️ Real-World Use Case: Drilling a Hole Pattern
🧱 Absolute (G90):
G90
G81 X10 Y10 Z-5 R2 F100
X20 Y10
X30 Y10
G80
- Each hole has its full coordinate explicitly stated
🔁 Incremental (G91):
G91
G81 X10 Y0 Z-5 R2 F100
X10 Y0
X10 Y0
G80
- Starts at initial point, then adds 10mm in X after each move
❌ Common Mistakes to Avoid
| Mistake | What Happens | Solution |
|---|---|---|
| Forgetting G90/G91 change | Machine interprets wrong direction | Always declare G90 or G91 |
| Incrementing large moves | Unexpected rapid movement | Use G90 unless increment needed |
| Mixing G90 & G91 inside loops | Erratic motion | Keep consistent in subprograms |
| G91 at program start | Unpredictable result | Start with G90 to define zero |
🧪 Sample Program with Mixed Modes
%
O7001 (G90 vs G91 Example)
G21 G90 G54
G0 X0 Y0 Z5
G81 Z-10 R2 F150
X10 Y0
X20 Y0
X30 Y0
G91
X10 Y0 ; moves 10mm right from last point
X10 Y0
G80
G90
G0 Z100
M30
%
🛡️ Safety Tips
- Always begin your program with a clear G90 or G91 declaration
- In subprograms/macros: set positioning mode explicitly
- Use G90 for complex part shapes, G91 for simple repetitive tasks
- When debugging: switch all to G90 first to trace motion clearly
📐 Coordinate Visualization
G90 (Absolute):
(0,0) → X10 → X20 → X30
G91 (Incremental):
Start → +X10 → +X10 → +X10
Both reach the same end point — but the logic differs greatly!
🔚 Final Thoughts
G90 and G91 are the foundation of CNC motion logic. By understanding their use cases and pitfalls, you avoid crashes, reduce debugging time, and write smarter programs.
Don’t let one G-code mode ruin your setup — declare it, double-check it, and control it.
Leave a comment