A Feedrate Planning Method for the NURBS Curve in CNC Machining Based on the Critical Constraint Curve

: The curvature of the NURBS curve varies along its trajectory, therefore, the commonly used feedrate-planning method, which based on the acceleration/deceleration (Acc/Dec) model, is difﬁcult to be directly applied in CNC machining of a NURBS curve. To address this problem, a feedrate-planning method based on the critical constraint curve of the feedrate (CCC) is proposed. Firstly, the problems of existing feedrate-planning methods and their causes are analyzed. Secondly, by considering both the curvature constraint and the kinematic constraint during the Acc/Dec process, the concept of CCC which represents the relationship between the critical feedrate-constraint value and the arc length is proposed. Then the CCC of a NURBS curve is constructed, and it has a concise expression conforming to the Acc/Dec model. Finally, a feedrate-planning method of a NURBS curve based on CCC and the Acc/Dec model is established. In the simulation, a comparison between the proposed method and the conventional feedrate-planning method is performed, and the results show that, the proposed method can reduce the Acc/Dec time by over 40%, while little computational burden being added. The machining experimental results validate the real-time performance and stability of the proposed method, and also the machining quality is veriﬁed. The proposed method offers an effective feedrate-planning strategy for a NURBS curve in CNC machining.


Introduction
The parametric interpolation based on a non-uniform rational B-splines (NURBS) curve is gradually being applied to CNC machining of complex free-form surfaces [1][2][3], such as molds, turbines, and blades, due to its advantages of a smooth machining process, high machining efficiency, and precision [4][5][6][7]. When machining a NURBS curve, the low feedrate will increase the machining time while an excessive feedrate will damage the workpiece and the machine tool; therefore, feedrate planning is crucial to machining efficiency and quality [8,9].
The curvature of a NURBS curve changes along the trajectory, affecting the feedrateconstraint value of each point on the curve path, while the feedrate of the line-segment path is only restricted at its endpoints and the arc path has a constant feedrate-constraint value. Therefore, the feedrate-planning method, based on acceleration/deceleration (Acc/Dec) models [10][11][12], which is commonly used in line-segment and arc paths, is difficult to be directly used in planning the feedrate of a NURBS curve. To address this problem, scholars have conducted active research and have mainly put forward two methods: point-by-point planning and segment-by-segment planning. The point-by-point planning method does not use the Acc/Dec model, and it takes the interpolation period as the calculation unit to plan the feedrate of the NURBS curve instead. Starting from the head of the NURBS curve, Beudaert et al. [13] planned the feedrate and calculated interpolation points along the curve in each interpolation period with the local optimization of machining efficiency as the goal, under the constraints of chord error, normal acceleration and others [14,15]. However, when a constraint-satisfied feedrate cannot be planned at the current interpolation point, the strategy of backing off for a certain distance and replanning was adopted, which resulted in a large amount of calculations and it was difficult to be used in real-time CNC machining. Erkorkmaz et al. [16] divided a NURBS curve into multiple windows, and tried using a multi-core CPU to perform parallel calculations on these windows to reduce the total calculation time. However, the point-by-point planning method was still used to plan the feedrate in a single window. Sun et al. [17] first generated an initial feedrate curve, and then adjusted the feedrate for the sample points on that curve that did not satisfy the constraint by using an iterative approach until the feedrate of all sample points met the constraint. The above point-by-point planning method suffers from the problem of requiring multiple adjustments and replanning, so the real-time performance of the algorithm cannot be guaranteed. The segment-by-segment planning method divides a NURBS curve into several sub-curves, which are taken as calculation units, and the Acc/Dec model is used to plan the feedrate in each unit. Du et al. [18] divided a NURBS curve into sub-curves at the points with the local maximum curvature, and calculated the feedrate-constraint value at junctions between different sub-curves, then the feedrate was planned accordingly. However, there is a risk that the feedrate will exceed the limit in the inner region of each sub-curve, since this algorithm only constrained the feedrate at the junctions of sub-curves. Jia et al. [19] divided the regions of the NURBS curve of which the feedrate-constraint value was less than the command value into independent sub-curves, calculated the feedrate-constraint value of each sub-curve according to its minimum radius of curvature (hereinafter referred to as "minimum-constraint principle"), and then finally planned the feedrate. Although this method ensures that the feedrate does not exceed the limit, the minimum-constraint principle reduces machining efficiency due to its conservation. Bardine et al. [20] and Annoni et al. [21] divided a NURBS curve with the criterion that the curvature of adjacent sub-curves differ by a factor of 2, after which the feedrate of each sub-curve was also planned based on the minimum-constraint principle. The segment-by-segment planning method described above has good real-time performance because of no backing-off or replanning, but its feedrate-planning results have the problem of exceeding the limit or being conservative.
Based on the studies of the above scholars, this paper constructs a critical constraint curve of the feedrate (CCC) corresponding to a NURBS curve by considering both the geometric constraints caused by the curvature and the kinematic constraints during the Acc/Dec process. A CCC consists of three parts, which are a critical deceleration curve constructed to avoid feedrate planning failure, a straight line with a constant value equal to the minimum feedrate-constraint value of the NURBS curve, and a critical acceleration curve to improve machining efficiency. The concise expression of CCC can be used in combination with existing Acc/Dec models, so the real-time planning process is ensured and the planning results will not exceed the limit. On the other hand, the conservation problem existed in the results of feedrate planning due to the minimum-constraint principle used in previous literature can be avoided, since the values of the critical deceleration/acceleration curve in CCC are greater than the minimum feedrate-constraint value. Therefore, the CCC-based feedrate-planning method (CCCP) proposed in this paper can balance the computational efficiency and the machining efficiency. In the following sections, this method will be described in detail, and its effectiveness will be verified through simulations and experiments. The content of this paper is organized as follows: Section 2 details the CCCP method; Section 3 is the simulation and experiment; and Section 4 is the conclusion.

