NURBS Interpolator with Minimum Feedrate Fluctuation Based on Two-Level Parameter Compensation

Feedrate plays a crucial role in determining the machining quality, tool life, and machining time. Thus, this research aimed to improve the accuracy of NURBS interpolator systems by minimizing feedrate fluctuations during CNC machining. Previous studies have proposed various methods to minimize these fluctuations. However, these methods often require complex calculations and are not suitable for real-time and high-precision machining applications. Given the sensitivity of the curvature-sensitive region to feedrate variations, this paper proposed a two-level parameter compensation method to eliminate the feedrate fluctuation. First, in order to address federate fluctuations in non-curvature sensitive areas with low computational costs, we employed the first-level parameter compensation (FLPC) using the Taylor series expansion method. This compensation allows us to achieve a chord trajectory for the new interpolation point that matches the original arc trajectory. Second, even in curvature-sensitive areas, feedrate fluctuations can still occur because of truncation errors in the first-level parameter compensation. To address this, we employed the Secant-based method for second-level parameter compensation (SLPC), which does not require derivative calculations and can regulate feedrate fluctuation within the fluctuation tolerance. Finally, we applied the proposed method to the simulation of butterfly-shaped NURBS curves. These simulations demonstrated that our method achieved maximum feedrate fluctuation rates below 0.01% with an average computational time of 360 us, which is sufficient for high-precision and real-time machining. Additionally, our method outperformed four other feedrate fluctuation elimination methods, highlighting its feasibility and effectiveness.


Introduction
In computer-aided manufacturing, Non-Uniform Rational B-Spline (NURBS) interpolation is used to generate a toolpath for the CNC machining of parts. Feedrate is an important parameter that needs to be carefully controlled during machining, as it affects not only the quality and accuracy of the machined part but also the tool life and the time required for machining. The feedrate of CNC machines is determined based on the NURBS curve and the cutting parameters such as spindle speed, depth of cut, and feed per tooth. However, the feedrate can fluctuate because of irregularities in the NURBS curve, which can result in unwanted effects such as tool vibration, chatter, and excessive tool wear. Therefore, minimizing feedrate fluctuations in the NURBS interpolation process is essential to attain high-precision and high-quality machined parts. Since NURBS curves are constructed piecewise using B-spline basis functions, the solution of curve trajectory points, the calculation of curve arc length, the derivation of NURBS curves, and the calculation of curvature surfaces have high computational loads. In particular, there is a nonlinear mapping relationship between the curve parameters and the arc length because of the segmented structure of the NURBS curve. ever, this method only considers the truncation error, and obtaining satisfactory results using the approximate method in the solution process is challenging. Super-resolution techniques [35,36] can be applied to the interpolated curves to enhance their resolution and improve their smoothness and curvature continuity. it is possible to improve the accuracy, precision, and overall quality of the interpolated curves, resulting in better performance and increased efficiency in various applications. However, super-resolution can bring a high computational load.
To improve the accuracy of NURBS interpolator systems and minimize feedrate fluctuations during CNC machining, a two-level parameter compensation strategy is proposed. The corresponding feedrate fluctuation methods are designed for different regions according to the curvature characteristics, which can greatly reduce the feedrate fluctuation rate on the premise of ensuring real-time performance. The first-level parameter compensation is employed in the non-curvature sensitive area to control the feedrate fluctuation of the interpolation. In the curvature-sensitive area, the second-level parameter compensation is adopted after the first-level parameter compensation to overcome the problem of large federate fluctuations caused by large curvature. This strategy raises the tolerated time load and cannot affect the interpolator's real-time performance. It generally utilizes the fact that feedrate changes are more noticeable in the curvature-sensitive area.
The novelty of the proposed two-level parameter compensation method lies in (1) proposing a two-level parameter compensation method specifically for NURBS interpolation to minimize feedrate fluctuation and improve machining quality, which utilizes the Taylor series expansion method in the first level and an iterative method without derivative calculations in the second level; (2) developing a novel approach for reducing feedrate fluctuation that considers the sensitivity of the curvature-sensitive areas, which can result in significant improvements in the quality of the final product; And (3) demonstrating the effectiveness of the proposed method through simulation studies and experiments, which show that the maximum feedrate fluctuation rate is below 0.01% with an average computational time of 360 us and that the proposed method outperforms other feedrate fluctuation elimination methods. Overall, the minimization of feedrate fluctuations is a novel contribution that can be applied to various applications, including those that require high precision and accuracy in motion control systems, such as 3D printing, CNC machining, and robotics.
The main contributions of this paper can be summarized as follows: (1) We focused on the critical role of curvature in feedrate fluctuation, proposed the concept of the curvature-sensitive area, and divide the NURBS curve into curvaturesensitive areas and non-curvature-sensitive areas according to the curvature threshold to adapt to the curvature variations; (2) A NURBS interpolator with minimum feedrate fluctuation based on two-level parameter compensation was proposed; (3) The first-level parameter compensation based on Taylor series expansion was employed in the non-curvature-sensitive area; the second-level parameter compensation based on Secant method was employed in the curvature-sensitive area. Compared with the other four methods for eliminating feedrate fluctuation, the proposed method performed best and controlled the feedrate fluctuation within the standard range.
The remainder of this paper is structured as follows. Section 2 introduces the NURBS interpolation and feedrate fluctuation. Section 3 describes the feedrate fluctuation elimination method based on the two-level parameter compensation. The simulation results of applying the suggested method on NURBS curves with a butterfly shape are presented in Section 4. Finally, conclusions and future aspects are presented in Section 5.

