Optimizing the numerical algorithm in Fast Constant Engagement Offsetting Method for generating 2.5D milling tool paths

In the case of 2.5D rough milling operations, machining efficiency can significantly be increased by providing a uniform tool load. This is underpinned by the fact that uniform load has a positive effect on both tool life and machining time. Unfortunately, conventional contour-parallel tool paths are unable to guarantee uniform tool loads. However, nowadays there are some advanced path generation methods which can offer a constant tool load by controlling the cutter engagement angle. Yet, the spread of these non-equidistant offsetting methods is hindered by their dependence on complex calculations. As a solution to this problem, the Fast Constant Engagement Offsetting Method (FACEOM), developed in the scope of our previous study, is seen to be taking a step towards reducing computational needs. In this paper, suggestions for further improvements of FACEOM are presented. Decreasing the number of path points to be calculated is made possible by implementing adaptive step size and spline interpolation. Through simulation tests, it was also analysed which of the numerical methods utilized for solving boundary value problems can be applied to obtain the shortest calculation time during tool path generation. The practical applicability of the algorithm has been proved by cutting experiments. With respect to research results, this paper also describes how a tool path created by the algorithm can be adapted to controllers of CNC machine tools. Solutions presented in this paper can promote a wider application of a modern path generation method that ensures constant tool loads.


Introduction
Metal cutting technologies still assume great importance in part manufacturing [1]. The associated cutting process is usually divided into several stages: roughing and smoothing steps are typically separated [2]. Approximately, half of the total machining time is spent on rough cutting [3]. For this reason, numerous studies deal with this area: in the industry quality improvement [4] and improved productivity [5] are strategic goals. The characteristics of tool path have a significant impact on machining costs [6]. Generally, even in the case of geometries with free-form surfaces, constant Z-level (2.5D) strategies are used in rough milling [7,8]. There are two basic tool path strategies for conventional 2.5D operations: directionparallel and contour-parallel strategies [9]. However, a common feature of these methods is that they are calculated only on a geometric basis. Therefore, they focus only on the complete removal of the resulting machining allowance [10]. For that reason, their common shortcoming is that technological aspects, such as tool load and chip formation, are not taken into account [11]. As a result, both cutting force and cutting temperature can sharply fluctuate in the case of conventional direction-parallel or contour-parallel strategies [12]. This phenomenon has a detrimental effect on tool life and machining time [13]. In this situation, varying cutting characteristics hinder the correct choice of cutting parameters during process planning [14], hamper the stability of cutting [15], and adversely affect both the machining quality and efficiency [16]. Moreover, during machining of thin walls, where tool deflection is critical [17], and during high speed machining, where pulse-like tool load can even lead to tool breakage, the fluctuation of the cutting force cannot be allowed at all. Uniform tool load is also required when strict requirements are specified for surface quality [18,19] or shape and size accuracy [20].
To characterize the connection between the tool and the workpiece, the most efficient parameter is cutter engagement angle (θ) [21]. Both for flat end mill [22] and ball end mill, cutter engagement is involved in cutting force formulas [23].
Cutting characteristics do not show any extreme fluctuations at trochoidal tool paths; nonetheless, Li et al. have shown that even with this strategy, controlling the cutter engagement can increase machining efficiency [24]. There are also methods for providing a uniform tool load through adjusting the feed rate based on different approaches. The offline feed rate control can be based on path curvature [25] or cutter engagement [26]. In addition, there are methods where an offline pre-optimization is followed by an adaptive control based on continuous cutting force monitoring [27,28]. However, feed rate control alone is only a partial solution, and the following problems still need to be addressed. On the one hand, the machine tool must be capable of performing continuous decelerations/accelerations [29]. On the other hand, occasionally emerging engagement can also lead to vibrations or a thermal shock [30]. Therefore, maximum efficiency can only be achieved through path modification [31]. Taking into account the above considerations, adjusting the cutter engagement is a factor that is capable of ensuring that tool paths can provide efficient machining [32].
In the case of milling along a straight line, stepover (s) is the same as radial immersion (a e = s), i.e., stepover directly determines cutter engagement. On the contrary, when the tool moves along arcs, radial immersion and stepover are different [33]. Alterations to radial immersion also change chip thickness, which is directly related to cutting force [34]. However, when constant cutter engagement is ensured, the constant feed rate also leads to a uniform tool load [35]. In turn, for the calculation of the cutter engagement, pixel-based [36] and polygon-based numerical solutions [37] can be used.
During tool path planning, several possible solutions that consider the effects of the cutter engagement can be used. For example, the conventional contour-parallel tool paths can be improved by adding trochoidal sections in critical zones [38,39]. However, the engagement can more extensively and allinclusively be controlled, if non-equidistant offsetting is used. The first of these methods was presented by Stori et al. [40]. Later, their method was further developed by Ibaraki et al., who followed similar considerations, but elaborated a more generally applicable method [41]. Uddin et al. showed that this method also improves the accuracy of the machined contour [42]. Since these geometry-based solutions work only in the case of simple geometries, different pixel-based solutions have also appeared [43]. Such pixel-based solutions can offer general usability, but as a disadvantage they require more computations than geometric solutions. Given this scenario, the FACEOM algorithm has been developed to combine the advantages of the two approaches: FACEOM is characterized by fast operation and general usability, including applicability in the case of complex geometries and the handling of transition sections [44]. In this paper, some suggestions are presented for further improving the computational efficiency of the FACEOM algorithm through the reduction of the number of tool path points to be determined.
Although the method presented does not have a direct impact on production efficiency, since there are cycles in CAM systems where engagement control is already implemented, the calculation time is still a critical factor. Increasing computational speed is essential for the spread of these modern solutions. Without this, it would also be challenging to apply optimization procedures that require path re-generating several times with different settings. Taking this into account, the method can indirectly help to increase production efficiency. Furthermore, it is also worth mentioning that although this paper focuses on 2.5D milling, the methods employed can be extended to five-axis machining, where the control of cutting force through cutter engagement is also an essential area of research [45,46].