Feedrate Planning of a NURBS Curve Based on CCC
NURBS is a general mathematical model for the free-form curve, and its expression [22] is: where P i is the control point whose quantity is n + 1, w i is the weight, and N i,p (u) is the p-order basis function defined by the node vector U = u 0 , u 1 , · · · , u n+p+1 , which is calculated as in which, 0/0 = 0 is stipulated. In order to ensure the machining accuracy in machining NURBS curves, the chord error and normal acceleration should not exceed the set upper limits, ε and a n , therefore, the feedrate should satisfy the constraint described by the following formula [23,24]: where T is the interpolation period and ρ is the radius of curvature. It can be seen from Equation (3) that any point on the NURBS curve has its corresponding feedrate-constraint value, therefore, for any NURBS curve, there exists a curve with the arc length as the abscissa value and the feedrate-constraint value as the ordinate value corresponding to it, shown as C 1 (s) in each figure in Figure 1 (for the convenience of the problem analysis below, C 1 (s) is set as a monotonically decreasing curve). Thus, the essence of feedrate planning for a NURBS curve is to construct a feedrate curve C 2 (s) that lies below C 1 (s), while satisfying the kinematic constraints during Acc/Dec process, with the goal of minimizing machining time.

Problem Analysis of the Existing C 2 (s)-Constructing Method
When constructing C 2 (s), in order to shorten the machining time, the acceleration should be performed as much as possible to obtain a higher feedrate, and there are various methods to avoid the gradually increasing C 2 (s) from exceeding the limit of C 1 (s).
As shown in Figure 1a, the literature [25,26] valued the C 2 (s) as C 1 (s) in the overrun part directly. However, in the high-curvature region of the NURBS curve, this method will lead to a sharp change in the feedrate, resulting in an overrun of the tangential acceleration [27]. The literature [13] adopted a back-and-reconstruct strategy, shown in Figure 1b, but it required multiple iterations and cannot guarantee the real-time performance. The literature [19] first divided a NURBS curve into sub-curves, and then the method shown in Figure 1c was adopted for a single sub-curve, conservatively setting the upper limit of C 2 (s) to the minimum value of C 1 (s), which affects the machining efficiency.
sponding feedrate-constraint value, therefore, for any NURBS curve, there exists a curve with the arc length as the abscissa value and the feedrate-constraint value as the ordinate value corresponding to it, shown as 1 ( ) in each figure in Figure 1 (for the convenience of the problem analysis below, 1 ( ) is set as a monotonically decreasing curve). Thus, the essence of feedrate planning for a NURBS curve is to construct a feedrate curve 2 ( ) that lies below 1 ( ), while satisfying the kinematic constraints during Acc/Dec process, with the goal of minimizing machining time.

