Study of the tool path generation method for an ultra-precision spherical complex surface based on a five-axis machine tool

The improvement of ultra-precision machining technology has significantly boosted the demand for the surface quality and surface accuracy of the workpieces to be machined. However, the geometric shapes of workpiece surfaces cannot be adequately manufactured with simple plane, cylindrical, or spherical surfaces because of their different applications in various fields. In this research, a method was proposed to generate tool paths for the machining of complex spherical surfaces based on an ultra-precise five-axis turning and milling machine with a C-Y-Z-X-B structure. Through the proposed tool path generation method, ultra-precise complex spherical surface machining was achieved. First, the complex spherical surface model was modeled and calculated, and then it was combined with the designed model to generate the tool path. Then the tool paths were generated with a numerically controlled (NC) program. Based on an ultra-precision three-coordinate measuring instrument and a white light interferometer, the machining accuracy of a workpiece surface was characterized, and the effectiveness of the tool path generation method was verified. The surface roughness of the machined workpiece was less than 90 nm. Furthermore, the surface roughness within the spherical region appeared to be less than 30 nm. The presented tool path generation method in this research produced ultra-precision spherical complex surfaces. The method could be applied to complex spherical surfaces with other characteristics.


Introduction
Ultra-precision machining technology has been widely used in the biomedicine, aerospace, defense, and electronic communication technology industries [1]. Because of their different applications in various fields, the geometric shapes and surface morphologies of machined surfaces have become more complicated. Improving the surface shape accuracy and roughness of a machined workpiece is significant, because these factors have a great influence on the performance of a workpiece. A complex surface requires the use of high precision calculations and encompasses both functional and aesthetic effects; it is a combination of a curved surface formed by multiple curvatures [2,3]. Typical complex surfaces include aspheric surfaces, free-form surfaces, and special-shaped surfaces [4].
The machining of complex surfaces can be achieved by using three-axis turning machining. Representative turning machining methods include single point diamond turning (SPDT), fast tool servo (FTS) turning, and slow tool servo (STS) turning [5]. At present, SPDT is commonly used in the manufacturing of ultra-precision spherical and aspherical surfaces [6]. However, traditional SPDT cannot meet machining requirements because the curvature of the spherical surface is larger than the common optical curved surface [7,8]. FTS turning has the characteristics of a high motion frequency response, easy resonance, and a short stroke [9][10][11]. However, it is not suitable for machining spherical workpieces with a certain degree of rotation. STS turning is significantly affected by the inertia of a machine tool slide and the response speed of a motor, and the dynamic response speed of a machine tool is low, which would not be suitable for the machining of a complex spherical surface [12,13]. Compared with turning, multiaxis milling is more suitable for the machining of spherical complex surfaces with millimeter-scale characteristics, such as pits and round chamfers [14,15]. Multi-axis milling requires more than three axes to work together. These axes generally include linear axes and rotary axes. The linear axis and the rotary axis work together to satisfy the requirements of machining spherical complex surfaces in different orientations [16,17]. However, due to the increase in the motion of the axes, the sources of error also increase. Therefore, it is necessary to ensure the accuracy of the important performance indicators of the machine tool and provide a stable processing environment [18,19]. Due to the above-mentioned reasons, the machining method employed in this research was based on ultra-precision turning combined with multi-axis milling. Multi-axis milling can be used to machine complex and high steepness surfaces [20,21].
Current research on the machining of five-axis complex curved surfaces mostly focuses on mold processing [22], optical lens processing [4], and impeller milling [23]. However, research on ultra-precision manufacturing of spherical complex surfaces with millimeter-scale characteristics is relatively rare. Chen et al. [24] used Taguchi method to optimize the tool path and finally obtained a concave sphere with an average roughness of 0.786 μm. Xiao et al. [25] studied the bionic compound eye model with a spherical radius of 1010 μm and obtained a compound eye surface with a surface shape error of about 5 μm. The roughness value Ra of all other ommatidia is between 92.3 and 480.2 nm after configuration optimization and accuracy analysis.
Therefore, the generation of tool paths plays an important role in complex surface machining. For workpieces with complex shapes, the key to tool path generation is determining how to solve interference processing. The generation of tool paths determines the actual movement paths and pose states in the computer numerical controlled (CNC) machining process. Additionally, for the same workpiece, using different tool path generation methods could thus cause obvious differences in the machining efficiency and accuracy.
Numerous research studies have been conducted to solve the tool path generation problems. Yuan et al. [26] proposed a tool vibration path generation strategy based on the working principle of the double frequency vibration cutting method. Kong et al. [27] proposed the processing of composite freeform surfaces by combining the hybrid processing technology of a slow sliding servo and a fast tool servo. The machining process for this hybrid tool servo was explained, and the tool path generation was presented. Koyama et al. [28] developed a computer-aided manufacturing (CAM) system in ultraprecision micromachining to assist operators with settings. From the simulation result, it was found that the CAM system was effective in producing micro parts easily and accurately. Chen et al. [29,30] proposed a new method to model complex surfaces based on the recursive subdivision theory. This method could deal with a complex surface with an arbitrary topological structure that had initial mesh controls. It had a high calculation efficiency, the modeling results were ideal, the numerical control interpolation accuracy of the complex surface was very high, and its error was controllable. Huang et al. [31] and Chen et al. [32] generated tool paths from geometrical calculations considering lens designs, tool geometries, and roller parameters. Gao et al. [33] discussed the methodology for the development of the tool path generator for a progressive lens. Using the model of the freeform surface, which represents a double cubic B-spline surface, the method of changing parameters was used to calculate the numerically controlled (NC) machining tool path. Brecher et al. [34] presented the layout of a tool path calculation based on the nonuniform rational B-spline (NURBS) data format. In addition, the interfaces, the hardware, and the software for the realization of a NURBS based control unit for Fast Tool Servo turning and local corrective polishing operations were described.
Software for generating complex curved tool paths is widely used, and popular programs include UG [35][36][37], PRO/E [38], and PowerMILL [39]. The main advantage of commercial software is that it can automatically generate tool paths flexibly according to the shape of a rough workpiece and a machining target. However, ultra-precision machining requires tool paths with step lengths, spacing, and feed rates with small sizes. Additionally, the singular problem in the tool path generation process should be avoided [40]. When these commercial software programs are employed, they can be time-consuming and difficult to use. Therefore, in this research, the use of programming software to design a complex spherical surface that needed to be processed was considered, and a small spacing was set for the tool path.
In summary, it is necessary to study the method for generating the tool paths of spherical complex surfaces. The method aims to improve the surface shape accuracy to meet the standard of the micron level and surface roughness to meet the standard of the nanometer level. In this research, a method was proposed for the generation of tool paths for the machining of complex spherical surfaces, and a golf-ball-like spherical surface served as a research model for the five-axis machining of complex curved surfaces. The reasons for this are as follows. First, such a research model would be useful in fluid mechanics applications [41,42]. Second, it can generate representative spherical complex surfaces because it has obvious characteristics such as spherical pits and round chamfers. In this research, the golf-like spherical surface machining was based on an ultra-precision five-axis turning and milling machine.

