Tianhui Machine Co.,Ltd

ホーム > ブログ> Use of special GM code in CNC machining

Use of special GM code in CNC machining

December 30, 2022

1 Introduction

In the format of the NC text address block, the G code and the M code respectively indicate the preparation function and the auxiliary function word. The G and M codes respectively represent different numerical control functions in different numerical control systems. Some numerical control systems also stipulate that several sets of G and M can be used. Code instruction, which adds a lot of flexibility for the development of CNC machining process, the programming of CNC machining program and the debugging of machining program, especially the reasonable use of special G and M codes, to ensure the processing quality and precision of parts, and to prevent CNC machine tools. The interference between the machining axes or between the tools has a positive and practical significance for improving the safe and stable operation of the CNC machine tools.

2. Use of special G and M codes in CNC machining

Delay G04 command

The delay G04 command is used to temporarily limit the running of the machining program. It is expressed as "G04X-, or G04U-, or G04P-" in the program. For example, “N0050 G04 X1.0” means that when the block is executed, the feed is aborted for 1 second and then the subsequent program command is executed. The delay time in the G04 command is set during programming. The selection range is “0.001 to 99999.999 seconds or revolution (IS-B incremental system with X or U command). The delay time unit of 1 to 99999999 is 0.0001 seconds or Turn (IS-C incremental system with P command). The G04 delay command is generally used in several cases: when the tool is sent to the specified depth for the deep machining of the non-through hole, the tool can be used for non-feeding finishing machining with the G04 command, and then the tool is retracted to ensure the hole. The bottom is flat and the relevant surface is free of burrs; 2 when the groove is grooved, the spindle should be idling for a few turns and then retracted. Generally, the undercut does not need to be finished. The G04 delay command is adopted to facilitate the smooth bottom of the groove and improve the overall quality of the part. On the CNC lathe, when the center hole of the workpiece is drilled with a 60° tip hole or a 45° angle, In order to make the side of the hole and the chamfer flat, use the G04 command to rotate the workpiece after 1 revolution and then retract the tool. 4 The shoulder of the shaft part for turning, when the tool is sent to the running direction, should be set between the instructions for changing the running direction. G04 command to ensure the perpendicularity of the shoulder end and the workpiece axis.

In addition to the above general use, in the use of actual CNC machining, I tried some special analysis and research, and got new enlightenment from it:

The numerical control machine tool with stepping motor as the feed drive system, especially the CNC machine tool with improved design in China, in the high-precision machining, in order to avoid the influence of the frequency change too fast and the displacement accuracy, the person will quickly carry the G00 command road. It is decomposed into two blocks, segment 1 is the fast point carry, and segment 2 is the linear interpolation. Since the high-speed point carry operation is the initial speed increase, when it reaches the set speed frequency, it runs normally at a constant speed, and when it reaches the set point, it is down frequency (that is, the automatic speed increase and decrease). If the delay G04 command is set after segment 1, it can ensure that the high-speed running frequency reduction is completely stable, and then run at low speed, so that the control precision can be improved. Especially for the positioning of the hole in the CNC drilling machine is particularly obvious.

In the processing of parts with short batch processing time, the start button is frequently used. To reduce the operator's fatigue or frequent button malfunction, the G04 command is used instead of the first part. The delay time is set according to the loading and unloading time of one part. After the operator skillfully masters the NC machining program, the delay command time can be gradually shortened, but it must be guaranteed a certain safety time. The part machining program is designed as a cyclic subroutine. The G04 command is designed in the main program that calls the cyclic subroutine. If necessary, the design selection plan stops the M01 command as the end or check of the program.

When the tap of the CNC lathe taps the center thread, it needs to use the elastic collet to tap the teeth to ensure that the tap will not break when it taps to the bottom of the thread, and the G04 delay command is set at the bottom of the thread to make the tap for non-feed cutting. The time of delay should ensure that the spindle stops completely. After the spindle stops completely, it will reverse according to the original forward speed, and the tap will retreat according to the original lead.

Program example:

