G90 & G91: Absolute vs Incremental Positioning – Know the Difference Before You Crash
When writing CNC programs, one of the most critical choices is how movement commands are interpreted: absolute or incremental. This is controlled by the G-codes:
| G-Code | Mode | Interpretation of Coordinates |
|---|---|---|
| G90 | Absolute Positioning | All moves from part zero |
| G91 | Incremental Positioning | All moves from current point |
Choosing the wrong mode — or switching without realizing — can result in tool crashes, holes in the wrong place, or failed parts.
📍 What Is Absolute Positioning (G90)?
In G90, all positions are given relative to a fixed origin point, usually the part zero or work offset.
🔹 Example:
G90
G0 X10 Y20 ; Move to absolute position (10, 20)
G1 X30 Y40 ; Move to (30, 40)
- All coordinates are fixed and easy to verify on the drawing.
- Most CAM software outputs in G90.
🔁 What Is Incremental Positioning (G91)?
In G91, all movements are relative to the current position.
🔸 Example:
G91
G0 X10 Y0 ; Move +10mm in X
G1 Y20 ; Move +20mm in Y (from current point)
- Ideal for loops, patterns, or repetitive shapes
- Requires careful tracking of tool position
🧪 Comparison in Practice
Assume the tool starts at (0, 0):
🔹 G90 Example:
G90
G0 X10 Y10 ; Moves directly to (10,10)
G0 X20 Y20 ; Then moves to (20,20)
🔸 G91 Example:
G91
G0 X10 Y10 ; Moves +10 X and +10 Y → (10,10)
G0 X10 Y10 ; Moves another +10 X and +10 Y → (20,20)
🧠 Same destination, but different logic.
🧠 Where G91 Shines
G91 is powerful in repeating patterns or subprogram loops. For example, drilling a series of equally spaced holes:
G91
G81 X20 Z-10 R2 F100 ; Drill at current position
X20 ; Drill 20mm further in X
X20 ; Repeat
G80
- Efficient
- Shorter code
- Easy to adjust spacing
⚠️ Dangers of Mixing G90 & G91
If you forget to switch back to G90 after using G91, the next motion could go wildly off course.
❌ Bad Example:
G91
G0 X10 Y0 ; OK
G90
G0 X20 Y20 ; Fine
G0 X30 Y30 ; Expected: move to (30,30), but what if G90 wasn’t active?
Always reset positioning mode clearly at the start of your program:
%
O1001
G21 G17 G90 G40 G49
...
🧩 Mixing Modes Intelligently
You can mix G90 and G91 in the same program — just do it carefully.
🔸 Example: Absolute Setup + Incremental Repeats
G90
G0 X0 Y0 ; Go to starting position
G91
G81 X10 Z-5 R2 F100 ; Drill first hole
X10 ; Next hole
X10
G80
G90
G0 X0 Y0 ; Return to origin
📌 Summary Table
| Feature | G90 (Absolute) | G91 (Incremental) |
|---|---|---|
| Moves from | Part Zero | Current Position |
| Best for | General profiling | Loops/patterns |
| Safer to debug | ✅ | ❌ (easy to lose track) |
| CAM Output Style | Common | Rare |
| Useful with Subprograms | ❌ | ✅ |
🛠️ CAM Post-Processing Tip
Most CAM post-processors default to G90 for safety and compatibility. However, you can configure your post to use incremental moves for drilling or peck cycles, which can reduce code size.
🔚 Final Thoughts
Choosing between G90 and G91 isn’t just a syntax detail — it’s a mindset. Every program should explicitly declare the positioning mode and maintain it consistently unless there’s a deliberate reason to switch.
Precision starts with clear intentions — and that begins with G90 or G91.
Leave a comment