Development of advanced cycles for control system Sinumerik 840D SL

. Sinumerik 840D includes several predefined cycles that allow the user to effectively create NC programs. In addition to the possibility of using these cycles, Sinumerik also has the possibility of creating new user-defined cycles. The article deals with possibilities of designing new cycles that extend the options available Sinumerik 840D in a simulated environment WinNc. Designed cycles focus on the use of advanced machining options such as jeweling or engine turning and trochoidal milling.


Introduction
Currently exist several options for creating NC programs. They are divided into several groups, manual programming, workshop programing and NC program creation with usage of CAD/CAM systems. They differ mainly in their capabilities or functions they offer. Among the most basic ones it is possible to include the control systems themselves, which enable the creation of NC programs directly writing the ISO code (G-Code) or with usage of predefined cycles [1,2]. An alternative are control systems with workshop programming, which simplifies the creation of NC programs by using cycles (blocks) with complex graphical help. The most complex way of creating NC programs is the CAD/CAM system [3,4]. These systems allow to create NC programs for complex parts that contain complex 3D surfaces. In terms of available cycles and functions, it can be said that the control system with manual programming, contains the smallest number of available cycles and functions and can be used for simple components without complex surfaces, while this system places the greatest demands on the programmer, in addition to knowledge of technology and ISO code [5]. Nevertheless, this method of creating NC programs is used in unit or small series production of parts, as well as in teaching the basics of CNC machine programming [6]. One of the possibilities to increase the efficiency of manual programming seems to be the use of macros to create new user-defined cycles. These macros or cycles should make possible to speed up the creation of NC programs or to implement functions that are not available by default in this type of programming. An example is the use of new cycles for advanced milling strategies such as trochoidal milling.

Motivation
Control system Sinumerik 840D is emulated in WinNC and contains predefined cycles, which are divided into several groups according to technology -turning, milling and drilling. In the case of turning, cycles are available for turning grooves, threads and contours. In the case of milling, cycles are available for milling face, pockets, grooves, spigots and contours. Due to the absence of further cycles, it is necessary to create contours for some shapes and look for ways to machine them. One of the possibilities to increase the efficiency of manual programming seems to be the use of macros to create new userdefined cycles. These macros or cycles should make possible to speed up the creation of NC programs or to implement functions that are not available by default in this type of programming. An example is the use of new cycles for advanced milling strategies such as pseudotrochoidal milling. New cycles can be also created for machining sphere and ring selections, machining custom text with adjustable parameters, and a cycle for creating a pattern on the part surface. A face alignment cycle can be created for the turning, becouse this option is missing in the Sinumerik 840D.

Pre-programed cycles and macros
Cycles are used to speed up and facilitate repetitive activities. A standard cycle is defined as a subroutine with its own name and parameter list. The pre-programmed cycles in the Sinumerik 840D also include a graphical interface. The graphical interface provides the programmer with sufficient information about the order and properties of the parameters that need to be added for the functionality of the cycle. Subroutines work with user-defined parameters, based on which they perform the required steps. On Figure 1. can be seen example of pre-programed cycle for contour roughing.

Macros
Macros can be divided into two parts front end (seen by the user -programmer when creating an NC program as a cycle, eg Fig. 1) and back end (computational part).In the Sinumerik 8040D, back end of macro consist of the following parts:  definition of parameters,  calculation part,  toolpath programming. Three types of variables are used in the created cycle, user-defined variables, arithmetic variables and system variables. New variables can be created by the user or they are readied from the machine's memory or from the control system. At the beginning of macro, it is necessary to define a type for all variables that are used in a given cycle. There are two options to define them. User-defined variables are defined in parentheses after the user cycle name. They are entered in any order specified by the programmer and are separated by a comma. The variables that the system detects itself are defined separately in groups according to the types of variables they represent. Table 1 lists the types of system variables that can be used to design a macro. Table 2 lists the mathematical operators and their priority. In Figure 2 can be seen part of the macro for the custom text milling cycle, where various types of variables are defined by user (Figure 2 A) and variables loaded form control system (Figure 2 B). The calculation part is used to perform calculations necessary for the operation of macros.In the Figure 3 can be seen a part of the calculations used for pseudotrochoidal milling of pocket. Macro calculates the number of transitions in the X and Y axis, then the number of cuts in the Z axis is calculated.

CYCLETEXT
Cycle formilling custom text has been named "CYCLETEXT" and allows the user to mill custom text on the maximum length of 100 characters (letters and numbers).The cycle may be used for identification of the individual products, the individual user.
The cycle allows to define the height and depth of the letter, as well as its rotation and the definition of the starting point in the X, Y and Z axes ( Figure 4).The parameters, their unit and explanation can be seen in the Table 3.  Milling character is realized by a single stroke, where the end of the cycle, the tool reaches the bottom right corner character.Digits and alphabets have been standardized by the technical font created at the height of 10 mm, which is then inserted through ratio to the desired size.For better efficiency was united creating characters, their origin is in the lower left corner of the letters and ends in the lower right corner of the letters, which ensures easy transition between characters. The application of the cycle and the result of the machining simulation can be seen in Figure 5.

