G28 – Zero Return

Author:

G28 is a G-code that instructs the CNC machine to move the tool to the reference position, also known as the machine zero or home position. This position is usually set by the machine manufacturer or operator, and it is the origin of the machine coordinate system. G28 is useful for resetting the machine after a program is finished, or for moving the tool away from the workpiece before changing tools or performing maintenance.

Usage Format

The general format of G28 is:

G28 [X#] [Y#] [Z#] [U#] [V#] [W#]

where # is a numerical value that specifies the intermediate point for each axis. The intermediate point is a position that the tool passes through before reaching the reference position. This is optional and can be omitted if not needed. If no intermediate point is given, the tool will move directly to the reference position.

Explanation

When G28 is executed, the CNC machine will perform the following steps:

  1. Move the tool to the intermediate point, if given, at the current feed rate.
  2. Move the tool to the reference position, at the rapid traverse rate.
  3. Set the current position as the reference position, and reset the machine coordinate system.

The reference position is usually located at the corner or center of the machine’s working area, where the tool is clear of any obstacles or clamps. The reference position can be changed by the operator using another G-code, such as G92 or G10.

Example

Here is an example of using G28 in a CNC program:

N10 G90 G54 G00 X50 Y50 Z10 ; Move to start point in absolute coordinates N20 G01 Z-5 F100 ; Cut down to depth at feed rate 100 mm/min N30 X100 Y100 ; Cut a diagonal line N40 G28 Z50 ; Return to reference position in Z-axis, passing through Z50 N50 M30 ; End of program

In this example, the tool will first move to the start point (X50, Y50, Z10) in the coordinate system G54, then cut down to Z-5 and make a diagonal cut to (X100, Y100). After that, the tool will return to the reference position in the Z-axis, passing through Z50 as an intermediate point. This will prevent the tool from colliding with the workpiece or the clamps. Finally, the program will end with M30.

Leave a Reply

Your email address will not be published. Required fields are marked *