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

Programming Tips for CNC Machining Center

For CNC machining, programming is very important and directly affects the quality and efficiency of machining. I believe everyone loves and hates programming. So how to quickly master the programming skills of CNC machining centers? Let’s study with the editor!
【Pause instruction】
G04X(U)_/P_ refers to the pause time of the tool (the feed is stopped, the spindle does not stop), and 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 in one-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).
However, in some hole machining commands (such as G82, G88 and G89), in order to ensure the roughness of the hole bottom, there needs to be a pause time when the tool reaches the bottom of the hole. At this time, it can only be expressed by the address P. Address X indicates that the control system considers X to be the coordinate value of the X axis and executes it.
[The difference and connection of M00, M01, M02 and M03]
M00 is the unconditional pause command of 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 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 OPSTOP key 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 in the middle of processing.
M02 is the main program end instruction. When this instruction is executed, the feed will stop, the spindle will stop, and the coolant will be shut off. 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.
[Addresses D and H have the same meaning]
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 No. 21 (tool magazine with 20 tools).
【Mirroring command】
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 circular interpolation direction will all be opposite to the actual program. 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 only after returning to the origin of the workpiece coordinate system. 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.
【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/G03X_Y_R_F_, where X and Y are the coordinates of the arc end point, and I and J are the arc starting point to the center of the arc For the incremental value on the X and Y axes, R is the radius of the arc, and F is the feed.
Pay attention to the arc cutting, q≤180°, R is a positive value; q>180°, R is a negative value; the designation of I and K can also be designated by R. When both are designated at the same time, the R command takes precedence, and I , K is invalid; R can not do full circle cutting, full circle cutting can only be programmed with I, J, K, because there are countless circles with the same radius after 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; in circular interpolation, tool compensation commands G41/G42 cannot be used.
[Pros and cons between G92 and G54~G59]
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 92, start this program again, and the current position of the machine tool becomes the new workpiece coordinate origin, which is prone to accidents. Therefore, I hope that the majority of iron powder should be used with caution.
【Programming tool change subroutine】
On machining centers, 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. Before the tool is changed, 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 guaranteed before each manual tool change, it is not only error-prone but also inefficient. Therefore, we can write a tool change program to save it, and then call it with M98 to complete the tool change 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 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. The majority of iron powder can compile corresponding tool changing subprograms according to the characteristics of their own machine tools.
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. In order to save 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. In the same program segment, the same instruction (same address character) or the same group of instructions will work afterwards.

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