Generating the Code Controlling the CNC Machine Tool for Shaping the Surfaces of Worms with a Circular Concave Profile by a Point Method

. Despite the fact that worm gears have been known for millennia, they are still used and they are constantly improved and developed. The goal is to obtain a gear that is not wearing out under the assumed operating conditions. That is why such an important issue is the ability to make worms with a defined profile as well as with a certain accuracy. This directly affects the durability of the worm gear. Comparing worm gears with concave-convex surfaces with conventional cooperation surfaces worm gears, they are characterized by: more favorable change in the distribution of Hertz pressure, change in the course of the contact line between the cooperating surfaces and an increase in the thickness of the worm wheel tooth at the base. In this way, improved power transmission and lubrication properties can be expected, what consequently results in less energy loss and less wear. The article presents the method of forming helical surfaces with a circular concave axial profile by the point method and the developed code generation program for controlling a universal multi-axis CNC machine tool.


Introduction
The development of modern multi-axis multi-tasking CNC machine tools and their technological capabilities have contributed to the creation of new gears in drive and transport systems. Support from the CAD/CAM software allows you to design machine components of any cross-sections and profiles and make them with simple universal tools using machining cycles, e.g. profiling or lace cutting. Nowadays, in cylindrical worms used in worm gears, except helical straight or cone-shaped surfaces, there are also used concave surfaces with an arched nominal profile of the thread or with an arched nominal profile of the tool for tooth machining [1,2].At the same time, due to technological reasons, the arched nominal profile can be tangential to the main cylinder of the worm in the normal or axial cross-section.Also in the worms used in polymer processing machines, a very important issue is the shape of the profile of the side surfaces of the threads, which affects the quality of mixing and homogenization of plastic components [3,4].
Thanks to the capabilities of computer systems, it is more and more common to design gears with a variable ratio with a toothed belt, the task of which is to obtain variable kinematic and dynamic properties during one cycle [5,6,7,8]. Gears, spline connections and cog belt pulleys are most often made by enveloping methods, where the shape of the cut depends on the profile of the tool, its position and comparative movement, and sometimes the profile of the tool should be variable, as in worms with variable pitch [9] or non-circular toothed pulleys [10]. The contact of the worm wheel teeth in gears with a straight or cone-shaped worm gear is the contact of two convex surfaces. There are then small replacement radiuses of curvatures of the profiles along the contact line, which contributes to the formation of high pressures and difficulties in maintaining an oil film in the space between teeth. In the case of curvilinear profiles, the contact point of the worm teeth occurs as the contact of the convex surface with the concave surface. They then create large replacement radiuses of curvatures, which improves conditions for the formation and maintenance of the oil film between cooperating surfaces as well as good teeth adhesion conditions and promotes the formation of less pressure. According to G. Niemann, a gear with the worm with concave teeth can carry about 25% higher load than the same uncorrected gear with an involute or Archimedes worm [11]. The worms are most often machined using the envelope method with a mill, disc, finger, cup or ring grinding wheel [9,12,13], where the tool profile is strictly defined for shaping a given helical surface and is determined from the envelope condition [9,12,13,14,15,16]. The accuracy of profiles of the lateral surfaces of the worm threads during grinding is affected, among others, by the diameter of the grinding wheel [9,15]. Grinding wheels wear out during grinding and the grinding wheel profile shape correction should occur continuously to maintain the required shape of the worm profile. In modern specialist thread grinders, for the assumed axial cross-section of the worm, the computer calculates and gives the grinding wheel the required shape through a computer-controlled profiling diamond. Despite so many achievements in manufacturing technique, this is a difficult issue and requires specialized equipment. Worms and gears with any axial profile can also be produced using simple geometrically universal cutting tools by Step-by-Step method on universal CNC-controlled machine tools [9,17,18,19,20,21]. With this method, the tool surface and the machined one are not coupled (mutually enveloped), therefore the machining accuracy is determined by the number of tool passes and also the density of the tool movement path during cutting.This machining technology is used, among others, for shaping injection molds, turbine blades, and has also proven itself in the production of non-circular cog belt pulleys [10].

