Products Catalogue Home     |     About Us    |     Retrofit     |     Download     |     News     |     Tech Support     |     Contact Us     |     
ppr fittings-NF-4011-Newsun Industry Co., Ltd
Home > Tech Support >

Machining center CNC codes differences and programming skill

With the development of science and technology and the progress of society, people have higher and higher requirements for product performance and quality, so that the application of CNC machining center has been popularized to a certain extent, and high-performance and high-efficiency machining centers have gradually become social needs. . After more than ten years of concentrated research and development on machining centers, Taiqun Precision Machinery has summarized its own experience and experience, hoping to inspire readers.
 
1. Pause instruction
 
G04X(U)_/P_ refers to the tool pause time (feed stop, spindle does not stop), the value after the address P or X is the pause time. The value after X must have a decimal point, otherwise it is calculated as a thousandth of this value, in seconds (s), and the value after P cannot have a decimal point (that is, expressed as an integer), in milliseconds (ms). For example, G04 X2.0; or G04 X2000; or G04 P2000; pause for 2 seconds.
 
However, in some hole machining commands (such as G82, G88 and G89), in order to ensure the roughness of the hole bottom, there is a pause time when the tool reaches the bottom of the hole. At this time, it can only be expressed by address P. Address X indicates that the control system assumes that X is the coordinate value of the X axis to execute. For example, G82X100.0Y100.0Z-20.0R5.0F200P2000; drilling (100.0, 100.0) to the bottom of the hole pause for 2 seconds G82X100.0Y100.0Z-20.0R5.0F200X2.0; drilling (2.0, 100.0) to the bottom of the hole without Will be suspended.
 
2. The difference and connection of M00, M01, M02 and M30
 
M00 is the program unconditional pause command. 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 rotation) 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 command. The OP STOP button on the control panel must be turned on before the program is executed. The effect after execution is the same as M00, and the program must be restarted as above.
 
M00 and M01 are often used for inspection or chip removal of workpieces during processing.
 
M02 is the main program end instruction. When this instruction is executed, the feed stops, the spindle stops, and the coolant is closed. But the program cursor stops at the end of the program.
 
M30 is the main program end instruction. 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 blocks after M30.
 
3. Addresses D and H have the same meaning
 
The tool compensation parameters D and H have the same function and can be interchanged arbitrarily. 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 the machining center, in order to prevent errors, generally 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 21 (tool magazine with 20 tools).
 
For example, G00G43H1Z100.0; G01G41D21X20.0Y35.0F200;
 
4. Mirror instruction
 
Mirror processing instructions M21, M22, M23. When only the X-axis or Y-axis is mirrored, the cutting sequence (climb milling and up-cut milling), tool compensation direction, and arc interpolation direction will all be opposite to the actual program, as shown in Figure 1. When mirroring the X axis and Y axis at the same time, the cutting sequence, tool compensation direction, and circular interpolation direction of rotation are all unchanged.
 
Note: M23 must be used to cancel after using the mirroring command to avoid affecting the subsequent programs. In G90 mode, use mirror image or cancel command, you must return to the origin of the workpiece coordinate system to use it. Otherwise, the CNC system cannot calculate the subsequent motion trajectory, and random tool movement will occur. At this time, the manual origin return operation must be implemented to solve the problem. The rotation of the spindle does not change with the mirroring command.
 
5. Circular 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 03 X_Y_R_F_, where X and Y are the coordinates of the arc end point, and I and J are the arc starting points The incremental value to the center of the circle on the X and Y axes, R is the arc radius, F is the feed.
 
Pay attention to the arc cutting, q≤180°, R is a positive value; q>180°, R is a negative value; I and K can also be specified by R. When both are specified at the same time, the R command takes precedence, and I , K is invalid; R cannot be used for full circle cutting, and full circle cutting can only be programmed with I, J, K. There are countless circles with the same radius after 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 all programmed according to relative coordinates; in circular interpolation, tool compensation commands G41/G42 cannot be used.
 
6. Advantages and disadvantages between G92 and G54~G59
 
G54~G59 is the coordinate system set before processing. If you want to learn machining center programming, it can help you in group 565120797, while G92 is the coordinate system set in the program. There is no need to use G92 after G54~G59. Otherwise, G54~G59 will be replaced and should be avoided, as shown in Table 1. Table 1 The difference between G92 and working coordinate system.
 
G54~G59 is the coordinate system set before processing, and G92 is the coordinate system set in the program. If G54~G59 is used, there is no need to use G92, otherwise G54~G59 will be replaced and should be avoided.
 
Note: (1) Once G92 is used to set the coordinate system, using G54~G59 will not have any effect, unless the system is restarted after power off, or G92 is then used to set a new workpiece coordinate system. (2) After the program using G92 is finished, if the machine tool does not return to the origin set by G92, start this program again, the current position of the machine tool becomes the new workpiece coordinate origin, which is prone to accidents. Therefore, I hope readers use it with caution.
 
7. Compile the tool change subroutine.
 
On machining centers, tool change is 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. Before the tool is changed, the tool compensation and cycle must be cancelled, the spindle stops, and the coolant is closed. There are many conditions. If you must ensure these conditions before manually changing the tool, it is not only error-prone but also inefficient. Therefore, we can compile a tool change program and save it in the system memory. When changing the tool, use M98 in the MDI state to call The tool change action can be completed at one time. Take PMC-10V20 machining center as an example, the procedure is as follows:
 
O2002; (program name)
 
G80G40G49; (cancel fixed cycle, tool compensation)
 
M05; (Spindle stop)
 
M09; (Coolant closed)
 
G91G30Z0; (Z axis returns to the second origin, that is, the tool change point)
 
M06; (tool change)
 
M99; (End of subroutine)
 
When the tool needs to be changed, just press "T5M98P2002" in the MDI state to replace the required tool T5, thus avoiding many unnecessary mistakes. Readers can compile corresponding tool change subroutines according to the characteristics of their own machine tools.
 
8. Other
 
The sequence number of the program segment is represented by the address N. Generally, the memory space of the numerical control device itself is limited (64K). In order to save the storage space, the sequence number of the program segment is omitted. N only represents the block number, which is convenient for searching and editing the program, and has no effect on the machining process. The sequence number can be increased or decreased, and the continuity of the value is not required. However, certain cycle instructions, jump instructions, subroutine calls and mirroring instructions cannot be omitted.
 
9. In the same program segment, the same instruction (same address character) or the same group of instructions will work afterwards.
 
For example, the tool change program is T2M06T3; T3 is replaced instead of T2; G01G00X50.0Y30.0F200; G00 is executed (Although there is an F value, G01 is not executed). Command codes that are not in the same group will have the same effect in the same program segment. G90G54G00X0Y0Z100.0; G00G90G54X0Y0Z100.0;
 
All the above items are running and passing on PMC-10V20 (FANUC SYSTEM) machining center. In practical applications, only a deep understanding of the usage and programming rules of various instructions can reduce errors and avoid accidents.
 
10. The difference between different control system commands
 
For different control systems, such as Mitsubishi, Frank, and Siemens, their instructions are very different.

—[Close]— —[ Back]— —[ Print]—