The NURBS Curve and Parameter Discretization
NURBS curves are often expressed in the following rational fractional form [1]: where P i is the control point, ω i is the weight of P i , u is the non-uniform knot vector, and N i,k (u) is the kth-order B-spline basic function.
Determining the curve parameter u for every interpolation period in the NURBS curve interpolation process is essential. The definition of the NURBS curve gives a deterministic mathematical expression for the free curve. Therefore, the key function of the NURBS interpolator is to discretize the curve parameter u and obtain the coordinates of interpolation point C(u) that meet the requirements of dynamic and motion characteristics.
The Taylor expansion approach effectively creates commands in general motion systems to discretize the curve parameter. By applying the Taylor expansion on the function u(t) at t = t i and ignoring the higher-order terms, the First-order Taylor expansion method can be expressed as Additionally, the Second-order Taylor expansion method can be written as Then, the curve velocity v(u i ) can be derived as Since the curve parameter discretization by Taylor expansion approximation ignores the higher-order terms, there is a deviation between the discretized and actual values of u. Subsequently, this will cause a bias between the expected and actual arc lengths. Therefore, according to Equation (4), the bias of the arc length will cause a deviation between the interpolation and actual velocities.
Besides, the CNC interpolation trajectory comprises micro-straight lines fed at v(u i ) per cycle. There is a gap between the feed micro-line and the planned arc trajectory, called the chord error. If the feedrate v(u i ) is inappropriate, it might become unsatisfactory. Throughout the interpolation procedure, the curve velocity v(u i ) must be modified adaptively depending on the curvature to maintain the chord error within a tolerance range. As shown in [37], the adaptive velocity corresponding to the maximum chord error can be obtained as: where k i is the curvature of the current interpolation point v(u i ). The interpolation feedrate cannot always be constant since the velocity is adaptively altered in response to curvature changes. Set the given maximum feedrate to F, then we can get Substituting Equation (6) into Equation (2) yields the first-order adaptive-feedrate method (FAM): Substituting Equation (6) into Equation (3) yields the second-order adaptive-feedrate method (SAM): The interpolation parameter u pre,i+1 of the next point is first predicted according to the current adaptive velocity v(u i ) and the interpolation period by FAM or SAM. SAM has one more item than FAM, with higher calculation accuracy, while FAM should calculate the second-order derivative, which has higher calculation complexity.

