Blog

An integrated method for compensating and correcting nonlinear error in five-axis machining utilizing cutter contacting point data | Scientific Reports

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Scientific Reports volume  14, Article number: 8763 (2024 ) Cite this article Fanuc Teach Pendant

An integrated method for compensating and correcting nonlinear error in five-axis machining utilizing cutter contacting point data | Scientific Reports

In current five-axis computer numerical control (CNC) machining, the use of minute linear path segments as an approximation for the ideal cutter contacting (CC) point trajectory is still prevalent. However, introducing rotation axes leads to a deviation of the actual CC point trajectory from the ideal, resulting in nonlinear errors. An integrated method is proposed in this paper for compensating and correcting both the contour error, associated with the approximation of the part surface by the ideal CC point trajectory and the nonlinear error of the CC point trajectory based on the information in the CC point data. By analyzing the spatial relationship between the tool posture and the CC point path during the five-axis linear interpolation process, two adjacent machining tool positions containing CC point data information are selected as the starting and ending points of the five-axis linear interpolation machining. The ideal tool center point and the actual CC point are calculated during the interpolation process, as well as the distance and the unit vector in the perpendicular direction between the actual CC point and the ideal CC point trajectory segment. In the comprehensive error compensation and correction phase, the obtained unit vectors are used as direction vectors for error compensation, and the tool center point during interpolation is first compensated and corrected. This ensures the actual CC point and the contour curve are on the same plane. The compensation direction for contour error is calculated using the start/end tool axis vectors and the ideal CC point trajectory vectors. The size of the contour error approximating the contour curve is calculated through the chord error. A second compensation and correction are applied to the tool center point for interpolation, ultimately achieving comprehensive compensation and correction of nonlinear errors. The data calculations were conducted in the MATLAB environment using actual machining data. After compensation and correction, the contour error was reduced by 76%, the nonlinear error of the CC point trajectory decreased to below 0.88 μm, and the comprehensive nonlinear error of the CC point trajectory was reduced from 19 to 1.5 μm, a reduction of 93%. This demonstrates significant practical value in enhancing the accuracy of five-axis CNC machining. Through actual machining verification, after using the method described in this paper, the average surface roughness decreased from 1.133 to 0.220 μm, and the maximum surface roughness decreased from 6.667 to 1.240 μm. This significantly demonstrates that the compensation and correction method proposed in this paper can significantly improve the surface quality of machined parts.

Five-axis CNC machine tools have extensive applications in aerospace, automotive, and medical devices, primarily used for machining components with complex surfaces like impeller blades, precision molds, and ship propellers1,2. Five-axis CNC machines, building upon the traditional three-axis models, incorporate two additional rotation axes and can complete multiple operations in a single clamping of the workpiece. These advantages significantly enhance the machining efficiency and precision of complex surface components3,4. However, the current five-axis CNC machining process still utilizes numerous continuous small linear path segments to approximate the contour surface curve of the workpiece, with these tiny segments forming the trajectory of the tool-workpiece CC point during five-axis CNC machining. This traditional approximation machining approach initially results in a contour approximation error. Even if the error is not considered, it will further produce the nonlinear error of the CC point trajectory caused by the introduction of the rotation axes in the five-axis CNC interpolation process5,6, which in turn reduces the machining accuracy and surface machining quality of the five-axis CNC machine tool. It can be seen that effectively reducing the nonlinear error of the CC point trajectory in five-axis CNC machining to improve the accuracy of five-axis CNC machining has gradually become a key technical problem to be solved in the field of five-axis CNC machining.

In response to the issues mentioned above, researchers domestically and internationally have extensively and deeply studied the nonlinear error problem in five-axis CNC machining and proposed various implementation methods.

Wang7 introduced the DICT (Double Interpolation algorithm based on the Cosine Theorem) method, which uses the STE (Second-order Taylor’s Expansion) method twice within one interpolation cycle, achieving minimal feed rate fluctuations within a stable consumption time. Liu8 proposed a method that uses a flat-bottom cutter to substitute the cutter envelope surface with a discrete bottom circle, iterating step errors in calculations. Chen9 modeled the nonlinear error of the tool center point, demonstrating that, within the same interpolation cycle, the tool center point lies on the same plane, thereby converting the three-dimensional problem into a two-dimensional one for research. Wang10 established a motion error model of five-axis machine tools using a method based on dual quaternions and analyzed its correlation with the PIGE (Position Independent Geometric Error) definition in ISO 230-7. Zhang11 proposed a new pre-compensation method for contour errors in five-axis CNC machine tools. This method involves fitting the machine tool’s position commands with quintic spline functions and using analytical techniques to predict the servo system’s tracking errors, thereby pre-compensating for contour errors before machining. Li12 proposed a three-parameter tool path interpolation method for five-axis machining with three-dimensional tool compensation, providing a suitable method for generating three-parameter tools in five-axis parameter interpolation. Wang13, based on HTM (Homogeneous Transformation Matrix) theory, developed an identification model for the incremental length of the double ball screw C-axis rod, mapping the relationship between the rod length increment and C-axis geometric error parameters. On this basis, five measurement trajectories were designed to identify the geometric error of the C-axis. Zhang14 introduced a BP neural network model to predict step error values. Sang15 proposed a simplified calculation model for the deviation between the ideal cutter trajectory and the actual cutter trajectory caused by the nonlinear motion of the rotary and translational axes and an improved interpolation algorithm considering geometric deviation and motion constraints, which improves the precision of machining to a certain extent. Zhang16 proposed an angle single sphere domain linear interpolation method to reduce nonlinear errors. Fu17 compensated for geometric errors by optimizing CNC codes with particle swarm optimization algorithms. Remus18 introduced a method for precisely determining errors, different from the traditional chordal deviation method, describing the exact interpolation position of the tool between two contact points. Ma19 proposed a feasible region solution for tool orientation with nonlinear error constraints, which can effectively avoid tool interference and improve machining accuracy, yet it may concurrently impact the efficiency of interpolation. Duong20 proposed an OGA (Offline Gain Adjustment) method to reduce contour errors in five-axis high-speed machining. This method optimizes servo drive control gains based on model predictive control, enhancing machining accuracy by considering machine dynamics and constraints. Chen21 proposed an innovative analytical path-reshaping model and solution algorithm for pre-compensating contour errors in multi-axis CNC machining. This approach integrates analytical prediction of contour error, optimal path reshaping, and a decoupling solution algorithm, significantly enhancing the accuracy of five-axis machining processes.

