G-code reference

G28.1 G-Code: Set Predefined Position (GRBL / LinuxCNC)

Set Predefined Position (GRBL / LinuxCNC) — On GRBL and LinuxCNC, stores the current machine position as the G28 position. A later G28 moves there (through an optional intermediate point). Handy as a…

By cnccode · Updated
PropertyValue
CodeG28.1
FunctionSet Predefined Position (GRBL / LinuxCNC)
Modal group00
TypeOne-shot (non-modal) — active only in its own block
Used onMilling machines
SyntaxG28.1

What does G28.1 do?

On GRBL and LinuxCNC, stores the current machine position as the G28 position. A later G28 moves there (through an optional intermediate point). Handy as a safe tool-change or park position on routers.

G28.1 is a one-shot code: it only acts in the block where it is written, and the previously active modal codes take over again afterwards.

Syntax and parameters

Format
G28.1

G28.1 example program

Example
(jog to park position, then)
G28.1
(later in a program)
G28 G91 Z0
G90

▶ Open this example in the G-code viewer

Tips and common mistakes

  • Not used on Fanuc, where the G28 position is machine zero.

Controller compatibility

G28.1 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.

Frequently asked questions

Is G28.1 modal?
No. G28.1 is a one-shot (group 00) code and only acts in the block where it appears.
What does G28.1 mean in CNC?
G28.1 means Set Predefined Position (GRBL / LinuxCNC). On GRBL and LinuxCNC, stores the current machine position as the G28 position. A later G28 moves there (through an optional intermediate point). Handy as a safe tool-change or park position on routers.
What is the difference between G28.1 and G28?
G28.1 is Set Predefined Position (GRBL / LinuxCNC), while G28 is Return to Reference Point (Machine Home). See the G28 page for its syntax and examples.
Can I use G28.1 on a lathe?
Usually not with the same meaning: G28.1 is documented here for milling machines. Check your control manual for the equivalent.