Application of popular user subroutine and macro p

2022-08-23
  • Detail

Application of user subroutines and macro programs in mold NC Milling Programming

at present, CNC machine tools with small memory are still the mainstream of machine tools in use in our country. How to make the processing program concise is of great practical significance for practical processing. The author introduces the subroutine, macro program, code segment call commonly used in NC Milling Programming and the application of tool plane conversion of five axis NC machine tool with spindle compound swing through examples, hoping to provide reference for readers engaged in NC machining and programming

I. preface

NC programming is one of the key technologies of NC machining, and its programming efficiency and quality largely determine the machining accuracy and production efficiency of products. Especially with the continuous development of NC machining towards high-speed and precision, improving the quality and efficiency of NC programming is of great significance to improve the competitiveness of manufacturing enterprises. With the continuous popularization and application of cad/cam software, the mode of NC programming gradually replaces manual programming by automatic programming. However, CAM software programming and manual programming have their own advantages, and the existing CAM software can not meet the special functions of all CNC systems. The full combination of the two programming modes is of great significance to improve the efficiency and quality of programming. Due to historical reasons, the coexistence of ordinary numerical control machine tools and high-precision numerical control machine tools in domestic enterprises will last for a long time. For traditional ordinary numerical control machine tools, high-speed machining cannot be realized, the programming strategy of high-speed machining is difficult to give full play to the processing efficiency of ordinary numerical control machine tools, and the memory capacity of traditional numerical control machine tools is generally limited, so the characteristics of traditional numerical control machine tools can be used reasonably and effectively, Combining the automatic programming and manual programming of CAM software, it is of great practical significance to compile a simple and reasonable small capacity NC program

II. Application of subroutines and macro programs

in the actual NC machining programming, making full use of the functions of CAM software and cooperating with manual programming, such as the application of macro programs, the calling of code segments and subroutines, can fully improve the efficiency of NC programming

1. Application example of user subroutine

in practical application, when programming with CAM software or manual programming for multiple identical machining features of the same product, if you can make full use of the subroutine function, you can not only reduce the workload of modeling, but also improve the simplicity of the program and reduce the error rate of the program. In most CNC systems, subroutine calls have special instructions, such as m98/m99 in FANUC system and G14 or G22 in deckelmaho system. As shown in Figure 1, there are three different typical milling cycles, namely, contour depth milling 6 building lighting milling cycle, rectangular array milling cycle and circular rotating array milling cycle. Figure 2 is the corresponding subroutine call code based on FANUC system, in which o8001 is the deep milling cycle subroutine call code, o8002 is the rectangular array subroutine code, and o8003 is the circular rotary array circular insulation ring milling subroutine call code

a) deep milling cycle

b) rectangular array milling cycle c) circular array milling cycle

Figure 1 Schematic diagram of typical milling cycle

a) deep milling cycle call

b) rectangular array subroutine call

c) circular array subroutine call

Figure 2 Schematic diagram of corresponding subroutine cycle call

2 Application of user macro program

the early ordinary CNC machine tool systems have the characteristics of small memory capacity, but most CNC systems provide the function of user macro program. Using user macro program can effectively solve the machining features such as regular surface, fillet, cavity and contour. When using macro program, it is required to have clear thinking and correct syntax. The macro program function provided by general CNC system is composed of conditional judgment statements, logic operations, arithmetic operations, cycle control statements, system variables and user variable settings. Its basic function composition is described in the following table

user macro program function composition