This paper distinguishes itself from existing literature by addressing not only the reduction of contour errors but also the positional errors of the CC point due to deviations of the actual CC point trajectory from the theoretical CC point trajectory. It adopts the concept of vector composition to synthesize these errors into a comprehensive nonlinear error, which is then compensated and corrected accordingly. This innovative approach allows for a more accurate and holistic error correction mechanism in multi-axis CNC machining processes. Existing research methods mainly focus on compensating and optimizing the nonlinear error of the tool center point trajectory caused by tool swinging. However, they do not consider the actual positional error of the CC point, which ultimately leads to low control of the CC point trajectory accuracy. The reason is the lack of CC point data throughout the five-axis CNC machining process, which results in insufficient data support for correcting the position of the CC point. This deficiency hinders effective compensation and correction of the CC point positional error during CNC machining trajectory interpolation. Furthermore, the absence of CC point data information also makes it challenging to carry out effective contour error compensation during the trajectory interpolation process, thereby complicating the reduction of surface contour errors on the workpiece.

The machining path of the CC point and the associated trajectory errors are investigated in this paper. A five-axis linear interpolation method is proposed to reduce CC point trajectory errors by adjusting the tool center point’s machining trajectory. In this method, the first step involves calculating the nonlinear error and contour error of the CC point trajectory. Subsequently, the positions where these errors are maximized are identified, leading to the determination of the error compensation direction unit vector. Finally, the corrected positions of the tool center points needed to minimize both types of errors are calculated. These corrected positions are used as the output locations for interpolation to control the machine tool’s position. The subsequent content of this paper primarily includes an introduction to conventional five-axis linear interpolation methods and their error analysis, as well as the presentation of the proposed five-axis linear interpolation method and its techniques for error compensation and correction.

Five-axis linear interpolation is a motion control technique used in multi-axis mechanical systems. It is primarily utilized in systems requiring complex motion paths across multiple axes, such as CNC machines and robots. Five-axis linear interpolation achieves linear movement in multidimensional space by simultaneously controlling five axes (typically three linear axes and two rotation axes). Through the collaboration of mathematical algorithms and motion controllers, five-axis linear interpolation enables synchronized and precise motion control of multiple axes, allowing mechanical systems to move along specified paths. In five-axis linear interpolation, the motion trajectory is usually composed of parameters such as target positions and the speeds of each axis. By interpolating these parameters, controllers can generate corresponding motion commands, facilitating smooth movement of the mechanical system in multidimensional space.

Currently, the five-axis linear interpolation method is achieved by data sampling between the start and endpoint of the linear path segment to be interpolated. Assuming that the coordinates of the start and endpoint of the path segment in the machine tool coordinate system are \((X_{s} ,Y_{s} ,Z_{s} ,\theta_{As} ,\theta_{Cs} )\) and \((X_{e} ,Y_{e} ,Z_{e} ,\theta_{Ae} ,\theta_{Ce} )\) , respectively, with a feed rate of f, and the CNC system interpolation cycle is T, then the total number of interpolation cycles required between the start and endpoint is:

In the formula, the operator [*] represents the function of rounding * to the nearest integer, and D denotes the total length of the path segment to be interpolated.

Based on the principle of data sampling interpolation, it is understood that the coordinates of the interpolation points between the start and endpoint can be calculated as:

In Eq. (3), xi, yi, and zi represent the target motion position coordinates of each translational axis of the machine tool for the i-th interpolation cycle, while \({\uptheta }_{{{\text{Ai}}}}\) and \({\uptheta }_{{{\text{Ci}}}}\) , respectively, represent the target motion position coordinates for the A and C rotation axes. Through the calculation of the interpolation above point position coordinates, the five interpolation motion position coordinates are transmitted to the corresponding servo drivers, ultimately achieving the synchronous joint movement of the five feed coordinate axes of the machine tool.

While interpolating in the joint space as discussed in references22,23 maximizes the reduction of nonlinear errors, our decision was based on striking a balance between computational complexity and the precision requirements of the specific machining process we studied. Interpolation in task space, although advantageous in certain scenarios, could introduce its own challenges in terms of computational demands and the complexity of implementing real-time control systems for high-speed machining.

Through the interpolation calculation process of the aforementioned conventional five-axis linear interpolation, it is known that after the combined movement of translational and rotation axes, the resulting motion trajectory at the tool will be as shown in Fig. 1. Os and Oe represent the tool center point position vectors in the workpiece coordinate system corresponding to the start point \(\left( {X_{s} ,Y_{s} ,Z_{s} ,\theta_{As} ,\theta_{Cs} } \right)\) and end point \(\left( {X_{e} ,Y_{e} ,Z_{e} ,\theta_{Ae} ,\theta_{Ce} } \right)\) of the path segment to be interpolated. Ds and De, respectively, represent the unit vectors in the direction of the tool axis at the start and endpoint. In an ideal scenario of five-axis CNC machining, the tool follows the red path depicted in Fig. 1 for cutting operations, which can produce a workpiece with a high-quality contour surface.