Problem Analysis of the Existing 2 ( )-Constructing Method
When constructing 2 ( ), in order to shorten the machining time, the acceleration should be performed as much as possible to obtain a higher feedrate, and there are various methods to avoid the gradually increasing 2 ( ) from exceeding the limit of 1 ( ).
Among the above methods, the method in the literature [13] (Figure 1b) is representative and complex, and an analysis of its existing problems and causes is helpful to understand and deal with the feedrate planning problem of the NURBS curve.
In Figure 1b, after the value of C 2 (s) at s a reaches its upper limit C 1 (s a ), the method performs a back-off process and reduces the value of constructed C 2 (s) in the range of s ≤ s a . It can be seen that although the C 2 (s) before being reduced satisfies the constraint of C 1 (s), there is a hidden overrun problem which leads to the failure of feedrate planning for the subsequent trajectory.
Take any point (s b , C 1 (s b )) of C 1 (s) in Figure 2 as an example. There is a deceleration curve D b (s) passing through this point with the upper tangential-acceleration limit a T of the machine tool as the acceleration, which represents the limit of the deceleration capability of the machine tool. At this time, take another point (s c , C 1 (s c )) on C 1 (s), and it is easy to know that when the feedrate at s b is C 1 (s b ), the value of D b (s) in the range of s > s b cannot be decelerated below C 1 (s), due to the acceleration limitation of machine tool, resulting in the feedrate at s c exceeding the limit.
Appl. Sci. 2021, 11,4959 4 of 17 will lead to a sharp change in the feedrate, resulting in an overrun of the tangential acceleration [27]. The literature [13] adopted a back-and-reconstruct strategy, shown in Figure 1b, but it required multiple iterations and cannot guarantee the real-time performance. The literature [19] first divided a NURBS curve into sub-curves, and then the method shown in Figure 1c was adopted for a single sub-curve, conservatively setting the upper limit of 2 ( ) to the minimum value of 1 ( ), which affects the machining efficiency.
Among the above methods, the method in the literature [13] (Figure 1b) is representative and complex, and an analysis of its existing problems and causes is helpful to understand and deal with the feedrate planning problem of the NURBS curve.
In Figure 1b, after the value of 2 ( ) at reaches its upper limit 1 ( ), the method performs a back-off process and reduces the value of constructed 2 ( ) in the range of ≤ . It can be seen that although the 2 ( ) before being reduced satisfies the constraint of 1 ( ), there is a hidden overrun problem which leads to the failure of feedrate planning for the subsequent trajectory.
Take any point ( , 1 ( )) of 1 ( ) in Figure 2 as an example. There is a deceleration curve ( ) passing through this point with the upper tangential-acceleration limit T of the machine tool as the acceleration, which represents the limit of the deceleration capability of the machine tool. At this time, take another point ( , 1 ( )) on 1 ( ), and it is easy to know that when the feedrate at is 1 ( ), the value of ( ) in the range of > cannot be decelerated below 1 ( ), due to the acceleration limitation of machine tool, resulting in the feedrate at exceeding the limit. In the above process, the value of 2 ( ) at satisfies the constraint of 1 ( ), but it causes the feedrate at to exceed the limit. The reason is that the value of each point on 1 ( ) is only the feedrate-constraint obtained by Equation (3), which mainly considers the geometric constraint, while the kinematic constraint during the Acc/Dec process of the machine tool is not considered.
Taking the point ( , 1 ( )) in Figure 2 as an example, ( ) is the deceleration curve that passes through this point and takes T as the acceleration, and the value of ( ) at is ( ). Therefore, if the value of 2 ( ) at is greater than ( ), it will inevitably cause the feedrate at to exceed the limit, even if it satisfies the constraint 2 ( ) ≤ 1 ( ). It can be seen that the point ( , 1 ( )) will limit the feedrate 2 ( ) at . From the arbitrariness of , it also follows that any point on 1 ( ) with an abscissa value greater than will limit the feedrate at . The minimum of these limit values is the kinematic-constraint feedrate at , and the smaller value between it and 1 ( ) is the actual upper limit of the value of 2 ( ).
Obviously, when the method shown in Figure 1b constructing 2 ( ), only the geometric constraints represented by 1 ( ) are considered, while the kinematic constraints In the above process, the value of C 2 (s) at s b satisfies the constraint of C 1 (s b ), but it causes the feedrate at s c to exceed the limit. The reason is that the value of each point on C 1 (s) is only the feedrate-constraint obtained by Equation (3), which mainly considers the geometric constraint, while the kinematic constraint during the Acc/Dec process of the machine tool is not considered.
Taking the point (s c , C 1 (s c )) in Figure 2 as an example, D c (s) is the deceleration curve that passes through this point and takes a T as the acceleration, and the value of D c (s) at s b is D c (s b ). Therefore, if the value of C 2 (s) at s b is greater than D c (s b ), it will inevitably cause the feedrate at s c to exceed the limit, even if it satisfies the constraint C 2 (s b ) ≤ C 1 (s b ). It can be seen that the point (s c , C 1 (s c )) will limit the feedrate C 2 (s b ) at s b . From the arbitrariness of s c , it also follows that any point on C 1 (s) with an abscissa value greater than s b will limit the feedrate at s b . The minimum of these limit values is the kinematic-constraint feedrate at s b , and the smaller value between it and C 1 (s b ) is the actual upper limit of the value of C 2 (s b ).
Obviously, when the method shown in Figure 1b constructing C 2 (s), only the geometric constraints represented by C 1 (s) are considered, while the kinematic constraints are not, which leads to the overlarge value of C 2 (s).
Therefore, the excessive value of C 2 (s) and the resulting back-off and reconstructing process can be avoided, if a composite feedrate-constraint curve that considers both geometric constraints and kinematic constraints can be generated, on which C 2 (s) is constructed based. The composite feedrate-constraint curve, which ensures the real-time performance of the C 2 (s) constructing process is the CCC proposed in this paper.

Establishment of the CCC Mathematical Model
The problems in the existing C 2 (s) constructing method and their causes are analyzed in the previous section, which is the basis of establishment of the CCC mathematical model in this section. Establishing the coordinate system shown in Figure 3a for any NURBS curve segment, the abscissa is the accumulated arc length, and its maximum value is the arc length s e of the NURBS curve segment, while the ordinate is the feedrate. C 1 (s) in the figure is the constraint curve, and f min is the minimum value of C 1 (s).
Let the expression of the CCC to be constructed be g(s). If any point (τ, g(τ)) and (s u , C 1 (s u )) are taken from each of g(s) and C 1 (s) as shown in Figure 3a, it can be known from the content of Section 2.1 that when τ ≤ s u , (τ, g(τ)) must lie below the deceleration curve D u (s) passing through (s u , C 1 (s u )) (to simplify the derivation process, the geometric constraint of C 1 (s) to (τ, g(τ)) is not considered here), namely Letting the following inequation can be obtained: Since √ λ u − 2a T s is a monotonically increasing function of λ u , in order to make this inequation hold for λ u corresponding to any point on C 1 (s), a feasible value of g(s) is: where λ min is the minimum value that λ u can be on C 1 (s). The square root of the negative number is specified as 0. At this point, the curve corresponding to g(s) is the critical deceleration curve f 1 (s) in Figure 3b. In addition, g(s) = f min can also guarantee that Equation (6) always holds, so the expression of g(s) is: The curve corresponding to this expression is shown in Figure 4. If the feedrate is planned based on it, C 2 (s) can be decelerated to f min along f 1 (s) and then move with a constant feedrate to the end of the NURBS curve segment, when the constructing C 2 (s) intersects with f 1 (s).

