Home › G-codes › Mach3 Mach4 › G30
G30 Return to second home
Mach3 Mach4 G-code · Mill
Like G28 but ends at a second home point, often a tool change or load spot. Mach3 uses parameters 5181 to 5186. Mach4 adds P2, P3 or P4.
Format
G30 [P] [X] [Y] [Z]
Addresses
| Address | What it does |
|---|---|
P | Mach4 only, P2 to P4 picks the return point, default P2 |
X Y Z | Intermediate point for the axes to send |
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
- Same trap as G28. In G90 the intermediate point is a work coordinate. Use G91 G30 Z0.
- Mach4 P2 point is in #5301 to #5306, P3 in #5311 up and P4 in #5321 up.
- Mach3 G30 point is in #5181 to #5186. Set it before you trust the move.
Related codes
G30 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Return to 2nd, 3rd or 4th reference position |
| 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 |
| Centroid CNC12 Acorn | Return to reference point 2 |
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 G30 in the app All Mach3 Mach4 G-codes