The basis of the FACEOM algorithm
The expectations associated with and the task of generating a 2.5D tool path providing a constant cutter engagement can be defined as follows. The tool radius r tool , the cutter engagement angle to be applied θ, and a planar curve c t ð Þ indicating the boundary of the workpiece material are given. Based on these, tool path p t ð Þ, which is a planar curve and along which the resulting cutter engagement is equal to θ, is to be determined.
In the case of contour curves with a constant curvature, including shapes composed of straight lines and circular arcs, this task is trivial. However, in the case of a contour with a variable curvature, the situation is quite different. In general, the following differential equation describes the tool path which provides a constant cutter engagement: is the rotation matrix. An analytical solution to this differential equation is not feasible. However, by using the FACEOM algorithm, the appropriate direction of stepping forward can be determined at any given point with the help of geometric calculations. The method applied in this case is similar to numerical solutions of boundary value problems, so the desired tool path can be created step by step. The referent procedure is shown in Fig. 1.
This method is based on the following scenario: the angle between vector P i C i , which points from the tool centre point to the tool edge exit point (or enter point in case of up-milling), and the tangent vector v i in point P i is equal to α = 90°− θ. Therefore, it suffices to define the intersection point of a halfline and a circle at each step. In order to do this, the tool should be considered as a circular plate with a radius r tool . In fact, the edges of the tool do not move along a circular path, but they move along a cycloid path. Still, the deviation caused by the circular approximation is not significant at normal feed rates [47]. For that reason, this simplification can also be used in tool path generation.
If points P 0 and C 0 are known at the initial position, the Fast Constant Engagement Offsetting Method (abbreviated as FACEOM) can be used to determine the next tool path point. The procedure is as follows: Further details of the method is found in reference [44].

Opportunities of further development
In what follows, three solutions will be presented for improving the computational efficiency of the basic method outlined in Sect. 2. The first one is to optimize the step size of the numerical method. The second one is related to increasing the degree of polynomial spline fitted to the calculated points. The third one considers the suitability of various methods developed for the numerical solution of boundary value problems.