M03 S300; tapping spindle speed can not be too fast

G00 XO Z5.0; to workpiece center coordinates

G32 Z-20.0 F1.0 M05; the spindle stops after tapping

G04 X5.0; tap delay 5 seconds for non-overcutting

G32 Z5.0 M04; spindle reverse, tap back

When the keyhole is retracted, in order to avoid the spiral scratches caused by the retraction and affect the surface roughness, the boring tool should be stopped at the bottom of the hole, and then retract after the spindle is completely stopped. When the knife is retracted, the retracting knife scratch of the vertical end surface is left. Generally, in the boring processing process, the retracting knife scratch is allowed to exist, and the shape error of the boring hole can be judged by using the scratch.

The G04 command must be set after the command is sent to ensure that there is sufficient time delay, and wait for the required action of the command to start or complete before running the subsequent program to ensure the reliability of the process. Such as changing the tool position, turning the spindle off, lubricating or turning on other signals. Such as: Sima188 S-188 double-spindle double-turret CNC turning and milling center of Switzerland, equipped with NUM 1050 CNC system, the program in automatic pulling is:

N0160 M60; clamp open allows

N0170 M169; clamp open

N0180 G04 FO.3

N0190 G01 ZL1; L1 has been assigned

N0200 M168; clamp clamping

N0210 G04 FO.3

The G04 command can be set when there is a large change in the spindle speed. The purpose is to stabilize the spindle speed and then machine the part to improve the surface quality of the part.
Program example:

N0010 S1000 M13; spindle rotation, coolant opening

N0020 T0302

N0030 G01 X32.4 FO.1

N0040 S3500 M03; spindle speed has a large change

N0050 G04 XO 6; time delay 0. 6S

N0060 G01 Z-10.0 FO.02

The G04 command must be set when multiple functions are executed sequentially in the machining program. Such as robotic hand-connected parts, dual-spindle synchronization, conversion from the first turret to the second turret processing, etc., according to the complexity of the action, set the different G04 delay amount, so that the previous action is completely finished, and then proceed to the next Action, avoid interference.

During the milling process, the G04 command can be set when machining the same arc angle. The taper caused by the knife and the R deviation of the actual machining can be eliminated, but the surface quality of the arc angle is lowered.

Program example:

N0120 G03 X20.5 Y18.6 R6 F100

N0130 G04 XO.5

N0140 G01 Y50.5 F300

When the spindle is running dry, set the time of each speed with G04, compile a heat engine program, let the equipment run automatically, and the effect of the heat machine can be better. Such as:

N0220 M03 S1000

N0230 G04 X600

N0240 S5000

N0250 G04 X600

N0260 S10000

N0270 G04 X600

Return to reference point G26, G27, G28, G29 commands

The reference point is a fixed point on the machine that can be easily moved to this position by the reference point return function. The reference point is mainly used as an automatic tool change or setting coordinate system. Whether the tool can accurately return to the reference point is an important indicator to measure the accuracy of its repeated positioning, and it is also a prerequisite for CNC machining to ensure its dimensional consistency.

In actual machining, the use of the return reference point command can be used to improve the accuracy of the product.

For machines with high repeatability, in order to ensure the machining accuracy of the main dimensions, the tool can return to the reference point and re-run to the machining position before machining the main dimensions. The purpose of this approach is actually to re-check the benchmark to determine the dimensional accuracy of the process.

For multi-axis linkage machine tools, especially multi-axis multi-turret machine tools, the beginning of the program, generally set back to the reference point command, to avoid interference when changing tools or multi-axis linkage machining.

Before the B-axis rotation of the machining center with more than four axes, the double-spindle lathe is set to the reference point command before the main and auxiliary axes are synchronously processed to prevent the collision of the knife. Such as: HERMLE 600U five-axis five-link vertical machining center, with Heidenhain i530 CNC system, its B-axis can be rotated by ±110°, while the tool magazine is behind the spindle, and the reference point command is added before the B-axis rotation.

