A Multi-Scale Tool Orientation Generation Method for Freeform Surface Machining with Bull-Nose Tool

Free-form surface parts are widely used in industries, and they consist of intricate 3D surfaces such as molds, impellers, and turbine blades that possess complex geometrical contours and demand high precision. Proper tool orientation is crucial for ensuring the efficiency and accuracy of five-axis computer numerical control (CNC) machining. Multi-scale methods have received much attention and have been widely used in various fields. They have been proven to be instrumental and can obtain fruitful outcomes. Ongoing research on multi-scale tool orientation generation methods, which aim to acquire tool orientations that satisfy both macro- and micro-scale requirements, is significantly important for improving the machining quality of workpiece surfaces. This paper proposes a multi-scale tool orientation generation method that considers both the machining strip width and roughness scales. This method also ensures a smooth tool orientation and avoids interference in the machining process. First, the correlation between the tool orientation and rotational axis is analyzed, and feasible area calculation and tool orientation adjustment methods are introduced. Then, the paper introduces the calculation method for machining strip widths on the macro-scale and the roughness calculation method on the micro-scale. Besides, tool orientation adjustment methods for both scales are proposed. Next, a multi-scale tool orientation generation method is developed to generate tool orientations that meet the macro- and micro-scale requirements. Finally, to verify the effectiveness of the proposed multi-scale tool orientation generation method, it is applied to the machining of a free-form surface. Experimental verification results have shown that the tool orientation generated by the proposed method can obtain the expected machining strip width and roughness, meeting both macro- and micro-scale requirements. Therefore, this method has significant potential for engineering applications.


