Home › G-codes › Haas NGC › G28
G28 Return to machine zero
Haas NGC G-code · Mill, Lathe
On mills: Return to machine zero
Sends the named axes to machine zero, through an intermediate point if axis values are given. The common safe use is G91 G28 Z0. to send Z home straight up.
Format
Addresses
| Address | What it does |
|---|---|
X Y Z A B | Axes to send home. The values are an intermediate point in the current mode |
How it works
Non-modal, group 00.
Example program
G91 G28 Z0. (Z HOME STRAIGHT UP)
G28 Y0. (Y HOME TO BRING THE TABLE FORWARD)
G90 (BACK TO ABSOLUTE)
…
The full 5-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- G28 with no axis words sends all axes home at once. Make sure that path is clear.
- In G90, G28 Z0. first moves to work Z0, which can crash. Use G91 G28 Z0. instead.
- Go back to G90 after the G91 G28 line.
On lathes: Return to machine zero
Sends axes to machine zero. With no axis words all axes go home. With axis words the tool first moves to that point, which is saved as the G29 reference point.
Format
Addresses
| Address | What it does |
|---|---|
U0 W0 | Go straight home on X or Z with no intermediate move |
X Z | Intermediate point in the current work offset before going home |
How it works
Non-modal, group 00.
Example program
G28 U0 (X HOME DIRECTLY)
G28 W0 (Z HOME DIRECTLY)
M30 (END PROGRAM)
Example is in inch. Check offsets and clearances first.
Watch out for
- G28 X0 moves to X0 in the work offset first, which can drive the tool into the part. Use G28 U0 or G53 X0.
- G28 with no axis sends all axes home at once. Know where the tailstock and chuck are.
Related codes
G28 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Return to reference position |
| Mazak (EIA) | Reference point return |
| Mitsubishi M70 M80 | Return to reference position |
| Brother Speedio | Return to reference point |
| Heidenhain TNC (ISO) | Mirror image |
| LinuxCNC Tormach | Go to stored position 1 |
| Mach3 Mach4 | Return to home through a point |
| Centroid CNC12 Acorn | Return to reference point 1 |
| Hurco WinMax (NC) | Return to reference point |
| Fadal | Return to zero |
| Swiss (Citizen Star) | Return to reference point |
Every G-code for Haas NGC in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open G28 in the app All Haas NGC G-codes