Machining objects
We used a golf-ball-like spherical surface as the machining object. The main body of the golf-ball-like spherical surface was a sphere, and the spherical pits were arranged regularly on its surface. As shown in Fig. 1a, the size, depth, the number of pits, different complex shapes, and different area types were all important geometric parameters that significantly influenced the golf-ball-like spherical surface. We found that there were round chamfers at the junction of the pit and the sphere.
In this research, the spherical diameter of the machined workpiece was set to 42.74 mm. The pits were distributed at a distance of 10°along the latitude line of the sphere, and the longitude circular array quantity of each latitude line was set. The depth of each pit was 0.25 mm, the diameter of the pit surface was 10 mm, and the pit and the spherical surface had round chamfers with a radius of 2 mm, as shown in Fig. 1b.
The main characteristics of the studied golf-ball-like spherical surface were small sizes, high surface shape accuracy, and high surface machining quality requirements. According to the machining requirements of the workpiece, the manufacturing process was a typical precision or ultra-precision machining process. Therefore, machining this workpiece required ultra-precision precision machine tools, as well as strict control of the machining technology and the environment. Additionally, high precision tool path generation methods were strongly needed. The key technology of tool path generation included the step length selection, step distance selection, and interference avoidance.

Experimental set-up
This research was based on a five-axis ultra-precision turning and milling compound machine tool developed by the Center for Precision Engineering of the Harbin Institute of Technology. The ultra-precision five-axis machine tool had a C-Y-Z-X-B structure, as shown in Fig. 2. The machine tool consisted of three linear axes, including an X-axis, Y-axis, and Z-axis, and two rotary axes, including a B-axis and a C-axis. The X-axis and the Z-axis were located on the base of the machine tool. The X-axis and the B-axis constituted the tool branch of the machine tool. The Z-axis, Y-axis, and C-axis constituted the workpiece branch of the machine tool.
The machine tool adopted the open loop CNC system of a UMac platform with independent and controllable features. It could independently add functions according to the actual processing requirements and achieve the RTCP (Rotational Tool Center Point) function through five-axis collaborative work [43,44]. It was able to operate in conjunction with an optical microscope and a contact probe. The main parameters of the machine tool are shown in Table 1.