Introduction
Free-form surface parts are widely used in the industry, and they usually consist of complex three-dimensional surfaces, such as turbine blades, impellers, and molds [1]. These parts have complex geometric shapes and high-precision requirements. Traditional machining methods make it difficult to meet their processing needs. Compared with three-axis computer numerical control (CNC) machine tools, five-axis CNC machine tools add two rotational axes based on the three translational axes so that the cutting tool can contact the part in any direction in the machining process [2]. Meanwhile, five-axis CNC machining has the properties of high efficiency, excellent flexibility, high precision, and good reliability; therefore, it has been widely used in free-form surface processing [3]. To better exploit the characteristics of five-axis machine tools, tool orientation is one of the critical elements in tool path planning.
The bull-nose tool, characterized by its variable diameter, circumvents the issue of zero cutting speed. In recent years, numerous researchers have conducted mechanistic modeling The tool orientation significantly affects the machining strip widths, so many scholars have conducted related research. Frad et al. [31] investigated the influence of tool orientation on the machining strip widths in flat end milling and proposed a method that maximizes the machining strip widths. Wang et al. [32] developed a method for calculating a barrel cutter's global spatial error and established the machining strip width calculation method. Additionally, they built a method that aims to obtain the maximum machining strip widths. Zhu et al. [33] selected the tool orientation for 3 + 2 axis free surface machining to improve machining efficiency by maximizing the average machining strip widths. Considering the interference problem, Fan et al. [34] provided a tool orientation planning method for maximizing the machining width by using the quadratic surface local approximation method. He et al. [35] studied the influence of the tilt angle and lifted value on the machining strip width without changing the yaw angle. According to the original tool path, they adjusted the tool orientation at each CC point to obtain a smooth tool orientation and approximate constant machining strip width. Liu et al. [36] investigated the effective cutting surface of a flat-end cutter under different tool orientations and obtained the machining strip widths at the CC point. Moreover, they proposed a tool path generation method that applies tensor metrics to the machining strip width. Hu et al. [37] developed a tool orientation optimization method that considers both the machining strip width and the machine motion capability to maximize the material removal rate. He et al. [38] provided a method of reducing the fluctuation of the machining strip widths by adjusting the tool orientation, thus making the machining edge gradually converge to the effective machined area.
The roughness significantly affects the workpiece's performance. Therefore, the effect of the tool orientation on the roughness of the workpiece has always been a research focus, and many related studies have been conducted. Duan et al. [39] investigated the relationship between the tool orientation and surface roughness when processing 300 M steel material through experiments and developed a strategy to optimize the tool orientation. Yao et al. [40,41] studied the effect of the tool orientation on surface roughness through experiments taking TC17 titanium alloy as the research object, and they found that the surface roughness of the workpiece was better within the current inclination angle range of 30-60 • . Fard et al. [42] investigated the effect of tool orientation on roughness through experiments in micro-milling. It was found that the tool's inclination angle had a more significant impact on surface roughness. When the inclination angle was 15 • , the surface roughness could be reduced by 35% compared to the absence of an inclination angle. Taking a ball-end tool as the research object, Pesice et al. [43] investigated the effect of the lead angle on roughness. They found that the roughness of the workpiece decreased as the lead angle increased (0-30 • ). Gdula [44] conducted experiments on the five-axis milling of blade parts using a bull-nose tool to study the effect of the tool orientation on surface roughness and morphology. It was discovered that within the range of 7-23 • , the surface roughness gradually decreased as the inclination angle increased. Urbikain et al. [45] established a geometric model for oval-form cutter side milling and studied the effect of tool orientation on roughness and surface morphology. Simulation results indicated that roughness remained unchanged for different tilt angles. Koprowski et al. [46] conducted experimental research on the effect of tool orientation on surface roughness during grinding. It was found that the tilt and lead angles directly affected the structure angle, which further affected the workpiece's surface roughness. Gao et al. [47] explored the effect of the inclination angle on surface roughness in micro ball-end milling. The experimental results demonstrated that when the inclination angle was between 0 and 45 • , the surface roughness decreased as the absolute value of the inclination angle increased. Bouzakis et al. [48] designed a simulation algorithm for ball-end tool machining and studied the effect of the inclination angle on roughness. When the inclination angle was between 0 and 60 • , the roughness decreased first and then increased as the angle increased. Zhang et al. [49] established a simulation model for ball-end tool milling to study the relationship between the inclination angle and roughness. The experimental results indicated that when the inclination angle increased from 0 to 30 • , the roughness decreased first and then increased. Especially, when the inclination angle was 0 • , the roughness was the largest. Runout, a form of inaccuracy in rotating mechanical systems, occurs when the tool deviates from its precise rotational axis during operation. This phenomenon directly impacts the surface roughness of the workpiece. Arizmendi et al. [50] developed a surface topography prediction model for end mill peripheral milling that accounts for the impact of tool vibration during machining. This model facilitates the estimation of topography, roughness values, and form errors. Arizmendi et al. [51] developed a predictive model for surface topography in ball-end milling, taking tool runout into consideration. The model assumes that runout results from a parallel offset between the tool and spindle axes. According to the findings, when the offset is minimal, the cusps, valleys between cusps, and scallops along the feed direction exhibit uniformity in shape. However, as the offset increases, the uniformity of cusps, valleys, and scallops diminishes.
In five-axis tool path planning, achieving interference-free and smooth tool orientations is also a key issue. He et al. [23] analyzed the causes of interference in the machining of convex surfaces with a bull-nose tool and developed an interpolation-based interference elimination method. Based on geometric analysis. Zhao et al. [25] provided a method for identifying interference-free tool orientations to determine the interference-free range. Ma et al. [52] proposed a method for calculating the minimum bounding rectangle of the tool projection section. They determined whether the tool orientation was within the interference-free feasible range by determining whether the points were inside the bounding rectangle. Wang et al. [53] investigated the geometric relationship between the tool and the surface of the blisk in five-axis milling and obtained the interference-free area of the tool in the machining process. Sun et al. [26] converted the tool orientation at the CC point into the rotational axis representation in the machine coordinate system. To reduce the angular velocity and acceleration of the rotational axis, they directly optimize the coordinates of the rotational axis. This improved the kinematic and dynamic performance of the five-axis CNC machine tool in machining and prevented drastic changes in the tool orientation at adjacent CC points. Lu et al. [54] developed a smooth tool path planning method for flat-end tool side milling that considered both geometric deviations and tangential constraints. The optimization algorithm could minimize the angular acceleration of the rotational axis. Fountas et al. [55] proposed a tool path global optimization method that uses intelligent algorithms to minimize machining errors, tool orientation smoothness, and production efficiency. Lu et al. [56] provided a five-axis side milling tool path generation method to smooth the rotational axis for impeller parts. This method improved tool path smoothness by directly optimizing the rotational axis and the tool reference point. Xu et al. [57] directly controlled the rotational angle in the machine coordinate system to achieve smooth changes in the tool orientation, thereby effectively alleviating tool orientation fluctuations. Additionally, based on the minimum deflection cutting force, López et al. [58] introduced a novel approach for selecting toolpaths in complex surface milling that minimizes dimensional errors caused by tool deflection, thereby enhancing the milling surface accuracy. Zha et al. [59] introduced an "evolution" method aimed at enhancing the accuracy of curved surfaces. This approach involves adjusting the part through toolpath compensation while maintaining other process variables constant, taking into account the measured deviation of the workpiece. Consequently, the method yields a product with the fewest number of iterations.
Previous research on the impact of tool orientations on machining strip width and roughness has obtained significant results. However, there has been limited investigation of tool orientation generation methods from a multi-scale perspective, and how to simultaneously satisfy both machining strip width and surface roughness at these scales through tool orientation planning is less studied. In response, this paper proposes a multi-scale tool orientation generation method that considers both machining strip width and roughness scales. The proposed method can also ensure no interference in the machining and guarantee the smoothness of the tool orientation. The rest of this paper is organized below. In Section 2, the relationship between the tool orientation and rotational axis is analyzed, and the feasible area calculation and the tool orientation adjustment method are introduced. In Section 3, machining strip width calculation and tool orientation adjustment on the macroscale are introduced. In Section 4, roughness calculation and tool orientation adjustment on the microscale are introduced. Section 5 proposes a multi-scale tool orientation generation method that satisfies both macro-scale and micro-scale requirements. Meanwhile, it has interference-free and smooth rotational axis characteristics. In Section 6, the multi-scale method was verified experimentally with a free-form surface. Conclusions are presented in Section 7. The proposed method was validated in machining experiments on the free-form surface. The results indicated that it can effectively control the roughness and machining strip widths with no interference and a smooth rotational axis.