Feedrate Fluctuation Analysis
Feedrate fluctuation, resulting from a nonlinear correspondence between the curve parameters and the arc length displacement, is the difference between the desired and actual feed rates. The actual feedrate during the interpolation process can be expressed as [34] . s = (ds/dt) where s is the actual arc length, C (u) is the derivative of the NURBS curve, is the Euclidean norm,û is the predicted parameter, and s d is the desired arc length.
There is no accurate analytical expression for the NURBS curve's parameters and arc length because of their unique definitions in Equation (1). The acquisition of the predicted parameterû generally adopts an approximate method (such as FAM or SAM). Because of the deviation of the estimated parameterû from the actual value, the arc displacement along the curved path is inaccurately mapped to the spline parameters, causing the term C (u) · (dû/ds d ) not to be equal to 1. Consequently, the inequality According to Figure 1, A and B represent the actual ith point and the predicted (i + 1)th point. AB and AB are the arc and chord lengths, respectively. The arc length between A and B is S i+1 , and the chord length AB is l i+1 . When the arc length is tiny enough, a circle with the same curvature can approximate it. R i is the curvature radius at point A.
Interpolation feedrate can be obtained as The theoretical feedrate can be calculated as For the path with nonzero curvatures, as depicted in Figure 1, the expression l i+1 = S i+1 holds, which results in v i+1 = v i+1 . Consequently, feedrate fluctuations during the NURBS curve interpolation may result from discrepancies between the actual and predicted trajectories. Interpolation feedrate can be obtained as The theoretical feedrate can be calculated as For the path with nonzero curvatures, as depicted in Figure 1 . Consequently, feedrate fluctuations during the NURBS curve interpolation may result from discrepancies between the actual and predicted trajectories.
Thus, the feedrate fluctuations rate of the (i + 1) th interpolation point can be defined as 11 1 1 It can be rewritten as From Figure 1, according to the relationship between arc length and radian, it can be obtained as is the curvature radius at point A In (14), the arcsine term can be roughly calculated using the Maclaurin series, which is written as Substituting Equation (15) into Equation (14) yields Thus, the feedrate fluctuations rate of the (i + 1)th interpolation point can be defined as It can be rewritten as From Figure 1, according to the relationship between arc length and radian, it can be obtained as R i is the curvature radius at point A In (14), the arcsine term can be roughly calculated using the Maclaurin series, which is written as Substituting Equation (15) into Equation (14) yields Substituting Equation (16) into Equation (13) gives Equation (17) shows that the curvature radius change directly determines the feedrate fluctuation's magnitude.
As the reciprocal of the curvature equals the curvature radius, R i = 1 k(u i ) R holds, where k(u i ) is the curvature obtained as follows: where the first and second-order derivatives of the current point are denoted by C (u i ) and C (u i ), respectively. Equation (17) can be rewritten as Under the same actual interpolation trajectory length l, it can be concluded from Equation (19) that greater curvature leads to more significant feedrate fluctuations. After eliminating the feedrate fluctuations, it is necessary to take corresponding measures combined with the curvature properties.

Two-Level Parameter Compensation
In this research, we aimed to address the issue of feedrate fluctuations that occur during NURBS interpolation. Such fluctuations can significantly impact the quality, accuracy, and efficiency of Computer Numerical Control (CNC) machining processes. Although various methods have been proposed in previous studies to reduce these fluctuations, most of them involve complex calculations and are not conducive to real-time and high-precision machining applications. Hence, we proposed a new two-level parameter compensation method that effectively minimizes feedrate fluctuations, considering the curvature-sensitive areas in the NURBS curve.

Feedrate Fluctuation Elimination Strategy
In order to balance efficiency and effectiveness, a two-level parameter compensation method is suggested to avoid feedrate fluctuations. Figure 2 shows the schematic diagram of two-level parameter compensation for the (i + 1)th interpolation point. Firstly, to address the federate fluctuation in non-curvature sensitive areas with low computational cost, firstlevel parameter compensation is performed. The compensation is achieved through the Taylor series expansion method, ensuring that the chord trajectory of the new interpolation point after compensation closely matches the original arc trajectory. Secondly, although the first-level parameter compensation reduces truncation error in curvature-sensitive areas, significant feedrate fluctuations can still occur. To further address this issue, second-level parameter compensation is performed using an iterative method that does not require derivative calculations.
As shown in Figure 2, initially, parameters such as u i and curvature k(u i ) of the current interpolation point, command feedrate F, the maximum chord error δ max , curvature threshold k threshold , and the feedrate fluctuation tolerance ε are input into the two-level parameter compensation module. Then, the first-level parameter compensation is performed. In this process, the adaptive velocity of the next interpolation point is calculated using the adaptive velocity approach described in Equation (5) and is restrained under the command feedrate constraint according to Equation (6). The estimated parameters u pre,i+1 of the next interpolation point are obtained by using the FAM or SAM described in Equations (7) and (8). As the numerical approximation method is utilized to obtain the estimated parameters, there are inevitable discrepancies between these parameters and the actual ones. Consequently, the arc displacement along the curved path is inaccurately mapped to the spline parameters, leading to fluctuations in the federate. In this paper, we provided a theoretical derivation process for compensating for the problem of feedrate fluctuation caused by parameter estimation deviation. More details can be found in Section 3.2. Therefore, we can obtain the parameter compensation step size ∆u i+1 according to the method called first-level compensation in this paper. In this way, the first-level parameter Coordinate position calculation

