# LinuxCNC G28 Go to Predefined Position

Instructions · `G28` · verification: source checked

G28 is a LinuxCNC G-code that makes a rapid move to a predefined absolute machine position stored in parameters. With axis words, it first rapid-moves to the programmed position including offsets, then rapid-moves to the stored predefined position for the specified axes. It is intended for use when the machine is homed to a repeatable position and a G28 position has been stored with G28.1.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | G28 |
| Syntax | G28 axes |
| Dialect | LinuxCNC |

### Parameters

| Name | Description |
|---|---|
| axes | Any axis as defined in the configuration; optional axis words specify a destination including offsets before the rapid move to the stored predefined position. Any axis not specified will not move. |

## Safety

- Only use G28 when the machine is homed to a repeatable position and the desired G28 position has been stored with G28.1.
- If no positions are stored with G28.1, all axes will go to the machine origin.
- It is an error if cutter compensation is turned on.

## Study notes

- G28 uses values stored in parameters 5161-5169 as the final X Y Z A B C U V W point; the G28 and G28 axes descriptions also refer to parameters 5161-5166.
- G28.1 stores the current absolute position into parameters 5161-5166.
- All axes defined in the INI file will be moved when a G28 is issued.
- With G28 axes, any axis not specified will not move.
- G28 axes first makes a rapid move to the position specified by the axis words including offsets, then rapids to the stored absolute position for the specified axes.
- Parameter values are absolute machine coordinates in the native machine units specified in the INI file.

## Sources

1. [G-Codes](https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g28-g28.1) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/gcode-g28  
JSON: https://machineschema.com/instruction/gcode-g28.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