Generation of nonlinear error of five-axis linear interpolation.

However, due to the interconnected relationship between translational and rotation axes during the actual cutting motion, the tool performs a rotation movement around its pivot point while simultaneously translating. This leads to the tool center point actually following the black path depicted in Fig. 1 for the cutting motion. Consequently, during the interpolation process, a positional deviation \(\sigma\) occurs between the actual interpolated cutter location \(\left( {{\text{O}}_{{\text{i}}} {\text{,D}}_{{\text{i}}} } \right)\) at the i-th point and the anticipated ideal interpolated cutter location. This deviation represents the nonlinear error in the tool center point trajectory during five-axis linear interpolation.

To calculate the tool center point trajectory nonlinear error generated during conventional five-axis linear interpolation, one can first determine the tool axis point position vectors corresponding to Fig. 1, based on the tool center point position vectors at the start and endpoints.

In the above formula, L represents the total length from the tool center point to the tool rotation pivot point (swing tool length). Referring to Eq. (3), the position coordinates of the tool axis point corresponding to the i-th interpolated tool center point can be calculated as:

Utilizing the two rotation motion coordinates in Eq. (3), the unit vector of the cutter axis at the i-th interpolated tool center point can be derived as follows:

Combining Eq. (4), the expression for the position vector Oi of the i-th interpolated tool center point can be calculated as

Therefore, the nonlinear error \(\sigma_{i}\) at the i-th interpolated tool center point is the distance from point Oi to the spatial line OsOe, which can be calculated as

In Eq. (8), a = Oe − Os, b = Oi − Os.

Having discussed the errors associated with the tool center point, it is essential to now shift the focus to the trajectory errors of the CC point. Understanding the distinction between the tool center point and the CC point is crucial for a comprehensive grasp of machining accuracy. While the tool center point errors illuminate the spatial positioning of the tool itself, the CC point errors delve into the specifics of how the tool interacts with the material being machined. This aspect is vital for assessing the quality of the machined surface and the efficiency of material removal. The following discussion will explore the nuances of CC point trajectory errors, highlighting how these differ from and impact the errors associated with the tool center point. This examination is pivotal for optimizing machining processes and enhancing overall workpiece quality.

In current five-axis machining CNC programming, the common practice involves extracting several discrete data points within the permissible accuracy range on the surface contour of the workpiece to serve as CC points. These points are then connected by line segments, forming the ideal trajectory of the CC points. When this continuous ideal CC point trajectory is used as an interpolation path segment to approximate a designed curve on the workpiece contour surface (contour design curve), each interpolation path segment (the j-th segment in Fig. 2) will generate a distance error (hj in Fig. 2) relative to the contour design curve. This error, inherent in CNC programming, is defined as the CC point trajectory chord error.

Chord error in CC point trajectory.

Due to the complexity of accurately calculating the chord error in the CC point trajectory, an arc model is typically used to approximate the solution of the tool path. To calculate the chord error of the CC point trajectory, it is first necessary to determine the curvature radius of the contour design curve based on the approximate circular arc formed by three adjacent CC points. As shown in Fig. 3, \({\varvec{C}}_{s}^{j - 1}\) and \({\varvec{C}}_{e}^{j - 1}\) represent the starting and ending CC points of the j-1th interpolation path segment, while \({\varvec{C}}_{s}^{j}\) and \({\varvec{C}}_{e}^{j}\) denote the starting and ending CC points of the j-th interpolation path segment.

The curvature circle and curvature radius at the CC point.

The curvature radius \({\uprho }^{j}\) at the starting CC point of the j-th interpolation path segment can be calculated as

The chord error at this CC point can be obtained using the circular arc approximation method, as illustrated in Fig. 4.

Estimating chord error using the approximate circular arc method.

The equation,\(\Delta {\text{L}}^{j}\) represents the distance between the given CC point and its adjacent CC point, which can be calculated using the following formula:

Unlike chord error, which is caused by approximating the tool path with tiny linear segments instead of a smooth, continuous trajectory, nonlinear error arises from the tool’s oscillation or deviation from the predetermined path. During the conventional five-axis linear interpolation process, the combined movement of three translational axes and two rotation axes can cause the actual CC point’s motion trajectory to deviate from the ideal CC point trajectory, resulting in nonlinear errors in the CC point trajectory. This deviation arises because, following the linear interpolation movement through the CNC system, only the precision of the CC points at the start and endpoint can be guaranteed. It cannot ensure that the CC points, after tool rotation at intermediate interpolation points, still remain on the ideal CC point trajectory. Thus, the actual CC point trajectory between Cs and Ce (the black curve in Fig. 5) deviates from the ideal CC point trajectory (the red line segment CsCe in Fig. 5). The distance δ between the two trajectories represents the nonlinear error of the CC point trajectory.

Nonlinear error in CC point trajectory.

The conventional five-axis linear interpolation methods exhibit errors in both tool center point and CC point trajectories. Current technological approaches, due to the lack of relevant data on the CC points, are unable to effectively reduce these trajectory errors. Therefore, it is necessary to propose a new method of five-axis linear interpolation, distinct from conventional approaches, that allows comprehensive compensation and correction of both types of trajectory errors during the interpolation process. To ensure that the compensation and correction of trajectory errors are data-supported, a new five-axis linear interpolation method that incorporates CC point data is introduced in this paper.