Establishment of the CCC Mathematical Model
The problems in the existing 2 ( ) constructing method and their causes are analyzed in the previous section, which is the basis of establishment of the CCC mathematical model in this section. Establishing the coordinate system shown in Figure 3a for any NURBS curve segment, the abscissa is the accumulated arc length, and its maximum value is the arc length e of the NURBS curve segment, while the ordinate is the feedrate. 1 ( ) in the figure is the constraint curve, and min is the minimum value of 1 ( ). Let the expression of the CCC to be constructed be g( ). If any point ( , g( )) and ( , 1 ( )) are taken from each of g( ) and 1 ( ) as shown in Figure 3a, it can be known from the content of Section 2.1 that when ≤ , ( , g( )) must lie below the deceleration curve ( ) passing through ( , 1 ( )) (to simplify the derivation process, the geometric constraint of 1 ( ) to ( , g( )) is not considered here) , namely Letting the following inequation can be obtained: Since √ − 2 T is a monotonically increasing function of , in order to make this inequation hold for corresponding to any point on 1 ( ), a feasible value of g( ) is: where min is the minimum value that can be on 1 ( ). The square root of the negative number is specified as 0. At this point, the curve corresponding to g( ) is the critical deceleration curve 1 ( ) in Figure 3b. In addition, g( ) = min can also guarantee that Equation (6) always holds, so the expression of g( ) is: The curve corresponding to this expression is shown in Figure 4. If the feedrate is planned based on it, 2 ( ) can be decelerated to min along 1 ( ) and then move with a constant feedrate to the end of the NURBS curve segment, when the constructing 2 ( ) intersects with 1 ( ). However, the way moving to the end of the NURBS curve with the low feedrate min obviously has poor machining efficiency. Therefore, the appropriate acceleration should be performed to improve machining efficiency. In addition, in order to avoid 2 ( ) exceeding the constraint of 1 ( ) during the acceleration process, a critical acceleration curve can be obtained according to the constructing method of the above critical deceleration curve 1 ( ) with the following process: Each point on a NURBS curve has a corresponding acceleration curve ( ), of which the expression is: If the minimum value of is recorded as min , the mathematical model of the critical acceleration curve can be obtained as which is shown in Figure 5a. However, the way moving to the end of the NURBS curve with the low feedrate f min obviously has poor machining efficiency. Therefore, the appropriate acceleration should be performed to improve machining efficiency. In addition, in order to avoid C 2 (s) exceeding the constraint of C 1 (s) during the acceleration process, a critical acceleration curve can be obtained according to the constructing method of the above critical deceleration curve f 1 (s) with the following process: Each point on a NURBS curve has a corresponding acceleration curve A u (s), of which the expression is: If the minimum value of κ u is recorded as κ min , the mathematical model of the critical acceleration curve can be obtained as which is shown in Figure 5a. In summary, the complete mathematical model of CCC corresponding to the NURBS curve is: and the corresponding curve is shown in Figure 5b.
Appl. Sci. 2021, 11, 4959 7 of 17 which the expression is: If the minimum value of is recorded as min , the mathematical model of the critical acceleration curve can be obtained as which is shown in Figure 5a. In summary, the complete mathematical model of CCC corresponding to the NURBS curve is: Equation (11) for CCC is derived based on the kinematic constraint, but whether it satisfies the geometric constraint represented by C 1 (s) remains to be verified by the following process: The difference between g(s) and C 1 (s) can be obtained from Equation (11) as For √ λ min − 2a T s − C 1 (s) in the above formula, assume there exists an arc length value s = s d to make it greater than 0, namely then the following inequation can be obtained: which contradicts the setting that λ min is the minimum, therefore, the s d does not exist, which means and combined with f min − C 1 (s) ≤ 0, the conclusion g(s) − C 1 (s) ≤ 0 can be drawn. Therefore, g(s) satisfies the geometric constraint represented by C 1 (s).
So far, the establishment of the CCC mathematical model is completed. The data required in the above constructing process of CCC can be obtained by traversing the NURBS curve segment, in which the accumulated arc length at each point on the NURBS can be acquired by accumulating the chord length [28,29] because of the absence of an analytical solution. The adaptive step size can be used according to the curvature of the NURBS curve during the traversal to ensure the calculation accuracy of the accumulated arc length.
Meanwhile, from the constructing process of CCC shown in Figure 5a and its mathematical model (Equation (11)), CCC can be regarded as the fitting of C 1 (s) using a combined curve. Therefore, before constructing CCC, the NURBS curve can be divided into subcurves appropriately to avoid the overly complicated variation of a single segment C 1 (s), to improve the "fitting effect" of CCC.