Methodology
The process of machining a golf-ball-like spherical surface was divided into turning and milling. In the machining process, the spherical surface was turned first, and then the pits on the golf-ball-like spherical surface were milled.

Spherical surface turning
The geometry of the cutting part of the diamond tool affected the machining quality of the workpiece surface. A suitable tool arc radius and center envelope angle ensured that the tool arc could cut every point on the ideal curved surface. Proper rake and back angles prevented the diamond tool from overcutting the machined surface during the machining process. When the required cutting angle of the curved surface was larger than the center envelope angle of the tool, the swing of the B-axis needed to satisfy the machining. Therefore, when editing the tool path, it was necessary to consider the motion path of the X, Z, and B three-axes linkage, and the Yaxis was used for the centering adjustment and height adjustment.
Programming software was used to generate the cutting path. According to the surface shape, the X, Z, and B coordinates corresponding to the cutting points were obtained. For spherical surfaces with the nature of a cyclotron, Archimedes spirals were suitable for generating the tool paths. Common point definition methods were divided into an equidistance method and an equiangular method, as shown in Fig. 3.  Figure 3a shows that the number of points on each spiral in the equiangular method was the same. The density of the points on the spiral was inversely proportional to the radius. This meant that the distribution of the points near the edge of the surface was relatively sparse, while the distribution of points near the center of the surface was relatively dense. Figure 3b shows that in the equidistance method, the arc length between two adjacent points on each spiral was equal. The distribution of points near the edge of the surface was relatively dense, and the distribution of points near the center of the surface was relatively sparse. Considering the characteristics of these two methods, we selected the equiangular method for processing the spherical surface because the central part needed more points. The calculation of the equiangular spiral method is shown in Eq. (1).
In Eq. (1), (x i , y i , z i ) are the coordinates of the cutting point numbered i, ω is the total radians of the X-Y plane, ρ is the total radian of the Z direction, and t i is between 0 and 1. The distance was determined by the distance Δt between t i − 1 and t i . Since the workpiece was a spherical surface, the B-axis and the spindle were required to rotate with the position of the machined surface. The tool axis was aligned with the center of the sphere to define the B-axis and the spindle, which required the calculation of the normal vector of the cutting point. The spherical formula is shown in Eq. (2). The derivatives of x, y, and z in Eq. (2) were calculated as shown in Eq. (3).
First, the corresponding homogeneous transformation of Eq. (4) to Eq.
When machining, the tool cutting points coordinates had to be converted into tool center coordinates. The conversion process needed to consider the radius of the tool. The spatial relationship is shown in Fig. 4. Figure 4 shows that the tool center point needed to translate the distance of the tool center r along the ( x * , z * ) direction to avoid the overcut. For this purpose, the modulus in the ( x * , z * Fig. 2 Ultra-precision five-axis CNC machine tool Verticality error between B-axis and X-axis <2″ Verticality error between B-axis and Z-axis <2″ Angle between the C-axis and Z-axis <2″ Y-axis and Z-axis pitch angle <1″ B-axis angular positioning accuracy <±1″ ) direction had to be found first, and then the tool nose radius was compensated for. The tool center path diagram for the spherical surface machining is shown in Fig. 5.
The calculated tool path was output according to the specified format corresponding to the machine tool, and a CNC file was generated. The generated file was imported into the CNC system to complete the spherical turning process.