The application of adaptive step size
Tool path generation algorithms must satisfy two basic criteria: (1) the calculation has to work appropriately also on a highly curved section, (2) and meeting accuracy requirements is also essential. To fulfil these criteria, a small enough Fig. 1 Determination of the appropriate direction of stepping forward step size (Δt) has to be used. However, if equal steps are used, an unnecessarily dense resolution can result in not so curved sections. Therefore, it is expedient to use adaptive (i.e. varying) step size. If step size is adapted to the curvature of the path, computing speed and accuracy improve. For the application of adaptive step size, a quick-to-check criterion has been defined. This criterion concerns that the angle between two adjacent segments of the calculated polyline cannot exceed a specified value. This ensures that the points will be denser on segments with a higher curvature, and sparser on segments with a lower curvature. This is illustrated in Fig. 2. In the figure, the black curve represents the reference curve, which was obtained by approximating two different methods but using the same number of base points. Shown in the same figure, the blue polyline exhibits equidistant resolution, whereas the red polyline exhibits adaptive resolution. As it can be seen, the chord error is much lower in the case of the red polyline, i.e. when adaptive resolution is used.
To implement the approach described above, the following procedure was used to supplement the algorithm. Instead of simply specifying the value of step size (Δt), three parameters are defined as input data. Δφ crit represents the maximal angular deviation permissible to be formed between the tangents of adjacent path segments. Besides that, it is also necessary to establish a minimum step size (Δt min ) and a maximum step size (Δt max ), between which the current step size can fluctuate. At the initialization, the maximum value for the initial step (Δt = Δt max ) is selected. Then, after calculating each new vector (v iþ1 ), the angle (Δφ i + 1 ) between the new (v iþ1 ) and the previous vectors (v i ) is examined. If this value is greater than the allowable deviation Δφ crit , then increment Δt is proportionally reduced to the magnitude of deviation (λ), and then the status i + 1 is calculated again. It may also happen that the criterion cannot be satisfied even with a step size close to zero. In this case, the algorithm enters an infinite loop. To avoid this, a comparison with the minimum step value is made. It is advisable to set this value low, because this parameter will be needed and used only if it is not possible to generate the path. This can occur in two cases: (1) the shape of the contour does not allow for a constant cutter engagement, (2) the initial conditions are not properly selected. In such cases, the algorithm stops. However, in normal operating conditions, after a few iteration steps the step size will take the appropriate value.
Furthermore, the algorithm should also include the determination of the next step size. After step i is accepted, based on the angle enclosed by the adjacent sections of the path, step size can be determined with the help of the following equation: Thus, the value of step size Δt will follow the magnitude of the path curvature. However, it is important that step size should not exceed the maximum value, because in that scenario the numerical calculation may become unstable if the distance between the calculated point and the contour is greater than the tool radius.
By implementing these additions, the number of path segments can significantly be reduced and the accuracy of the result can also be controlled. Furthermore, the suitability and the applicability of the solution were tested experimentally, and the referent results are presented in Sect. 4 below.

Tool path smoothing using a spline curve
The FACEOM algorithm generates a sequence of points {P j } j = 0, …, i by way of applying a step-by-step calculation. These points refer to the base points of the tool path. If these points are linked with the help of linear interpolation (i.e. by straight lines), the tool path will be a simple polyline. In this case, the path will only have G 0 continuity. However, it is also possible to describe the tool path by fitting a higher order polynomial spline to the point sequence. When a cubic spline is used, the path will have C 2 continuity. Since the exact solution is a continuous function, the value of the resulting engagement will fluctuate to a lesser extent along the tool path on condition the tool path is also described by applying a continuous function. As a result, fewer points will have to be calculated, and this will be enough to achieve the same level of accuracy as the one obtained by using a simple polyline. Although the advanced CNC controllers are capable of automatically performing spline fitting, it is necessary to know at what density the control points should be determined. Therefore, this topic also needs to be addressed during tool path generation. This is illustrated in Fig. 3. For the purpose of the investigations, on the reference curve marked black, four base points were selected. Then, a first-degree spline (marked in blue) and a third-degree spline (marked in red) were fitted to these base points. While the polyline is a very rough approximation, the cubic spline almost perfectly matches the original curve. Although spline fitting requires more extensive computation, Fig. 2 Application of adaptive step size Fig. 3 Applying a cubic spline for linking the calculated points this extra time is still less than the one that can be gained by calculating fewer base points. In order to justify the benefits of spline fitting, experiments were also performed. The results are presented in Sect. 4 below.