The double-spindle lathe can only use the reference point return command to make the other spindle at the reference point position during the machining of the spindle, which can make the program run smoothly and ensure the machining accuracy. For example, the S188 twin-spindle double-turret CNC turning and milling center only uses the G28 command to return the other spindle and the turret to the reference point position for machining smoothly.

For multi-axis slitting machine, when it is necessary to close an axis for various reasons, use the reference point command to make the axis at the reference point position and then close it to ensure the position of the axis. For TONUS DECO2000 machines, the X4 and Z4 axes must be closed due to machining requirements. In this case, the return reference point operation is performed before the system shields the X4 and Z4 axes.

When repairing a servo unit of an axis, generally refer to the reference point operation (if possible) to avoid loss of the coordinate position when the axis is de-energized. For example, the COTRA 42 machine tool of the American Harding Company needs to check the noise of the X-axis motor, and return to the reference point operation before the inspection.

3, relative programming G91 and absolute programming G90 instructions

Relative programming is based on the position of the tool tip as the coordinate origin, and the tool tip is programmed to be displaced relative to the coordinate origin. That is to say, the relative programmed coordinate origin is often transformed, and the operation is to control the displacement based on the current tool tip point. Then, when the continuous displacement is performed, a cumulative error is inevitably generated. Absolute programming has a relatively uniform reference point, that is, the origin of coordinates, in the whole process of machining, so its cumulative error is smaller than relative programming.

In CNC turning, the accuracy of the radial dimension of the workpiece is higher than the axial dimension. Therefore, when programming, the radial dimension is preferably absolutely programmed. Considering the convenience of machining, the axial dimension is relatively programmed, but for important Axial dimensions are also available in absolute programming. When machining CNC milling machines, absolute programming should be used for important dimensions. When machining parts in the CNC turning and milling machining center, it is generally programmed with relative programming during machining and converted to milling, with absolute programming. Such as: EMCO 332 CNC turning and milling center, with Siemens 840D CNC system, twin-spindle double turret, the procedure in the milling process:

M06 T10

M38; car mode, default programming in G91

M04 S1000 M08

G95 FO.03

G00 X8.0 YO Z10.0

G00 Z1.0

G01 Z-11.55 FO.01

M06 T13

M39; milling mode, G91 relative programming, G90 absolute programming

G00 G90 X-L12 Z1; L12 has been assigned

G01 G90 Z-9.5 F1200

G01 G91 XO.30

G00 G90 Z1

In addition, in order to ensure some relative position of the parts, according to the requirements of the process, flexible use of relative programming and absolute programming.

Spindle release clamp command
The spindle release and clamping commands are used under normal conditions for loading and unloading parts, but for multi-spindle lathes, there are other uses:

For two-axis simultaneous machining. When machining slender shaft parts, the main and auxiliary shafts are respectively clamped at both ends of the part, and the back-retraction force when the jacket is clamped is used to make the parts are tensioned, and then cutting is performed to prevent the The knife produces a taper and improves the quality of the part's surface.

For the CNC slitting lathe, after reasonable setting of the loosening and clamping commands of the main and auxiliary shafts, the feeding is repeated several times, and the processing is repeated several times, and the slender parts which are several times longer than the rated stroke can be processed. The author used this method to machine the 96mm long φ0.6mm and φ0.8mm step shaft on the TONUS DECO2000 machine tool (Z-axis stroke 64mm).

Such as: TONUS DECO2000 machine tool is CNC vertical cutting lathe, with PUN2000 (TONUS patented product) CNC system with electronic cam function and electronic cutting machine function, which is based on FUNAC16 system. Its programming method is different from ordinary car. , milling, each step is the technical process in each block diagram separately, now only the main processing steps:

G00 G100 Z1=0 X1=1; spindle rotation, cooling, adjustment of the knife and other steps
G01 X1=0.6 FO.05

G01 Z1=-60.0 FO.02

G01 X1=1.2 FO.05

G00 G100 X1=20

M111; loose spindle
G04 XO.4

G01 Z1=0.0 FO.1

M110; the second clamping of the spindle

G04 XO.4