From the cutter location file, two adjacent cutter location data are extracted. Let’s assume that the cutter location data for the cutting start and end points are respectively \(\left( {{\varvec{X}}_{{\varvec{s}}} {,}{\varvec{Y}}_{{\varvec{s}}} {,}{\varvec{Z}}_{{\varvec{s}}} {,}{\varvec{I}}_{{\varvec{s}}} {,}{\varvec{J}}_{{\varvec{s}}} {,}{\varvec{K}}_{{\varvec{s}}} {,}\user2{X^{\prime}}_{{\varvec{s}}} {,}\user2{Y^{\prime}}_{{\varvec{s}}} {,}\user2{Z^{\prime}}_{{\text{s}}} } \right)\) and \(\left( {{\varvec{X}}_{e} {,}{\varvec{Y}}_{e} {,}{\varvec{Z}}_{e} {,}{\varvec{I}}_{e} {,}{\varvec{J}}_{e} {,}{\varvec{K}}_{e} {,}\user2{X^{\prime}}_{e} {,}\user2{Y^{\prime}}_{e} {,}\user2{Z^{\prime}}_{e} } \right)\) , where (X, Y, Z) represents the coordinates of the tool center point, (I, J, K) the unit vector of the cutter axis, and (X′, Y′, Z′) the coordinates of the CC point.

Based on the structure of the five-axis CNC machine tool being used (taking an A-C type dual-rotary table CNC machine as an example), the angular displacements of the two rotation axes can always be calculated from the unit vector of the cutter axis.

Utilizing Eq. (3), the rotation motion coordinates for the i-th interpolation cycle can be calculated. By employing Eqs. (4), (5), (6), and (7), the position coordinates of the tool center point for the i-th interpolation cycle can be determined, as well as the calculation of the corresponding ideal CC point position coordinates for the i-th interpolation cycle.

As can be understood from Sect. "Conventional five-axis linear interpolation methods", the calculation of interpolation errors in conventional five-axis linear interpolation methods includes CC point data information. However, due to the lack of detailed descriptions of the CC point position data in the interpolation data, it is not feasible to calculate the position error of the interpolated CC point and the contour error, let alone carry out error compensation and correction during the interpolation process. This section will detail the derivation of the calculation of errors in the interpolation of CC points separately. Based on the calculation results, compensation and correction for the errors obtained in the workpiece coordinate system will be conducted. This ensures that errors are assessed based on the final expected geometric shape of the workpiece, thereby directly demonstrating machining accuracy from the perspective of the finished product.

Based on Eqs. (5), (6), and (7), the tool axis point vector Ti, cutter axis unit vector Di, and tool center point vector Oi for the i-th interpolation cycle can be calculated, respectively. Utilizing the coordinate vectors Oi, Ti, and Ci, the spatial relationship between the tool and the ideal CC point trajectory during the i-th interpolation cycle can be depicted, as shown in Fig. 6. This research concentrates on the application of ball end cutters in multi-axis CNC machining processes and their impact on machining accuracy. Due to their unique geometric shape, ball end cutters necessitate a different method for calculating the actual CC point compared to flat end cutters, which in turn affects the implementation of error compensation strategies.

The spatial relationship between the tool and the ideal CC point trajectory.

As can be seen from Fig. 6, the position coordinates of the ball center point can be expressed as

where r is the tool radius. Magnifying a section of Fig. 6 results in the enlarged view of the entire path segment interpolation as shown in Fig. 7.

Local magnification during full path segment interpolation.

A perpendicular line \({\mathbf{t}}_{i} {\mathbf{C^{\prime}}}_{ri}\) is drawn from the ball center point ti to the line segment CsCe, with the foot of perpendicular being the point \({\mathbf{C^{\prime}}}_{{{\mathbf{ri}}}}\) . The perpendicular line \({\mathbf{t}}_{{\mathbf{i}}} {\mathbf{C^{\prime}}}_{{{\mathbf{ri}}}}\) intersects the cutter edge contour line at Cri. The intersection point Cri represents the nearest point to the ideal trajectory of the CC point CsCe, and it is considered the actual CC point. The unit vector B in the direction of nonlinear error compensation and correction can be calculated as

In the above equation, \({\mathbf{d}} = {\mathbf{t}}_{i} - {\mathbf{C}}_{{\mathbf{s}}}\) , \({ \mathbf{e}} = {\mathbf{C}}_{e} - {\mathbf{C}}_{s}\) .

Assuming the foot of the perpendicular \({\mathbf{C^{\prime}}}_{{{\mathbf{ri}}}} = (X^{\prime}_{c} ,Y^{\prime}_{c} ,Z^{\prime}_{c} )\) , based on the equation of the linear path segment CsCe of the CC point

The equation of the plane passing through a point \({\mathbf{t}}_{i} = (X^{\prime}_{o} ,Y^{\prime}_{o} ,Z^{\prime}_{o} )\) and perpendicular to the line CsCe can be derived as

By combining Eqs.(16) and (17), the foot of perpendicular \({\mathbf{C^{\prime}}}_{{{\mathbf{ri}}}}\) can be calculated.

Using Eq. (18), the actual CC point position vector for the i-th interpolation cycle can be calculated.

Therefore, the position error at the interpolated CC point can be calculated as

For the contour design curve represented by the red line in Fig. 8, an approximate calculation process for the contour error at the CC point within any interpolation cycle can be performed as follows:

Approximate calculation of contour error.

The chord error h at the midpoint of the segment CsCe is approximated as the maximum error.A perpendicular line \({\mathbf{C^{\prime}}}_{{{\mathbf{ri}}}} {\mathbf{C^{\prime\prime}}}_{{{\mathbf{ ri}}}}\) is drawn from the point \({\mathbf{C^{\prime}}}_{{{\mathbf{ri}}}}\) to the segment CsCe, intersecting the contour design curve at the point \({\mathbf{C^{\prime\prime}}}_{{{\mathbf{ri}}}}\)The unit vector E is directed from \({\mathbf{C^{\prime\prime}}}_{{{\mathbf{ri}}}}\) towards \({\mathbf{C^{\prime}} }_{{{\mathbf{ri}}}}\) is calculated as:

In Eq. (20), Ds and De, respectively, represent the unit vectors of the cutter axis at the start and endpoints.

The length of the segment \({\mathbf{C}}_{{\mathbf{s}}} {\mathbf{C^{\prime}}}_{{{\mathbf{ri}}}}\) can be calculated as

In Eq.(21),\(\left| {{\mathbf{C}}_{{{\mathbf{ri}}}} - {\mathbf{C^{\prime}}}_{{{\mathbf{ri }}}} } \right|.=\delta_{i}\) .

From the proportional relationship between the sides of similar triangles, it is known that

In Eq. (22), h represents the chord error of the interpolation path segment, which can be obtained by calculating using Eq. (10). Further, the contour error γi at the i-th interpolated CC point can be calculated as:

In Fig. 8, βi represents the combined nonlinear interpolation error formed by the contour error and the position error of the CC point at the i-th interpolated point, which can be calculated using the following formula.

By substituting Eqs. (15), (19), (20), and (23) into Eq. (24) and rearranging, the following can be obtained.

The unit vector F for the direction of compensation and correction of the comprehensive interpolation error is:

Based on Eqs. (25) and (26), the coordinates of the tool center point of the new interpolated point after compensation can be calculated.

By substituting Eqs. (24) and (26) into Eq. (27), the following can be obtained:

The calculation process for the comprehensive compensation and correction of interpolation nonlinear errors is now summarized and illustrated in Fig. 9.

Comprehensive compensation and correction process for interpolation error.

Using C++ to read the cutter location file generated by UG (Unigraphics), the nine coordinates of discrete data are extracted. The curvature radius at each point is calculated using Eq. (9), and then the chord error at each point is determined using the approximate circular arc method. By selecting adjacent cutter location data, the actual coordinates of the tool center point are calculated, followed by determining the actual CC point coordinates. Using Eqs. (15) and (19), the magnitude of the positional error at the CC point and the unit vector for error correction are calculated sequentially. Then, the compensation direction of the contour error is determined using the start/end tool axis vectors and the ideal CC point trajectory vectors. The magnitude of the contour error approximating the contour curve is calculated through chord error, and unit vectors for correcting both types of errors are assigned their respective magnitudes for vectors synthesis. Using Eqs. (24) and (26) are used in sequence to calculate the magnitude of the combined nonlinear error at the CC point and the unit vector for the error correction position. A comprehensive correction is then applied to the tool center point to obtain new tool center point coordinates. These new coordinates, along with the rotation axes information, are transmitted to the controllers of the five feed axes. The process continues in a loop until the endpoint is reached, checking at each iteration whether the endpoint has been achieved.

Utilizing UG/NX, a spatial freeform surface as shown in Fig. 10 is modeled. In the CAM module, the surface is processed with a discrete tolerance of 3 μm to obtain the required CC point trajectory for machining the surface, as indicated by the red curve in Fig. 10. One of the CC point trajectories (as shown by the blue dot sequence of discrete CC points in Fig. 10) is selected for interpolation calculations and comprehensive nonlinear error compensation and correction. This is done to verify the effectiveness of the methods presented in this paper in reducing contour errors and nonlinear errors in the CC point trajectory. The extracted CC point trajectory consists of 85 points. The corresponding machining cutter location data in the workpiece coordinate system is listed in Table 1. After post-processing calculations, the five-coordinate G01 interpolation instruction data in the machine tool coordinate system can be obtained (Table 2). The complete versions of Tables 1 and 2 are included in the Supplementary material as Supplementary Table S1 and Supplementary Table S2, respectively.

Using Eq. (11), the distance between adjacent CC points on the trajectory shown in Fig. 10 can be calculated. Then, based on Eqs. (9) and (10), the approximate curvature radius and chord error at each CC point on this trajectory can be determined. Based on these calculations, the distance, curvature radius, and chord error data curves at each CC point are plotted respectively as shown in Figs. 11 and 12. It can be observed that to ensure the chord error in approximating the contour of freeform surfaces remains within the tolerance range, at areas with smaller curvature radii, the distance between adjacent CC points is also smaller. A dense CC point approximation approach is adopted to reduce chord error. Conversely, in areas with larger curvature radii, the distance between CC points is increased, utilizing a sparse CC point approximation to improve machining efficiency.

Spacing distance between the adjacent CC points.

Chord error and curvature radius at the all CC points.

Using Eq. (3), the conventional five-axis linear interpolation for the commands in Table 2 is calculated (assuming an interpolation cycle T = 2 ms and feed rate f = 250 mm/min). Then, based on Eqs. (8) and (19), the nonlinear error in the tool center point position and the positional error at the CC point for each interpolation cycle are calculated. The trajectory error curve is shown in Fig. 13, where the blue curve represents the error of the tool center point and the red curve represents the error of the CC point. It is evident that during the processing of the data in interpolation Table 2, the tool’s swing results in significant positional deviation of the tool center point, with a maximum value reaching 21 μm. With the increase in trajectory error of the tool center point, the positional error of the CC point also grows incrementally. It can be observed that the magnitude of their errors is not significantly different, due to the small distances and angular differences between the start and end points of each interpolation path segment in Table 2. During linear interpolation between these points, the movement between adjacent interpolated CC points can be approximated as micro translational movement, leading to a similarity in the magnitude of errors at the interpolated CC point and the tool center point. However, a detailed observation around interpolated CC point number 120 in Fig. 13 shows that there are still slight differences in their error magnitudes, as depicted in Fig. 14.

Trajectory error curves of the tool center points and the CC points.

Local amplification of the two trajectory error curves.

