Back to Supported G-Codes
G90 & G91 - Positioning Modes
DMC File Mode: Supported
Streaming Mode: Supported
Description
G90 and G91 commands control the positioning mode for all subsequent movement commands in your G-code program. These commands determine whether coordinate values are interpreted as absolute positions relative to the coordinate system origin, or as relative distances from the current position.
G90 (Absolute Positioning): All coordinate values represent absolute positions in the coordinate system. This is the most common mode and provides predictable, repeatable positioning.
G91 (Relative Positioning): All coordinate values represent distances to move from the current position. This mode is useful for incremental movements and certain machining patterns.
Syntax
G90 ; Set absolute positioning mode
G91 ; Set relative positioning mode
Parameters
Command | Parameters | Description |
---|---|---|
G90 | None | Sets absolute positioning mode |
G91 | None | Sets relative positioning mode |
Important Considerations
- G90 is the default mode when a program starts
- Mode changes (G90/G91) affect all subsequent movement commands until changed again
Examples
Basic Absolute Positioning (G90)
G90 ; Set absolute positioning
G0 X10 Y10 ; Move to absolute position (10, 10)
G1 X20 Y20 F1000 ; Move to absolute position (20, 20)
G1 X0 Y0 ; Move back to origin (0, 0)
Basic Relative Positioning (G91)
G90 ; Start in absolute mode
G0 X10 Y10 ; Move to starting position (10, 10)
G91 ; Switch to relative positioning
G1 X5 Y5 F1000 ; Move +5 in X and Y (now at 15, 15)
G1 X-10 Y0 ; Move -10 in X, 0 in Y (now at 5, 15)
G90 ; Return to absolute mode
Drilling Pattern with Relative Positioning
G90 ; Absolute mode for initial positioning
G0 X0 Y0 Z10 ; Move to start position
G91 ; Switch to relative mode
G1 Z-15 F500 ; Drill down 15mm
G0 Z15 ; Retract 15mm
G0 X10 Y0 ; Move to next hole position
G1 Z-15 F500 ; Drill second hole
G0 Z15 ; Retract
G90 ; Return to absolute mode
Mixed Mode Programming
G90 ; Start in absolute mode
G0 X50 Y50 Z5 ; Position at absolute coordinates
G1 Z0 F1000 ; Lower to work surface
G91 ; Switch to relative for pattern
G1 X10 Y0 F500 ; Draw line +10 in X
G1 X0 Y10 ; Draw line +10 in Y
G1 X-10 Y0 ; Draw line -10 in X
G1 X0 Y-10 ; Draw line -10 in Y (square complete)
G90 ; Return to absolute mode
G0 Z5 ; Lift to safe height