G01 G100 X1=1.2

G01 X=0.8 F=0.05

G01 Z1=-36.0 FO.02

G01 X1=1.2 FO.05

G00 G100 X1=20; Switch to the cut step.

G53 zero drift instruction

Under normal circumstances, G53~G59 and other commands are used in the case of re-establishing the programming origin in the process of part processing, such as simultaneous processing of multiple parts, but if such instructions are used reasonably, the efficiency of the machine tool can be improved.

For most CNC equipment, after starting up, it is necessary to carry out a heat engine for a period of time to eliminate the error caused by the heating of the spindle or the turret. If you are familiar with the machine tool, you can set commands such as G53 to G59 at the beginning of the machining program, and artificially compensate, which can greatly shorten the heat engine time. For example, S-188 double-spindle double turret CNC turning and milling center, because the number of axes controlled is more, if the size is completely stable, it needs to run for about 2 hours every day. After a period of exploration, the G53 command is used, namely:
G53 XO.04 YO.01. Within 2 hours, XO.01 YO.005 is reduced every 0.5h, and the heat engine time can be controlled within 0.5h.

Mass production, when the workbench can hold several parts, use G53~G59 and other instructions in programming to define several different machining origins, which can process several parts at one time, saving tool change time and improving work efficiency. For example, VC750 vertical machining center, the worktable is 850mm × 530mm, the blank of the machined parts is φ160mm, and the clamping part can be removed, and 4 parts can be installed at a time. The procedure is as follows:

G54 P1 M98

/G55 P1 M98

/G56 P1 M98

/G57 P1 M98

M99

The program to be processed is programmed into a subroutine (P1), and the program with / is not executed during debugging, and then executed after mass production.

G79 jump instruction

The G79 command is a forced jump, which is used in the part processing program of the turning and milling combined machining center, which can bring great convenience. Such as S-188 double spindle double turret CNC turning and milling center, equipped with NUM 1050 CNC system, with automatic pulling mechanism, in the preparation of parts processing program, such as:

$ G79 N2037

N2037 GO X52.0 Z2.0

By adding the G79 command, it is very convenient to debug the various step programs, eliminating the need for the general program to find the block from the beginning or to add M01 at the end of each block. At the same time, you can jump directly to the end of the program. Cut off.

G09 deceleration and precise positioning instructions

The G09 command has the function of decelerating and accurately stopping the position determined by the current bar program before executing the next program. Used in finishing, it can make the machining position and size accurate, such as S-188 twin-spindle double-turret CNC turning and milling center, equipped with NUM 1050 CNC system:

G01 Z1 FO.02
G01 G09 ZO.5
G01 G09 X9.745 Z-0.4
G01 Z-11.52

4 Conclusion

CNC machining is an automated processing method based on NC program. In the actual processing, the G and M codes are deeply analyzed and studied. To change the traditional processing methods, it is necessary to have strong program commanding ability and rich practical skills. The author has been engaged in the teaching of numerical control technology, numerical control processing and numerical control equipment maintenance for nearly 20 years. He has encountered many technical problems and accumulated certain experience in the use of special G and M codes. In the NC machining program, it is of great significance to use these special G and M codes to improve the machining quality and precision of the parts and to use and maintain the CNC machine tools.
お問い合わせ

Author:

Ms. SU LAN RONG

Eメール:

susu@cn-tianhui.com

Phone/WhatsApp:

++86 13396680822

人気商品
企業ニュース
You may also like
Related Categories

この仕入先にメール

タイトル:
イーメール:
メッセージ:

Your message must be betwwen 20-8000 characters

お問い合わせ

Author:

Ms. SU LAN RONG

Eメール:

susu@cn-tianhui.com

Phone/WhatsApp:

++86 13396680822

人気商品
企業ニュース

ホーム

Product

Phone

私たちに関しては

お問い合わせ

We will contact you immediately

Fill in more information so that we can get in touch with you faster

Privacy statement: Your privacy is very important to Us. Our company promises not to disclose your personal information to any external company with out your explicit permission.

送信