Implementing different methods to determine the direction of stepping forward
The determination of the tool path tangent vector from a given point according to FACEOM is detailed in Sect. 2. However, in the scope of step 3 of the FACEOM algorithm, not only can the next step be taken in the direction of the tangent vector, but also, alternatively, it is to be considered how the curvature changes in the environment of a given point of the contour curve. This means that the next point can be defined with the help of several strategies. Such strategies, i.e. numerical solutions, are known and used in the field of boundary value problems. In the scope of this study, seven different methods were tested, including explicit and implicit, first-order (explicit Euler, implicit Euler, semi-implicit Euler), second-order (midpoint, trapezoidal), and higher-order methods (Adam-Bashforth, Runge-Kutta). In the following, symbol v will refer to a unit-length vector approximating the tangent vector.

Explicit Euler method
The explicit Euler-also known as the forward Eulermethod is the simplest approach. This solution is the same as the basic version of FACEOM (detailed in Sect. 2). Calculating the next tool path point can be defined as follows: 1. Determine the intersection point of the half-line from point P i along vector v i and of the circle with a centre point C i + 1 and a radius r tool , and thereby obtain P i + 1 In the scope of this method, each step is obtained directly by taking a point along the tangent vector on the basis of the last tool path point. This means that it is necessary to calculate intersection points only once in the case of each step.

Implicit Euler method
The implicit Euler method is also a first-order method. However, in that case the steps are not taken along the tangent of the current point but along the tangent of the next point. Therefore, a fixedpoint iteration has to be performed in each step: ð Þ and of the circle with a centre point C i + 1 and a radius r tool , and thereby obtain P i + 1 (1) 5. Determine the limit of the above iteration: lim Determine the intersection point of the half-line from point P i along vector v i * and of the circle with a centre point C i + 1 and a radius r tool , and thereby obtain P i + 1 In the scope of the study, fixed-point iteration was performed only for two steps: (P i + 1 = P i + 1 (2) ). This did not cause a significant error because the algorithm showed fast convergence. The early termination of fixed-point iteration is also justified by the fact that calculating the tangent vector with an extreme precision significantly increases computational time. With a view to this, intersection points are calculated three times in each step.

Semi-implicit Euler method
The semi-implicit Euler method is a simplified version of the previous method. In the scope of this method, no fixed-point iteration is performed, but the vector obtained in the first approximation is adopted (P i + 1 = P i + 1 (1) ). Thus, intersection points must be calculated only twice in each step.

Midpoint method
The midpoint method is an advanced version of the explicit Euler method, but this algorithm already belongs to the group of second-order methods. Compared with the explicit Euler method, the midpoint method needs twice as many operations, but in return it provides second-order convergence. Taking a step can be defined as follows: 1. Substitute parameter t i + Δt/2 in the function c t ð Þ, and thereby obtain point C i + 1/2 2. Determine the intersection point of the half-line from point P i along vector v i and of the circle with a centre point C i + 1/2 and a radius r tool , and thereby obtain P i + 1/2 3. Determine tangent vector v iþ1=2 for point P i + 1/2 4. Determine the intersection point of the half-line from point P i along vector v iþ1=2 and of the circle with a centre point C i + 1 and a radius r tool , and thereby obtain P i + 1 Given this, it is necessary to calculate intersection points twice in each step, but the resulting step is closer to the exact solution than in the case of the explicit Euler method.

Trapezoidal rule method
This algorithm also belongs to second-order methods. It is a combination of the explicit Euler and the semi-implicit Euler method. Taking a step can be defined as follows: and of the circle with a centre point C i + 1 and a radius r tool , thereby obtain P i + 1 In this scenario, it is necessary to calculate intersection points twice in each step.

Runge-Kutta method
The Runge-Kutta method is a general procedure. During the experiments, the classical second-order Runge-Kutta method was used. The process is as follows: and of the circle with a centre point C i + 1 and a radius r tool , thereby obtain P i + 1 Given this, it is necessary to calculate intersection points four times in each step. However, this method allows for making the most precise tracking as far as the path tangent's changes in the environment of point P i are concerned.

