Development of Toolkit for Formalizing the Programming of Canned Cycles on CNC Machine Tools

The analysis shows that the development of programming tools for CNC systems is focused on the development of new machine canned cycles, including those for processing complicated surfaces, their complex combinations or complex mutual arrangement, but does not concern such issues as the universalization of cycle parameters. This does not make it impossible to transfer control programs from one CNC system to another. This work proposes an approach to the development of tools for creating universal cycles of typical technological transitions of machining on machines with different CNC systems. 1 New requirements for canned cycles An important attribute of modern CNC and CAM systems are the canned cycles that implement typical technological transitions, such as machining pockets, holes, grooves, undercuts and chamfers, contour turning and milling, as well as mashining of holes, grooves, etc. [1-3]. Using of canned cycles significantly reduce the programming time for CNC systems. A large number of researches and developments on the creation of machine cycles are being implemented, their nomenclature is expanding, including through the creation of cycles for processing complex surfaces, their complex combinations or complex mutual arrangement [4-7], which is dictated by the growing demand for parts of complex shapes. However, enterprises in practice face some problems that reduce the effectiveness of of using of cycles [8-10]. First, CNC systems from different manufacturers on machines of the same functionality have unique sets of parameters for programming machine cycles. Moreover, these sets differ both for CNC systems of different manufacturers and developers (Fanuc, Siemens, HAAS, AxiOMA Ctrl, etc.) and for CNC systems of different versions from the same manufacturer. This circumstance makes it impossible to use control programs on other machines that are developed for a specific CNC machine, while such a need in production conditions arises very often, in particular, in connection with the current load, scheduled maintenance or repair of machines. MATEC Web of Conferences 346, 03098 (2021) ICMTMTE 2021 https://doi.org/10.1051/matecconf /202134603098 * Corresponding author: martinov@ncsystems.ru © The Authors, published by EDP Sciences. This is an open access article distributed under the terms of the Creative Commons Attribution License 4.0 (http://creativecommons.org/licenses/by/4.0/). Secondly, modern production conditions are such that at the workshop level, more and more universal mobile applications (on laptops, tablets and smartphones) are required for programming CNC systems [11-13]. The development of toolkit for creating universal cycles of typical technological transitions of machining on machines with various CNC systems is based on the analysis of existing canned cycles and the identification of the main geometric and technological parameters that ensure the shaping and quality of surfaces [14-17], and additional parameters that determine the strategy of movement of the cutting tool during the cycle [18]. 2 Analysis of syntactic constructions for calling of canned cycles The results of the analysis of cycles of different CNC systems are summarized in Table 1. As you can see, different syntactic constructions are used to call similar cycles in different CNC systems, which limits the transfer of control programs from one CNC system to another Table 1. Examples of canned cycles. Canned cycle Siemens 810, 840d, 840dSL Fanuc Mate AxiOMA Ctrl Longitudinal turning Cycle95 G71 Cross turning Cycle95 G72 Radial groove turning Cycle93 G75 G288 Face groove turning Cycle93 G74 G289 Radial undercut turning G281 Face undercut turning G282 Cylindrical and conical threading Cycle97 G76 G276 Partoff Cycle92 Drilling Cycle83 G83 G83 Deep Drilling Cycle83 G83 Tapping Cycle84 G84 Thread Milling Cycle70 Milling straight slot Slot1 G388 Milling circle slot Slot2 Milling pocket Pocket3 G387 Milling round pocket Pocket4 G389 Milling edge Cycle76 Milling round edge Cycle77 Milling multiedge Cycle79 For a detailed analysis of syntactic structures and execution strategies, below is a cycle for drilling holes with a retraction for chip breaking from different CNC systems (table 2). MATEC Web of Conferences 346, 03098 (2021) ICMTMTE 2021 https://doi.org/10.1051/matecconf /202134603098

Secondly, modern production conditions are such that at the workshop level, more and more universal mobile applications (on laptops, tablets and smartphones) are required for programming CNC systems [11][12][13]. The development of toolkit for creating universal cycles of typical technological transitions of machining on machines with various CNC systems is based on the analysis of existing canned cycles and the identification of the main geometric and technological parameters that ensure the shaping and quality of surfaces [14][15][16][17], and additional parameters that determine the strategy of movement of the cutting tool during the cycle [18].