The Feedrate Planning Method Based on CCC
For any NURBS curve, its corresponding CCC can be constructed according to the method in the previous section, as shown as g(s) in Figure 6, and the feedrate planning of the NURBS curve will be carried out in this section based on g(s). The feedrate values f s and f e at the start/end of this NURBS curve segment can be obtained from the feedrate look-ahead [30][31][32], which are treated as known quantities here. As shown in Figure 6, when planning the feedrate with an initial feedrate s , the acceleration should be performed first in order to obtain a higher machining efficiency. That is, an acceleration curve 4 ( ) starting from (0, ) should be constructed, which intersects with 1 ( ) at point . After that, deceleration should be performed along 1 ( ) until it intersects with 3 ( ) at point 1 , then a uniform motion along 3 ( ) holds until the intersection point 2 . Next, the acceleration is performed along 2 ( ) and the final deceleration starts from the point (the intersection point of the reverse acceleration curve 5 ( ) and 2 ( ) with e as the initial feedrate) to the end of the NURBS curve segment. Since 1 ( ) and 2 ( ) are both Acc/Dec curves with T as their accelerations, the above process does not have the problem of tangential acceleration exceeding the limit. Therefore, when the coordinate values of each intersection point in Figure 6 are calculated, the feedrate planning of the NURBS curve is carried out. The method of solving each intersection point is as follows: is the intersection point of 4 ( ) and 1 ( ), so the equation can be obtained as For the intersection points 1 , 2 and , the coordinates can be obtained in the same way as As shown in Figure 6, when planning the feedrate with an initial feedrate f s , the acceleration should be performed first in order to obtain a higher machining efficiency. That is, an acceleration curve f 4 (s) starting from (0, f s ) should be constructed, which intersects with f 1 (s) at point A. After that, deceleration should be performed along f 1 (s) until it intersects with f 3 (s) at point B 1 , then a uniform motion along f 3 (s) holds until the intersection point B 2 . Next, the acceleration is performed along f 2 (s) and the final deceleration starts from the point C (the intersection point of the reverse acceleration curve f 5 (s) and f 2 (s) with f e as the initial feedrate) to the end of the NURBS curve segment. Since f 1 (s) and f 2 (s) are both Acc/Dec curves with a T as their accelerations, the above process does not have the problem of tangential acceleration exceeding the limit. Therefore, when the coordinate values of each intersection point in Figure 6 are calculated, the feedrate planning of the NURBS curve is carried out. The method of solving each intersection point is as follows: A is the intersection point of f 4 (s) and f 1 (s), so the equation can be obtained as From this, the coordinates of A are gained: For the intersection points B 1 , B 2 and C, the coordinates can be obtained in the same way as The above calculation process and results are based on the premise that there exists intersection point A between f 4 (s) and f 1 (s) and intersection point C between f 2 (s) and f 5 (s) in Figure 6. However, whether this premise holds is related to the values of variables, such as f s and f e , therefore, it is necessary to check the premise and process the calculation results accordingly, and the process is as follows: (I) If f B 1 ≤ min( f A , f C ), the above premise holds. At this time, the feedrate-planning result of this NURBS curve segment contains five Acc/Dec stages, shown in Figure 7. and 5 ( ) in Figure 6. However, whether this premise holds is related to the values of variables, such as s and e , therefore, it is necessary to check the premise and process the calculation results accordingly, and the process is as follows: (I) If 1 ≤ min ( , ), the above premise holds. At this time, the feedrate-planning result of this NURBS curve segment contains five Acc/Dec stages, shown in Figure 7. The feedrates , 1 , 2 and at the intersection of each Acc/Dec stage have been obtained from Equations (16) and (17), while the values of the time parameters corresponding to each intersection can be obtained from the above known feedrates and linear Acc/Dec model, as follows: The above content of (a) and (b) is the correction of the calculated values of Equation (17) in the case of 1 > . If 1 > , the processing flow will be similar.
At this state, for any NURBS curve segment, the corresponding five Acc/Dec stages shown in Figure 7 can be obtained, as well as the corresponding feedrate and time parameters, thus realizing the feedrate planning of the NURBS curve segment.
The above is based on the linear Acc/Dec model to realize the feedrate planning of the NURBS curve, while when the S-shaped flexible Acc/Dec model is used, the feedrate can be planned according to the three constraint curves of 1 ( ) , 3 ( ) and 2 ( ) in Figure 6, respectively. Among them, 3 ( ) is a constant value. The feedrate-planning method based on 3 ( ) is the same as the conventional feedrate-planning algorithm based on the S-shaped Acc/Dec model. 2 ( ) is an acceleration curve with the acceleration T . Since the acceleration of the S-shaped Acc/Dec model needs to increase from 0 to T gradually, its average value will be less than T , making the planned feedrate curve lie below 2 ( ), so the planning result must satisfy the constraint of 2 ( ). As for 1 ( ), in the The feedrates f A , f B 1 , f B 2 and f C at the intersection of each Acc/Dec stage have been obtained from Equations (16) and (17), while the values of the time parameters corresponding to each intersection can be obtained from the above known feedrates and linear Acc/Dec model, as follows: The above content of (a) and (b) is the correction of the calculated values of Equation (17) in the case of f B 1 > f A . If f B 1 > f C , the processing flow will be similar.
At this state, for any NURBS curve segment, the corresponding five Acc/Dec stages shown in Figure 7 can be obtained, as well as the corresponding feedrate and time parameters, thus realizing the feedrate planning of the NURBS curve segment.
The above is based on the linear Acc/Dec model to realize the feedrate planning of the NURBS curve, while when the S-shaped flexible Acc/Dec model is used, the feedrate can be planned according to the three constraint curves of f 1 (s), f 3 (s) and f 2 (s) in Figure 6, respectively. Among them, f 3 (s) is a constant value. The feedrate-planning method based on f 3 (s) is the same as the conventional feedrate-planning algorithm based on the S-shaped Acc/Dec model. f 2 (s) is an acceleration curve with the acceleration a T . Since the acceleration of the S-shaped Acc/Dec model needs to increase from 0 to a T gradually, its average value will be less than a T , making the planned feedrate curve lie below f 2 (s), so the planning result must satisfy the constraint of f 2 (s). As for f 1 (s), in the interval 0 → s B 1 , it is a deceleration curve, but in the interval s B 1 → 0 , it is also an acceleration curve similar to f 2 (s), on which the feedrate can be planned based as well with the S-shaped Acc/Dec model. Therefore, the CCC constructed in this paper is also applicable for the S-shaped flexible Acc/Dec model.