Adam-Bashforth method
The most common representative of linear multistep methods is the Adams-Bashforth method. In the experiments, a twostep version of the method was tested. Taking a step can be defined as follows: 1. Mark the tangent vector for point P i with v i 2. Determine the intersection point of the half-line from point P i along vector v i * ¼ 3=2 v i −1=2 v i−1 and of the circle with a centre point C i + 1 and a radius r tool , and thereby obtain P i + 1 In that case, the tangent vector of the previous point is used in each step. The first step can be made using the explicit Euler method.

Simulation analysis for the comparison of computational efficiency
All seven methods detailed in Sect. 3.3 were coded in Wolfram Mathematica. Each algorithm was tested with constant and adaptive step sizes, as well as with linear and cubic spline fittings. This meant a total of 28 combinations. During the simulation tests, different geometries as well as diverse cutter engagement values and accuracy limits were set.
For the comparison of the different methods, the time required to achieve a given accuracy constituted the basis. For the analysis, the numerical equation solving algorithms of Wolfram Mathematica version 11 was used; this scenario also made it possible to measure the CPU time required for the referent calculations (CPU type: Intel Core i3-3220 3.30 GHz). To check the cutter engagement, a selfdeveloped discrete model-based simulator [11] was used. The parameters for adaptive step size were set by way of using an iterative search to obtain appropriate accuracy.

Geometries used for analysis
Three sample geometries were used during the analysis. The first two geometries were right-angled convex or concave corners, where the corners were rounded with a radius r tool . In the case of the convex corner, the algorithm works well even with a zero-corner radius. However, in the case of the concave corner, a geometry at which the tool can reach the allowance had to be formed; otherwise, the criterion of constant engagement could not have been met. The third geometry was a twoperiod length sine wave-shaped contour. This geometry aptly represents the geometrical circumstances that can occur at path generation. This is because this curve contains convex sections, concave sections, and almost fully straight sections where the curvature is zero. This means that the most comprehensive picture of the efficiency of algorithms can be obtained when this geometry is used. These sample geometries were chosen because they made it possible to analyse the computational efficiency separately at different contour types. If a complex contour is to be machined, the computational efficiency depends on the proportion of contour types. In other words, the results of the experiments can be generalized to arbitrary geometry. Figure 4 shows the tool paths which provide a cutter engagement of 60°. It is noticeable that along convex sections the tool removes less material, and along concave sections the tool removes more material if a constant engagement tool path (marked in blue) is used instead of a contour-parallel tool path (marked in green). This manner of controlling the radial immersion of the tool is essential for providing a constant tool load, which is key to achieving higher machining efficiency.

The development of cutter engagement at different numerical methods
At first, a brief overview of the methods will be presented from the point of view of accuracy. Figure 5 presents how the cutter engagement has changed along the tool path for the sine wave-shaped contour shown in Fig. 4. The desired engagement was 60°± 1°for all the 28 variations. At this accuracy limit, the tool path shapes are almost the same, but there are differences in the evolution of engagement angle. In the diagrams, vertical grey lines indicate different parts of the contour. The first and third parts are the convex half-periods, the second and fourth parts are the concave half-periods.
It can be noticed that some methods required much more time for tool path generation. The experiments have shown that multiple calculations in the case of the implicit methods and in the case of the Adam-Bashforth method did not help to reduce the number of points to be calculated. It can also be stated that both cubic spline fitting and adaptive step size significantly reduced the number of base points and the time required for path generation. The greatest improvement was detected in the case of the Runge-Kutta method, where both indicators showed a tenfold improvement over the basic version introduced in Sect. 2. With reference to the other methods, the results became at least twice or three times more favourable using the newly developed algorithm.
In Fig. 5. it can be observed that in the case of first-order methods, error development is asymmetric. In case of the implicit and semi-implicit Euler methods, deviation is positive along the convex parts, and negative along the concave parts, while the explicit Euler method shows opposite development. It can be considered more advantageous if deviation fluctuates symmetrically around the nominal value, since in this case it is easier to keep the symmetric accuracy limit. As a result, higher-order methods, such as the midpoint, trapezoidal rule, and Runge-Kutta methods, can meet the accuracy criteria by exhibiting significantly fewer base points. The scenario and the obtained results were similar in the case of all other geometries and parameter settings; therefore, in the following only higher-order methods and-as a reference-the explicit Euler method will be detailed. In addition, the results presented below all refer to tool paths generated by using cubic spline fitting and adaptive step size. Figure 6 shows a comparative analysis, where the abovedescribed path generation algorithms were applied for three different sample geometries. The cutter engagement was uniformly 60°± 1°. In the case of simpler geometries, where the contour contained long straight sections, the explicit Euler method proved to be quite efficient. This is explained by the fact that in the case of straight Fig. 4 The geometries used for analysis lines the intelligent consideration of tangent vector change yields no benefits, but-concurrently-taking a step requires more extensive calculation. However, the midpoint method proved to be as effective as the explicit Euler method. Furthermore, in the case of more complicated contour geometries, higher-order methods clearly yielded better results. The least amount of computation time was required by the Runge-Kutta method, which was followed by the midpoint method with almost the same value.

