G28 – Return To Machine Home

G28 returns one or more axes to their machine home position after the machine has been homed. Axis values on the same line set an intermediate position the machine moves to first.

Syntax
G28 / G91 G28 Z0
Motion
Rapid speed
You need
Machine homed first
CAUTION
G28 behaves differently in G90 Absolute and G91 Incremental mode, and incorrect use can cause unexpected rapid moves. Take extra care with this command.

Parameters

WordMeaning
G28 (alone)All axes rapid to machine home. Z goes home first, then X, Y, A and B.
X Y Z A BIntermediate position to move to before going home, in the current machine units. Only the axes given move.
G91 + rotary axisIn incremental mode, G28 unwinds a rotary axis to zero within one revolution or less.

Examples

CodeResult
G28All axes rapid to machine home: Z first, then X, Y, A and B.
G28 X0 Y0 Z0Moves X, Y and Z to working coordinates X0 Y0 Z0, then on to machine home. Only the axes given move.
G91 G28 X0 Y0 Z0
G90
The incremental values are zero, so X, Y and Z go straight home with no intermediate move. G90 then restores absolute mode.
G91 G28 X0 Y0 Z8
G90
Raises Z by 8 units, then sends X, Y and Z home. Useful for clearing tooling or fixtures before homing.

Rotary axis unwind

G00 A900  (Rapids A to A900 – 2.5 turns)
G91    (Incremental mode)
G28 A0   (Moves A by 0°, then to A0 within one rotation)
G90    (Back to absolute mode)

The A axis unwinds to A0 in less than one revolution, avoiding unnecessary extra turns. With a non-zero value such as G28 A360, the axis first turns a further 360°, then unwinds to A0.

INFORMATION
Without G91, G28 A0 still unwinds within one revolution, but it first moves to the absolute intermediate position A0, which can take many turns. Use G91 with G28 A0 to avoid the extra rotations, whatever the current A coordinate.