Phone / WhatsApp / Skype
+86 18810788819
E-mail
john@xinfatools.com    sales@xinfatools.com

CNC machining center programming instructions, if you don’t know it, come and learn it

1. pause command

G04X (U)_/P_ refers to the tool pause time (feed stops, the spindle does not stop), and the value after address P or X is the pause time. The value after

For example, G04X2.0; or G04X2000; pause for 2 seconds

G04P2000;

However, in some hole system processing instructions (such as G82, G88 and G89), in order to ensure the precision of the hole bottom, there is a pause time when the tool processes to the hole bottom. At this time, it can only be expressed by address P. If Address X indicates that the control system considers X to be the X-axis coordinate value and executes it.

For example, G82X100.0Y100.0Z-20.0R5.0F200P2000; drill (100.0, 100.0) to the bottom of the hole and pause for 2 seconds

G82X100.0Y100.0Z-20.0R5.0F200X2.0; drilling (2.0, 100.0) to the bottom of the hole without pausing.

2. Differences and connections between M00, M01, M02 and M30

M00 is an unconditional pause instruction for the program. When the program is executed, the feed stops and the spindle stops. To restart the program, you must first return to the JOG state, press CW (spindle forward) to start the spindle, and then return to the AUTO state, press the START key to start the program.

M01 is a program selective pause instruction. Before the program is executed, the OPSTOP key on the control panel must be turned on. The effect after execution is the same as M00. The program must be restarted as above.

M00 and M01 are often used for inspection or chip removal of workpiece dimensions during processing.

M02 is the main program end instruction. When this command is executed, the feed stops, the spindle stops, and the coolant is turned off. But the program cursor stops at the end of the program.

M30 is the main program end command. The function is the same as M02, the difference is that the cursor returns to the program head position, regardless of whether there are other program segments after M30.

3. Addresses D and H have the same meaning

Tool compensation parameters D and H have the same function and can be interchanged at will. They both represent the address name of the compensation register in the CNC system, but the specific compensation value is determined by the compensation number address behind them. However, in machining centers, in order to prevent errors, it is generally artificially stipulated that H is the tool length compensation address, the compensation number is from 1 to 20, D is the tool radius compensation address, and the compensation number starts from No. 21 (a tool magazine with 20 tools).

For example, G00G43H1Z100.0;

G01G41D21X20.0Y35.0F200;

4. Mirror command

Mirror image processing instructions M21, M22, M23. When only the X-axis or Y-axis is mirrored, the cutting sequence (climbing and up-cut milling), tool compensation direction, and arc interpolation steering will be opposite to the actual program, as shown in Figure 1. When the X-axis and Y-axis are mirrored at the same time, the tool feeding sequence, tool compensation direction, and arc interpolation steering remain unchanged.

Note: After using the mirror command, you must use M23 to cancel it to avoid affecting subsequent programs. In G90 mode, when using the mirror image or cancel command, you must return to the origin of the workpiece coordinate system before it can be used. Otherwise, the CNC system cannot calculate the subsequent movement trajectory, and random tool movement will occur. At this time, manual origin return operation must be performed to solve the problem. The spindle rotation does not change with the mirror image command.

Figure 1: Tool compensation, forward and reverse changes during mirroring

5. Arc interpolation command

G02 is clockwise interpolation, G03 is counterclockwise interpolation. In the XY plane, the format is as follows: G02/G03X_Y_I_K_F_ or G02/G

03X_Y_R_F_, where

When arc cutting, please note that when q≤180°, R is a positive value; when q>180°, R is a negative value; I and K can also be specified with R. When both are specified at the same time, the R command takes precedence, and I , K is invalid; R cannot perform full circle cutting, and full circle cutting can only be programmed with I, J, and K, because there are countless circles with the same radius passing through the same point, as shown in Figure 2.

Figure 2 A circle passing through the same point

When I and K are zero, they can be omitted; regardless of G90 or G91 mode, I, J, and K are programmed according to relative coordinates; during arc interpolation, tool compensation instructions G41/G42 cannot be used.

6. Advantages and disadvantages between G92 and G54~G59

G54~G59 is the coordinate system set before processing, and G92 is the coordinate system set in the program. After using G54~G59, there is no need to use G92 again, otherwise G54~G59 will be replaced and should be avoided, such as As shown in Table 1.

Table 1 The difference between G92 and working coordinate system

Note: (1) Once G92 is used to set the coordinate system, using G54~G59 again will have no effect unless the system is powered off and restarted, or G92 is used to set the required new workpiece coordinate system. (2) After the program using G92 ends, if the machine tool does not return?

If the origin set by 羾92 is started again, the current position of the machine tool will become the new workpiece coordinate origin, which is prone to accidents. Therefore, I hope readers will use it with caution.

7. Prepare tool changing subroutine.

On a machining center, tool changes are inevitable. However, the machine tool has a fixed tool change point when it leaves the factory. If it is not at the tool change position, the tool cannot be changed. Moreover, before tool change, the tool compensation and cycle must be canceled, the spindle stops, and the coolant is turned off. There are many conditions. If these conditions must be ensured before each manual tool change, it will not only be error-prone but also inefficient. Therefore, we can compile a tool change program to save it and use it in the DI state. Calling M98 can complete the tool change action in one go.

Taking the PMC-10V20 machining center as an example, the program is as follows:

O2002;(program name)

G80G40G49; (Cancel fixed cycle and tool compensation)

M05; (Spindle stops)

M09;(coolant shut off)

G91G30Z0; (Z axis returns to the second origin, which is the tool change point)

M06; (Tool change)

M99; (End of subroutine)

When you need to change the tool, you only need to type “T5M98P2002″ in the MDI state to replace the required tool T5, thus avoiding many unnecessary mistakes. Readers can compile corresponding tool changing subroutines according to the characteristics of their own machine tools.

8. other

Program segment sequence number, represented by address N. Generally, the CNC device itself has limited memory space (64K). In order to save storage space, the program segment sequence numbers are omitted. N only represents the program segment label, which can facilitate the search and editing of the program. It has no effect on the machining process. The sequence number can be increased or decreased, and the continuity of the values is not required. However, it cannot be omitted when using certain loop instructions, jump instructions, calling subroutines and mirror instructions.

9. In the same program segment, for the same instruction (same address character) or the same group of instructions, the one that appears later will take effect.

For example, the tool change program, T2M06T3; replaces T3 instead of T2;

G01G00X50.0Y30.0F200; G00 is executed (although there is an F value, G01 is not executed).

Instruction codes that are not in the same group have the same effect if they are executed in the same program segment by exchanging the sequence.

G90G54G00X0Y0Z100.0;

G00G90G54X0Y0Z100.0;

All the above items were run and passed on the PMC-10V20 (FANUCSYSTEM) machining center. In practical applications, only a deep understanding of the usage and programming rules of various instructions is required.

Xinfa CNC tools have the characteristics of good quality and low price. For details, please visit:

CNC Tools Manufacturers – China CNC Tools Factory & Suppliers (xinfatools.com)


Post time: Nov-06-2023