Home › G-codes › Mach3 Mach4 › G28
G28 Return to home through a point
Mach3 Mach4 G-code · Mill
Rapids to the given point first, then to the home position. Mach3 home is the G28 position in parameters 5161 to 5166, normally machine zero. Mach4 returns to machine home.
Format
G28 [X] [Y] [Z] [A]
Addresses
| Address | What it does |
|---|---|
X Y Z A | Intermediate point, in the active mode, for the axes to send home |
How it works
Non modal.
Example program
G0 G20 G90 G54 G17 G40 G49 G80 (SAFE START, INCH)
T1 M6 (TOOL CHANGE)
S5000 M3 (SPINDLE ON)
G43 H1 Z1.0 (LENGTH OFFSET)
…
T1 M6 (TOOL CHANGE)
S5000 M3 (SPINDLE ON)
G43 H1 Z1.0 (LENGTH OFFSET)
…
The full 9-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- In G90, G28 Z0 first plunges to work Z0, then goes home. Use G91 G28 Z0 or G53 G0 Z0 instead.
- Leave G91 off after it. Put G90 back on the next line.
- With no home switches, machine zero is wherever you last referenced. G28 may go somewhere you do not expect.
Related codes
G28 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Return to reference position |
| Haas NGC | Return to machine zero |
| 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 |
| 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 Mach3 Mach4 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 Mach3 Mach4 G-codes