G28 Return to reference position
Fanuc G-code · Mill, Lathe
On mills: Return to reference position
Sends the axes at rapid through an intermediate point and then to the machine reference position, often called home. Used before tool changes and at the end of a program.
Format
Addresses
| Address | What it does |
|---|---|
X Y Z | Intermediate point the axes pass through first. Only named axes move |
How it works
One shot, group 00. The intermediate point is remembered for G29.
Example program
G91 G28 Z0. M05 (Z HOME, SPINDLE OFF)
G28 Y0. (Y HOME FOR PART UNLOAD)
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
- Use G91 G28 Z0. to go straight up from where you are. G90 G28 Z0. first moves to work Z zero, which can crash.
- Only the axes written in the block go home. G91 G28 Z0. moves Z only.
- Cancel cutter compensation before G28.
On lathes: Return to reference position
Rapids to the reference position through an intermediate point. On a lathe G28 U0 W0 goes straight home from where the tool is.
Format
Addresses
| Address | What it does |
|---|---|
X Z | Intermediate point in absolute values |
U W | Intermediate point as an incremental distance. U0 W0 means no detour |
How it works
Non-modal.
Example program
G28 U0 (X HOME)
G28 W0 (Z HOME)
M30 (END)
Example is in inch. Check offsets and clearances first.
Watch out for
- G28 X0 sends the tool through X0, the part center. Use U0 for a direct return.
- Send X home first with G28 U0, then Z with G28 W0, to stay clear of the part.
- Cancel tool nose radius compensation before G28.
Related codes
G28 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| 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 |
| 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 Fanuc 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 Fanuc G-codes