---
title: "Z Axis Overtravel on G28: Where the Waypoint Math Went Wrong"
description: "An overtravel alarm on G28 means the intermediate waypoint, not the home position, landed outside the machine's travel. The waypoint math, and the fix."
url: https://gcodepractice.com/journal/z-axis-overtravel-on-g28/
canonical: https://gcodepractice.com/journal/z-axis-overtravel-on-g28/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-07
updated: 2026-06-07
category: "Guides"
tags: ["g28", "overtravel", "alarms", "z axis"]
lang: en
---

# Z Axis Overtravel on G28: Where the Waypoint Math Went Wrong

> **TL;DR** A Z axis overtravel alarm on G28 almost always means the intermediate waypoint landed outside the machine's travel, not the home position itself, which is by definition reachable. G28 moves to your commanded point first and to the reference position second, and in G90 that commanded point is an absolute work-coordinate position: with a tall work offset, an innocent-looking G28 Z5.0 can resolve to a machine position above the physical travel. The fixed idiom G91 G28 Z0 G90 makes the waypoint the current position, and G53 G00 Z0 skips the waypoint entirely.

An overtravel alarm on a G28 line carries a small paradox: the whole point of G28 is to go to the machine's reference position, which is by definition inside the travel, so how does going home exceed the travel? The answer is that G28 never goes straight home. It goes to a waypoint you commanded first, and the alarm is reporting that the waypoint, not the destination, resolved to a Z the machine physically does not have.

## What G28 actually commands

G28 is a two-leg move: first to the intermediate point given by the words on the G28 line, then to the reference position, behavior documented plainly in references like [LinuxCNC's](https://linuxcnc.org/docs/html/gcode/g-code.html) and shared across dialects. The waypoint is a real commanded position, computed under the current modal state like any other coordinate, which means it inherits the two ingredients people forget: the active distance mode (G90 versus G91) and the active work offset.

In G90, `G28 Z5.0` does not mean "go up a bit, then home." It means "move to work-coordinate Z5.0, then home." Where work Z5.0 physically sits depends entirely on the active offset: with a work zero set high on a tall part or a riser, work Z5.0 can resolve to a machine position above the top of travel. The control checks the commanded move against its soft limits, finds the stop outside the envelope, and raises overtravel before anything moves, an alarm family every control documents in its own numbering, the Fanuc versions cataloged in lists like [Helman CNC's](https://www.helmancnc.com/fanuc-alarm-codes-for-cnc-machines/).

## The three ways the waypoint goes out of range

| The setup | The line | Why it overtravels |
| --- | --- | --- |
| Tall work offset, G90 active | G28 Z5.0 | Work Z5.0 resolves above machine travel |
| Program inherited G91, big Z word | G28 Z10.0 | A 10-unit incremental hop from near the top of travel |
| Inch program, metric state | G28 Z1.0 meant as an inch | The same number, reinterpreted, lands out of range |

The first row is the classic. The second is its mirror: an incremental waypoint from a position already near the limit. The third is the units family making a guest appearance, the same [state bookkeeping](/journal/how-to-read-g-code-to-find-errors/) that decides most of what any block means.

## The two fixes, and which to prefer

**The safe idiom: G91 G28 Z0 G90.** Switch to incremental, command a zero-distance waypoint, go home, restore absolute. The waypoint becomes the current position, the arithmetic disappears, and the line behaves identically under every offset. This is the form worth memorizing as a unit, and the full story of why it exists, including the crash that happens when the waypoint lands inside the travel but on top of the workholding, is in [why did my Z axis dive into the chuck on G28](/journal/why-did-my-z-axis-dive-into-the-chuck-on-g28/).

**The direct alternative: G53 G00 Z0.** On controls that support it, G53 commands machine coordinates for one block, no waypoint, no modal dependency: Z0 in machine coordinates is the top of travel on most mills, stated outright. Many programmers consider it the cleaner retract for exactly that reason; G28 persists for compatibility and for controls where the [stored reference position](/journal/g28-return-to-home-position-explained/) does additional duty.

Either fix beats the third option people improvise, shrinking the waypoint number until the alarm stops, which leaves a line in the program that works by coincidence and breaks the next time the offset changes.

## The alarm is the good outcome

Overtravel on G28 deserves a reframe before the reset button: soft limits just stopped a move you had not actually calculated, at zero cost. The same uncalculated waypoint with slightly different numbers is a rapid into the fixture, which is why the response worth practicing is not silencing the alarm but rereading the line: what waypoint did I command, in which mode, under which offset? That three-question habit, applied to every G28 in every inherited program, runs on the same fluency that all [numerical control](https://en.wikipedia.org/wiki/Numerical_control) work does, the core codes at recall speed, which the free 60-second drills on the [G-code practice page](/g-code-practice/) keep sharp. A machinist who can answer those three questions on sight never meets this alarm twice.

## Sources

- [LinuxCNC: G-code reference](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [Helman CNC: Fanuc alarm codes](https://www.helmancnc.com/fanuc-alarm-codes-for-cnc-machines/)
- [Wikipedia: Numerical control](https://en.wikipedia.org/wiki/Numerical_control)

## Frequently asked questions

### Why do I get a Z axis overtravel alarm on G28?

Because G28 moves through an intermediate waypoint you command, and that waypoint resolved outside the axis travel. The reference position is always reachable; the alarm is soft-limit protection catching the stop on the way, usually a G90 waypoint combined with a tall work offset.

### What does G91 G28 Z0 G90 actually do?

It makes the waypoint harmless: in incremental mode, Z0 is a zero-distance move, so the waypoint becomes the current position and the machine goes straight home. The trailing G90 restores absolute mode.

### Is G53 G00 Z0 better than G28 for sending Z home?

On controls that support it, many programmers prefer it: machine coordinates directly, no waypoint, no modal traps. For the plain job of retracting Z to the top of travel, it says exactly what it does.

### Is an overtravel alarm on G28 dangerous?

The alarm itself is the protection working. The danger lives in the same waypoint confusion when the numbers land inside the travel but on top of something, which is the crash version of this story.

---

Source: https://gcodepractice.com/journal/z-axis-overtravel-on-g28/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
