G90 vs G91 in CNC Programming: Key Differences and Usage
G90 sets absolute positioning where coordinates refer to a fixed origin, while G91 sets incremental positioning where coordinates are relative to the current position. This difference changes how the machine interprets movement commands.Quick Comparison
Here is a quick side-by-side comparison of G90 and G91 codes in CNC programming.
| Feature | G90 (Absolute Positioning) | G91 (Incremental Positioning) |
|---|---|---|
| Position Reference | Fixed origin point | Current tool position |
| Coordinate Meaning | Coordinates are absolute values | Coordinates are relative distances |
| Use Case | Precise location from zero point | Stepwise or repetitive moves |
| Movement Commands | Move to exact coordinate | Move by specified offset |
| Typical Example | Move to X=100, Y=50 | Move 10 units right, 5 units up |
| Reset Needed? | No, always from origin | Yes, depends on current position |
Key Differences
G90 and G91 control how the CNC machine interprets coordinate values in movement commands. With G90, all coordinates are absolute, meaning the machine moves to a fixed point measured from the program's origin or zero point. This is like using a map with fixed landmarks.
In contrast, G91 uses incremental positioning. Coordinates specify how far to move from the current position, not from a fixed origin. This is like giving directions step-by-step, such as "move 5 steps forward" rather than "go to the park."
Choosing between them affects programming style and machine behavior. G90 is preferred for precise, repeatable positioning, while G91 is useful for repetitive or relative moves where the exact absolute position is less important.
Code Comparison
Example: Move the tool first to X=100, Y=50, then move 10 units right and 5 units up.
G90 ; Set absolute positioning G00 X100 Y50 ; Move to absolute position X=100, Y=50 G01 X110 Y55 F100 ; Move to absolute position X=110, Y=55 at feed rate 100
G91 Equivalent
Using incremental positioning to achieve the same moves as above.
G91 ; Set incremental positioning G00 X100 Y50 ; Move 100 units right and 50 units up from current position G01 X10 Y5 F100 ; Move 10 units right and 5 units up at feed rate 100
When to Use Which
Choose G90 when you need precise control over exact positions relative to a fixed origin, such as machining complex parts where repeatability is critical. It simplifies understanding the program because all coordinates refer to the same reference point.
Choose G91 when performing repetitive or incremental moves, like drilling a pattern of holes spaced evenly or making small adjustments relative to the current tool position. It can simplify programming for stepwise operations.
Key Takeaways
G90 uses absolute coordinates from a fixed origin for precise positioning.G91 uses incremental coordinates relative to the current position for stepwise moves.G90 for complex, repeatable machining tasks.G91 for repetitive or relative movements.