Second-level parameter compensation
Curvature-sensitive area?  Greater curvature leads to more prominent fluctuation in feedrate. Even after eliminating the feedrate variation through the first-level parameter compensation in the curvaturesensitive area, there is still a pressing issue of substantial feedrate fluctuations. This paper presents a second-level parameter compensation method that is combined with curvature characteristics to address this problem. As shown in Figure 2, after completing the first-level parameter compensation, it is important to check whether the next interpolation point is situated in the curvature-sensitive area. If the point is located in the non-curvature-sensitive area, the NURBS interpolator will proceed with the calculation process, which involves obtaining the interpolation position based on the parameters. Once this is done, the feed system will execute the interpolation action to complete the feed process. If the point falls within the curvature-sensitive area, then proceed to the second-level parameter compensation based on the Secant iteration method. First, initialize the parameters, including the number of iterations, u k and u k−1 , etc. In each iteration, a new compensated parameter Then, the estimated feedrate v k+1 is obtained by the ratio of the distance between two points u k+1 and u i , which are the new compensated interpolation point and the previous interpolation point, to the interpolation period. After that, the new feedrate fluctuation is gained and is compared with the set fluctuation tolerance ε. If the feedrate fluctuation is still higher than the set tolerance, the number of iterations k will update and the next update iteration process proceed. If the current parameter compensation results in the feedrate fluctuation being within the set tolerance and meets the accuracy condition, then, the second-level compensation will end. Next, the NURBS interpolator will solve the curve point coordinates and perform the feed motion. The specific process of second-level parameter compensation is detailed in Section 3.3. After two-level parameter compensation, the feedrate fluctuation of the estimated point can be well eliminated, and the quality of the processed surface can be better guaranteed.
High curvature regions are the curve parts that exceed the curvature threshold in the second-level parameter compensation. The NURBS curve is firstly divided into low and high curvature regions by the curvature threshold. The curve's curvature threshold is determined by considering dynamic limitations and geometric properties. Taking F as the maximum command feedrate, and δ max as the chord error tolerance, the curvature threshold can be determined from Equation (5) as (20) Then, the curve is divided into numerous sections based on the curvature threshold. The NURBS curve's high and low-curvature areas are defined as the portion with curvature larger and less than the threshold, respectively. It can be seen from the curvature characteristics that when the interpolation point is located in the low curvature area, the feedrate fluctuation is slight, and only the first-level parameter compensation is required. In contrast, when the interpolation point is located in the high curvature area, the feedrate fluctuation is significant, and it is necessary to perform the second-level parameter compensation after the first-level parameter compensation.

The First-Level Parameter Compensation
The main factor causing feedrate fluctuation is that the synthesis trajectory is a short straight line instead of a circular arc. In order to make the chord trajectory of the new interpolation point after compensation as similar to the original arc trajectory as possible, the first-level parameter compensation was performed, as shown in Figure 1, where C is the new point of point B after the first-level compensation.
The parameters of B and C were set as u pre,i+1 u f ,i+1 . The parameter compensation incremental value of point B was set to ∆u i+1 . Now, we have where u pre,i+1 is the predicted parameter of the next interpolation point by FAM or SAM.
Here, the first-order Taylor series expansion technique establishes a model between the interpolation point and the compensation value [38].
where C (u pre,i+1 ) is the first-order derivative of C(u pre,i+1 ).
After the first-level parameter compensation, it is assumed that there is no feedrate fluctuation, and AB = AB holds. This also means that the desired feedrate should equal the actual feedrate. It yields Equation (23) can be rewritten by By substituting (22) with (24), we obtain The quadratic equation for ∆u i+1 can be obtained by squaring both sides of Equation (25).
Then, it can be rewritten as where a, b, and c are listed as follows: Two roots of Equation (27) can be obtained as and Since one of the roots turns out to be close to zero, and the other root is ∆u i+1,2 = − b a . Therefore, the parameter compensation should be slight, and the parameter compensation is taken to be the value of ∆u i+1,1 .

The Second-Level Parameter Compensation
The FAM or SAM based on Taylor expansion employed in the first-level compensation has truncation errors, which cannot be ignored in high curvature areas, and will still cause feedrate fluctuations.
Suppose a point in the high curvature region with feedrate v i+1 . Assuming there are no feedrate fluctuations on this point, it just requires finding parameter u to satisfy f (u) = 0 in Formula (31).
where f (u) represents the difference between the linear distance of adjacent interpolation points and the actual interpolation trajectory length. When f (u) equals 0, there is no feedrate fluctuation. The Secant method is introduced to solve (31), an iterative method without calculating the derivatives. Suppose the feedrate fluctuation tolerance is ε. The pseudocode representation of the method is shown in Algorithm 1.