Golf-ball-like spherical machining methods
The golf-ball-like spherical surface was different from free-form surfaces and microstructures. Dimples and round chamfers were distributed on the spherical surface along the B-axis. Therefore, the machine tool needed to have three linear axes and two rotary axes. Furthermore, it also needed to have the RTCP function to complete the ultra-precision milling of the workpiece.
The processing material of the target workpiece was microcrystalline aluminum alloy RSA905, which was purchased from the Shanghai Microhesion Industry Co. Ltd. In order to  Fig. 4 Tool radius compensation method ensure the surface processing quality of the parts, single crystal diamond tools were used for the cutting of the aluminum alloy. The positive rake angle not only increased the process difficulty, but also reduced the tool wedge angle. All these factors could lead to a shortened tool life. Considering the above reasons, it was more reasonable to choose a rake angle of 0-15°. A single arc-edged diamond micro-milling cutter was selected for the machining. The tool structure is shown in Fig. 6. The parameterized equation of the cutting edge in the tool coordinate system was as follows:

Tool path programming design method
The golf-like spherical surface had a spherical surface with a certain depth of spherical dimples, so it was necessary to  process the spherical pits on the basis of the spherical surface processing. If the small pits were processed after the machining of the spherical surface, thermal errors and deflection errors would appear after the machine moved for a period of time. These conditions would inevitably lead to the appearance of tool marks, which could affect the surface accuracy. In addition, machining the sphere first and then machining small pits will also lead to the reduction of machining efficiency. Therefore, the surface feature milling of the spherical surface, the small ball pits, and the round chamfers had to be completed during the same process.
The idea of the tool path generation proposed in this paper was to use the coordinates of the small pits instead of spherical coordinates. First, the radius, depth, and location of the small pit were determined in order to get the corresponding pit center coordinates (O x , O y , O z ). Then the sphere center coordinates were set as the origin of the workpiece coordinate system. Finally, the pit coordinates were solved along the direction of the origin of the workpiece coordinate system, and the spherical coordinates were replaced. The solution process is shown in Eq. (8) and Fig. 7. Additionally, Eq. (8) was turned into Eq. (9).
In Eq. (8) and Eq. (9), the proportional coefficient k was defined. Using this coefficient, the spherical points could be replaced by pits and round chamfer characteristic points. The replacement process is shown in Eq. (10).
The (x ′ , y ′ , z ′ ) obtained with Eq. (10) was used to replace the spherical coordinates (x, y, z). Thus, the spherical tool paths with the features of pits and round chamfers were obtained. Then the spherical features were arrayed on the spherical surface according to the regular pattern. The cutting points path after the array is shown in Fig. 8.
The generated trajectory shown in Fig. 8 was the tool path of the cutting point, so it needed to be compensated for according to the radius of the milling cutter and the normal vector along the tangent plane. Since the milling cutter was tangent to the workpiece surface, the tool center compensation needed to be compensated for in three parts, as shown in Fig.  9. According to Eq. (11), the radius of the milling cutter was compensated for: In Eq. (11), x ′ , y ′ , z′ are the coordinates of the contact point between the milling cutter and the workpiece surface. x ′′ , y ′′ , z ′ ′ are the milling cutter center coordinates after the compensation. d r is the milling cutter radius. O x , O y , O z are the sphere center coordinates of the workpiece. After the golf-ball-like spherical tool path compensated for the radius of the milling cutter, the center of the milling cutter path was as shown in Fig. 10.
In Eq. (12), x ′′ , y ′′ , z ′ ′ are the central coordinates of the milling cutter after the compensation, B′ is the rake angle of the B direction, and B, C represents the coordinates of the Baxis and the C-axis. An appropriate rake angle of the B direction can effectively avoid the emergence of the singularity phenomenon.
Through the RTCP function of the machine tool, the tool center path was converted from the machine coordinate system to the workpiece coordinate system. Figure 11 shows the change of the tool axis swing form before and after the compensation.
The calculated trajectory was output according to the X, Y, Z, B, and C five-axis coordinate mode. The file was imported into the CNC system of the machine tool and then that of the machine experiments.