Preliminaries
This paper introduces the tool orientation generation method using a 5-axis CNC machine tool with a BC double turntable structure. The machine contains three translational axes (X, Y, and Z) and two rotational axes (B and C), as shown in Figure 1. This section briefly describes two preliminaries, i.e., the relationship between tool orientation and rotational axis, and the calculation of interference-free area. roughness scales. The proposed method can also ensure no interference in the machi and guarantee the smoothness of the tool orientation.
The rest of this paper is organized below. In Section 2, the relationship between tool orientation and rotational axis is analyzed, and the feasible area calculation and tool orientation adjustment method are introduced. In Section 3, machining strip w calculation and tool orientation adjustment on the macroscale are introduced. In Sec 4, roughness calculation and tool orientation adjustment on the microscale are introdu Section 5 proposes a multi-scale tool orientation generation method that satisfies macro-scale and micro-scale requirements. Meanwhile, it has interference-free smooth rotational axis characteristics. In Section 6, the multi-scale method was ver experimentally with a free-form surface. Conclusions are presented in Section 7. The posed method was validated in machining experiments on the free-form surface. Th sults indicated that it can effectively control the roughness and machining strip wi with no interference and a smooth rotational axis.

Preliminaries
This paper introduces the tool orientation generation method using a 5-axis C machine tool with a BC double turntable structure. The machine contains three tran tional axes (X, Y, and Z) and two rotational axes (B and C), as shown in Figure 1. section briefly describes two preliminaries, i.e., the relationship between tool orienta and rotational axis, and the calculation of interference-free area.