Algorithm 1. Secant-Method Based Parameter Compensation
Input: In Algorithm 1, the input parameters include parameter u i , the desired feedrate v i+1 , the predicted parameter u pre,i+1 , the first-level parameter compensation u f ,i+1 , and the feedrate fluctuation tolerance ε. u k+1 represents the parameter compensation of Equation (31) at the (k + 1)th iteration, and v k+1 indicates the actual feedrate according to parameter u k+1 . If the feedrate fluctuation is under the upper bound ε, then u k+1 is set to the desired value.

The Order of Convergence for the Second-Level Parameter Compensation
Let e k be an error in the kth iteration approximation. The parameter compensations u k and u k−1 can be written as Substituting Equation (32) into Equation (31) and expanding with the Taylor series, we get Since f (u) = 0, Equation (33) can be rewritten as Now, the following formula can be obtained The second-level iteration parameter compensation can be described as Substituting Equations (34) and (35) into Equation (36) gives Equation (37) can be rewritten as By binomial theorem, Equation (38) can be rewritten as Neglecting powers of e k and e k−1 yields e k+1 ≈ e k e k−1 2 From Equations (43) and (46), we can obtain The roots of Equation (47) are Taking the positive sign, we have p = 1+ √ 5 2 ≈ 1.618. The order of convergence of the second-level parameter compensation is 1.618, which is superlinear.

The Simulation Parameters and Methods
In order to demonstrate the feasibility and effectiveness of the supposed approach, the typical butterfly-shaped NURBS curve is simulated. The typical butterfly-shaped curve and its control polygon are shown in Figure 3. In this simulation, the command feedrate, maximum chord error, and interpolation period are set to 0.1 mm/ms, 0.001 mm, and 2 ms, respectively.

The Simulation Parameters and Methods
In order to demonstrate the feasibility and effectiveness of the supposed approach, the typical butterfly-shaped NURBS curve is simulated. The typical butterfly-shaped curve and its control polygon are shown in Figure 3. In this simulation, the command feedrate, maximum chord error, and interpolation period are set to 0.1 mm/ms, 0.001 mm, and 2 ms, respectively.  Figure 4 depicts the curvature of the butterfly-shaped curve. The curvature threshold is 0.19998, calculated by the given parameters according to Equation (20), as shown by the red line in Figure 4. As shown in Figure 4, most regions are below the curvature threshold, while there are also several regions above the curvature threshold, which are high curvature areas that require performing second-level parameter compensation after the firstlevel parameter compensation. In Figure 4, the part with the parameter range of 0.30-0.40 is selected and magnified (the area indicated by the arrow in Figure 4), which can be seen more clearly.  Figure 4 depicts the curvature of the butterfly-shaped curve. The curvature threshold is 0.19998, calculated by the given parameters according to Equation (20), as shown by the red line in Figure 4. As shown in Figure 4, most regions are below the curvature threshold, while there are also several regions above the curvature threshold, which are high curvature areas that require performing second-level parameter compensation after the first-level parameter compensation. In Figure 4, the part with the parameter range of 0.30-0.40 is selected and magnified (the area indicated by the arrow in Figure 4), which can be seen more clearly.
This paper performed simulation experiments on the first-level and second-level parameter compensations under the FAM and SAM. The horizontal axis shows the normalized parameter vector and its value range is 0~1. The vertical axis shows the feedrate fluctuation rate as a percentage.

Simulation Analysis
In Figure 5, the NURBS curve interpolation adopts the FAM, which does not consider the deviation between the estimated and theoretical interpolation trajectories. Figure 5 shows that this method gives significant feedrate fluctuations, and the maximum feedrate fluctuation rate reaches 18.39%. Such high feedrate fluctuations will directly degrade the interpolation accuracy and surface quality. This paper performed simulation experiments on the first-level and second-level parameter compensations under the FAM and SAM. The horizontal axis shows the normalized parameter vector and its value range is 0~1. The vertical axis shows the feedrate fluctuation rate as a percentage.

Simulation Analysis
In Figure 5, the NURBS curve interpolation adopts the FAM, which does not consider the deviation between the estimated and theoretical interpolation trajectories. Figure 5 shows that this method gives significant feedrate fluctuations, and the maximum feedrate fluctuation rate reaches 18.39%. Such high feedrate fluctuations will directly degrade the interpolation accuracy and surface quality.   This paper performed simulation experiments on the first-level and second-level parameter compensations under the FAM and SAM. The horizontal axis shows the normalized parameter vector and its value range is 0~1. The vertical axis shows the feedrate fluctuation rate as a percentage.