Selection of the processing parameters
According to the requirements of the surface roughness, the line spacing could be selected through theoretical calculations. When the contact surface between the tool and the workpiece was a plane, the relationship between the tool and the surface was as shown in Fig. 12a. The relationship between the residual height of the surface and the cutting line spacing was as follows: If the contact surface between the tool and the workpiece was inclined or spherical, a trigonometric relationship existed between the actual line spacing and the theoretical line spacing, as shown in Fig. 12b. The relationship between the surface residual height and the cutting line spacing was as follows: Because the cutting line spacing was quite small, Fig. 12b could be approximately equivalent to the calculation of Fig.  12a. The requirement of the surface roughness was 100 nm. This meant that the root mean square of all of the z parameters in a sampling area was less than 0.1 μm. Considering the influences of the cutting heat, cutting force, material properties, cutting environment, and other conditions during the machining process, the theoretical ascending distance had to be less than 30 μm to satisfy the surface quality requirements.

Machining results
The process parameters were set according to the above requirements and the conduct verification experiments on the edited tool path. First, the blank workpiece was processed by rough turning, and the machining allowance that was reserved for turning the spherical surface was 200 μm. After turning the spherical surface, the surface milling of the golf-ball-like spherical surface was performed. The milling process and the corresponding parameters are shown in Table 2.
The depth of the pit was 250 μm. At least 450 μm of the machining allowance had to be retained during the first rough machining. Due to the large machining allowance, it was necessary to perform multiple steps on the golf-ball-like spherical surface. Four milling cutters with different parameters were used for milling. Fixtures with the features of high precision and quick change were used to repeat the positions of different tools required by multiple processes.
The finishing milling of the golf-like spherical surface adopted a single arc edge milling cutter with a radius of 0.4978 mm, as shown in Fig. 6. A diamond was used for the milling cutter. The process parameters of the main finishing are presented in Table 3.
The finished part of the machining experiment is shown in Fig. 13. It can be seen from the figure that the processed sample had the characteristics of a golf-ball-like spherical surface, spherical pits, and round chamfers. The features on the sphere were distributed according to the specified laws in the program. Thus, the workpiece shown in Fig. 13 could satisfy the expected requirements, and it could prove the feasibility of the tool path method.

