technology news

How to Make Good Use of Milling Machine General Codes G28, G30, M06

The G/M/S/F and other instructions introduced in CNC milling machine programming are basically applicable to machining centers, so these instructions will not be repeated, but simply introduce some typical instructions of machining centers.

1. The milling machine automatically returns to refer to the point command G28

Format: G28 X_ Y_ Z_; for automatic tool change or to eliminate mechanical errors Explanation:

①G28 makes the X, Y, Z axes quickly locate to the center point, and then return to the reference point from the center point. Among them, X, Y, Z are the center point (absolute value/incremental value) passed when returning to the reference point.

② Setting the center point is to prevent the tool from interfering with the workpiece or the center tool when it returns to the reference point.

③For safety, the tool radius compensation and tool length compensation should be canceled before executing this command.

④In the block of G28, not only the coordinate axis movement command is issued, but also the coordinate value of the center point is memorized for use by G29.

⑤ The G28 command is only valid in its regular block.

2. Go back to the second reference point command G30

Format: G30 X_ Y_ Z_;

Explanation: G30 is the second reference point, and this function is similar to the G28 command.


①The position of the second reference point is set by the system parameters, and the G30 command is only valid after executing the automatic return to the reference point (G28) or the manual return to the reference point

②Generally, the G30 command is used when the orientation of the active tool change (ATC) is different from the reference point.

3. Actively return from the reference point to command G29

Format: G29 X_ Y_ Z_;

To clarify:

①G29 command can make X, Y, Z axes start from the reference point, pass through the center point defined by G28 (or G30) command, and quickly reach the target point.

②X, Y, Z are the return target points; (G90 is the absolute value of the target point, and G91 is the incremental value of the target point relative to the center point.)

③This command can be used after G28 (or G30) command, but this command is not necessary, and it may be more convenient to use G00 for positioning.

④The G29 command is only valid in its regular block.

Examples of application functions of G28/G30 and G29

4. Active tool change command M06

The M06 command is used for active communication of the tool.

This command also includes the spindle exact stop M19 command. When executing M06, the spindle exact stop action is completed first, and then the tool change action is performed.

The tool magazine capacity of QM-40SA vertical machining center is 24 tools, and the tool change point is at the second reference point. The tool change procedure is as follows:

N20 G91 G30 X0 Y0 Z0; the machine returns to the second reference point

N30 T02; T is the tool search command, T02 indicates that the No. 2 tool in the tool magazine is rotated to the tool position to be changed

N40 MO6; Perform tool change, exchange the tool on the spindle with the tool in the tool magazine to be changed

Get The Required Product Quotation As Quickly As Possible

If possible, Given detailed request helps to gain better-matched customized solution. Thanks for your patience. your request will be responsed within 1 hours, kindly pay attention to your email please.

have any queries? Send to

Contact Us