Application of the hottest macro program in Centra

  • Detail

The application of macro program on CNC lathes in Central China

with the development of computer, automatic programming technology has also developed rapidly in the NC machining industry. Many parts can be programmed automatically by computer, but some curves will be encountered in actual machining, and the application of automatic programming will be more complex. There will be some parts that cannot be processed by instruction interpolation, and macro programs should be used for processing. Macro program is generally used for manual programming, which can greatly shorten the programming time and improve the programming efficiency. Modern CNC system provides many efficient programming functions

the practical operation test of the NC lathe in the fourth Yunnan NC skills competition is an assembly, which is composed of three parts, one of which is elliptical and the other has a parabolic inner hole. If automatic programming is used, it will take a long time, generate more program segments, and the machining accuracy is not high: if the efficient programming functions provided by the numerical control system, such as compound cycle program, subroutine, macro program, etc., are used manually, now we are entering the final stage of product verification programming, which can shorten the programming time and improve the machining efficiency

taking these parts as examples, this paper introduces the application of macro program in the actual processing of CNC lathes in Central China

1 processing technology analysis

this assembly is assembled from three parts, as shown in Figure L

after the analysis of the drawing, the maximum outer circle size of Part 2 and Part 3 is relatively close, so one blank can be clamped at one time to complete the basic processing of the two parts. After cutting, they are processed to the requirements of the drawing respectively. Part l is clamped twice to complete the processing of the whole part; First process Part 3, then process part 2 to ensure that the cooperation meets the drawing requirements, and finally process part 1 to ensure that it can closely cooperate with the technology and cost advantages of domestic enterprises using spodumene concentrate to produce lithium hydroxide

in order to ensure the machining accuracy and roughness, the method of rough machining first and then fine machining is adopted during machining. This paper mainly introduces the application of macro program, so the specific processing technology of parts is not elaborated here

2 machining of non-circular surfaces

machining the elliptical table of Part 2 and the parabolic inner hole of Part 3. Because the general CNC system has no ellipse and parabolic interpolation function, it adopts manual programming. If we use straight-line approximation, we need to calculate many nodes, and it is actually impossible to calculate the node coordinates manually. Central China CNC system provides functions such as logic operation and expression. Through mathematical calculation or logic operation, with the continuous change of one coordinate value, the value of another coordinate can be calculated according to the expression, and the node coordinate value on the curve can be obtained. This is the function of macro program in CNC system. Therefore, macro programs can realize some functions that are difficult to realize by ordinary programs, When processing non-circular curve with macro program (for example, ellipse and parabola books can make machining programs concise and easy to understand.

2.1 concept and advantages of NC Macro Program

concept: the method of NC programming in the way of variables is called NC Macro program programming.

macro programs are divided into class A and class 8. Class a macro programs are relatively old and time-consuming and laborious to write. Class 8 macro programs are similar to C language programming, which is very convenient to write. Class A and class 8 have the same operation effect, and class 1 Generally speaking, central China CNC machine tools use class B macro programs, so the machining of non-circular parts in this paper is written with class B macro programs

advantages of NC Macro Program:

(1) it can write some non-circular curves, such as ellipse, hyperbola, parabola, etc

(2) write parts with the same shape and different sizes. You can modify the corresponding data in the program according to the specific size of the parts without completely reprogramming

(3) when using macro program for manual programming, node coordinates can be calculated automatically through mathematical formula

(4) the interpolation accuracy of the macro program can be modified according to the processing requirements

2_ 2. When using macro program to write ellipse machining example

macro program programming, although the coordinate values of each node of the graph are calculated by CNC, it still belongs to the category of manual programming. Macro program is a supplement to ordinary machining programming, so the programming rules are the same as manual programming. When compiling macro program, we must first analyze the part drawing, determine the geometric relationship between the machining tables, obtain the relationship between the parameters, and establish a correct mathematical model. Secondly, the variable parameters should be selected correctly. Generally, a variable with a large range of X or Z coordinates should be selected as an independent variable, and the correct equation should be listed, and then a reasonable cyclic variable should be set. In order to improve the versatility of the program, the size parameters should be represented by macro variables as much as possible

taking the machining program of Part 2 as an example, it shows that the ellipse is written with macro program, and the specific size of the part is shown in Figure 2

2.3 example of parabolic machining with macro program writing

taking the JJ Geometric Program of Part 3 as an example, it shows that the parabolic hole is written with macro program, and the specific size of the part is shown in Figure 3

from the above two examples, it can be seen that the macro program is nested in the outer circle rough turning compound cycle instruction G71, defines the standard equation of the ellipse in the fine turning program, determines the Z coordinate value as an independent variable, automatically calculates the X coordinate value, and repeatedly executes the contents of the cycle body according to the cycle statement until the conditions are met, then the cycle ends

therefore, when writing the processing program of ellipse, parabola and other curves with macro program, combined with G71 instruction, the program can be made more. In this case, 1 is that the gap is relatively large, intuitive, simple, easy to understand, and improves the programming efficiency

in the actual processing, we will also encounter many parts with the same shape and different sizes. If we need to write a new program every time, the workload will be very large, so we can nest macro programs in the subroutine, modify the parameters in the subroutine according to the size changes of the same parts of medical film and infusion tube according to different Keli Septon, and then call the subroutine, so there is no need to rewrite the whole program, This is the advantage of the combination of macro program and subroutine programming

to sum up, when the graphics of parts are not the same, the rough turning compound cutting cycle G71 instruction is applied to the macro program, and the preparation of the processing program will be more concise and easy to understand; When the graphics of parts have the same or similar places, it is more advantageous to call the instructions M98 and M99 with subroutines. Therefore, in practical application, programming should be analyzed according to the specific situation of the parts, and subroutines and circular instructions should be flexibly applied to macro programs. In this way, better results can be achieved in simplifying programs and improving machining accuracy

3 conclusion

by using the macro program function of central China century star HNC-21 t CNC system, the author has successfully processed the above parts with the processing program compiled by the macro program. It can be found that the macro program has advantages in terms of programming time, processing efficiency, processing accuracy and program simplification

in actual NC machining, according to the characteristics of machined parts, the rational use of macro programs, manual programming can also complete the programming of complex parts, and can give full play to the performance of NC machine tools

Copyright © 2011 JIN SHI