---
title: G28, G30 (Return to Home)
slug: g28-g30-return-to-home
docTags: 
createdAt: 2023-04-18T09:30:27.000Z
---

Two home positions are defined (by [variables](docId\:oqHjs3LLCfQkSac_cemc2) `#5161` to `#5166` for G28 and variables `#5181` to `#5186` for G30). The variable's values are in terms of the absolute coordinate system but are in unspecified length units.&#x20;

To return to the home position by way of the programmed position, program `G28 X... Y... Z... A...` (or use G30). All axis words are optional. The path is made by a traverse move from the current position to the programmed position, followed by a traverse move to the home position. If no axis words are programmed, the intermediate point is the current point, so only one move is made. The order of Z depends on its position, if the end position is higher than the current Z position Z will move first, otherwise Z will move last, this is to prevent collisions.

:::hint{type="warning"}
Addition for lathe: For a lathe the X axis is moved first, the assumption is that X moves away from the turning center.
:::