Analysis of the Relationship between the Tool Orientation and the Rotational Axis
The spatial position of the tool is determined by the cutter location data (CL D which contains the cutting tool location ( CL ) and the tool orientation ( T ). As illustr in Figure 2, when the bull-nose tool is machining the CC point on the surface, the and the surface are tangent to each other. N represents the normal vector at the point, and the vector ' T is the projection of T on the common tangent plane.

Analysis of the Relationship between the Tool Orientation and the Rotational Axis
The spatial position of the tool is determined by the cutter location data (CL Data), which contains the cutting tool location (CL) and the tool orientation (T). As illustrated in Figure 2, when the bull-nose tool is machining the CC point on the surface, the tool and the surface are tangent to each other. N represents the normal vector at the CC point, and the vector T is the projection of T on the common tangent plane.
The surface to be machined is described in the workpiece coordinate system (CS W ). The CS W is defined at the time of designing the workpiece, and the geometric features of the workpiece and CC paths are described under the CS W . The local coordinate system (CS L ) is established at the CC point, where the origin O L is the CC point, Z L is parallel to N, X L is parallel to the principal direction T S max , and Y L is parallel to the principal direction T S min . At the CC point, the angle between T and N is referred to as the local inclination angle and is denoted as λ. The angle between the T and X L is referred to as the local tilt angle and is denoted γ. T . At the CC point, the angle betw T and N is referred to as the local inclination angle and is denoted as λ . The a between the ' T and L X is referred to as the local tilt angle and is denoted γ . The feed coordinate system ( F CS ) is related to the feed direction. The origin O the CC point, F Z is parallel to N , L X is parallel to the feed direction, and L Y is pendicular to the feed direction. The angle between the T and N is referred to a inclination angle and is denoted as τ . The angle between ' T and L X is referred the tilt angle and is denoted as ω . Therefore, the tool orientation can be described in two ways: (1) local inclination gle λ and local tilt angle γ ; (2) inclination τ and tilt angle ω [60]. Based on Figu the following relationship can be obtained: In W CS , the expression for the tool orientation T is: sin cos sin sin cos sin cos sin sin cos sin cos sin sin cos  The feed coordinate system (CS F ) is related to the feed direction. The origin O F is the CC point, Z F is parallel to N, X L is parallel to the feed direction, and Y L is perpendicular to the feed direction. The angle between the T and N is referred to as the inclination angle and is denoted as τ. The angle between T and X L is referred to as the tilt angle and is denoted as ω.
Therefore, the tool orientation can be described in two ways: (1) local inclination angle λ and local tilt angle γ; (2) inclination τ and tilt angle ω [60]. Based on Figure 2, the following relationship can be obtained: In CS W , the expression for the tool orientation T is: When the workpiece is fixed on the machine table, the CS W changes with the motion of the machine rotational axis, so T in CS W can be also represented as: Combining Equations (2) and (3), the relationship between the tool orientation and the rotational angle of the machine rotational axis can be represented as: Thus, based on the local inclination and local tilt angles at any CC point, the rotational angle of the machine rotational axis can be obtained by Equation (4), as shown in Figure 3. cos sin sin cos sin sin sin sin cos cos Thus, based on the local inclination and local tilt angles at any CC point, the rotational angle of the machine rotational axis can be obtained by Equation (4), as shown in Figure 3.

Feasible Area of Tool Orientation and Tool Orientation Adjustment Method
In multi-axis CNC machining, the linkages between the axes are flexible, making interference problems easier to occur between the tool and the workpiece. Interference problems can affect the machining quality of the workpiece, scrap the part, seriously damage the machine spindle, or even cause problems such as machine scrapping. Thus, in fiveaxis CNC machining, it is necessary to avoid interference between the tool and the machined surface [61]. To obtain an interference-free tool path, it is necessary to calculate each CC point and guarantee that the tool orientation meets the basic requirements of tool path planning [25].
As shown in Figure 4, the plane passing through the CC point and parallel to N is referred to as the normal evaluation plane and is denoted as N P , and α is the angle be- where max

Feasible Area of Tool Orientation and Tool Orientation Adjustment Method
In multi-axis CNC machining, the linkages between the axes are flexible, making interference problems easier to occur between the tool and the workpiece. Interference problems can affect the machining quality of the workpiece, scrap the part, seriously damage the machine spindle, or even cause problems such as machine scrapping. Thus, in five-axis CNC machining, it is necessary to avoid interference between the tool and the machined surface [61]. To obtain an interference-free tool path, it is necessary to calculate each CC point and guarantee that the tool orientation meets the basic requirements of tool path planning [25].
As shown in Figure 4, the plane passing through the CC point and parallel to N is referred to as the normal evaluation plane and is denoted as P N , and α is the angle between P N and X L . On P N , the difference between the curvature κ C N (α) and κ S N (α) is referred to as the evaluation curvature κ N (α): where κ C N (α) and κ S N (α) are respectively the normal curvature of the tool and workpiece surface on P N . According to Euler's criterion, κ S N (α) can be calculated as: where κ S max and κ S min are the principal curvatures of the workpiece surface, respectively. Similarly, κ C N (α) can be calculated as: where κ C max and κ C min are the principal curvatures of the tool, respectively. When the condition κ N (α) ≥ 0 is met on normal evaluation planes, local interference does not occur at the CC point; when the condition κ N (α) < 0 is satisfied at least on one normal evaluation plane, local interference occurs at the CC point.
Analyzing κ N (α) of the normal evaluation plane P N , and associating Equations (5) to (7), we have: where the minimum value of κ N (α) is referred to as the critical evaluation curvature and is denoted as κ Critical :    Since κ Critical is the minimum of the evaluation curvature of all normal evaluation planes, the tool orientation is referred to as the feasible tool orientation if κ Critical ≥ 0 and no local interference occurs. The set of all feasible tool orientations is referred to as the feasible area of tool orientation, as shown in Figure 5. When the tool orientation is in the feasible area, the following equation holds:  (8) minimum value of ( ) N κ α is referred to as the critical evaluation curvature and is noted as Critical Since Critical κ is the minimum of the evaluation curvature of all normal evalua planes, the tool orientation is referred to as the feasible tool orientation if 0 Critical κ ≥ no local interference occurs. The set of all feasible tool orientations is referred to as feasible area of tool orientation, as shown in Figure 5. When the tool orientation is in feasible area, the following equation holds:  When machining the CC point, if local interference occurs, it is necessary to adjust the tool orientation to eliminate the interference and make it fall within the feasible area. The feasible area of tool orientation contains numerous options, and the process of adjusting the tool orientation is described below.
The initial tool orientation (γ init , λ init ) is outside the feasible area when machining the CC point. For the convenience of calculation, take γ r = r · ∆γ, r = 1, 2, . . . , 180/∆γ − 1 and substitute it into Equation (10) to obtain the tool orientation corresponding to the boundary of the feasible area at this CC point, which is referred to as the potential interference-free tool orientation and denoted as (γ r , λ r ). The distance ∆d r between each (γ r , λ r ) and the (γ init , λ init ) is: The potential tool orientation with the shortest distance ∆d min from the initial tool orientation is the selected tool orientation, as shown in Figure 6.
ary of the feasible area at this CC point, which is referred to as the potential interfere free tool orientation and denoted as ( ) The potential tool orientation with the shortest distance min d Δ from the initial orientation is the selected tool orientation, as shown in Figure 6.

Calculation Method of Machining Strip Width with a Bull-Nose Tool
The machining strip width can be obtained by intersecting the scallop surface with the tool in the plane Y F O F Z F perpendicular to the feed direction. Assuming a specified tolerance h for the workpiece surface, the scallop surface S is obtained by offsetting the surface by h in the direction away from the workpiece. The tool orientation affects the projection of the bull-nose tool on Y F O F Z F . Meanwhile, due to the special geometry of the bull-nose tool, it is impossible to approximate the tool's geometry in this plane by a close circle at the CC point. As illustrated in Figure 7, in the plane Y F O F Z F , a series of sampling points are planned on the workpiece surface along Y F . The spacing between adjacent sampling points is denoted as ∆d. The distance between each sampling point along N and the tool is referred to as the normal distance and is denoted as d N . The sampling points are planned on both sides of the CC point, and the normal distance corresponding to each sampling point can be calculated. The sampling points corresponding to ∆d = h are the boundaries of the machining strip width, denoted as G L and G R , respectively. The length of the projection of − −− → G L G R on Y F is referred to as the machining strip width W.
Observing in the negative direction of Y F , the machining strip width on the left side of the CC point is denoted as W L , and the machining strip width on the right side is denoted as W R . The tool orientation affects the machining strip width. With the above mach strip width calculation method, the effect of tool orientation on it can be easily calcul Figure 8 presents the effect of local inclination and local tilt angles on W , L W , and respectively. The tool orientation affects the machining strip width. With the above machining strip width calculation method, the effect of tool orientation on it can be easily calculated. Figure 8 presents the effect of local inclination and local tilt angles on W, W L , and W R respectively. The tool orientation affects the machining strip width. With the above machining strip width calculation method, the effect of tool orientation on it can be easily calculated Figure 8 presents the effect of local inclination and local tilt angles on W , L W , and R W respectively. As illustrated in Figure 8a, without local interference, the machining strip width de creases as the local inclination angle increases. As presented in Figure 8b, without loca interference, the machining strip width increases and then decreases as the local tilt angle gradually increases from 0 to 180°. The maximum W appears when γ σ = , i.e., W reaches the maximum when the feed direction of the tool is the same as max S T . Addition ally, due to the special geometric properties of the bull-nose tool, L W and R W are equa when γ σ = .

Tool Orientation Adjustment Method to Keep Machining Strip Width Uniform
From a geometric perspective, a larger machining strip width corresponds to a highe material removal rate. However, when the machined surface is a freeform surface, the curvature of each CC point differs. Therefore, even if the tool orientation remains un changed, it still leads to changes in W . In five-axis CNC milling, significant fluctuation in cutting force arise from the rapid changes in strip width, which consequently reduce tool life and machining quality [38]. Therefore, to avoid the problem of frequent changes in machining strip width that may cause a decrease in workpiece quality, it is necessary to keep the machining strip width as uniform as possible in the machining process. As illustrated in Figure 8a, without local interference, the machining strip width decreases as the local inclination angle increases. As presented in Figure 8b, without local interference, the machining strip width increases and then decreases as the local tilt angle gradually increases from 0 to 180 • . The maximum W appears when γ = σ, i.e., W reaches the maximum when the feed direction of the tool is the same as T S max . Additionally, due to the special geometric properties of the bull-nose tool, W L and W R are equal when γ = σ.

Tool Orientation Adjustment Method to Keep Machining Strip Width Uniform
From a geometric perspective, a larger machining strip width corresponds to a higher material removal rate. However, when the machined surface is a freeform surface, the curvature of each CC point differs. Therefore, even if the tool orientation remains unchanged, it still leads to changes in W. In five-axis CNC milling, significant fluctuations in cutting force arise from the rapid changes in strip width, which consequently reduce tool life and machining quality [38]. Therefore, to avoid the problem of frequent changes in machining strip width that may cause a decrease in workpiece quality, it is necessary to keep the machining strip width as uniform as possible in the machining process.
To maintain a uniform machining strip width, it is necessary to adjust the tool orientation at each CC point. By changing the tool orientation, it is expected that the machining strip width at any CC point will converge to the expected machining strip width where R e f f is the curvature radius of the bull-nose tool at the CC point on the plane Y F O F Z F . In Figure 9, when the tool orientation is within the range of curves S W max E W max and S W min E W min , the machining strip width falls within W e . It is better to adjust the local inclination angle instead of the local tilt angle to change W, and this is because the change in the local inclination angle has a more significant influence on W than the local tilt angle. Besides, adjusting the local tilt angle results in a larger difference between W L and W R . To maintain balance in material removal on both sides of the CC point during processing, it is preferable to select the tool orientation of γ = σ. min min S E , the machining strip width falls within e W . It is better to adjust the local incl tion angle instead of the local tilt angle to change W , and this is because the chang the local inclination angle has a more significant influence on W than the local tilt an Besides, adjusting the local tilt angle results in a larger difference between L W and To maintain balance in material removal on both sides of the CC point during process it is preferable to select the tool orientation of γ σ = . Figure 9. The relationship between the expected machining strip width and tool orientation.

2D Profile Simulation Model and Roughness Calculation Method
After using a bull-nose tool for five-axis CNC machining, a specific surface topo phy will be exhibited on the surface of the workpiece. From a geometric perspective surface topography is related to the step distance d and the feed per tooth z f . Since is very small, it can be considered the scallops left by the tool motion as a part of the to toric surface, as illustrated in Figure 10.

2D Profile Simulation Model and Roughness Calculation Method
After using a bull-nose tool for five-axis CNC machining, a specific surface topography will be exhibited on the surface of the workpiece. From a geometric perspective, the surface topography is related to the step distance d and the feed per tooth f z . Since f z is very small, it can be considered the scallops left by the tool motion as a part of the tool's toric surface, as illustrated in Figure 10. The surface topography can be approximated as a series of scallops, with each scallop being determined by the CC point, principal direction, and principal curvature. The expression of the approximate surface of the scallop in the local coordinate system CC, T C max , T C min , N is: Micromachines 2023, 14, 1199 12 The profile method is an important method for evaluating surface topography has been widely used. As an essential characteristic of surface topography, roughness is the difference between the real profile and the nominal profile within the evalu length L . Generally, roughness is evaluated on a plane P that is perpendicular t feed direction [62]. The evaluation length is determined by the standard, and the real file refers to the intersection of the plane P with the real surface. The nominal profi the curve obtained by the intersection of the plane P with the workpiece surface, a is a curve on the theoretical surface   The profile method is an important method for evaluating surface topography and has been widely used. As an essential characteristic of surface topography, roughness Ra is the difference between the real profile and the nominal profile within the evaluation length L. Generally, roughness is evaluated on a plane P that is perpendicular to the feed direction [62]. The evaluation length is determined by the standard, and the real profile refers to the intersection of the plane P with the real surface. The nominal profile is the curve obtained by the intersection of the plane P with the workpiece surface, and it is a curve on the theoretical surface  Roughness Ra also refers to the difference between the real and nominal profiles. The line L p i passes through point p i on the nominal profile, and it is parallel to the measurement direction V M . The intersection points of L p i with real profile is p R i corresponds to p i , as shown in Figure 11. feed direction [62]. The evaluation length is determined by the standard, and the file refers to the intersection of the plane P with the real surface. The nominal p the curve obtained by the intersection of the plane P with the workpiece surfac is a curve on the theoretical surface    The line L p i intersects with several scallops, and the distance between the point p m i and the point p i is denoted as l m i , where m is the index of the scallop. The point corresponding to the minimum l m i is the intersection point p R i between L p i and the real profile, as illustrated in Figure 12.
The steps to calculate the 2D real profile are as follows: a. Input the workpiece surface, tool parameters, and CL data. b.
Calculate the discrete point p i on the nominal profile and obtain L p i according to p i and the measurement direction V M . c.
Calculate the intersection point p m i between L p i and the scallop whose index is m. Then, calculate the distance l m i . d.
Calculate the intersection point between L p i and the next scallop and update the minimum distance l i,min . e.
Repeat steps (c) and (d) for each scallop to obtain the minimum distance l i,min and p R i . f.
Repeat steps (b) to (e), for each discrete point p i to obtain the real profile.  The tool orientation significantly affects the roughness Ra . Based on the ab culation method of Ra , the influence of the tool orientation on the roughness Ra easily calculated. Figure 13 shows the influence of local inclination angle and angle on roughness. As illustrated in Figure 13a, without local interference, the ro After the real and nominal profiles are obtained, the roughness of the workpiece can be calculated based on the difference between the two. Ra is the average difference between the real profile and the mean profile in the evaluation length L, and it can be expressed as: The tool orientation significantly affects the roughness Ra. Based on the above calculation method of Ra, the influence of the tool orientation on the roughness Ra can be easily calculated. Figure 13 shows the influence of local inclination angle and local tilt angle on roughness. As illustrated in Figure 13a, without local interference, the roughness increases with the local inclination angle. As shown in Figure 13b, without local interference, as the local tilt angle gradually increases from 0 to 180 • , the roughness first decreases and then increases. When γ = σ, the roughness Ra reaches its minimum.
( ) The tool orientation significantly affects the roughness Ra . Based on the above calculation method of Ra , the influence of the tool orientation on the roughness Ra can be easily calculated. Figure 13 shows the influence of local inclination angle and local tilt angle on roughness. As illustrated in Figure 13a, without local interference, the roughness increases with the local inclination angle. As shown in Figure 13b, without local interference, as the local tilt angle gradually increases from 0 to 180°, the roughness first decreases and then increases. When γ σ = , the roughness Ra reaches its minimum.

Tool Orientation Adjustment Method to Meet Roughness Requirement
In the machining process, the roughness Ra must meet the design requirements. By adjusting the tool orientation, it is expected that the roughness Ra at any CC point is smaller than the design requirements. As illustrated in Figure 14, if there is a curve Ra Ra e e S E , selecting any tool orientation below the curve causes the roughness Ra to be smaller than the design requirements. Compared with the local tilt angle, the effect of adjusting the local inclination angle on the roughness is more significant. Meanwhile, as the local

Tool Orientation Adjustment Method to Meet Roughness Requirement
In the machining process, the roughness Ra must meet the design requirements. By adjusting the tool orientation, it is expected that the roughness Ra at any CC point is smaller than the design requirements. As illustrated in Figure 14, if there is a curve S Ra e E Ra e , selecting any tool orientation below the curve causes the roughness Ra to be smaller than the design requirements. Compared with the local tilt angle, the effect of adjusting the local inclination angle on the roughness is more significant. Meanwhile, as the local inclination angle decreases, the roughness also gradually decreases. Therefore, when the roughness of the workpiece cannot meet the design requirements, the method of reducing the local inclination angle can be adopted to control the roughness.
Micromachines 2023, 14,1199 inclination angle decreases, the roughness also gradually decreases. Therefore, w roughness of the workpiece cannot meet the design requirements, the method of r the local inclination angle can be adopted to control the roughness.

Multi-Scale Tool Orientation Generation Method
The multi-scale tool orientation generation method aims to generate tool orie that satisfy both the macro-scale machining strip width constraint and the mic roughness constraint.

Method for Generating a Tool Orientation with a Smooth Rotational Axis
The tool orientation is nonlinear during the conversion between the workpie dinate system

Multi-Scale Tool Orientation Generation Method
The multi-scale tool orientation generation method aims to generate tool orientations that satisfy both the macro-scale machining strip width constraint and the micro-scale roughness constraint.

Method for Generating a Tool Orientation with a Smooth Rotational Axis
The tool orientation is nonlinear during the conversion between the workpiece coordinate system CS W and the machine coordinate system CS M , so a smooth tool orientation in the CS W alone cannot ensure equally smooth rotation in a five-axis machine [56]. Poor tool orientation smoothing may cause discontinuous machine motion, which can lead to problems such as increased machining time and damage to surface quality. Therefore, when planning the tool orientation, the variation of the machine's rotational axis should be considered to ensure smooth motion of the machine's rotational axis.
The CC path is a continuous curve on the surface of the workpiece, as denoted as s(u). The angle of the rotational axis corresponding to the CC point on the CC path is denoted as β * , where * = B, C. In this paper, the distribution of the rotational axis is expressed in the form of B-spline in the following form: where N j,3 (u) represents the cubic B-sample basis function, Q * j represents the control coefficient, and U represents the knot vector.
The angular velocity of the rotational axis is an important parameter. To constrain the angular velocity to achieve a smooth rotational axis and to facilitate the calculation, the angular velocity is approximated by using the numerical differentiation method as follows: where , The least-square (LS) objective function shown in (20) can be obtained by substituting Equations (17) and (18) into Equation (19), which minimizes the angular velocity of the rotation axis by adjusting the control coefficient Q * j .
The necessary condition for the minimum of the LS objective function is ∂Ω ∂Q * k = 0, and k is the index of the control coefficient.
At the start and end of each tool path, the tool orientation is given. Meanwhile, the first and last control coefficient Q * 0 and Q * n are the same as the rotation angles β * (0) and β * (1) of the rotational axis. Substituting Q * 0 = β * (0) and Q * n = β * (1) into Equation (21), we have: Bredies, other constraints need to be added to the above set of equations. For instance, if some CC points are found to have local interference or the machining strip width does not meet the expectation, their corresponding tool orientations should be corrected according to the adjustment method in the previous section and set to fixed values. Suppose there are p CC points and their fixed tool orientations are β * u p . the curve of the rotational axis angle needs to be constrained by these tool orientations, i.e., Substituting Q * 0 = β * (0) and Q * n = β * (1) into Equation (23) yields: Combining Equations (22) and (24), a set of linear equations can be obtained with the control coefficient Q * j , j = 1, 2, . . . , n − 1 as the unknown: where The control coefficient can be solved by the following equation:

Multi-Scale Tool Orientation Generation Method
The implementation of the multi-scale tool orientation generation method proposed in this paper is shown in Figure 15. The input includes the workpiece surface, tool, CC path, and roughness requirements, and the output is the NC program (including CL and tool orientation) that meets the roughness requirements on the micro-scale and has uniform machining strip widths on the macro-scale.
Specifically, the generation method requires iterative calculation, which mainly includes the following four steps: Before planning the tool orientation, some preparation work needs to be performed: first, find the evaluation length Ra in the standard according to the roughness requirement, and according to this, calculate the number of CC paths to be planned Num, and then the iterative calculation of the tool orientation for the above CC paths can be conducted.
Step 1: Specify the constraints for the tool orientation.
Step 2: According to Equation (26), calculate the smooth angle of the rotational axis β * .
Step 3: According to the formula in Section 2.2, calculate the tool orientation (λ, γ) corresponding to each CC point in CS L and judge whether there is local interference or the machining strip width exceeds the expectation according to the description in Sections 2 and 3. If these problems occur, adjust the tool orientation and add the corresponding tool orientations at these CC points to the constraints, and then execute steps 2 and 3 again until the tool orientations that satisfy the expectation of no local interference and machining strip width are generated.
When the planning of the tool orientation of one CC path is completed, the calculation of the next CC path is conducted until the tool orientations of Num CC paths are all planned.
Step 4: According to the roughness calculation method in Section 4, the roughness of the above Num CC paths is calculated to determine whether the roughness meets the design requirements. If the roughness does not meet the requirement, adjust the tool orientation according to Section 4.2 and add the tool orientation corresponding to these CC points to the tool orientation constraint of the CC paths, and then execute steps (1) to (3) again until the tool orientations that meet the roughness requirements are generated.

Multi-Scale Tool Orientation Generation Method
The implementation of the multi-scale tool orientation generation method proposed in this paper is shown in Figure 15. The input includes the workpiece surface, tool, CC path, and roughness requirements, and the output is the NC program (including CL and tool orientation) that meets the roughness requirements on the micro-scale and has uniform machining strip widths on the macro-scale. Specifically, the generation method requires iterative calculation, which mainly includes the following four steps: The multi-scale tool orientation generation method proposed in this paper can ensure that no local interference occurs at any CC point. Meanwhile, it can ensure that the cutting bandwidth at the machining strip widths on the macro-scale is uniform and the roughness requirements on the micro-scale are met. Additionally, this method can ensure the smoothness of the rotational axis. During the machining process, kinematic singularities occur when the tool orientation passes through singular points, causing the rotation axis to move over a large range in a short period of time [63]. Consequently, when the angle of the rotational axis experiences abrupt changes at adjacent CC points, singularities appear, and the constraint of the tool orientation must be reassigned. Furthermore, since the objective of this study is to generate tool orientations that satisfy both macro-scale and micro-scale requirements, only the smoothing of the rotational axis is considered. To the best of our knowledge, maintaining continuous and smooth velocity for the rotational axis during the machining process also ensures continuous and smooth velocity, acceleration, and jerk for the machine tool driver. However, this aspect warrants further investigation.

Experiment
To verify the effectiveness of the proposed multi-scale tool orientation generation method, it was applied to the machining of a free-form surface. The iso-parametric method is employed to generate CC paths with ∆v = 0.02, and the interval between the adjusted CC points is, ∆u = 0.01, as shown in Figure 16a. Besides, the Sturz [64] method and the multi-scale method are adopted to plan the tool orientation, respectively. Specifically, the Sturz method has an inclination angle of 20 • and a tilt angle of 0 • . The tool orientation of the method proposed in this paper is consistent with the Sturz method at the starting and end points, both of which have an inclination angle of 20 • and a tilt angle of 0 • , and then the tool orientations at other CC points are planned. The workpiece roughness requirement is Ra = 1.6 µm, and according to the standard, the evaluation length L = 4 mm. According to Equation (14), the range of expected machining strip width is W e ∈ [2.15 mm, 3.15 mm]. Figure 16b illustrates the distribution of the normal vector on the free-form surface. During the machining of free-form surfaces, variations in the normal vector influence the tool orientation, resulting in continuous changes throughout the machining process. Therefore, the experimental validation involves real 5-axis operations.
In this experiment, a 5-axis CNC machine tool with a BC double turntable structure (JDGR200T, Beijing, Jingdiao, China) was employed to machine the workpiece. The material used in the experiment was 2Cr13. Meanwhile, a 4-tooth bull-nose tool with a radius R = 5 mm and corner radius r = 3 mm was used for finishing. The machining parameters used in the experiment are as follows: the spindle speed is 4800 r/min, and the feedrate is 800 mm/min. The workpiece is fixed on the turntable as shown in Figure 16c. After machining the workpiece with the above two methods, the machined workpiece was obtained, as shown in Figure 16d. vector influence the tool orientation, resulting in continuous changes throughout the machining process. Therefore, the experimental validation involves real 5-axis operations.
In this experiment, a 5-axis CNC machine tool with a BC double turntable structure (JDGR200T, Beijing, Jingdiao, China) was employed to machine the workpiece. The material used in the experiment was 2Cr13. Meanwhile, a 4-tooth bull-nose tool with a radius 5 mm R = and corner radius 3 mm r = was used for finishing. The machining parameters used in the experiment are as follows: the spindle speed is 4800 / min r , and the feedrate is 800 mm / min . The workpiece is fixed on the turntable as shown in Figure 16c. After machining the workpiece with the above two methods, the machined workpiece was obtained, as shown in Figure 16d. After machining, the roughness of the workpiece was measured at 90 different locations evenly distributed on the surface with the Renishaw REVO © 5-axis measurement system. The experimental equipment comprised a Renishaw Agility 5-axis measurement system outfitted with an SFM-C3 surface finish module, as depicted in Figure 17a,b. The After machining, the roughness of the workpiece was measured at 90 different locations evenly distributed on the surface with the Renishaw REVO © 5-axis measurement system. The experimental equipment comprised a Renishaw Agility 5-axis measurement system outfitted with an SFM-C3 surface finish module, as depicted in Figure 17a,b. The maximum permissible error of length measurement (MPE) in the 5-axis measurement system was 1.9 µm + L/350 µm, while maximum permissible limit of the repeatability range (MPL) was 1.3 µm. The SFM-C3's accuracy (of nominal Ra) was ±10% + 35 nm. The SFM-C3 was calibrated prior to the measurement process with Renishaw Roughness Specimen SFA1, as demonstrated in Figure 17c. The measurements were conducted at a stable temperature of 20 • C, and the SFM-C3 operated at a speed of 1 mm/s during roughness measurements. The measurement results are shown in Tables 1 and 2.  In the machining process, the minimum and maximum machining strip widths of the tool orientation generated by the Sturz method are, respectively W min = 2.60 mm and W max = 2.78 mm, which fall within the expectation of machining strip width. It can be seen from Table 1 that there are 13 positions where the roughness does not meet the roughness requirements. Hence, the tool orientation obtained by the Sturz method can meet the machining strip width expectation but cannot achieve the required roughness. In contrast, the minimum and maximum machining strip widths of the tool orientation generated by the multi-scale method are, respectively W min = 2.60 mm and W max = 2.84 mm, which fall within the expectation of machining strip width too. From Table 2, it can be determined that the roughness at all positions meets the roughness requirements. Hence, the multi-scale method proposed in this paper can meet the machining strip width expectation, and at the same time, it ensures that the roughness meets the requirement.
Therefore, it can be concluded that the proposed multi-scale method can obtain the tool orientation that meets the requirements of the macro-scale and micro-scale.

Conclusions
In five-axis CNC machining, the machining quality of the workpiece is closely related to tool orientation. An appropriate tool orientation can help to avoid interference, keep the machining strip width uniform, control the roughness, etc. In this paper, by considering the influence of both machining strip width in the macro-scale and roughness in the micro-scale, a multi-scale tool orientation generation method is proposed for 5-axis CNC machining of bull-nose tools, which can ensure no interference and smoothness of the rotational axis during machining. Based on the conducted analyses and the obtained findings, the following conclusions can be drawn: (1) The method is proposed to calculate the machining strip width of a free-form surface machined by a bull-nose tool, and the influence of the tool orientation on the machining strip width is analyzed. Meanwhile, to solve the problem that frequent changes in machining strip width reduce machining quality, a tool orientation adjustment method is proposed to maintain the machining strip width uniform in the machining process. (2) The simulation model of the real profile of a free-form surface machined by a bull-nose tool is established, and the roughness is calculated based on this. Additionally, the influence of tool orientation on roughness is analyzed, and a tool orientation adjustment method is proposed to ensure that the roughness meets the design requirements. (3) Based on the above models, a multi-scale tool orientation generation method is proposed that can ensure no local interference at any CC point and meet the requirements for machining strip width on a macro-scale and roughness on a micro-scale. Additionally, the proposed method can ensure the minimum angular velocity of the rotational axis. (4) The experimental results indicate that the multi-scale method proposed in this paper is effective. It is experimentally verified that the tool orientation generated by the method can not only meet the requirement for machining strip widths but also ensure roughness, i.e., satisfy both macro-scale and micro-scale requirements.
This demonstrates that the method proposed in this paper has a wide prospect and potential for practical applications and can provide an effective solution for the industry. Data Availability Statement: Not applicable.

Conflicts of Interest:
The authors declare no conflict of interest.