CNC mill · G-code
G28: return to machine zero
G28 sends the axes home. Named axes go to the given point first, then to machine zero; most programs use it incrementally (G91 G28 Z0) so the tool goes straight up. Haas lists it as one-shot (group 00). Formats below from Haas and LinuxCNC, each from its maker.
Worked example
Send Z straight up home, then X and Y. Written for this page in the Haas format.
G91 G28 Z0 (incremental: no intermediate move)G28 X0 Y0G90 (back to absolute)How each control writes it
Haas G28 X- Y- Z-
One source: Haas Automation, the control's maker
- X, Y, Z, A, B
- Intermediate point (G90) or distance (G91) before going home (optional)
- With no axis named, all axes go to machine zero together.
- The intermediate point is saved as the G29 reference point.
- Setting 108 changes how rotary axes return.
Source: Haas Automation, mill G28
LinuxCNC G28 axes
One source: the LinuxCNC project, the control's maker
- X, Y, Z …
- Intermediate point; only the named axes then go to the stored position (optional)
- Goes to the position stored with G28.1 (parameters 5161–5169), not necessarily machine zero.
- Use it only on a machine homed to a repeatable position.
- An error if cutter compensation is on.
Source: LinuxCNC documentation, "G28, G28.1 Go/Set Predefined Position" (archived Oct 29, 2026)
How the controls differ
- Only Haas takes A, B, Z.
- Only LinuxCNC takes Z ….
- A word two controls share can still mean different things: read each control's list above.
No Fanuc row yet: that chapter of the 0i manual has not been read.
Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.