G30 Return to 2nd, 3rd or 4th reference position
Fanuc G-code · Mill, Lathe
On mills: Return to 2nd, 3rd or 4th reference position
Like G28 but goes to the second, third or fourth reference position set in parameters. Often used as the tool change position or a part unload spot.
Format
G30 [P2 P3 P4] X Y Z
Addresses
| Address | What it does |
|---|---|
P | P2, P3 or P4 picks the reference position. P2 if left out |
X Y Z | Intermediate point, only named axes move |
How it works
One shot, group 00.
Example program
G00 Z1. M09 (CLEAR PART)
G91 G30 Z0. M05 (Z TO TOOL CHANGE POSITION)
G90 (ABSOLUTE)
T4 M06 (TOOL CHANGE)
G91 G30 Z0. M05 (Z TO TOOL CHANGE POSITION)
G90 (ABSOLUTE)
T4 M06 (TOOL CHANGE)
Example is in inch. Check offsets and clearances first.
Watch out for
- Same G91 rule as G28. Use G91 G30 Z0. to avoid a move to work zero first.
- The positions are machine parameters. Ask the builder what each one is used for.
On lathes: Return to 2nd, 3rd or 4th reference position
Rapids through an intermediate point to a second, third or fourth reference position, often a safe tool change point set by parameter.
Format
G30 [P2] X(U) Z(W)
Addresses
| Address | What it does |
|---|---|
P | Reference position number 2, 3 or 4. P2 if left out |
U W | Intermediate point, incremental. U0 W0 means no detour |
How it works
Non-modal.
Example program
G00 X3. M09 (CLEAR PART)
G30 U0 W0 (TO TOOL CHANGE POSITION)
T0202 (NEXT TOOL)
G30 U0 W0 (TO TOOL CHANGE POSITION)
T0202 (NEXT TOOL)
Example is in inch. Check offsets and clearances first.
Watch out for
- The positions are set in parameters, not in the program.
- Use U and W, not X0, or the tool goes through part center.
Related codes
G30 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Mazak (EIA) | Second, third or fourth reference point |
| Okuma OSP | Positioning to home position |
| Mitsubishi M70 M80 | Second to fourth reference return |
| Brother Speedio | Second reference point return |
| Heidenhain TNC (ISO) | Blank form min point |
| LinuxCNC Tormach | Go to stored position 2 |
| Mach3 Mach4 | Return to second home |
| Centroid CNC12 Acorn | Return to reference point 2 |
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 G30 in the app All Fanuc G-codes