3D printer G-code · Marlin and Klipper
G90: Absolute positioning (G90 / G91) (Marlin & Klipper)
Absolute positioning (G90 / G91) — G90 makes X, Y and Z coordinates absolute (from the zero point), G91 relative (from the current position). In Marlin G90 and G91 also switch E unless M82/M83 is used…
On this page
| Property | Value |
|---|---|
| Command | G90 |
| Function | Absolute positioning (G90 / G91) |
| Firmware | Marlin and Klipper |
| Group | Motion |
| Syntax | G90 or G91 |
What does G90 do?
G90 makes X, Y and Z coordinates absolute (from the zero point), G91 relative (from the current position). In Marlin G90 and G91 also switch E unless M82/M83 is used after them; in Klipper too. Most slicers use G90 with M83 for relative extrusion.
Example
G91 ; relative
G1 Z10 F600 ; lift 10 mm
G90 ; back to absoluteTips from practice
- Always write G90 after a relative move in start or end code.
- Send M83 after G90 if you want relative E, because G90 can switch E back to absolute.
The command works in Marlin and Klipper. Options can differ: Klipper accepts fewer parameters for some M-codes and ignores codes it does not know with an "Unknown command" error.
Related commands
More motion commands
| Command | Function | Firmware |
|---|---|---|
G1 | Linear move (G0 / G1) | Marlin and Klipper |
G2 | Arc move clockwise (G2 / G3) | Marlin and Klipper |
G4 | Dwell (pause) | Marlin and Klipper |
G28 | Home axes | Marlin and Klipper |
Test it before you print
Paste your start code or a whole file into the 3D printer simulator. It plans every move, shows the time and finds missing waits, cold extrusion and moves outside the bed.
Open the simulator