To illustrate scenarios where the positional error of the CC point significantly differs from that of the tool center point, data from Table 3 is presented in this paper. The data in Table 3, obtained through post-processing calculations, represents the five-coordinate G01 interpolation instruction data in the machine tool coordinate system. The distance and angular difference between the start and endpoints of the interpolation path segments are 2.162 mm and 5.0008°/8.877°, respectively, which are significantly larger than the data listed in Table 2. Figure 15 shows the positional error data curve of the CC point when the tool center point moves along the ideal tool center point trajectory. Figure 15 indicates that the positional error of the CC point relative to the tool center point can reach a maximum of 15.3 μm. This demonstrates that when the movement between any adjacent interpolated CC points cannot be approximated as microscopic translation, the positional error of the CC point relative to the tool center point is significant and cannot be ignored. Therefore, it is necessary to consider both tool center point trajectory error and CC point trajectory error for compensation and correction when performing nonlinear error compensation.

Position error curve of the interpolated CC points between the adjacent CC points with large spacing distance.

Further, using Eq. (23), the contour error at all interpolated CC points during the conventional five-axis linear interpolation process can be calculated. The data curve of the error is plotted as shown in Fig. 16. It is evident that the contour error at each interpolated CC point fluctuates within the range of the chord error, indicating that the conventional five-axis linear interpolation method cannot adequately address the chord error issue when the CC point trajectory approximates the contour design curve. For subsequent comprehensive compensation and correction of the nonlinear error, Eq. (25) can be used to combine the CC point position error from Fig. 13 and the CC point contour error from Fig. 16. This allows for the calculation of the comprehensive nonlinear error that needs to be compensated and corrected at each interpolated CC point, with its error curve depicted in Fig. 17. The maximum comprehensive nonlinear error of the interpolated CC points can reach 19um. Since the positional error at the interpolated CC points is significantly larger than the contour error, the difference in magnitude between the comprehensive nonlinear error and the positional error is not pronounced after the vector synthesis calculation, with only minor differences.

Contour error curve of the interpolated CC points without compensating and correcting.

Comprehensive nonlinear error curve of the interpolated CC points without compensating and correcting.

Following the method of comprehensive compensation and correction of nonlinear errors described in Sect. “Five-axis linear interpolation method incorporating CC points”, Eq. (28) is used to adjust the position of the tool center point while simultaneously readjusting the CC point position. Then, using Eqs. (19) and (23), the curves for the CC point position error and contour error after compensation and correction are plotted (Figs. 18 and 19). A comparison with Figs. 13 and 16 shows that after adjusting the CC point position, the maximum nonlinear error in the CC point trajectory can be reduced from 21 to 0.88 μm, a decrease of 96%; the maximum contour error can also be reduced from 2.8 to 0.69 μm, a reduction of 76%, achieving better machining results than the preset tolerance of 3 μm.

Position error curve of the interpolated CC points using compensation and correction method.

Contour error curve of the interpolated CC points using compensation and correction method.

Using Eq. (25), the curve for the comprehensive nonlinear error after compensation and correction is plotted (Fig. 20). The maximum comprehensive nonlinear error of the interpolated CC points can reach 1.5 μm. Comparing with Fig. 17, it is evident that after the adjustment of the CC point position, the comprehensive error is reduced from 19 to 1.5 μm, with the reduction also reaching 93%. After zooming in on the trajectory between CC points 32 and 33, the resulting image, shown as Fig. 10, displays the CC point trajectories: the blue line represents the trajectory before compensation, the black line represents the trajectory after compensation, and the red line represents the ideal CC point trajectory. Using the method from reference24, we obtained the compensated comprehensive nonlinear error as shown in Fig. 21. This approach only accounted for contour errors, neglecting the positional errors caused by tool deflection. Consequently, the maximum comprehensive nonlinear error after compensation was 3.94 μm, which exceeds the machining tolerance of 3 μm. In contrast, the method proposed in this paper successfully meets the tolerance requirement, with the maximum compensated comprehensive nonlinear error also within limits. A comparison indicates that the method proposed in this paper has good machining accuracy.

Comprehensive nonlinear error curve after compensation and correction using the method proposed in this paper.

Comprehensive nonlinear error curve after compensation and correction using the method from reference24.

The above only involves linear interpolation machining for a specific curve. Next, the entire surface shown in Fig. 10 will be processed through linear interpolation. Based on the coordinates of the interpolation points and the error values, a four-dimensional surface will be generated. This surface will be displayed using a mesh grid, and the grid will be colored according to the error values of each point to more intuitively present the effects before and after compensation. Figure 22a shows the comprehensive nonlinear error of CC points before compensation, with a maximum error of 60.5 μm; Fig. 22b shows the comprehensive nonlinear error of the interpolated CC points after compensation and correction using the method described in this paper, with a maximum error of 2.82 μm; Fig. 22c shows the comprehensive nonlinear error of the CC points after correction using the method proposed in reference 24, with a maximum error of 6.02 μm. The experimental results demonstrate that the compensation and correction of CC points proposed in this paper can significantly reduce errors.

Four-dimensional surface plot before and after compensation.

To verify the total amount of nonlinear error and compensation methods in this paper, the experiment utilized the spatial freeform surface shown in Fig. 10 for actual machining. The processing was conducted on T-6045 and V-1160 machines using the FANUC-0i MD system, comprising three stages: rough machining, semi-finishing, and finishing. A 65 mm*15 mm*15 mm aluminum 6061 workpiece was used. Initial rough machining and semi-finishing were performed on the T-6045 machine using a 10 mm diameter flat end mill for roughing, followed by a 4 mm diameter flat end mill and ball end mill for semi-finishing to achieve the basic shape. Finally, finishing was carried out on the V-1160 machine, using the method proposed in this paper as well as the traditional method without compensation for comparison. A 4 mm diameter ball end mill was used with an interpolation cycle T = 2 ms and a feed rate f = 250 mm/min. The machining process are shown in Fig. 23.

