Understanding GCode G90 and Absolute Positioning

Understanding GCode G90 and Absolute Positioning

G-code is the programming language used to control CNC machines like 3D printers, CNC mills, CNC routers, and CNC lathes. One of the most commonly used G-codes is G90, which enables absolute positioning for motion commands. Understanding how G90 works and when to use absolute vs incremental positioning is crucial for effective CNC programming.

What is GCode G90 ?

G90 is the code used to set absolute positioning mode for motion commands like G0 (rapid move) and G1 (linear interpolation). With G90 active, the coordinates given for X, Y, Z specify the exact position to move to relative to the origin (0,0,0) coordinate of the machine.

For example, if the current position is X10 Y10 and a G0 X20 Y20 command is issued, the tool will move directly to the point X20 Y20. The coordinates X20 and Y20 are absolute positions referenced from the origin.

G90 absolute positioning contrasts with G91 incremental positioning where the coordinates specify the distance to move relative to the current position rather than an absolute point.

Why Use Absolute Positioning with G90?

There are a few key advantages to using G90 and absolute coordinates:

  • Exact tool positioning – With absolute coordinates, you can directly command the tool to move to an exact position on the workpiece without having to calculate increments from the current position. This makes programming motions and points much simpler.
  • Program simplicity – G90 allows CNC programs to be written as a series of discrete points to move to, without having to track the incremental moves. Programs are easier to visualize and modify.
  • Resume capability – If a CNC program is stopped midway and needs to be resumed, G90 allows it to continue moving to the proper remaining points. With incremental positioning, resuming the program would be more difficult since the new starting position would alter all the remaining increments.
  • Readability – Absolute coordinate programs clearly show the exact positions the tool will move to, rather than obscure offset values. This makes programs very readable for both programmers and operators.

For these reasons, G90 is the most commonly used mode for CNC positioning. Nearly all CNC programs will begin with a G90 command to initialize absolute mode before any motions occur.

When Should Incremental Positioning Be Used?

While G90 absolute positioning is generally preferred, the G91 incremental mode does have some uses:

  • Fine-tuning positions – Incremental motions allow you to tweak the position in very small increments to dial-in the perfect location.
  • Material removal – Incremental coordinates are useful for repetitive material removal operations like facing, planing, and roughing where the tool follows a regular incremental pattern.
  • Pattern generation – Some 2D patterns like grids and spirals can be easier to program using incremental motions rather than calculating absolute positions.

So while absolute mode will account for the bulk of your program motions, short segments of incremental positioning can be inserted where it makes sense. Just remember to switch back to G90 when finished with the incremental moves.

Programming Examples

To better understand the difference between absolute and incremental positioning, let’s look at some code examples.

First, a simple program using absolute coordinates:

G90 (Absolute positioning mode) G0 X10 Y15 (Rapid to point X10, Y15) G1 X30 (Linear motion to X30, Y stays at 15) G1 Y25 (Linear motion to X30, Y25) G0 X10 Y10 (Rapid back to X10, Y10)

And the same program using incremental coordinates:

G91 (Incremental positioning mode) G0 X10 Y15 (Move 10 units in X, 15 units in Y from current position) G1 X20 (Move 20 more units in X from current position) G1 Y10 (Move 10 more units in Y from current position) G0 X-20 Y-15 (Move -20 units in X, -15 units in Y from current position)

As you can see, the absolute program specifies the exact positions to go to while the incremental example uses relative offsets.

Important Gcode G90 Programming Notes

Important Gcode G90 Programming Notes

When programming with G90, keep these guidelines in mind:

  • Set G90 mode before any motion commands. This prevents unwanted incremental moves.
  • Double-check your zero reference point. Absolute coordinates depend on proper machine origin setup.
  • Beware of machine travel limits. Make sure your absolute positions are within the machine’s range of motion.
  • Reset to absolute mode after incremental moves. A simple G90 restores absolute positioning.
  • Use work offsets and subprograms for repeated features. This avoids redundant absolute coordinates.

Following these G90 programming best practices will help you be successful using absolute coordinates for your CNC projects.

Conclusion

Understanding the difference between G90 absolute positioning and G91 incremental positioning is a key foundation for effective G-code programming. While both have their uses, G90 will form the backbone of nearly all CNC programs due to the simplicity and precision of absolute coordinate moves. Mastering G90 absolute commands will give you the confidence and skill to program efficient toolpaths for any CNC machine.

1 thought on “Understanding GCode G90 and Absolute Positioning”

  1. Pingback: The Essential Guide for 3D Printing GCode - 3DPrinterStuff

Comments are closed.