Problem description:
Excuse me, what is CNC programming, what is manual programming, what kind of working platform does it work on, and what is its nature? Please explain to my brother that I am weak in this respect. I hope you can make it clear and be popular. Thank you! ! ! !
Analysis:
1 Introduction
In the format of NC text address program segment, G code and M code respectively represent preparatory function and auxiliary function word, and G code and M code respectively represent different NC functions in different NC systems. Some CNC systems also stipulate that several sets of G and M code instructions can be used, which gives great flexibility to the formulation of NC machining process, the compilation of NC machining program and the debugging of machining program. Especially, the rational use of special G and M codes can ensure the machining quality and accuracy of parts and prevent NC machine tool machining.
2 The use of special G code and M code in NC machining
1) Delay G04 instruction
The function of delay G04 instruction is to artificially temporarily restrict the running machining program, which is expressed as "G04X-, or G04U-, or G04P-" in the program. For example, "N0050 G04 X 1.0" means that when executing this program segment, the feed will stop 1 sec, and then continue to execute the subsequent program instructions. The delay time in G04 instruction is set during programming, and its selection range is "0.00 1 ~ 99999.999 seconds or revolutions (IS-B incremental system with X or U instruction). 1~ * * * * * The delay time unit is 0.000 1 sec or revolutions (IS-C incremental system with P instruction) ". G04 delay instruction is generally used in the following situations: ① When deep-processing blind holes, after the tool is sent to the specified depth, G04 instruction can make the tool finish machining without feeding, and then withdraw the tool to ensure that the hole bottom is flat and the related surface is free of burrs; (2) When slotting, at the bottom of the slot, let the spindle idle for several turns, and then exit the tool. Generally, it is not necessary to finish machining the relief groove, and G04 delay instruction is adopted, which is beneficial to leveling the bottom of the chute and improving the overall quality of the parts. (3) When drilling a 60-degree top hole or an inverted 45-degree angle in the center of the end face of the workpiece on the CNC lathe, in order to make the hole edge and chamfer smooth, use G04 instruction to make the workpiece turn 1 and then retract the tool; (4) When turning the shoulder of shaft parts, G04 instruction should be set in the instruction room to change the running direction when feeding the tool, so as to ensure the verticality between the shoulder end and the axis of the workpiece.
In addition to the above general purposes, in the practical use of NC machining, some special purposes have been analyzed and studied, and new enlightenment has been obtained from them:
(1) CNC machine tools with stepping motor as feed drive system, especially those with improved design in China, in high-precision machining, in order to avoid the influence of too fast frequency change on displacement accuracy, the average person divides the instruction path of quick point carry G00 into two program segments, segment 1 for quick point carry and segment 2 for linear interpolation. Because the high-speed point-and-belt operation starts with increasing speed, it is normal constant-speed operation when the set speed frequency is reached, and it is frequency reduction when it is close to the positioning point (that is, it is often called automatic speed increase). If the delay G04 instruction is set after the 1 segment, the frequency reduction of high-speed operation can be guaranteed to be completely stable before low-speed operation, thus improving the control accuracy. In particular to the positioning of holes on a numerical control drilling machine.
(2) Start button is often used for parts with short processing time. In order to reduce the misoperation caused by fatigue or frequent keystrokes, G04 instruction is used instead of the beginning of the first part. The delay time is set according to the loading and unloading time of 1 part. After the operator is familiar with the NC machining program, the delayed instruction time can be gradually shortened, but a certain safety time needs to be guaranteed. The part processing program is designed as a loop subroutine, and the G04 instruction is designed in the main program that calls the loop subroutine. If necessary, design and select the planned stop M0 1 command as the end or inspection of the program.
(3) When tapping the central thread with a tap on a CNC lathe, it is necessary to tap the thread with an elastic cylindrical chuck to ensure that the tap will not break when tapping to the bottom of the thread, and set a G04 delay instruction at the bottom of the thread to make the tap cut without feeding. The delay time needs to ensure that the spindle stops completely. After the spindle stops completely, it will reverse at the original forward speed, and the tap will retreat in advance.
Program example:
M03 S300 Tapping spindle speed should not be too fast.
G00 XO Z5.0 workpiece center coordinates
g32 Z-20.0 f 1.0 M05; After tapping, the spindle stops.
G04 X5.0 For non-overfeed cutting, the tape is delayed for 5 seconds.
G32 Z5.0 M04 Spindle reversal, tap back.
(4) When withdrawing the tool from the keyhole, in order to avoid leaving spiral scratches when withdrawing the tool and affecting the surface roughness, the boring tool should stay at the bottom of the hole without feeding, and then withdraw the tool after the spindle stops completely. When withdrawing the tool, it will leave a scratch on the vertical end face, which is generally allowed in the process of boring, and the shape error of boring can also be judged by using this scratch.
(5) G04 instruction should be set after sending the instruction to ensure enough time delay, and the follow-up program should be run after the action required by sending the instruction is started or completed to ensure the reliability of processing. Such as changing the cutter position, opening and closing the spindle, lubricating or switching on other signals. For example, the S- 188 two-axis twin-tower CNC turning and milling center of Swiss Bumatex Company is equipped with NUM 1050 CNC system, and the automatic discharging procedure is as follows:
n 0 160 M60; Fixture opening permission
n 0 170m 169; Clamp opening
N0 180 G04 FO.3
n 0 190g 0 1 ZL 1; L 1 has been assigned.
n 0200m 168; Fixture clamping
N02 10 G04 FO.3
(6) When the spindle speed changes greatly, G04 instruction can be set. The purpose is to stabilize the spindle speed before cutting the parts, so as to improve the surface quality of the parts.
Program example:
n 00 10s 1000m 13; When the spindle rotates, the coolant is turned on.
N0020 T0302
n 0030g 0 1 x 32.4 f 0. 1
The spindle speed of N0040 S3500 M03 has changed greatly.
n 0050 G04 XO 6; Delay 0. 6s
n 0060g 0 1 Z- 10.0 f 0.02
(7) When multiple functions are executed in sequence in the machining program, G04 instruction must be set. For example, the manipulator connects parts, the two spindles are synchronized, and the processing is switched from 1 turret to the second turret. According to the complexity of the action, set different G04 delay, so that the last action is completely completed, and then proceed to the next action to avoid interference.
(8) In the process of milling, when machining arc angles with the same tool diameter, you can set G04 instruction. The taper caused by cutting and the R deviation of actual machining can be eliminated, but the surface quality of arc angle will decrease.
Program example:
n 0 120 G03 x 20.5y 18.6 R6 f 100
N0 130 G04 XO.5
N0 140 G0 1 Y50.5 F300
(9) When the spindle is idling, set the speed of each gear with G04, and compile the heat engine program to make the equipment run automatically, which can make the heat engine effect better.
For example:
N0220 M03 S 1000
N0230 G04 X600
N0240 S5000
N0250 G04 X600
N0260 S 10000
N0270 G04 X600
2) Instructions to return to reference points G26, G27, G28 and G29.
The reference point is a fixed point on the machine tool, and the tool can be easily moved to this position through the reference point return function. Reference points are mainly used for automatic tool change or coordinate system setting. Whether the tool can accurately return to the reference point is an important index to measure its repeated positioning accuracy, and it is also the premise of ensuring its dimensional consistency in NC machining.
In actual machining, the precision of products can be improved by skillfully using the command of returning to reference point.
(1) For machine tools with high repetitive positioning accuracy, in order to ensure the machining accuracy of main dimensions, before machining the main dimensions, the tool can return to the reference point and then run to the machining position. The purpose of this practice is actually to re-check the benchmark to determine the dimensional accuracy of machining.
(2) For multi-axis linkage machine tools, especially multi-axis multi-tool tower machine tools, the reference point instruction is generally reset at the beginning of the program to avoid interference during tool changing or multi-axis linkage machining.
(3) Before the B-axis of the machining center with more than four axes rotates, the double-axis lathe sets the instruction to return to the reference point before the synchronous machining of the main shaft and the auxiliary shaft, which can prevent tool collision accidents. For example, the HERMLE 600U five-axis five-linkage vertical machining center is equipped with Heidenhain i530 numerical control system, and its B axis can rotate 1 10, while the tool magazine is behind the main axis, and the reference point instruction is added back before the B axis rotates.
(4) Double spindle lathe, only when machining one spindle, use the reference point instruction to make the other spindle at the reference point position, can the program be executed smoothly and the machining accuracy be guaranteed. For example, in S 188 CNC turning and milling center with two spindles and two turrets, when machining parts with only one spindle, first use G28 instruction to return the other spindle and turret to the reference point position, so that the machining can proceed smoothly.
(5) For the multi-axis slitting machine, when a certain axis is to be closed for various reasons, the position of the axis can be ensured by using the reference point command to make the axis at the reference point position. Such as TONUS DECO2000 machine tool, due to the processing requirements, the X4 and Z4 axes must be closed. In this case, before the system shields the X4 and Z4 axes, the operation of returning to the reference point should be performed.
(6) When repairing the servo unit of an axis, it is generally necessary to return to the reference point (if possible) to avoid the loss of coordinate position when the axis is powered off. For example, COBRA 42 machine tool of Harting Company in the United States needs to be inspected because of the noise when the X-axis motor is running, and the operation of returning to the reference point should be carried out before the inspection.
3) relative programming G9 1 and absolute programming G90 instruction.
Relative programming takes the position of the tool tip as the coordinate origin, and programs the tool tip through the displacement relative to the coordinate origin. That is to say, the coordinate origin of relative programming is constantly changing, and the displacement is controlled based on the current tool point, so when the displacement is continuous, accumulated errors will inevitably occur. In the whole machining process, absolute programming has a relatively unified reference point, that is, the coordinate origin, so its cumulative error is smaller than that of relative programming.
In NC turning, the accuracy of the radial dimension of the workpiece is higher than that of the axial dimension, so when programming, it is best to use absolute programming for the radial dimension, and relative programming for the axial dimension considering the convenience of machining, but absolute programming can also be used for important axial dimensions. Absolute programming should be adopted when machining important dimensions with CNC milling machine. When machining parts in CNC turn-milling machining center, turn-milling generally adopts relative programming, while turn-milling adopts absolute programming. Such as: EMCO 332 CNC turning and milling center, equipped with Siemens 840D CNC system, double spindle and double turret, turning and milling program:
M06 T 10
M38 car mode, default in G9 1 relative programming.
M04 S 1000 M08
G95 FO.03
G00 X8.0 YO Z 10.0
G00 Z 1.0
g 0 1 Z- 1 1.55 f 0.0 1
M06 T 13
M39 milling methods: G9 1 relative programming and G90 absolute programming.
g00 G90 X-l 12 z 1; L 12 has been allocated.
G0 1 G90 Z-9.5 F 1200
G0 1 G9 1 XO.30
G00 G90 Z 1
In addition, in order to ensure some relative positions of parts, relative programming and absolute programming are flexibly used according to process requirements.
4) The spindle releases the clamping instruction.
Normally, spindle loosening and clamping instructions are used when loading and unloading parts, but for multi-spindle lathes, there are other uses:
(1) is used for two-axis synchronous machining. When machining slender shaft parts, the main shaft and the auxiliary shaft are used to clamp the two ends of the parts respectively, and the parts are in a state of tension by using the retraction force during clamping, and then cutting is carried out, which can prevent the taper caused by the tool and improve the machining quality of the parts surface.
(2) For the CNC longitudinal cutting lathe, slender parts several times longer than the rated stroke can be processed by reasonably setting the loosening and clamping instructions of the main shaft and the auxiliary shaft, pulling and feeding for many times and processing in sections for many times. Using this method, the author machined φ0.6mm and φ0.8mm step shafts with a length of 96mm on a TONUS DECO2000 machine tool (Z axis stroke 64mm).
For example, TONUS DECO2000 machine tool is a numerical control longitudinal cutting lathe, which is equipped with an improved PNT2000 (patented product of TONUS) numerical control system with electronic cam function on the basis of FUNAC 16 system. Its programming method is different from the general turning and milling, and each program step is compiled separately in each program block diagram. Now only the procedures of the main processing steps are listed:
g00 g 100 z 1 = 0 x 1 = 1; Spindle rotation, cooling and tool adjustment have other steps.
G0 1 X 1=0.6 FO.05
G0 1 Z 1=-60.0 FO.02
g 0 1 x 1 = 1.2 fo . 05
G00 G 100 X 1=20
m 1 1 1; Loose spindle
G04 XO.4
g 0 1 z 1 = 0.0 fo . 1
m 1 10; Second clamping of spindle
G04 XO.4
g 0 1g 100 x 1 = 1.2
G0 1 X=0.8 F=0.05
G0 1 Z 1=-36.0 FO.02
g 0 1 x 1 = 1.2 fo . 05
g00 g 100 x 1 = 20; Switch to the cutoff step.
5) G53 zero drift instruction
In general, when it is necessary to re-establish the programming origin in the process of machining parts, such as machining multiple parts at the same time, instructions G53~G59 are used, but if these instructions are used reasonably, the efficiency of the machine tool can be improved.
For most numerical control equipment, it must be preheated for a period of time after starting to eliminate the error caused by the heating of the spindle or tool rest. If you are familiar with the machine tool, you can set instructions such as G53~G59 at the beginning of the machining program for manual compensation, which can greatly shorten the preheating time. For example, S- 188 CNC double-shaft and double-tower turning and milling center needs to idle for about 2 hours every day because of the large number of controlled shafts. After a period of exploration, the G53 instruction is now used, namely: G53 XO.04 YO.0 1. The preheating time can be controlled within 0.5h by reducing XO.0 1 YO.005 every 0.5h within 2h. ..
In mass production, when the workbench can clamp multiple parts, we can use G53~G59 and other instructions to define several different processing origins in programming, so that multiple parts can be clamped and processed at one time, which saves tool changing time and improves work efficiency. For example, VC750 vertical machining center, the workbench is 850mm×530mm, and the blank of the parts to be machined is φ 160 mm, except the clamping part, four parts can be loaded at a time. The process is as follows:
G54 P 1 M98
/G55 P 1 M98
/G56 P 1 M98
/G57 P 1 M98
M99
The program to be processed is compiled into a subroutine (P 1), and the program with/is not executed during debugging, but will be executed after mass production.
6) G79 jump instruction
G79 instruction is a mandatory jump, which can bring great convenience when used in the part processing program of turn-milling compound machining center. For example, S- 188 CNC turning and milling center with two shafts and two turrets is equipped with NUM 1050 CNC system and automatic material pulling mechanism. In the preparation of parts processing program, such as:
$79 N2037
N2037 GO X52.0 Z2.0
By adding G79 instruction, it is convenient to debug every step of the program, and avoids the trouble that ordinary programs have to find program segments from the beginning or add M0 1 at the end of each program segment. At the same time, you can skip to the last sentence of the program and cut it off.
7) G09 deceleration and precise positioning instructions
G09 instruction is used to slow down and accurately stop at the position determined by the current program before executing the next program. When used in finishing, it can make the shape and size of machining accurate, such as S- 188 CNC two-axis double turret turning and milling center, equipped with NUM 1050 CNC system;
G0 1 Z 1 FO.02
G0 1 G09 ZO.5
G0 1 G09 X9.745 Z-0.4
g 0 1 Z- 1.52
3 Conclusion
NC machining is an automatic machining method based on NC program. In actual machining, it is necessary to have strong application ability of program instructions and rich practical skills to deeply analyze and study G code and M code and reform traditional machining methods. The author has been engaged in CNC technology teaching, CNC machining and CNC equipment maintenance for nearly 20 years, and has encountered many technical problems and accumulated some experience in using special G codes and M codes. In the NC machining program, it is of great significance to make good use of these special G codes and M codes to improve the machining quality and accuracy of parts and to use and maintain NC machine tools.