The machining process of spatial freeform surface (a) T-6045 and V-1160 machines (b) workpiece and base (c) rough machining and semi-finishing (d) finish machining (e) after machining.

As shown in Fig. 24, the surface roughness of the machined surface was measured using the SRA series surface roughness tester. The machining result without compensation, as shown in Table 4, had an average surface roughness of 1.133 μm and a maximum surface roughness of 6.667 μm. After machining with the nonlinear error comprehensive compensation method proposed in this paper, the surface roughness obtained is shown in Table 4. The average surface roughness was reduced to 0.220 μm, and the maximum surface roughness was decreased to 1.240 μm. In comparison, the compensation and correction methods adopted in this paper significantly improved the machining effect and quality of the parts. Figure 25 shows a comparative diagram of the machined workpieces before and after compensation and correction. The close-up view is a magnified image using a stereomicroscope, which also demonstrates that the method proposed in this paper significantly improved the machining precision of the parts.

Measuring the roughness of machined parts with the SRA series surface roughness tester.

Comparison of machined workpieces before and after compensation and correction.

The mechanism of chord error generation at interpolated CC points is analyzed in this paper, and a method for calculating the chord error of interpolation points by using an approximate circular arc approach is proposed; It also analyzes the mechanisms of trajectory errors at interpolated tool center points and positional errors at CC points, proposing a method to determine the actual CC points based on the current actual interpolated tool center points.

The introduction of contour error combines the CC point contour error with the positional error of the CC point during interpolation into a comprehensive nonlinear error. A method for calculating the magnitude and compensation direction of this error has been proposed and implemented, resulting in new coordinates for the interpolated tool center point.

Using Matlab, the curves of comprehensive nonlinear error data before and after correction were plotted. After compensation and correction, the contour error was reduced by 76%, and the nonlinear error of the CC point trajectory was reduced to below 0.88 μm. The comprehensive nonlinear error of the CC point trajectory decreased from 19 to 1.5 μm, a reduction of 93%. And the entire surface underwent simulation calculations, with the nonlinear error after compensation also meeting the machining tolerance of 3 μm. Finally, using this comprehensive compensation method for nonlinear errors in actual machining, the average surface roughness was reduced from 1.133 to 0.220 μm, and the maximum surface roughness was reduced from 6.667 to 1.240 μm. This method significantly reduces the interpolation error of the CC point position and the comprehensive nonlinear error, and it has important practical value in improving the accuracy of CC point trajectory control in five-axis CNC machining.

However, the main focus of this study is on the impact of CC point trajectory error on the precision of five-axis CNC machining. Additionally, the influence of other error sources on the precision of five-axis CNC machining will be analyzed and discussed in future research.

Main data generated or analyzed during this study are included in this article. All data in this article are available from the corresponding author on reasonable request.

The vector pointing from the initial tool center point position vector to the terminal tool center point position vector. a = Oe − Os

The vector pointing from the initial tool center point position vector to the i-th interpolated tool center point position vector. b = Oi − Os

The total length of the path segment to be interpolated.

The unit vector in the direction of the tool axis at the start point.

The unit vector in the direction of the tool axis at the end point.

The unit vector in the direction of the tool axis at the i-th interpolation point under ideal conditions.

The unit vector in the direction of the tool axis at the i-th interpolation point under actual conditions.

The total number of interpolation cycles required between the start and endpoint

The position vector of the initial tool center point in the workpiece coordinate system.

The position vector of the terminal tool center point in the workpiece coordinate system.

The ideal position vector of the i-th interpolated tool center point in the workpiece coordinate system.

The actual position vector of the i-th interpolated tool center point in the workpiece coordinate system.

The CNC system interpolation cycle

The position vector of the initial tool axis point.

The position vector of the terminal tool axis point.

The ideal position vector of the i-th interpolated tool axis point

The actual position vector of the i-th interpolated tool axis point

The start point of the path segment in the machine tool coordinate system

The end point of the path segment in the machine tool coordinate system

The target motion position coordinates of each translational axis of the machine tool for the i-th interpolation cycle

The i-th interpolated tool center point

The target motion position coordinates for the A and C rotation axes

The nonlinear error in the tool center point trajectory during five-axis linear interpolation.

The nonlinear error at the i-th interpolated tool center point

Kumar, S. L. State of the art-intense review on artificial intelligence systems application in process planning and manufacturing. Eng. Appl. Artif. Intell. 65, 294–329 (2017).

Zirak, N., Shirinbayan, M., Deligant, M. & Tcharkhtchi, A. Toward polymeric and polymer composites impeller fabrication. Polymers 14(1), 97 (2021).

Article  PubMed  PubMed Central  Google Scholar 

Xiang, S. & Altintas, Y. Modeling and compensation of volumetric errors for five-axis machine tools. Int. J. Mach. Tools Manuf. 101, 65–78 (2016).

Zhang, S., Zhou, Y., Zhang, H., Xiong, Z. & To, S. Advances in ultra-precision machining of micro-structured functional surfaces and their typical applications. Int. J. Mach. Tools Manuf. 142, 16–41 (2019).

Jung, H. C., Hwang, J. D., Park, K. B. & Jung, Y. G. Development of practical postprocessor for 5-axis machine tool with non-orthogonal rotary axes. J. Cent. South Univ. Technol. 18, 159–164 (2011).

Li, Y. Q., Chen, Y. X. & Chen, Q. Research on nonlinear error analysis and overproof processing method in five-axis NC machining with dual turntable. Appl. Mech. Mater. 121, 3662–3666 (2012).