Simulation Analysis
In Figure 5, the NURBS curve interpolation adopts the FAM, which does not consider the deviation between the estimated and theoretical interpolation trajectories. Figure 5 shows that this method gives significant feedrate fluctuations, and the maximum feedrate fluctuation rate reaches 18.39%. Such high feedrate fluctuations will directly degrade the interpolation accuracy and surface quality.  In Figure 6, the first-level parameter compensation is performed on FAM. For the parameter estimated by the FAM in Equation (7), the compensation increment is calculated according to Equation (29), and the compensation increment is added to update the next point parameters. Figure 6 shows that the FAM algorithm's feedrate fluctuation range is significantly reduced after the first-level parameter compensation, and the maximum fluctuation rate is reduced from 18.39% to 1.2%. The feedrate fluctuation after the first-level parameter compensation in FAM is 93.5% lower than without parameter compensation. However, Figure 6 shows that most feedrate fluctuations are less than 0.2%, and the area with significant feedrate fluctuations corresponds to the curvature-sensitive area shown in Figure 4. next point parameters. Figure 6 shows that the FAM algorithm's feedrate fluctuation range is significantly reduced after the first-level parameter compensation, and the maximum fluctuation rate is reduced from 18.39% to 1.2%. The feedrate fluctuation after the firstlevel parameter compensation in FAM is 93.5% lower than without parameter compensation. However, Figure 6 shows that most feedrate fluctuations are less than 0.2%, and the area with significant feedrate fluctuations corresponds to the curvature-sensitive area shown in Figure 4. Since the feedrate fluctuation is still relatively significant after the first-level parameter compensation in the curvature-sensitive areas, the second-level parameter compensation method is adopted. Figure 7 shows the feedrate fluctuation of the FAM with two-level parameter compensation. This paper selected the maximum number of iterations as 1~5 in the second-level parameter compensation for real-time performance and investigated the feedrate fluctuation under the fixed iteration period. Figure 7 shows the feedrate fluctuation reduction under different iterations. When the iteration parameter was set to 1, the maximum feedrate fluctuation rate was reduced to 0.5036%, 58.03% lower than that of the FAM with the first-level parameter compensation. When the iteration parameter was set to 5, the feedrate fluctuation rate in the curvature-sensitive area continued to decrease, falling below 0.1%. Since the feedrate fluctuation is still relatively significant after the first-level parameter compensation in the curvature-sensitive areas, the second-level parameter compensation method is adopted. Figure 7 shows the feedrate fluctuation of the FAM with two-level parameter compensation. This paper selected the maximum number of iterations as 1~5 in the second-level parameter compensation for real-time performance and investigated the feedrate fluctuation under the fixed iteration period. Figure 7 shows the feedrate fluctuation reduction under different iterations. When the iteration parameter was set to 1, the maximum feedrate fluctuation rate was reduced to 0.5036%, 58.03% lower than that of the FAM with the first-level parameter compensation. When the iteration parameter was set to 5, the feedrate fluctuation rate in the curvature-sensitive area continued to decrease, falling below 0.1%.
In order to further eliminate the feedrate fluctuation rate, this paper also simulated two-level parameter compensation of the SAM, as shown in Figures 8-10. Figure 8 depicts the SAM's feedrate fluctuation without parameter compensation. Since SAM has one more second-order derivative than FAM, its truncation error is smaller than that of FAM, and its estimated parameter of the interpolation point is closer to the theoretical value. Therefore, the feedrate fluctuation rate in the SAM is lower than in the FAM. Nevertheless, the maximum feedrate fluctuation rate of the SAM still reached 6.32%, which cannot meet the high precision machining requirements. Figure 9 depicts the SAM's feedrate fluctuation with the first-level parameter compensation. Similar to the simulation results in Figure 6, the feedrate fluctuation rate was significantly reduced (from a maximum of 1.2% to 0.178%, a drop of 85.17%) after adopting the first-level parameter compensation. The main reason is that the parameters estimated by the SAM in Equation (8) are compensated according to Equation (29), so the estimated parameters were closer to the theoretical ones.
However, Figure 9 shows that corresponding to the curvature-sensitive areas in Figure 4, the feedrate fluctuations were more significant than other areas, which still cannot meet the high-quality machining requirements. The main reason is that the first-level compensation has a truncation error, and the length of the interpolation trajectory is minimal in the curvature-sensitive area. Thus, the effect of truncation error on feedrate fluctuation cannot be ignored. In order to further eliminate the feedrate fluctuation rate, this paper also simulated two-level parameter compensation of the SAM, as shown in Figures 8-10. Figure 8 depicts the SAM's feedrate fluctuation without parameter compensation. Since SAM has one more second-order derivative than FAM, its truncation error is smaller than that of FAM, and its estimated parameter of the interpolation point is closer to the theoretical value. Therefore, the feedrate fluctuation rate in the SAM is lower than in the FAM. Nevertheless, the maximum feedrate fluctuation rate of the SAM still reached 6.32%, which cannot meet the high precision machining requirements.   In order to further eliminate the feedrate fluctuation rate, this paper also simulated two-level parameter compensation of the SAM, as shown in Figures 8-10. Figure 8 depicts the SAM's feedrate fluctuation without parameter compensation. Since SAM has one more second-order derivative than FAM, its truncation error is smaller than that of FAM, and its estimated parameter of the interpolation point is closer to the theoretical value. Therefore, the feedrate fluctuation rate in the SAM is lower than in the FAM. Nevertheless, the maximum feedrate fluctuation rate of the SAM still reached 6.32%, which cannot meet the high precision machining requirements.  Therefore, the secondary second-level parameter compensation is adopted in SAM, and the feedrate fluctuation rate is shown in Figure 10. Similar to the second-level parameter compensation of the FAM, the maximum number of iterations was specified as 1~5 in the second-level parameter compensation, and the feedrate fluctuation under the fixed iteration period was investigated. As shown in Figure 10, when the iteration parameter was set to 1, the maximum feedrate fluctuation rate after parameter compensation for the curvaturesensitive area was reduced to 0.0679%, 61.85% lower than the SAM with the first-level parameter compensation. When the iteration parameter was set to 5, the feedrate fluctuation rate in the curvature-sensitive area decreased, falling below 0.01%. Even if the iteration parameter was set to 1 in the SAM with the two-level parameter compensation, the feedrate fluctuation error was sufficient for high-precision machining compared with the standard range of 0.001-0.1% [8].   Figure 9 depicts the SAM's feedrate fluctuation with the first-level parameter compensation. Similar to the simulation results in Figure 6, the feedrate fluctuation rate was significantly reduced (from a maximum of 1.2% to 0.178%, a drop of 85.17%) after adopting the first-level parameter compensation. The main reason is that the parameters estimated by the SAM in Equation (8) are compensated according to Equation (29), so the estimated parameters were closer to the theoretical ones.
However, Figure 9 shows that corresponding to the curvature-sensitive areas in Figure 4, the feedrate fluctuations were more significant than other areas, which still cannot meet the high-quality machining requirements. The main reason is that the first-level com-   Figure 9 depicts the SAM's feedrate fluctuation with the first-level parameter compensation. Similar to the simulation results in Figure 6, the feedrate fluctuation rate was significantly reduced (from a maximum of 1.2% to 0.178%, a drop of 85.17%) after adopting the first-level parameter compensation. The main reason is that the parameters estimated by the SAM in Equation (8) are compensated according to Equation (29), so the estimated parameters were closer to the theoretical ones.
However, Figure 9 shows that corresponding to the curvature-sensitive areas in Figure 4, the feedrate fluctuations were more significant than other areas, which still cannot meet the high-quality machining requirements. The main reason is that the first-level com-  Table 1 shows a comparison of the performance of parameter compensation interpolation algorithms. The FAM has a maximum feedrate fluctuation rate of 18.39%. The maximum federate fluctuation rate of the FAM with the first-level parameter compensation was 93.5% lower than the FAM. When using the two-level parameter compensation and setting the iteration parameter to one, the maximum feedrate fluctuation rate was 0.5, 97.3% less than the FAM. When the iteration parameter was set to 5, the feedrate fluctuation rate was 0.1%, 99.5% lower than the FAM. Correspondingly, in terms of the sum of feedrate fluctuations in the whole interpolation process, the FAM with the first-level parameter compensation was 99.19% lower than that without compensation, and the two-level parameter compensation was reduced by 99.56% and 99.71% when the iteration parameters were set to 1 and 5, respectively. Besides, for the SAM, the proposed two-level parameter compensation also provided excellent performance, as shown in Table 1. The maximum rate of feedrate fluctuations obtained with the SAM was 6.32%, while it was 0.18% for the SAM with the first-level parameter compensation, 97.2% lower than the SAM. When the two-level parameter compensation was adopted and the iteration parameter was set to 1, the maximum rate of feedrate fluctuation was 0.07%, 98.9% lower than that of the SAM. When the iteration parameter was set to 5, the maximum rate of feedrate fluctuation was 0.01%, 99.8% lower than the SAM. Similarly, the maximum rate of feedrate fluctuations obtained with the SAM with the first-level parameter compensation was 97.10% lower than without compensation, and the two-level parameter compensation reduced it by 97.88% and 98.00% when the iteration parameter was set to 1 and 5, respectively. At the same time, in the case of horizontal comparison, when the two-level parameter compensation was adopted and the number of iterations was set to 5, SAM's maximum rate of feedrate fluctuation was only one-tenth that of FAM. Under the SAM with the two-layer parameter compensation, even if the iteration parameter was set to 1, the feedrate fluctuation was sufficient for high-precision machining.
Furthermore, the FAM and SAM without parameter compensation consumed the least computational time while generating the worst feedrate fluctuation rate. The time required for the first-level parameter compensation to compute the NURBS curve's first derivative was doubled. However, the feedrate fluctuation rate decreased by more than 93% after adopting FAM and SAM. The second-level parameter compensation does not require calculating the first derivative of the NURBS curve while adding some simple calculations with no discernible time increase. The feedrate fluctuation control was further improved after adopting FAM and SAM. The SAM with the two-level parameter compensation (iteration is 5) consumed most time than the other methods and could reach the maximum rate of feedrate fluctuation below 0.01%. The proposed two-level parameter compensation method provided the best feedrate accuracy compared with the other methods. Furthermore, the proposed method has a computational time of about 350 us for FAM and 360 us for SAM, which is acceptable for the specified interpolation period (2 ms). As a result, the proposed method's real-time performance can meet the requirements of typical computer numerical control (CNC) systems. Table 2 compares the following four interpolation methods: the proposed SAM with two-level parameter compensation, the IRF method [26], Fast NURBS (fifth-degree ILF) [29], the TFSS method [12], and the OFB method [37]. The five methods had maximum federate fluctuation rates of 0.01%, 2%, 0.025%, 0.25%, and 0.027%, respectively. The proposed method had the smallest feedrate fluctuation among the four methods. The feedrate fluctuations of the other four methods were significantly higher than the proposed method, which were 1.99 × 10 3 %, 1.5 × 10 2 %, 2.4 × 10 3 %, and 1.7 × 10 2 %. Table 2. Simulation results of different interpolation algorithms.

