G28 & G30 CNC Codes: Return to Machine Zero Point

What is G Code G28?

G28 command instructs the CNC machine to return rapidly to the Absolute Zero (Datum) point of the machine. The motion can be direct or via an intermediate coordinate.

Syntax A: G28 – The machine will move directly to the zero point

Syntax B: G28 Xxx Yyy Zzz – The machine will move to the zero point, via an intermediate point (xx,yy,zz)

Gcdeo refernce point G28

Example #1: G28 – Move all the machine’s axis simultaneously to zero position. The movement will be along the red dashed line. In this example and many real-life situations, this will cause a crash.

Example #2: G91 G28 X0 Y0 Z0 – This is exactly like the example one.

Example #3: G91 G28 Z200.0 – Move safely to the datum via an intermediate point along the blue lines.

Attention!

Although it is not mandatory, using G28 with Relative G91 mode is always recommended.

What is G CODE G30?

G30 functions the same as G28 but moves to an alternative reference point. This 2nd point is defined in the machine parameters list. It can be, for example, a position for the tool during a pallet change.


Learn about more G-Codes

Scroll to Top