Computational times at different geometries
For further experiments, the sine wave-shaped geometry was used, since the real circumstances of application are best represented by this geometry.

Computational times at different cutter engagements
Comparative analyses were also performed in the case of different contact angles (30°± 1°, 60°± 1°, 90°± 1°). In all three cases, the midpoint and Runge-Kutta methods offered the Fig. 5 Cutter engagement along the sine wave-shaped contour shortest calculation times (see Fig. 7). It can be observed that if the nominal value of cutter engagement increases, the computational efficiency of advanced algorithms becomes even more advantageous.

Computational times at different accuracy limits
The effect of accuracy limit is even more interesting compared with the nominal value of cutter engagement. Experiments were performed with the following parameter settings: 60°± 0.2°, 60°± 1°, and 60°± 5°(see Fig. 8).
In the case of the strictest accuracy limit, the efficiency of the explicit Euler method is far behind the other three methods. In the case of this setting, the midpoint method and the Runge-Kutta method proved to be the most advantageous. However, in the case of the lowest accuracy limit, the Runge-Kutta method required the most extensive computational time. The reason for this is that, for most of the steps, the maximum step size also provided an accuracy of ± 5°, so the advantage of higher-order methods requiring fewer points for calculation was this way lost. For example, when using the Runga-Kutta method, the same time was required to meet accuracy limits of 1°and 5°, because it was no longer possible to increase the maximum step size and concurrently maintain numerical stability. As opposed to this, the midpoint method gave good results in the case of all three accuracy limits.

Results of the simulation analysis
From the comparative analysis presented above, it can be concluded that the midpoint method is the most advantageous for the calculation of tool path points. This method works efficiently whether with simple or complex geometry, with strict or loose accuracy limits, and likewise the extent of cutter engagement is of no interest, either. The Runge-Kutta method produced a shorter computational time under certain circumstances; nevertheless, in cases when it proved to be a slower method following its comparison with other methods, its disadvantages were rather significant. This is due to the fact that the midpoint method requires only two intersection point calculations per step, while the Runge-Kutta method requires four. The trapezoidal method was slower in the case of every comparison, and the explicit Euler method proved to be competitive only in the case of very simple geometries or very loose precision requirements. Because of these drawbacks, in the following it will only be focused on the midpoint method.
The experiments provided valuable insights into choosing the proper input parameters. For a maximum step size, 25-  50% of the tool diameter is recommended. In the vast majority of cases, the algorithm can operate at a greater increment, too. However, in that case multiple recalculations are required before making sharp changes in direction which undermines computational efficiency, and the numerical stability may also be compromised.
FACEOM's primary field of application is the planning of rough milling tool paths. This determines the accuracy limit to be set. It is not reasonable to use unreasonably strict constraints on the value of cutter engagement, since this no longer has any technological advantage above a certain level, but the strict constraints do increase calculation time. Similarly, it is not worth setting to low accuracy limits either, because the advantages of machining with a constant cutter engagement will be lost. The experiments also showed that an accuracy of ± 1°is sufficient for ensuring a uniform tool load during machining. In the scope of the experiments, uniform tool load was achieved by adjusting the settings through iterative trials and by calculating the cutter engagement through simulation. However, adaptive step size established on the basis of the maximum angles enclosed by the adjacent tangent vectors allows for the control of accuracy without any simulation analysis. For any given geometry, a linear relationship was found to exist between the maximal angular deviation and the error of cutter engagement. Based on the experiments, it has been concluded that, as a rule, it is expedient for the allowable angular deviation Δφ crit to be smaller or equal to the permissible error. For example, following the iterative setting of the algorithm for the purpose of providing a cutter engagement of 60°± 1°, the value of Δφ crit was~1.5°in the case of the concave corner, and~2.4°in the case of the convex corner. Furthermore, with respect to the sine waveshaped geometry, the C 2 continuity of the contour allowed for even greater angular deviation, because~6.8°was already sufficient to meet the referent requirement.
After the incorporation of the improvements presented in Sect. 3, the path generation algorithm operates according to the flow chart shown in Fig. 9.
At this point, it must also be mentioned how the algorithm behaves at exceptional workpiece profiles. During equidistant offsetting, removing of gaps and invalid loops is considered as a critical point. When using FACEOM, gaps cannot develop since the path is defined as a set of matching sections. However, the occurrence of loops has also to be considered. Similar to conventional offsetting, invalid loops can be classified into two groups: global and local loops. Global loops can develop when the contour contains such bottlenecks where the tool cannot traverse without touching a later section of the contour. This must also be taken into account when applying FACEOM, and the critical parts must be handled separately. For equidistant offset curves, a local loop occurs if the radius of curvature along the contour (ρ) is less than the offset distance which is equal to s − r tool in case of convex arcs, and rtool − s in case of concave arcs. When using FACEOM, these conditions are similar, but cannot be established so explicitly, whereas the earlier part of the contour also affects how the path develops around a given point. The presence of local loops does not stop the path generation process, but the evolution of cutter engagement should be checked and, if necessary, a local path modification may be required.

