3D Printer

G28 G-code

G28 means “seek the endstops for each axis, stop once they are found and this position is now the origin for the machine”.

This G-code is specific to Reprap and does not conform to the normal G-code standard.

Format

The command is used as such:

G28 X10 Y10

Which means: move until you hit the X and Y endstops, then set the current X position to 10 and the Y position to 10.

You can also use the G-code without any parameters:

G28

Which is equivalent to doing:

G28 X0 Y0 Z0

Parameters

Parameter Usage Example
X Move until you hit this endstop then set the position in this axis to this value G28 X0
Y Move until you hit this endstop then set the position in this axis to this value G28 Y0
Z Move until you hit this endstop then set the position in this axis to this value G28 Z0

Note on GRBL Mode: The Reprap homing behavior described on this page applies when is set to false (default). When GRBL mode is enabled, G28 instead goes to the recorded machine origin. See GRBL Mode for details.

Configuration

See the Endstops module documentation for configuring and related homing settings.

Basic V1 Configuration:

alpha_homing_direction home_to_min
alpha_min_endstop 1.24!^
alpha_max_endstop 1.25^

See the Endstops module documentation for V2 endstop configuration. V2 endstops feature enhanced protection (ESD buffering, configurable pull-up/pull-down).

Basic V2 Configuration:

[alpha endstop]
limit.enable = true
limit.pin = PA0!
homing.enable = true
homing.direction = home_to_min

Delta

This section describes Cartesian machine homing. For delta machines, see below.

If you are using a Delta machine, then you cannot individually home axes.

Instead, all “actuators” are homed together to the top of the machine, which sets you at the top of the Z work area, and at the center of the XY work area.

If you are using a Delta machine (Cartesian or rotary), homing behavior depends on your kinematics type:

Cartesian Delta (Kossel, Rostock): All three actuators home together to the top, setting position at the top of the Z work area and center of the XY work area. Use regular G28 command.

Rotary Delta: Home using G28.4 with actuator coordinates (A, B, C). For example: G28.4 A0 B120 C240 homes the three rotary actuators to their reference angles. See Rotary Delta documentation for calibration and configuration.

Soft Endstops: V2 adds automatic software endstop compensation during homing for delta machines, improving accuracy and safety.

Further reading

These resources are used as references for Gcode:

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.