Simulation and Experimental Results
In order to verify the effectiveness of the CCCP method proposed in this paper, the algorithm simulation and machining experiment are conducted. The algorithm simulation is conducted on a personal computer with a CPU of i3-9100F, while the machining experiment is conducted on a three-axis CNC machine tool DC-6060A (KAIBO, Ningbo, China) controlled by an independently developed CNC system, and the X/Y/Z axis travel of the machine tool is 600/600/260 mm respectively. The architecture of the whole experimental platform is shown in Figure 8.
for the S-shaped flexible Acc/Dec model.

Simulation and Experimental Results
In order to verify the effectiveness of the CCCP method proposed in this paper, the algorithm simulation and machining experiment are conducted. The algorithm simulation is conducted on a personal computer with a CPU of i3-9100F, while the machining experiment is conducted on a three-axis CNC machine tool DC-6060A (KAIBO, Ningbo, China) controlled by an independently developed CNC system, and the X/Y/Z axis travel of the machine tool is 600/600/260 mm respectively. The architecture of the whole experimental platform is shown in Figure 8. The Embedded Linux controller iTop4412 (TOPEET, Beijing, China) in the figure is mainly used for GUI, while the ARM (STM32H743) controller runs CNC algorithms, including G-code parsing, CCC constructing, feedrate planning, interpolation, etc. FPGA (EP4CE22) is mainly used for fine interpolation and generating control signals for servo drives.
The code of the CCCP method is written in C language and is used in both simulation and experimental platforms. The main parameters used in the simulation and experiment are shown in Table 1.

Simulation
The curvature of the N-shaped NURBS curve shown in Figure 9 alternates between small and large serval times along the arc length, which is typical and complex enough to be used as a simulation test object to verify the effectiveness of the CCCP method.

ARM+FPGA Embedded Linux
Machine Tool The Embedded Linux controller iTop4412 (TOPEET, Beijing, China) in the figure is mainly used for GUI, while the ARM (STM32H743) controller runs CNC algorithms, including G-code parsing, CCC constructing, feedrate planning, interpolation, etc. FPGA (EP4CE22) is mainly used for fine interpolation and generating control signals for servo drives.
The code of the CCCP method is written in C language and is used in both simulation and experimental platforms. The main parameters used in the simulation and experiment are shown in Table 1.

Simulation
The curvature of the N-shaped NURBS curve shown in Figure 9 alternates between small and large serval times along the arc length, which is typical and complex enough to be used as a simulation test object to verify the effectiveness of the CCCP method.
In order to improve the "fitting effect" of the CCC in the CCCP method, the NURBS curve shown in Figure 9 is first divided into sub-curves according to the monotonicity of the curvature and whether the feedrate-constraint value is greater than the command value (this dividing method will be used in the CCCP method, if no other dividing method specified). Then, the CCC constructing and feedrate planning are performed on these sub-curves. The final planning result is shown as C 2 (s) in Figure 10a, and its corresponding chord error, normal acceleration and tangential acceleration are shown as subplots b, c and d in Figure 10, respectively, which do not exceed their upper limits, indicating the effectiveness of this method. In order to improve the "fitting effect" of the CCC in the CCCP method, the NURBS curve shown in Figure 9 is first divided into sub-curves according to the monotonicity of the curvature and whether the feedrate-constraint value is greater than the command value (this dividing method will be used in the CCCP method, if no other dividing method specified). Then, the CCC constructing and feedrate planning are performed on these subcurves. The final planning result is shown as 2 ( ) in Figure 10a, and its corresponding chord error, normal acceleration and tangential acceleration are shown as subplots b, c and d in Figure 10, respectively, which do not exceed their upper limits, indicating the effectiveness of this method.   In order to improve the "fitting effect" of the CCC in the CCCP method, the NURBS curve shown in Figure 9 is first divided into sub-curves according to the monotonicity of the curvature and whether the feedrate-constraint value is greater than the command value (this dividing method will be used in the CCCP method, if no other dividing method specified). Then, the CCC constructing and feedrate planning are performed on these subcurves. The final planning result is shown as 2 ( ) in Figure 10a, and its corresponding chord error, normal acceleration and tangential acceleration are shown as subplots b, c and d in Figure 10, respectively, which do not exceed their upper limits, indicating the effectiveness of this method. The above are the results of feedrate planning of the NURBS curve in Figure 9 by using the curvature-monotonicity and command-feedrate-threshold dividing + CCCP method, while if the previously mentioned planning methods of command-feedrate-threshold dividing + minimum-constraint (CFTM) in the literature [19] and curvature-threshold dividing + minimum-constraint (CTM) in the literature [20,21] are used, the corresponding feedrate-planning results are shown in Figure 11a,b, respectively.
The above are the results of feedrate planning of the NURBS curve in Figure 9 by using the curvature-monotonicity and command-feedrate-threshold dividing + CCCP method, while if the previously mentioned planning methods of command-feedratethreshold dividing + minimum-constraint (CFTM) in the literature [19] and curvaturethreshold dividing + minimum-constraint (CTM) in the literature [20,21] are used, the corresponding feedrate-planning results are shown in Figure 11a,b, respectively. In Figure 11a, 2 ( ) and 1 ( ) do not fit closely enough, leading the poor machining efficiency, while in Figure 11b, although 2 ( ) and 1 ( ) fit more closely and the machining efficiency is improved, a large number of new sub-curves are generated, which increase the amount of calculation. In addition, feedrate in Figure 11b changes discontinuously, and the problem of "stepping" will have a negative impact on the machining quality.
The relevant data such as the number of sub-curves and machining time corresponding to the planning results shown in Figure 11a,b above are shown in Table 2. If 2 ( ) is directly valued as 1 ( ) without considering the Acc/Dec process, the corresponding machining time is the ideal value of the actual machining time. The difference between the machining time of other planning methods and the ideal value is the time of the Acc/Dec process.  Table 2, the Acc/Dec time is reduced by 76% from 0.90 s to 0.22 s, when the minimum-constraint principle in the CFTM method is replaced by the CCCP method. While the Acc/Dec time can be reduced by 44% when the minimum-constraint principle in the CTM method is replaced by the CCCP method, and its corresponding feedrate-planning result is shown in Figure 12. While reducing the Acc/Dec time, the problem of "stepping" In Figure 11a, C 2 (s) and C 1 (s) do not fit closely enough, leading the poor machining efficiency, while in Figure 11b, although C 2 (s) and C 1 (s) fit more closely and the machining efficiency is improved, a large number of new sub-curves are generated, which increase the amount of calculation. In addition, feedrate in Figure 11b changes discontinuously, and the problem of "stepping" will have a negative impact on the machining quality.
The relevant data such as the number of sub-curves and machining time corresponding to the planning results shown in Figure 11a,b above are shown in Table 2. If C 2 (s) is directly valued as C 1 (s) without considering the Acc/Dec process, the corresponding machining time is the ideal value of the actual machining time. The difference between the machining time of other planning methods and the ideal value is the time of the Acc/Dec process.  Table 2, the Acc/Dec time is reduced by 76% from 0.90 s to 0.22 s, when the minimum-constraint principle in the CFTM method is replaced by the CCCP method. While the Acc/Dec time can be reduced by 44% when the minimum-constraint principle in the CTM method is replaced by the CCCP method, and its corresponding feedrateplanning result is shown in Figure 12. While reducing the Acc/Dec time, the problem of "stepping" in Figure 11b can be alleviated, and the smoothness of the machining process can also be improved. Appl. Sci. 2021, 11, 4959 13 of 17 in Figure 11b can be alleviated, and the smoothness of the machining process can also be improved.