Practical application
In order to verify simulation results, cutting experiments were carried out. During these experiments cutting force was measured with a piezoelectric dynamometer.

Experimental conditions
With respect to cutting, the calculation of the tool path is irrelevant; given this, only the midpoint method was tested, which proved to be the most effective in terms of computational time. Experiments were performed for each of the geometries shown in Fig. 4, but since the experiments yielded the same results, the referent results are only reported for the  Table 1.

Linearization of tool path
During tool path generation, adaptive step size and cubic spline curve fitting were used. If the controller of the CNC machine tool to be used is capable of processing a splinedefined tool path, it is worthwhile to utilize this option, because this may shorten the path tacking time [48]. In many cases, however, controllers are not able to directly process tool paths created in a spline form. Below, with reference to this scenario, the issue of how to adapt the machining program to the controller is addressed.
In CAM systems, it is a general solution to approximate the paths using short straight or circular arc segments. In addition to this, there are also different methods [49] to optimize the approximation of spline curves. However, since a roughing process was investigated in the scope of the experiments, using only straight lines for the substitution of the spline has been deemed adequate. Thus, the machining program contained only G1 interpolation.
When a continuous tool path is discretized by short straight elements, choosing the right length of segments is extremely important [50]. The longer the segment is, the greater the chord error between the original and the approximating curve gets. However, if too short segments are used, the computational speed of the controller may be not adequate: if the execution of one sentence in the NC program takes more time than the completion of the motion with the programmed feed, the program run may become discontinuous. During the experiments, a segment length of l = 0.02 mm and a programmed feed rate of v f = 159 mm/min were used. In that setup, a duration of 7.5 ms was allotted for the execution of an NC sentence, which was approximately twice the critical value of the controller. Before performing the cutting experiments, the effect of discretization on the theoretical value of cutter engagement was also examined. In the scope of the approximation, from a C 2 continuous curve a polyline exhibiting only G 0 continuity is generated. The resulting deviation of the engagement is shown in Fig. 10. It can be seen that the original and the approximated paths produced almost the same results.
When the NC code of continuous cutting mode is on (G64), the tool moves along a path where the corners of the polyline are rounded. In addition, the path tracking error can also increase the fluctuation of cutter engagement. However, the effects of the above are negligible compared with the other factors interfering with the cutting process. Thus, it can be stated that the tool path linearization does not significantly change cutter engagement.