CYCLEVZOR1 (jewelling)
Cycle "CYCLEVZOR1" and was created to sample a part of the surface on a part. There are two pattern options to choose from, with a larger and smaller spacing of the tool engagement arrangement, creating different types of surface patterns. The pattern type determines the spacing distance between tool centers. It is also possible to set the creation of a pattern along the X or Y axis, which creates another possibility of user setting of the cycle.The parametes, their unit and explanation can be seen in the table 4. Fig. 6. Jewelling (internet). The _VARI variable is a user-defined variable that consists of two digits. The first digit indicates the direction in which the pattern will be created. It can take two values. There are two options. Zero, which means more line spacing and a unit that means smaller line spacing. With a larger line spacing, in each even line, the tool is shifted in the machining direction by the feed rate in the either X or Y axis, depending on the setting of the second digit of the _VARI variable. The second digit specifies the axis in which the primary movement will take place. For zero, the primary motion is performed along the X axis. For the number one, the primary motion is performed along the Y axis. Príkladynastavenia_VARI a dosiahnutévysledky can be seen in Figure 7.

_VARI 00 _VARI 01 _VARI 11
Pseudotrochoidal milling of the pockets The Sinumerik 840D system already includes cycles for machining either circular or rectangular recesses, but these cycles can be extended with the possibility of a pseudotrochoidmilling. Therefore, two cycles were created to machine the circular and rectangular pocketwithpseudotrochoid milling.The advantages of trochoidal milling are reduced cutting forces, reduced heat generation, higher machining accuracy and longer tool life. The reduction of cutting forces together with the reduction of heat generation also result in a reduction of the spindle load. A cycle called "CYCLEKRUHALT" was created for the circular pocket, which is used to machine the recess in a pseudotrochoid manner. The parameters, their unit and explanation can be seen in the table 5. A cycle called "CYCLEOBDALT" was created for pseudotrochoidal milling of rectangular pockets. The variables, unit and explanation can be seen in the table 7. Three variations of the tool approach into the material have been developed. The first variation is straight line, the second variation is semicircle, and the last, third, variation is spiral.  The application of the cycles and the results of the machining simulation can be seen in Figure 8 and 9.

CYCLESPHERE and CYCLERING
Machining cycle called "CYCLESPHERE" was developed for machining of the sphereshaped pocket. The parameters, their unit and meaning can be seen in the table 7.The cycle contain two variations of the cycle. The first option is roughing and the second option is finishing. For the roughing option, the system first calculates the number of transitions. Then the center area is milled to half the depth of the sphere and then continues with milling of the sides walls. With the finishing variation, the cycle only mill the sides of the walls, removing only the addition of material to the profile. The cycle variation options are set under the _VARI variable, which is defined by the cycle user. For roughing, _VARI is equal to zero, and for finnishing, this variable is equal to one.The application of the cycle and the result of the machining simulation can be seen in Figure 10.  The cycle for machining "CYCLERING" was developed for machining of the ring pocket. Variables, units and explanation can be seen in the table 8. The cycle contains two machining options, where the first option is for roughing and the second option is for finishing. The cycle variation options are determined by the user using the _VARI variable. As in previous cycles, the number zero in the variable _VARI determines the roughing operation and the number one indicates the finishing operation. The application of the cycle and the result of the machining simulation can be seen in Figure 11.

CYCLEFACE1
The Sinumerik 840D control system does not include a pre-programmed face alignment cycle for turning technology. The CYCLEFACE1 cycle will be proposed for this purpose. Parameters, units and explanation can be seen in the table 9. The cycle is designed to remove material in the positive Z axis.Zero point should be set on face of finished component (Fig. 12). The maximum part diameter, the material thickness in the positive part of the axis (allowance for aligning the part face) Z and the tool engagement depth must be entered in the cycle (Fig.).The cycle can be adjusted to align with only one millimeter instead of the user-defined material thickness.

Conclusion
The aim of the research was to create functional macros for the Sinumerik 840D control system, which are to be used to optimize and increase effectiveness of NC program preparation, for milling and turning. Macros were created for EMCO WinNC software simulating the Sunmerik 840D control system.Based on the proposed cycles, it is possible to formulate the following conclusions: 1. When creating macros, differences were found for some types of variables. This is due to the WinNC software itself, which is designed for training and teaching purposes. Also, some system variables are not available or have other designations, resulting in some limitations in macro creation. 2. WinNC does not allow you to create front ends for user-defined cycles. For this reason, the user must either memorize cycles and their parameters or must have the help available in another form. 3. Macros can also create complex cycles using pseudotrochoidal milling, which will allow you to optimize the machining process and increase tool life.