G28 – Return To Machine Home

CAUTION: The G28 command can be used in different ways, and incorrect usage may result in unexpected rapid motion. The behaviour of G28 depends on whether the machine is in G90 Absolute or G91 Incremental mode. Extra care must be taken when using this command.

 

 

The G28 command is used to move one or more axes back to their machine home position after the machine has been homed.

 

Axis values can be combined with G28 to define an intermediate position that the machine will move to before returning to home.

 


Syntax & Parameters

 

  • G28
    When used on its own, all axes will move at rapid speed directly to the machine home position.

 

  • X, Y, Z, A, B Value
    Defines an intermediate position to move to before returning to home.
    Values use the current machine units.

 

  • Incremental Mode (G91)
    When used with a rotary axis, G28 can be used to unwind the axis within one revolution or less.

 


Example Program – Move All Axes to Home

 

N10 G28

 

Moves all axes directly to their machine home positions at rapid speed.

 


Example Program – Move via Machine Zero First

 

N10 G28 X0 Y0 Z0

 

Moves all axes to working coordinates X0 Y0 Z0, then continues to the machine home position.


Example Program – G28 in Incremental Mode (No Intermediate Move)

 

N10 G91 G28 X0 Y0 Z0
N20 G90

 

Because the move is incremental and the values are zero, the machine moves directly to home.

 


Example Program – Raise Z Axis First, Then Home

 

N10 G91 G28 X0 Y0 Z8
N20 G90

 

The machine will:

 

  1. Move the Z axis up by 8 units

  2. Then move all axes to their machine home positions

 

This is commonly used to clear tooling or fixtures before homing.

 


Rotary Axis Unwind (Within One Rotation)

 

G00 A900 (Rapids the A axis to A900 (2.5 turns))
G91 (Change to Incremental mode)
G28 A0 (Moves Axis by 0 degrees then moves to A0 within one rotation)
G90 (Return to Absolute mode)

 

In this example:

 

  • The rotary axis unwinds to A0 in less than one revolution

  • This prevents unnecessary multiple rotations

 

 

If another value such as G28 A360 is specified, the axis will rotate an additional 360 degrees before unwinding to A0, resulting in an extra half rotation before reaching the home position.

 

 

INFORMATION: If the machine is not switched to G91 Incremental mode before issuing the G28 A0 command, the rotary axis will unwind the full number of revolutions back to A0 before moving to the home position. In this case, no additional unwind movement is required.