Results of the experiment
During the cutting experiments, the force acting on the workpiece was measured with a piezoelectric dynamometer. In the scope of the evaluation of the results of the experiment, the projection of the cutting force on the machining plane was calculated first, and then the development of maximum forces at each tool revolution was examined. For processing the data, Gaussian filter was used. The results are shown in Fig. 11.
Before machining the wave-shaped contour, a reference measurement was performed, where a straight line-shaped contour was machined with a 25% stepover, which provides a cutter engagement of 60°. In the scope of this measurement, all the other cutting parameters were the same. The result is shown in Fig. 11a. As for the results, cutting force changed from 96 to 113 N, and the resulting fluctuation of ± 8% is a combined effect of the dynamic characteristic of the milling process and external distractions. Given this, a smaller fluctuation than the above cannot be expected from the elaborated algorithm in the case of the wave-shaped contour, either.
As another reference measurement, a measurement where the wave-shaped contour was machined with a 25% constant stepover was also performed. Figure 11 b shows that the cutting force was significantly reduced at convex curves, while it was significantly increased at concave curves. Due to intense changes in cutter engagement angle (50°≤ θ ≤ 74°), the force fluctuation rate for this tool path was ± 34%.
The remaining diagrams in Fig. 11 show the results obtained with tool paths created with the FACEOM algorithm. It can be observed that the results were nearly the same for Δθ = ± 1°and for even stricter accuracy criteria than that. In these cases, force fluctuation was around ± 11%. In addition, a larger inaccuracy limit was applied also in the case of force measurement. In the case of Δθ = ± 2°, force fluctuation was ± 13%; in case of Δθ = ± 5°, it was ± 15%; and in case of Δθ = ± 10°, it was ± 30%, the last scenario was barely more favourable than the constant stepover strategy. In summary, it can be concluded that the cutting experiments have proved the proper operation of the algorithm. In addition, they have also proved the assumption that too strict tolerances should not be set. Moreover, as suggested in Sect. 4.6, the value of Δφ crit should be set so that the value of Δθ will be about 1-2°.

Conclusions
The FACEOM algorithm can easily and speedily generate tool paths which can provide uniform tool loads for 2.5D contour milling operations. The method behind FACEOM is based on the following principle: this newly elaborated geometric method avoids complicated intersection point calculations during path generation. The algorithm used for FACEOM determines the path from point to point in line with the desired accuracy requirements in question. Further developments of FACEOM presented in this paper are suitable for reducing the number of points to be calculated.
Seven different numerical methods were tested for tool path generation including both explicit and implicit, firstorder (the explicit Euler, the implicit Euler, the semiimplicit Euler), second-order (the midpoint and the trapezoidal), and higher-order (the Adam-Bashforth and the Runge-Kutta) methods. With the help of generating tool paths for three sample geometries with different cutter engagement values and accuracy limits, the algorithms were investigated as to their effectiveness in terms of computational time. The suitability of the algorithm was validated by cutting experiments. In addition, the paper also described how the tool path created by the algorithm can be adapted to CNC controllers.
The results can be summarized as follows: & The following led to an increase in computational efficiency: the application of adaptive step size (rather than using a uniform step size), and, during the process of linking the calculated points, the application of a cubic spline (instead of a polyline); & The comparative analysis showed that the midpoint method is preferential to be used, because it works efficiently for simple and complex geometries, for different cutter engagement values, and for strict and loose accuracy limits alike. & The allowable angular deviation between the tangents of adjacent path segments (Δφ crit ) should be smaller or equal than the permissible inaccuracy of cutter engagement angle (Δθ): experiments have shown that this is sufficient to meet the requirements.
& The permissible inaccuracy of cutter engagement angle (Δθ) should be set about 1-2°: experiments have shown that applying a stricter limit would no longer have any practical advantage so that the calculation time would increase aimlessly. & The tool path linearization does not significantly change cutter engagement.
It can be stated that by optimizing the numerical calculations within the FACEOM algorithm, a further reduction of computation time can be attained while retaining the general applicability of the method.
Funding information Open access funding provided by Budapest University of Technology and Economics (BME). The research reported in this paper has been supported by the National Research, Development and Innovation Fund of Hungary (TUDFO/51757/2019-ITM, Thematic Excellence Program). Research work for this paper was partly supported by the European Commission through project H2020 EPIC under grant no. 739592. The results introduced in this paper are applied in project no. ED_18-22018-0006, whose project has been implemented with support provided by the National Research, Development and Innovation Fund of Hungary, and was financed in the scope of (publicly funded) funding schemes according to Section 13(2) of the Hungarian Act on Scientific Research, Development and Innovation.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.