Analysis of syntactic constructions for calling of canned cycles
The results of the analysis of cycles of different CNC systems are summarized in Table 1. As you can see, different syntactic constructions are used to call similar cycles in different CNC systems, which limits the transfer of control programs from one CNC system to another

Universalization of the structure of canned cycles
Within the framework of this work, the universalization of cycles was carried out on the basis of the identified set of variable cycles and the creation of preparatory subprograms for technological operations and preparatory programs for technological transitions to support the correct operation of the cycle.   The preparatory subprogram of the technological operation (it is named O6999) implements the algorithm for assigning the entered local cycle variables to the global variables of the CNC system. This subprogram ensures the correct interaction of the developed cycles with the algorithms of the CNC systems, since it transfers to the CNC memory the variables responsible for changing the tool, the correct retraction and approach of the tool to the workpiece and restrictions on the spindle rotation. Geometric information and subprogram variables are shown in Figure 2 and Table 3.

Unification of work with auxiliary functions
The preparatory subprogram of the technological transition O7000 is necessary for the correct operation of the cycle and the organization of the interaction of the cycle with Mcodes and taking into account the geometric characteristics of the tool for the correct calculation of the trajectory of its movement. The variables of the subprograms are shown in Table 4.  The presented development of the preparatory subprogram of the technological operation and the preparatory program of the technological transition have a similar form of entering local variables in the body of the control program, which facilitates the development of control programs for the considered CNC systems Siemens, Fanuc and AxiOMA Ctrl.

Implementation of the ring groove milling cycle
To clarify the logic of the developed strategy for the development of control programs using calls to the subprogram of the technological operation and the subprogram of the technological transition and machining cycles, we will consider the circular groove milling cycle, since its implementation was carried out only by Siemens controllers, where the cycle is called by the Slot2 function.
The algorithm of the circular groove milling cycle provides for: moving the tool with a rapid traverse feed G00 from the tool change point XhZh to the safety plane -to the XeZe point, moving the tool with a rapid traverse feed G00 to the start point of the cycle X0Y0Z0, plunging the tool to a depth dZ depending on the selected machining planes and making a longitudinal movement along the horizontal axis of the slot or pocket element, displacement of the tool by the amount dXY, depending on the selected plane and making cutting movements parallel to the contour of the slot or pocket until the specified length and width, taking into account the finishing allowance, plunge the tool along the axis Z and repetition from item 3) and item 4) until the specified depth Z1 is reached, tool movement with rapid traverse feed G00 to the safety plane -to the XeZe plane, tool movement with rapid traverse feed G00 to the tool change point XhZh. A block diagram of the generalized algorithm of the milling cycles is shown in Figure 3.  For the Siemens CNC system, all movements are specified using the movements of the working stroke G1, G2, G3 in the X, Y and Z coordinates, since the system converts the movement along the Y axis into an angle of rotation along the C axis; For the Fanuc CNC, G12.1 polar coordinate interpolation is used for the XY plane, or G7.1 cylindrical interpolation mode for the ZY plane using travel movements G1, G2, G3; for the AxiOMA Ctrl CNC system, the algorithm is calculated in XY coordinates using the movements of the working stroke G1, G2, G3.
A cycle is a sequence of radial circular working movements of the tool to make an annular groove with a given width, angles and depth. The cycle can be performed in the XY or ZY planes. Can be multi-pass for oversize roughing and single-pass for finishing. The geometric and technological parameters of the cycle are shown in Figure 4. The variables responsible for all parameters used in the cycle are presented in Table 5.

Implementation of the interface for entering parameters and generating macrocode
The interface for inputting parameters and outputting the macrocode of the control program demonstrating the operation of the circular groove milling cycle using the developed solution for the development of control programs in a mobile operating system is presented in Figures 5 -7.

Conclusion
The analysis of the mechanisms for the formation of control programs using canned cycles, as well as the geometric and technological parameters of the cycles of different CNC systems, made it possible to create universal cycles of typical technological transitions of machining. Preparatory subprograms of the technological operation and technological transition were developed, as well as subprograms of cycles of technological transitions, which have the same number and value of sets of geometric and technological variables for all considered CNC systems, mechanisms and cyclic algorithms for the operation of subprograms were developed, and a classification system was developed and interaction of programs.
The developed toolkit is applicable for creation, implemented on CNC machines and has been successfully applied for programming canned cycles in Fanuc Mate, Siemens and AxiOMA Ctrl CNC systems.