Figure 12.
Planning result of the curvature threshold dividing + CCCP method.
From the above simulation results of the N-shaped NURBS curve, it can be seen that the CCCP method can effectively reduce the machining time without increasing the number of sub-curves.
To further verify the effectiveness of the CCCP method, the above simulation was repeated for a more complex butterfly-shaped NURBS curve shown in Figure 13, and the results are shown in Table 3.  From the data in this table, the Acc/Dec time can be reduced by 75% by replacing the minimum-constraint principle in the CFTM method with the CCCP method, while doing the same replacing to the CTM method can reduce the Acc/Dec time by 42%.
The above simulation results show that the planning of feedrate for NURBS curves by using the CCCP method can ensure the real-time planning process while obtaining high machining efficiency.

Experiment
The simulation results show that the CCCP method proposed in this paper can balance the computational efficiency and machining efficiency. In order to check whether the CCCP method can guarantee the final machining quality, the 2D butterfly-shaped NURBS curve and 3D apple-shaped NURBS surface are machined on the experimental platform shown in Figure 8. In the machining, a ball milling cutter W2QX4408 (Weidiao, Shanghai, From the above simulation results of the N-shaped NURBS curve, it can be seen that the CCCP method can effectively reduce the machining time without increasing the number of sub-curves.
To further verify the effectiveness of the CCCP method, the above simulation was repeated for a more complex butterfly-shaped NURBS curve shown in Figure 13, and the results are shown in Table 3.
Appl. Sci. 2021, 11, 4959 13 of 17 in Figure 11b can be alleviated, and the smoothness of the machining process can also be improved.

Figure 12.
Planning result of the curvature threshold dividing + CCCP method.
From the above simulation results of the N-shaped NURBS curve, it can be seen that the CCCP method can effectively reduce the machining time without increasing the number of sub-curves.
To further verify the effectiveness of the CCCP method, the above simulation was repeated for a more complex butterfly-shaped NURBS curve shown in Figure 13, and the results are shown in Table 3.  From the data in this table, the Acc/Dec time can be reduced by 75% by replacing the minimum-constraint principle in the CFTM method with the CCCP method, while doing the same replacing to the CTM method can reduce the Acc/Dec time by 42%.
The above simulation results show that the planning of feedrate for NURBS curves by using the CCCP method can ensure the real-time planning process while obtaining high machining efficiency.

Experiment
The simulation results show that the CCCP method proposed in this paper can balance the computational efficiency and machining efficiency. In order to check whether the CCCP method can guarantee the final machining quality, the 2D butterfly-shaped NURBS curve and 3D apple-shaped NURBS surface are machined on the experimental platform shown in Figure 8. In the machining, a ball milling cutter W2QX4408 (Weidiao, Shanghai,  From the data in this table, the Acc/Dec time can be reduced by 75% by replacing the minimum-constraint principle in the CFTM method with the CCCP method, while doing the same replacing to the CTM method can reduce the Acc/Dec time by 42%.
The above simulation results show that the planning of feedrate for NURBS curves by using the CCCP method can ensure the real-time planning process while obtaining high machining efficiency.

Experiment
The simulation results show that the CCCP method proposed in this paper can balance the computational efficiency and machining efficiency. In order to check whether the CCCP method can guarantee the final machining quality, the 2D butterfly-shaped NURBS curve and 3D apple-shaped NURBS surface are machined on the experimental platform shown in Figure 8. In the machining, a ball milling cutter W2QX4408 (Weidiao, Shanghai, China) is used, and the machining material is AlMg1SiCu aluminum and Al99.7 aluminum, respectively. The final machining results are shown in Figures 14 and 15.   The butterfly-shaped NURBS curve is composed of two typical curved machining paths alternating between the flat and high-curvature regions, as shown in Figure 14. When machining that curve, the CCCP method can effectively decrease the feedrate in the high-curvature region to ensure the machining quality, therefore, no overcutting occurs. While in the flat region, the CCCP method can rapidly increase the feedrate to ensure machining efficiency. During the whole machining process, the machine tool runs smoothly and the machining toolpath is smooth and clean.
The apple-shaped NURBS surface is a gradual surface, on which each point has different curvature. There is a lot of reciprocal motion during the machining process, which puts forward a higher requirement for the stability of the CCCP method. When machining this surface, the machine tool also runs smoothly, and the machining result shown in Figure 15 shows that the CCCP method can ensure fine surface machining quality.
The above simulation and experimental results show that, the CCCP method has good real-time performance, and the machining efficiency can be improved while the machining quality being ensured.

Conclusions
The feedrate-constraint value of the NURBS curve varies along the arc length, which makes the feedrate planning in the CNC machining of the NURBS curve difficult. For this reason, this paper analyzes the problems and corresponding causes of feedrate-planning methods in literatures, and proposes the CCCP method.   The butterfly-shaped NURBS curve is composed of two typical curved machining paths alternating between the flat and high-curvature regions, as shown in Figure 14. When machining that curve, the CCCP method can effectively decrease the feedrate in the high-curvature region to ensure the machining quality, therefore, no overcutting occurs. While in the flat region, the CCCP method can rapidly increase the feedrate to ensure machining efficiency. During the whole machining process, the machine tool runs smoothly and the machining toolpath is smooth and clean.
The apple-shaped NURBS surface is a gradual surface, on which each point has different curvature. There is a lot of reciprocal motion during the machining process, which puts forward a higher requirement for the stability of the CCCP method. When machining this surface, the machine tool also runs smoothly, and the machining result shown in Figure 15 shows that the CCCP method can ensure fine surface machining quality.
The above simulation and experimental results show that, the CCCP method has good real-time performance, and the machining efficiency can be improved while the machining quality being ensured.

Conclusions
The feedrate-constraint value of the NURBS curve varies along the arc length, which makes the feedrate planning in the CNC machining of the NURBS curve difficult. For this reason, this paper analyzes the problems and corresponding causes of feedrate-planning methods in literatures, and proposes the CCCP method. The butterfly-shaped NURBS curve is composed of two typical curved machining paths alternating between the flat and high-curvature regions, as shown in Figure 14. When machining that curve, the CCCP method can effectively decrease the feedrate in the high-curvature region to ensure the machining quality, therefore, no overcutting occurs. While in the flat region, the CCCP method can rapidly increase the feedrate to ensure machining efficiency. During the whole machining process, the machine tool runs smoothly and the machining toolpath is smooth and clean.
The apple-shaped NURBS surface is a gradual surface, on which each point has different curvature. There is a lot of reciprocal motion during the machining process, which puts forward a higher requirement for the stability of the CCCP method. When machining this surface, the machine tool also runs smoothly, and the machining result shown in Figure 15 shows that the CCCP method can ensure fine surface machining quality.
The above simulation and experimental results show that, the CCCP method has good real-time performance, and the machining efficiency can be improved while the machining quality being ensured.

Conclusions
The feedrate-constraint value of the NURBS curve varies along the arc length, which makes the feedrate planning in the CNC machining of the NURBS curve difficult. For this reason, this paper analyzes the problems and corresponding causes of feedrate-planning methods in literatures, and proposes the CCCP method.
In this method, a composite feedrate-constraint curve CCC with concise expressions is constructed, in which both the geometric and kinematic constraints of the feedrate are considered. Then, the feedrate planning of the NURBS curve is carried out based on CCC and the Acc/Dec model. The CCCP method avoids the iterative calculation of the pointby-point planning method, and also does not have the conservative problem caused by the minimum-constraint principle in the segment-by-segment planning method. Therefore, the CCCP method can balance the computational and machining efficiency.
The simulations of N/butterfly-shaped NURBS curves show that, without increasing the number of sub-curves, the Acc/Dec time can be respectively reduced by 44% and 42% for replacing the minimum-constraint principle in the CTM method with the CCCP method. The experimental results verify the real-time performance and stability of the CCCP method. Moreover, the machining quality can also be guaranteed for both free-form curves and surfaces. Hence, the CCCP method can balance the computational and machining efficiency, while ensuring the machining quality. For the parametric interpolation of NURBS curves, the CCCP method proposed in this paper offers an effective strategy to plan the feedrate, which will promote the application of NURBS curves in CNC machining.
In view of the limited research time, the CCCP method presented in this paper is currently implemented in single NURBS curve CNC machining in a 3-axis machine tool, and has not been applied to double NURBS curve paths in 5-axis CNC machining, which will be the focus of further research.

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.

Nomenclature
NURBS Non-uniform rational B-splines Acc Acceleration Dec Deceleration CCC A critical constraint curve of the feedrate CCCP The CCC-based feedrate-planning method C 1 (s) A curve with the arc length as the abscissa value and the feedrate-constraint value as the ordinate value C 2 (s) A curve with the arc length as the abscissa value and the feedrate value as the ordinate value CFTM A feedrate-planning method base on command-feedrate-threshold dividing + minimum-constraint principle CTM A feedrate-planning method base on curvature-threshold dividing + minimum-constraint principle T Interpolation period, µs ρ Radius of curvature, mm ε Chord error, µm a n Normal acceleration, mm/s 2 a T Tangential acceleration, mm/s 2