Description of the axial profile of the worm
Below there is described an axial arched concave profile of worm thread with head and foot modification. It is enough to one side of the worm be considered because of its symmetry. The profile will be described in the form of a discrete set of points, each point will be determined by specifying its rectangular coordinates and an angle of contact with the profile of the worm at this point relative to the positive direction of the abscissa axis of the worm coordinate system Figure 1. The profile consists of fragments of arcs of circles separated by points Figure 2. The profile coordinate system was introduced in such a way that the axis 2 is the axis of the worm and is at a distance equal to the pitch radius from it, and the axis 3 coincides with the axis of symmetry of the thread's profile. Based on Figure 2, the axial profile of the worm can be described in the following way: The upper indexes before the brackets (2 or 3) identify the coordinates, for example y and z. Indexes in brackets identify the profile points (start point number and end point number). The indexes n and i specify the number of points located on a given section of the profile. According to this methodology, any profile of the worm's thread can be described.

Determining the coordinates of the tool settings for the determined profile
The axial cross-section of the worm is composed of sections (the outer cylinder of the worm 1-2 and the core 6-7) and in this case three arches (transition surface 2-3, active zone 3-5 and transition surface 5-6). The worm will be machined using a ball-end mill. This type of tool has a ball-end tip shape. Half of the circle will form part of the axial cross-section of the ball-end mill.
The coordinate position of the tool tip, updated for the next calculated point, was used as input information to the algorithm for calculating the position of the tool. In addition to the coordinates of the tool setting, the coordinates of the contact point of the tool with the machined profile of the worm thread must also be calculated. This information will be used to accurately determine the type of used calculation algorithm. The coordinate of the contact point position in the axis will always be greater than the coordinate of the tool tip position. These coordinates will be equal only if the tools work on a flat surface. The difference between these coordinates becomes extremely significant during the transition of the tool from one machining zone to the next one. It may happen that when for the next calculated point the tip of the tool is already in the active zone, while the contact point of the tool with the profile of the thread is still remaining in transition zone 2-3. Correct machining process requires checking this parameter during the control code generation process.  presents the situation of machining the transition surface with a ball-end mill with a fillet radius equal to . The mutual position of the tool and the profile of the transition zone can be considered as two circles tangent to each other externally. The radiuses and 1 lie on one straight line, which creates the angle described in Figure 3 as with the worm axis. The value of this angle is variable as a function of the coordinate of the tool tip position in the 3 axis. Determination of the relationship describing the value of the angle is necessary for the correct calculation of the coordinates of the tool position. To calculate the value of the angle, a searched item is the coordinate of the location of the center of curvature with a radius in the 3 axis, which is marked as . It will be calculated based on the input information to the algorithm, i.e. the current coordinate of the tool tip position in the 3 axis, which will be marked as . Where: .
the coordinate of the point . position in the 3 axis, the current coordinate of the tool tip position in the 3 axis, the fillet radius of the tool. The position of the point 1 in the 3 axis was determined by parameter: Based on this information, the value of the difference in the 3 axis between points and 1 should be determined.
Where: ∆the difference in the 3 axis between points and 1 . Using trigonometric functions it is possible to determine the value of angle for a given coordinate of the tool tip position .
With the available angle , the coordinates of the contact point must be determined. This is necessary because the contact point is common for a circle with radius 1 and , so this information will be used to connect the equations of both circles. The beginning of calculations is related to the subsequent movements of the tool during machining, so the initial value of the coordinate determining the position of the tool before machining will be equal to half of the diameter of the worm tips. Based on the number of tool settings for the transition surface 1 , set by the user, it will be determined the value in the 3 axis by which the tool will depress with each newly calculated point. This value will be referred to as iterative step and marked with the letter t.
Where: the value of the tool depression in the 3 axis along with each newly calculated point, ℎ 1value on the 3 axis of the transition zone 1 , With each calculated point, the current coordinate of the tool tip position will be reduced by the value of t. The coordinates of the position of the contact point will be determined in relation to the previously determined coordinates of the point marked in Figure 3 as 1 , i.e. 1 and 1 . The , angle value and trigonometric functions will be used to find the distance between these points. The coordinates of the position of the contact point will be marked as ( , ).
Where: , -coordinates of the tool contact point with the surface of the worm gear profile. The calculated coordinates above will allow the correlation of the circle equation with the radius, shown in Figure 3, and with the transition surface 1 . This equation for the discussed situation has the form: Where: coordinate in the 2 axis the position of the tool axis, coordinate in the 3 of the center position of the circle with radius that is part of the tool. The coordinate whose value should be determined is . After transforming the above equation with respect to this coordinate, it will be created a quadratic equation. Due to the geometry of the worm gear, a higher value solution will be selected for further calculations. The resulting quadratic equation will take the following form: The discriminant of the quadratic triangle will take the form: The maximum value of the solution will be expressed as:

Determination of correction of the tool position in the plane
Considering the position of the tool in the 1 2 plane, you can notice the undercutting of the tooth profile caused by not taking into account the helix angle in the calculations. Figure 4 shows the cross-section of the tool with a plane perpendicular to the tool axis, whose position corresponds to the coordinate of the point of contact. The tool cross section has the shape of a circle with a radius of . Due to the nature of the tool geometry, it can be stated that from a certain height the diameter of the mill, and consequently its radius, decreases to zero - Figure 3. The value of the working radius can be determined from the formula: Where: value of the actual radius of the tool involved in machining, the fillet radius of the tool.
auxiliary angle. The tool cross-section before movement is in contact with the tooth profile, however, due to the helix angle , undercutting occurs - Figure 4. To avoid undercutting, the tool should be moved in the 1 axis by the value marked in Figure 4 as ∆ or slide the tool axis off the axial plane by the value . To determine the value of ∆ , it will be necessary to determine the parameters , and . The geometrical relationships show that the helix angle is between segment and the 2 axis. On this basis, the relationship regarding distance can be determined: To determine the distance , it is necessary to calculate the distance : The parameter is: Based on the above relationships, you can determine the tool correction value ∆ : Where: ∆ -the value of correction of the tool position in the 1 2 plane. After substitution and simplification of the expression, the final form of the relationship presents as follows: The helix angle is different for different cylinder diameters on which the tooth line is analyzed. For each change of the coordinate of the tool position in the 3 axis, the value of the helix angle on the current machining cylinder should be calculated separately. The calculated value of the machining helix angle will be marked as ℎ . The diameter of the cylinder on which the machining will be carried out will be marked as ℎ . Where: ℎ current diameter of the cylinder on which the machining is carried out.
current coordinate of the position of the tool contact point in the 3 axis The value of the helix angle corresponding to the diameter of the cylinder on which the machining is currently taking place is: Taking into account the value of the angle calculated above, equation (37) determining the tool correction for a specific coordinate of the tool position in the 3 axis will be as follows: The relationship describing the position of the tool in the 2 axis is also changing. After taking into consideration the current value of the helix angle, equation (31) looks like this:

Control of undercutting the profile in the plane
When calculating the points of subsequent tool positions in the machining process, it should be checked whether undercutting of the right side of the cut occurs when machining the left side of the cut and vice versa. This can occur when roughing, not necessarily when machining the bottom of the cut when the mill radius is too large. Mill position points that would guarantee undercutting should be rejected and machining should be completed for the last point where no undercutting occurred.
To control the occurrence of undercutting the thread profile in the 2 3 plane, it is necessary to find the coordinate describing the tool position for machining the opposite side of the worm cut, for each calculated coordinate of the milling cutter in the 2 axis. When the difference between the machining position of the coordinate for the opposite side of the cut and the calculated coordinate is greater than zero, no undercutting will occur. Otherwise, i.e. if the difference between these coordinates is less than or equal to zero, this point and all subsequent ones should be rejected and not taken into account during machining. Relationship for the tool position coordinate corresponding to the machining the opposite side of the cut: Where: When 2 − ≤ 0, the undercutting occurs and this point should be rejected.
The procedure for calculating the mill position for the active zone should be started by determining the distance between next points on the 3 axis. When starting calculations for the next point, it is necessary to update the variable storing the coordinate of the tool position in the 3 axis. The profile of the active zone is a segment of a circle, so the essence of the calculation will include two circles tangent to each other. The circle representing the tool will be tangent internally to the circle representing the profile of the active part of the worm. The coordinate specifying the position of point is not a constant value and changes as the position of the tool changes. It is therefore necessary to calculate the auxiliary angle value for each tool position change.
Based on the auxiliary angle value, the distance between the points of the circle centers in the 2 axis will be determined, marked as ∆ .
Referring the calculated value to the coordinates of the assumed coordinate system and taking into account the correction value (marked as ∆ ) excluding the possibility of undercutting the tooth profile in the 1 2 plane, the relationship describing the position of the tool is as follows: The coordinate determined above should be checked for the appearance of undercutting in the 2 3 plane. This phenomenon may be caused by the selection of a tool with too large a diameter, which makes it impossible to machine a full tooth profile without undesirable undercutting.
The procedure for calculating the position of the tool for the working zone of the worm thread ends when the tool tip reaches the second intermediate point 5 . The calculation procedure for a transition surface of 5-6 2 begins with the calculation of the distance between next tool position points.  In a similar way, there were described the circular convex, rectilinear, involute profiles of the tooth as well as the possibility of entering any profile introduced on the basis of e.g. measurements.
On the basis of the above considerations, there was developed an application for generating a code for machining circular concave worms in an axial cross-section using the ball-end mill with a diameter specified by the user. The program was built using the free programming environment Lazarus IED. The created application has the ability to generate the machining code also for rectilinear, involute and circular convex worms in axial crosssection.
The described coordinates specify the initial positions of the tool tip during finishing machining. After calculating and determining the remaining geometrical parameters of the worm and the appropriate preliminary and finishing machining strategy, the author's application allows you to determine the trajectory of the tool tip movement in the form of helixes that form the helical surface of the worm. The effect of the application activity is a text file containing the generated machine control code that allows you to make the designed detail.