Physical Mechanisms Analysis
The Taylor expansion approximation method disregards higher-order terms, inducing truncation errors, and discrepancies between estimated and theoretical interpolation points. As a result, it creates feedrate fluctuations that exceed the required range for high-speed and high-precision machining. This paper suggests a first-level parameter compensation method that establishes a mathematical analytical solution for the truncation error compensation and compensates for the error with a step increment. The simulation results indicated that utilizing a first-level parameter compensation for the first-order and secondorder Taylor expansion methods can decrease feedrate fluctuation to less than 0.02% in non-curvature sensitive areas. However, fluctuations in curvature-sensitive areas remain significant because of the continuous impact of curvature on NURBS interpolation. To solve this issue, the paper suggests the second-level parameter compensation to further limit the impact of curvature on feedrate fluctuation. The Secant method was introduced to iteratively regulate feedrate fluctuation within the fluctuation tolerance. The simulation results also demonstrated that feedrate fluctuation can be effectively managed within 0.01% after the second-level parameter compensation is implemented.

Conclusions
This paper suggests a two-level parameter compensation method for the NURBS interpolator to minimize feedrate fluctuation. First, the Taylor series expansion method was utilized in the first-level parameter compensation to obtain precise parameters to make the chord trajectory of the new interpolation point after compensation as close to the original arc trajectory as possible, eliminating federate fluctuation in non-curvature-sensitive areas with low calculation cost. Second, the second-level parameter compensation was performed based on the Secant method to overcome the truncation error of the first-level parameter compensation, an iterative method without derivative calculation requirement. Finally, the butterfly-shaped NURBS curves were simulated. The simulation results indicated that the maximum feedrate fluctuation rate was below 0.01% with an average computational time of 360 us in SAM with two-level parameter compensation, which is 99.8% lower than the SAM without parameter compensation. The proposed method performed best among the four feedrate fluctuation elimination methods. Compared with the standard range, the simulation demonstrated its feasibility and effectiveness for high-precision and real-time machining. However, this paper still has limitations, for example, the effectiveness of the proposed method in minimizing feedrate fluctuations during actual CNC machining needs to be tested experimentally. Future research will investigate the potential of machine learning and artificial intelligence algorithms in developing adaptive and self-optimizing feedrate control systems for CNC machining.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author.

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