Analysis and discussion
In order to study the surface condition of the processed sample, a Leitz PMM-Ultra three-coordinate measuring machine was used to scan the spherical surface. The maximum allowable error of the machine was 0.4 μm. The process and results of the measurements are shown in Fig. 14.   Figure 14b shows that the scan path had a good matching degree with the theoretical model. The pits and round chamfers on the golf-ball-like spherical surface in the scanning path were reflected. Due to the complex shape of the workpiece, the benchmark was difficult to locate when scanning. Therefore, other solutions were needed to further evaluate the surface accuracy.
A white light interferometer was used to scan the golf-balllike spherical surface. First, the surface roughness of the test results was calculated. Then, the collected points were fitted to evaluate the accuracy of the surface shape. A Zygo white light interferometer 10× objective lens was used to detect the characteristic areas of the three pits. The detection positions were located in the pits of the spherical latitudes of 0°, 40°, and 80°, as shown in Fig. 15.  The microscopic appearances of the pits, round chamfers, and spherical surfaces of the three characteristic areas were detected. The detection area was 834.37 μm × 834.37 μm. The detection result is shown in Fig. 16.
The characteristics of the spherical, pits, and round chamfers were clearly visible, as shown in Fig. 16. In order to evaluate the surface accuracy of the spherical surface and the pits in the workpiece, least squares fitting was performed on the spherical surface and the pits. Since the point spacing of the white light interferometer scan result was quite dense, every five data points were taken to keep one, and 70% of the sampling center points were retained. The data points of the sphere and the pits that were collected by the white light interferometer needed to be processed with least squares fitting, as shown in Figs. 17 and 18.
The surface fitting formula is shown on the front of each figure. The number on the right side of the equal sign in each figure is the fitted radius. Based on the fitting results of the spherical surface and the pits, the fitting radius was within 5 μm of the ideal radius such that the surface shape accuracy of the surface meets the standard of micron level. Combined with the machine parameters presented in Table 1, the fitted results met the expected requirements.
Furthermore, it was necessary to evaluate the micro morphology of the workpiece. The cross-section needed to be analyzed in order to prove the relationship between the surface residual height and the cutting line spacing shown in Fig. 12. The results shown in Fig. 16a were examples to be analyzed. The comparison between the cross-section height and the theoretical value is shown in Fig. 19.
A line of cross-section data located in the middle of the data was captured, and this line was perpendicular to the cutting path. The actual and theoretical cross-section heights were compared, as shown in Fig. 19. The figure shows that the two sets of data had a high degree of matching. The actual error data was obtained from the actual data minus the theoretical data, which was compared with the theoretical errors. The relationship between the surface residual height and the Fig. 16 Golf-ball-like spherical surface detection results: a, b, c latitude 0°, 40°, and 80°spherical surfaces; d, e, f latitude 0°, 40°, and 80°pits; and g, h, i latitude 0°, 40°, and 80°round chamfers cutting line spacing was clearly reflected. The actual errors were similar to the theoretical errors and the difference between the actual errors and the theoretical errors was below 0.1 μm. The results also proved the reliability of the tool path generation method and the machining process.
It was necessary to further process the data in order to obtain the microscopic appearance clearly. Since the scanned surface was a curved surface, the scanning result needed to be filtered. The detection results were processed with a Fast Fourier Transform (FFT) to obtain the surface topography after filtering the curved surface. The size of the filtered area was 300 μm × 300 μm, as shown in Fig. 20.
The surface morphology shown in Fig. 20 was consistent with the characteristics of single-point diamond milling. The line spacing of the tool path could be clearly observed, as could the uneven shape due to the rotation of the milling spindle.
The surface roughness is an important index in ultraprecision machining. The corresponding surface roughness value Sq of each feature could be obtained through the point data after high-pass filtering in order to evaluate the surface quality. The calculation result is shown in Fig. 21. Figure 21 shows that the roughness distribution of each feature on the surface of the workpiece was as follows: spherical surface<pit<round chamfer. The main reason for this phenomenon was that during the processing of the round chamfer and the pit, the milling tool path appeared to have radial movement along the center of the milling cutter. This led to a decrease in the quality of the cutting surface. In general, the surface roughness Sq (root mean square height) of each characteristic of the golf-like spherical surface was less than 90 nm, and the surface roughness of the spherical surface was less than 30 nm. Combined with the machine tool performance and the machining parameters, the roughness of the workpiece met the expectation of the standard of nanometer level. Additionally, the result proved that the tool path generation method in this research could effectively control the surface quality.

Conclusion
A tool path generation method for an ultra-precision spherical complex surface was designed based on the ultra-precision five-axis machine tool, and a representative golf-ball-like spherical workpiece was employed as the machining object for the verification of the proposed method. Through the ultraprecision five-axis turning and milling, a golf-ball-like Fig. 17 The fitting results of the spherical points least squares: a latitude 0°spherical surface, b latitude 40°spherical surface, and c latitude 80°spherical surface spherical surface was achieved. Finally, the surface accuracy and the surface quality of the workpiece were inspected and analyzed. The conclusions were drawn as follows: (1) A tool path-generating method for ultra-precision spherical complex surface machining was proposed. The tool path-generating method could effectively improve the machining precision, and it could effectively achieve the processing of pits and round chamfers of spherical complex surfaces. Furthermore, this method could also solve the problem of tool radius compensation by using mathematical derivation. (2) Based on the ultra-precision five-axis machine tool and the generated tool paths, a complete set of golf-ball-like    spherical machining plans was formulated. After the machining, the workpiece was characterized with a threecoordinate measuring machine and a white light interferometer. The measurement results showed that the machining results had a high matching accuracy with the theoretical model. The error between the least square fitting and the theoretical value was less than 5 μm. Besides, the surface roughness within the spherical region appeared to be less than 30 nm. The method improved the surface shape accuracy to meet the standard of the micron level and surface roughness to meet the standard of the nanometer level. The reliability of the tool path generation method was verified. (3) The feasibility of the tool path-generating method was verified through processing experiments and the inspection of the processed parts. Compared with conventional commercial software, the designed toolpath generation method could effectively meet the requirements of ultra-precision machining when calculating tool paths.
Availability of data and material Not applicable.
Code availability Not applicable.
Funding This work was supported by the Science Challenge Project of China (Grant No. TZ2018006-0202-01).