G28 and G30: returning to reference safely
G28 sends the axes to the machine reference point (machine home), for example before a tool change or at the end of a program. It always goes through an intermediate point first, and that point is where most G28 crashes come from.
How G28 works
G28 X_ Y_ Z_
The values are not the home position. They are an intermediate point. The axes move at rapid to that point first, then to home. Only the axes written in the block move.

The safe form: G91 G28
G91 G28 Z0. (mill: Z home, straight up) G28 X0. Y0. (then X and Y home) G90 (back to absolute)
In G91 (incremental), Z0 means "move zero from here", so the intermediate point is where the tool already is, and it goes straight up to home. On a lathe the same idea is written with U and W, which are incremental: G28 U0. W0.
The trap: G90 G28 Z0
In absolute mode, G28 Z0. means: first go to Z0 of the part, then home. If the tool is deep in a pocket below the top or beside a clamp, the move to part Z0 can crash. If the tool is above the part, it first rapids down to the top surface. Either way, it is not what you meant.
Do not forget G90
After G91 G28, the control stays in G91. The next X20. Y20. would then be an incremental move of 20 mm, not a move to X20 Y20. Always put G90 back, often in the safe start line of the next tool: G90 G54 G00 X20. Y20.
G30: the second reference point
G30 works like G28 but goes to a second reference point, set by parameter. Many machines use it as a tool change position closer to the work, or to keep a lathe turret away from the chuck. G91 G30 Z0. is used the same way.
G53: move in machine coordinates
Many programmers prefer G53 G00 Z0. on a mill. G53 moves directly to a machine coordinate (Z0 is usually machine home on a mill) with no intermediate point, and it works in G90. It is valid only in its own block.
Common mistakes
- G28 Z0 in G90 with the tool below the part top.
- Leaving G91 active after G91 G28.
- Sending X and Y home together with Z on a mill: the tool moves sideways before it is clear.
- On a lathe, homing X and Z together when the tool is inside a bore.
Check which home and tool change positions your machine uses. Some builders want a specific G28 or G30 sequence before M06.
Calculators, process sheet to program, simulation, codes and lessons. Free to start, no sign-in, on phone and laptop.
Open the app