The verification of the presented application
In order to confirm the correctness of the considerations made and the operation of the program, the axial profile worms were cut: circular concave with parameters presented in the program window (Figure 7), rectilinear and involute by a tool with the same parameters and the same machining strategies. The machining was performed with a ball-end mill with a diameter of 3mm at a rotational speed of 16000 rpm by 10 passes per side for transition zones and 50 passes for the active zone. This tool was used in both roughing and finishing machining. The worms are made of polyethylene PA6 material with a 48mm diameter and 50mm long rod on the proprietary worm processing station controlled in 4-axis CNC [22]. An example of a made circular concave worm (Figure 8). To compare the compliance of the axial profile of the cut worms with the given geometrical parameters set in the program, they were measured on a Zeiss CONTURA coordinate measuring machine. An example of the results of measuring a worm with a rectilinear axis profile is shown in Figure 9. The choice of the cross-sectional plane results primarily from the possibility of direct comparison of results with the given profile, calculated in the prepared software. The results of worm profile measurements performed with the same parameters were comparable. The accuracy of the rectilinear profile of the worm was ± 5µm, which follows from theoretical assumptions.

Conclusions
The Step-by-step method used to shape the helical surface with any axial profile of the worm is a universal method. Due to the required number of passes and the required accuracy of location the tool in the starting position, machining should be carried out on a CNC numerically controlled machine tool. The tool profile is independent of the machined profile and these types of mills are general commercial tools. Small-diameter finger mills are also made as solid carbide tools and can be used for machining difficult to machine materials (titanium, nickel alloys), which are increasingly used in the aerospace, medical and energy industries, or for machining thermally improved materials (eliminating grinding). In the case of traditional machining methods, where the mill profile depends on the profile of the helical surface and this helical surface is machined along the entire height of the profile, the machining efficiency is small and the surface roughness is high (hence the helical surfaces are ground in the finishing process). In the adopted machining method, this entire machining process consists of many tool passes, but with much higher parameters, which ensures high productivity of the process and high machining accuracy (the helical surface is shaped by milling). In the case of traditional methods of machining helical surfaces, for example with an axial circular profile, machining of helical surfaces different from cone-derivative (e.g. torus-derivatives) is rare, due to technological difficulties and the cost of making the tool. In the case of the adopted machining method, these limitations do not occur and the form of the machined profile of the machined surface does not matter, which in turn may allow the development of concave-convex worm gears (CC) and the start of research on new gears. In the case of the technology under consideration, machining of such worms is not a problem. At the same time, it gives the opportunity to easily modify the profile of the worm, as well as modify the profile of the wormwheel. The machining of transition profiles also makes it possible to apply in practice different transition curves of the axial worm profiles than previously used in practice.