Wang, T. Y., Zhang, Y. B., Dong, J. C., Ke, R. J. & Ding, Y. Y. NURBS interpolator with adaptive smooth feedrate scheduling and minimal feedrate fluctuation. Int. J. Precis. Eng. Manuf. 21, 273–290 (2020).

Liu, W. et al. Five-axis iso-error numerical control tool path generation for flat-end tool machining sculptured surface. Int. J. Adv. Manuf. Technol. 119(11–12), 7503–7516 (2022).

Chen, L., Tang, J., Wu, W. & Wei, Z. Nonlinear error compensation based on the optimization of swing cutter trajectory for five-axis machining. Int. J. Adv. Manuf. Technol. 124(11–12), 4193–4208 (2023).

Wang, H., Jiang, X. & Li, M. Identification and compensation machining evaluation of position-independent geometric error of dual rotation axes. Int. J. Adv. Manuf. Technol. 129(5–6), 2783–2799 (2023).

Zhang, K., Yuen, A. & Altintas, Y. Pre-compensation of contour errors in five-axis CNC machine tools. Int. J. Mach. Tools Manuf. 74, 1–11 (2013).

Li, C., Zhang, B., Wang, X., Liu, Q. & Liu, H. Triple parametric tool path interpolation for five-axis machining with three-dimensional cutter compensation. Adv. Mech. Eng. 10(9), 1687814018798229 (2018).

Wang, P., Fan, J., Zhao, Q. & Wang, J. An approach for improving machining accuracy of five-axis machine tools. Int. J. Adv. Manuf. Technol. 121(5–6), 3527–3537 (2022).

Zhang, Z. Y., Liu, W., Li, P. F., Zhang, J. P. & Fan, L. Y. A numerical control machining tool path step error prediction method based on BP neural network. Sci. Rep. 13(1), 16347 (2023).

Article  ADS  CAS  PubMed  PubMed Central  Google Scholar 

Sang, Y., Yao, C., Lv, Y. & He, G. An improved feedrate scheduling method for NURBS interpolation in five-axis machining. Precis. Eng. 64, 70–90 (2020).

Zhang, K., Zhang, L. & Yan, Y. Single spherical angle linear interpolation for the control of non-linearity errors in five-axis flank milling. Int. J. Adv. Manuf. Technol. 87, 3289–3299 (2016).

Fu, G., Fu, J., Shen, H., Yao, X. & Chen, Z. NC codes optimization for geometric error compensation of five-axis machine tools with one novel mathematical model. Int. J. Adv. Manuf. Technol. 80, 1879–1894 (2015).

Tutunea-Fatan, O. R. & Feng, H. Y. Determination of geometry-based errors for interpolated tool paths in five-axis surface machining. J. Manuf. Sci. Eng. 127(1), 60–67 (2005).

Ma, J. W., Chen, S. Y., Li, G. L., Qu, Z. W. & Lu, X. Study on tool orientation feasible region with constraint of non-linear error for high-precision five-axis machining. Int. J. Adv. Manuf. Technol. 106, 4169–4181 (2020).

Duong, T. Q., Rodriguez-Ayerbe, P., Lavernhe, S., Tournier, C. & Dumur, D. Contour error pre-compensation for five-axis high speed machining: Offline gain adjustment approach. Int. J. Adv. Manuf. Technol. 100, 3113–3125 (2019).

Chen, M., Sun, Y. & Xu, J. A new analytical path-reshaping model and solution algorithm for contour error pre-compensation in multi-axis computer numerical control machining. J. Manuf. Sci. Eng. 142(6), 061006 (2020).

Annoni, M., Bardine, A., Campanelli, S., Foglia, P. & Prete, C. A. A real-time configurable NURBS interpolator with bounded acceleration, jerk and chord error. Comput. Aided Des. 44(6), 509–521 (2012).

Sun, Y., Jia, J., Xu, J., Chen, M. & Niu, J. Path, feedrate and trajectory planning for free-form surface machining: A state-of-the-art review. Chin. J. Aeronaut. 35(8), 12–29 (2022).

Li, J., You, Z., Li, Y., Miao, E. & Yue, R. Five-axis contour error control based on spatial iterative learning. IEEE Trans. Autom. Sci. Eng. 20(1), 112–123 (2022).

The authors would like to acknowledge and express their gratitude for the contributions of all individuals who provided assistance, guidance, or support during the course of this research.

Funding information: This research was supported by National Natural Science Foundation of China under Grant (No.52365062).

Key Laboratory of Advanced Manufacturing and Automation Technology (Guilin University of Technology), Education Department of Guangxi Zhuang Autonomous Region, Guilin, 541006, China

Liangji Chen, Haohao Xu, Qiang Huang & Pengcheng Wang

You can also search for this author in PubMed  Google Scholar

You can also search for this author in PubMed  Google Scholar

You can also search for this author in PubMed  Google Scholar

You can also search for this author in PubMed  Google Scholar

The overarching research goals were developed by L.C., and H.X. L.C., and H.X. proposed the correction method and calculated the positional coordinates of the CC point after compensation and correction. L.C., H.X., and Q.H., analyzed the calculated results. The initial draft of the manuscript was written by L.C., H.X., Q.H., and P.W.

The authors declare no competing interests.

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

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/.

Chen, L., Xu, H., Huang, Q. et al. An integrated method for compensating and correcting nonlinear error in five-axis machining utilizing cutter contacting point data. Sci Rep 14, 8763 (2024). https://doi.org/10.1038/s41598-024-59458-w

DOI: https://doi.org/10.1038/s41598-024-59458-w

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.

Scientific Reports (Sci Rep) ISSN 2045-2322 (online)

An integrated method for compensating and correcting nonlinear error in five-axis machining utilizing cutter contacting point data | Scientific Reports

Electromagnetic Motor Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.