as shown in Figure 3, it is the processing of the upper fillet of a product. If the cylindrical milling cutter or ball head cutter adopts the straight-line fitting method for processing, the cam software is used to compile the NC program of the fillet surface, and its program is processed in the straight-line fitting method. The capacity of the program code is beyond the traditional NC machine tools. If DNC processing is used, there is a risk of data loss. If the macro program is adopted in the way of manual programming, and the tool tip or ball head cutter of the cylindrical end mill is used for the arc interpolation processing of the fillet surface, the program becomes simple and short, and its program is shown in Figure 4b, while the processing program code of straight line fitting programmed with CAM software is shown in Figure 4a. It can be seen from the figure that the program capacity compiled by cam is much larger than that of macro program. If the same machining interpolation accuracy is adopted, the macro program only needs to adjust 110 user variables to adjust the machining depth of Z axis of each layer, which can meet the machining accuracy requirements. When the accuracy is improved by linear fitting processing, the program capacity may increase exponentially, and the capacity of traditional CNC machine tools is more difficult to meet the production requirements. At the same time, the program can meet the requirements of rough machining, semi finishing and finishing by adjusting 110 user variables. The flexibility of the program is better than the adaptability of the NC program compiled with CAM software. User macro program function composition

Figure 3 user macro program circular processing schematic diagram

a) straight line fitting processing program code

b) user macro program circular processing program

Figure 4 Comparison between straight line fitting and macro program processing program code

3 Program code segment call

as shown in Figure 5, process the uniformly distributed U-shaped grooves on the side of a rotary part on a horizontal milling machining center. If CAM software is used for programming, even if absolute trajectory programming is used, its program capacity is large. Because of the same processing characteristics, we can make full use of the function of program code segment or subroutine call of the system, which not only facilitates programming, but also improves the efficiency of programming and reduces the risk of program processing. Figure 5C and figure 5D respectively show the schematic diagram of Machining NC program with the same characteristics by using the function of calling program code segments of deckelmaho and Heidenhain NC systems, in which G14 and tool call instructions complete the calling of program code segments. G14 in MAHO system repeatedly completes the processing function between N9 and n191, while toolcall in Heidenhain system repeatedly calls the program code between lbl1 and lbl0. As can be seen from Figure 5, for the repeatedly processed product feature objects, using this program has a concise style and clear thinking, and the flexibility and adaptability of the program are good, making it very convenient to modify and check errors

a) tool path diagram

b) simulation machining diagram

c) deckelmaho system NC code segment call

d) Heidenhain system NC code segment call

Figure 5 program code segment call

4 According to statistics, the NC machining of parts, the cutting time for machine tools is relative to the clamping, scheduling and inspection time. 1. The proportion of widely used external wall insulation materials is not more than 50%. Therefore, improving the clamping efficiency of products is of great significance to improve the efficiency of digital processing. As shown in Figure 6 is the hole processing schematic diagram of a product. If a three-axis NC machine tool is used, it needs to be clamped and aligned twice. For a five axis NC machine tool with a composite swing of the spindle, such as dmu125p, the function of the NC system can be fully used to quickly complete the programming by using functions such as tool plane conversion. For dmu125p CNC machine tool system, the M55 function provided by deckelmaho can manually complete the conversion of tool plane with G7 command code. As shown in Figure 7, the tool plane rotates around the X, y and Z axes respectively, and figure 8 is the NC code diagram of the five axis drilling processing of the product by means of tool plane conversion and coordinate offset for the hole processing of the product. Through this processing strategy, the clamping assistance time is reduced, and the processing accuracy and efficiency of the product are improved

Fig. 6 schematic diagram of five axis drilling machining

m55 G7 a5=15 °

a) cutter plane rotates around the X axis

m55 G7 b5=15 °

b) cutter plane rotates around the Y axis

m55 G7 c5=15 °

c) cutter plane rotates around the Z axis

Fig. 7 Schematic diagram of variable cutter plane

Fig. 8 dmu125p spindle composite pendulum five axis drilling machining with the maturity of technology

III. conclusion

make rational use of subroutines Manual programming of macro programs and code segments plays an obvious role in simplifying NC machining programs. Through our examples, we have a perceptual understanding of the remarkable effects it produces. In real processing, there are many parts with the same or similar characteristics. If we can make reasonable use of these technologies in the process of processing or programming, we will get twice the result with half the effort. (end)

Copyright © 2011 JIN SHI