1. Introduction
NURBS curves have emerged as the industry standard for curve and surface modeling, popularized by their unified mathematical representation of both standard and free-form shapes [
1]. This representation allows for efficient evaluation through numerically stable and accurate algorithms, leading to the widespread adoption of NURBS curves in the design of interpolators for high-speed, high-accuracy machining in modern manufacturing systems.
The primary function of an interpolator within a CNC (computer numerical controller) system is to discretize the tool path into segments of limited length. For NURBS curves, characterized by their parametric representation, the computation of intermediate parameters is essential to determine the corresponding interpolation points. Given the absence of an analytical solution for determining the length of NURBS curve parameters, numerical methods are employed to approximate these values. Among these, Taylor’s expansion (TE) is prevalent [
2,
3,
4], utilizing previously computed parameters to estimate subsequent ones. While methods such as the predictor–corrector (PC) [
5,
6,
7], polynomial-fitting (PF) [
8,
9,
10], and augmented Taylor’s expansion (ATE) [
11] offer increased accuracy by compensating for truncation errors in TE, TE remains sufficiently precise for most applications when considering derivatives up to the second order. Interpolation is conducted at each sample period, with each axis’ incremental motion serving as discrete position commands for the servo loop, ultimately guiding the tool along a polyline path composed of connected line segments. Shorter line segments are preferred for higher machining accuracy, posing a challenge for interpolator development due to the significant computational demands involved in calculating intermediate points and the first and second derivatives of NURBS curves. Enhancing computational efficiency, particularly when employing the TE method, is thus crucial to meet the growing precision requirements of modern manufacturing.
Furthermore, the chord error, resulting from the replacement of arc curves between interpolation points with line segments, is inevitable and proportional to the curvature [
12]. This error may exceed the allowable limits when encountering a sensitive corner (SC) with high curvature. Additionally, the centrifugal acceleration in these areas could surpass the servo system’s capacity, leading to tool path overshoot. Therefore, the feedrate must be reduced prior to reaching a sensitive corner in order to satisfy the demands of machining accuracy and dynamics. Adaptive feedrate planning [
13,
14,
15] has been recognized as a sophisticated solution, allowing the feedrate to be adjusted based on the curvature of the NURBS curve at sensitive corners, thereby achieving a uniform feedrate and controlled chord error. Jerk-limited feedrate planning [
16,
17,
18] has also been developed to create a smooth, S-shaped feedrate profile at sensitive corners, integrating machining dynamics into the interpolation stage. This method involves several linear acceleration or deceleration stages, maintaining a constant jerk as the tool moves along the sensitive corner. While high-order continuity feedrate planning methods, such as the jounce-limited method [
19] and the sinusoid method [
20], are applied to further reduce feedrate and acceleration fluctuations, they necessitate a longer sample period for heavy computation. Given the limited response time of mechanical systems, which include ball screws, servo motors, and other components, conventional adaptive and jerk-limited planning remain cost-effective for regulating feedrate profiles at sensitive corners. Although adaptive feedrate planning can achieve high efficiency due to its maximum value constraint within chord error limits, it may result in abrupt changes in acceleration and jerk at the start and end of the feedrate profile [
13]. Jerk-limited planning can provide a smoother feedrate profile, but at the cost of longer machining times. Consequently, there is a need to develop a comprehensive feedrate planning solution that balances machining efficiency and stationarity.
In this paper, Taylor’s expansion to the second order, along with a recursive matrix expression that substitutes the B-spline basis function via the de Boor algorithm, is applied for the interpolation of parametric NURBS curves to enhance computational efficiency. Meanwhile, an improved adaptive planning method is presented to adjust the feedrate at sensitive corners, integrating linear deceleration and acceleration stages to eliminate abrupt changes in acceleration and jerk, ensuring that jerk remains within predefined machining dynamics. The feedrate profile at the linear acceleration stage, after adjustment by the improved adaptive planning, matches the endpoint values of the linear deceleration stage, eliminating dynamic jumps and allowing for the reuse of the feedrate profile calculated by the look-ahead module, thus improving the computation efficiency of NURBS interpolation. The proposed method’s effectiveness and correctness are confirmed through simulation tests and machining experiments.
3. Feedrate Planning at Sensitive Corners
3.1. Sensitive Corners on NUBRS Curves
When NURBS curves are discretized into segments of a predetermined length by an interpolator, chord errors are an inevitable consequence. If there are some sensitive corners on a curve, the chord error cannot be guaranteed within a given tolerance.
The relationship between chord error
and feedrate
at the
interpolation point can be calculated using Equation (10).
where
,
, and
are the chord error, curvature, and feedrate at parameter
, respectively.
Adaptive feedrate planning is a widely used approach that adjusts the feedrate with the changes in curvature at a sensitive corner. It ensures that the chord error always stays in the tolerance zone. The adaptive feedrate
can be written as shown in Equation (11).
During the process of interpolation, the adaptive feedrate is calculated in every sample period, and then it will be compared with the command feedrate. A sensitive corner is met when the adaptive feedrate is smaller than the command one. Then, the adaptive feedrate, instead of the command one, will play the role of driving the tool along this sensitive corner. In this way, the feedrate remains constant for most of the machining time, and adaptively slows down at the sensitive corners. Taking the diamond shape as an example (
Figure 1), the profiles of feedrate, acceleration/deceleration, and jerk after adaptive feedrate planning are shown in
Figure 2.
However, the abrupt changes in acceleration and jerk can be observed at the start and end of the sensitive corner after adaptive feedrate planning. These changes have the potential to surpass the threshold limits of the machining dynamics. Therefore, we need a proper method to eliminate the abrupt changes in the feedrate profile generated by adaptive planning, whereby a balance point among machining accuracy, efficiency, and dynamics can be achieved, thus giving full play to the machine capacity and shortening the machining time.
3.2. Improved Adaptive Feedrate Planning
In this paper, a linear deceleration stage at the beginning of the corner and a linear acceleration stage at the end of the corner are applied to replace the corresponding parts of an adaptive feedrate profile, where the acceleration or jerk is larger than the threshold.
As shown in
Figure 3, the cutting tool should be slowed down from the command feedrate
to the feedrate
chosen as the terminal feedrate at the linear deceleration stage. Then, it goes through the sensitive corner with the feedrate profile generated by adaptive planning, until it reaches the feedrate
chosen as the initial one at the linear acceleration stage. Then, it will be sped up to the command feedrate again after passing the sensitive corner.
Following the improved adaptive feedrate planning method described, this paper introduces a novel look-ahead module for NURBS curve interpolation. The detailed operational mechanism of this module is illustrated in
Figure 4.
As shown in
Figure 4, a look-ahead buffer is created to store the interpolation vector (IV), including the profiles of feedrate, acceleration, jerk, etc., which are generated by the look-ahead module. Then, the buffer will be examined in detail to find out the jumps and to check the acceleration and jerk profiles. If the value of the acceleration or jerk is out of the preset range, the interpolated parameter will be picked out from the buffer to determine the endpoint at the deceleration stage, as well as the starting point at the acceleration stage. If both are present, they will be compared, and the parameter with the larger value will be selected at the linear deceleration stage, while the smaller one will be chosen at the linear acceleration stage.
Subsequently, new feedrate profiles for the linear deceleration and acceleration stages can be adopted to replace the relative parts of the adaptive feedrate profile where the dynamics capacity is exceeded. The other part of the feedrate profile can be reused rather than being discarded, as is the case with current approaches. Then, a corner buffer can be created to store the new profile for the sensitive corner. The interpolation values generated by the look-ahead module can be read from the buffer, and can be pushed into the output buffer by a writer. If a sensitive corner is met, the reader pointer will be relocated to the corner buffer and will then jump back to the look-ahead buffer until the corner buffer is finished. Meanwhile, an interpolation module will be started to re-interpolate the curve when the look-ahead module has gone further than a certain distance on the NURBS curve. Then, the interpolation value can be calculated from the output buffer in sequence, and a second interpolation can be performed according to the feedrate in the interpolation value. This is a necessary procedure because the tool cannot reach the same interpolation point after adjusting the feedrate profile. During the interpolation process, the look-ahead and interpolation modules run in turn in the sample period.
4. Interpolator Architecture
Actually, a smooth feedrate profile should be guaranteed when the linear deceleration and acceleration profiles are integrated into the profile generated by adaptive planning. As concerns the linear acceleration stage at the end part of the sensitive corner, the feedrate profile can be calculated by correctly selecting the acceleration and jerk.
4.1. Feedrate Profile Estimation
For the removal of the dynamic jumps in the feedrate profile, the feedrate is reduced from the command feedrate
to the adaptive feedrate
at the linear deceleration stage, where the acceleration or jerk exceeds the maximum value. If the deceleration value at the endpoint is
, the relationship between the feedrate and deceleration can be described using Equation (12).
where
is the total time of the linear deceleration stage. It should be considered that the deceleration time
must be an integral multiple of the sample time
; then, it needs to be recalculated using Equation (13).
Generally, the profiles of feedrate and acceleration are discrete; thus, the acceleration profile of the linear deceleration stage should be separated into a series of steps with an increment
in every sample period. Then, the federate
at the end of the linear deceleration stage should be corrected to the real value
using Equation (14).
However, the variation in the feedrate at the end of the linear stage caused by the procedure of rounding to an integer will result in an excessive dynamic jump due to the fact that the feedrate cannot be exactly decelerated to
. A proper procedure should be adopted to handle this problem. In this paper, a symmetric triangle profile of acceleration, as shown in
Figure 5, is superimposed onto the original one at the linear deceleration stage, aiming to compensate for such a deviation in the feedrate.
If the area of the triangle is equal to the variation in the feedrate
, the feedrate can be exactly reduced to
at the end of this stage. In fact, the area should be accumulated by
squares with
increments in height, as the acceleration profile is discrete. The correction of feedrate
produced by this additional triangle profile can be obtained using Equation (15).
Assuming correction
to be equal to
, the increment of acceleration
at every sample period can be achieved. As the deceleration time series is
, the feedrate profile of the linear deceleration stage can be obtained using Equation (16).
Moreover, the feedrate profile at the linear acceleration stage is similar to that at the deceleration stage.
4.2. Parameter Estimation
After feedrate adjustment using the improved adaptive planning, the newly generated feedrate profile can replace the buffer segments with abrupt changes or those exceeding the acceleration or jerk thresholds. Then, the methods by which we can estimate the parameter at the start point of the linear deceleration stage, as well as at the end point of the linear acceleration stage, become an obstacle when moving to the next step.
Taking the linear deceleration stage as an example, the moving distance can be estimated by the accumulation of the feedrate profile
and the sample time. It can be expressed as shown in Equation (17).
The deceleration distance
is larger than that of the adaptive feedrate profile from the beginning of the sensitive corner to the endpoint of the linear deceleration stage, because the deceleration of adaptive planning is quicker than the linear one. Hence, a longer distance is needed to slow down the feedrate from
to
. It means that the feedrate of the tool should be decreased in advance before it arrives at the beginning of the sensitive corner. The distance of deceleration from
to
according to adaptive planning can be defined as shown in Equation (18).
The feedrate profile
in Equation (18) can be read from the corner buffer shown in
Figure 4. Then, the number of interpolation points can be traced back from the beginning of the sensitive corner, as is defined by Equation (19).
If the parameters and represent the start point and the endpoint of the linear deceleration stage, respectively, the original feedrate at this section will be replaced by . Meanwhile, it should be noticed that the distance is a little bit longer than ; thus, the feedrate profile at the deceleration stage will shift back a little bit.
If the parameter read from the corner buffer at the feedrate is , then the parameter after the linear deceleration stage is a little bit smaller than , which is achieved by adaptive planning. This guarantees the profile at the deceleration stage, decreasing from the command to the minimum , which is smaller than the adaptive feedrate at the same position on the curve.
However, a drawback appears whereby the tool will not reach the bottom of the sensitive corner when the feedrate is decelerated to the minimum value. Moreover, the feedrate at the acceleration stage will exceed the adaptive one, resulting in a reduction in machining quality. In this paper, a number of
are added to the feedrate profile between the deceleration and acceleration stage. This could compensate for the moving distance, in order to drive the tool to reach the bottom of the sensitive corner. By doing so, the feedrate profile at the acceleration stage will shift a little bit forward, ensuring that the feedrate is less than the adaptive one, which coincides with the case of the declaration stage. Then, the number of
added to feedrate profile can be expressed using Equation (20).
Finally, the whole feedrate profile
can be expressed by Equation (21) when the tool arrives at a sensitive corner.
Taking the first sensitive corner in the diamond shape as an example, the feedrate profiles generated by adaptive planning and the proposed planning, respectively, are demonstrated in
Figure 6.
As described above, the proposed improved adaptive feedrate planning not only reserves the advantages of adaptive planning, which has a shorter machining time and a better machining performance, but it also removes feedrate changes at the beginning and end of the sensitive corner. After that, a second interpolation process will be started to calculate the increment of each motion axis with the feedrate profile generated by the proposed planning. It is quite simple and efficient because all the coefficients of the polynomial representation have been calculated in the look-ahead module, and they can be reused in this process.
4.3. Prediction–Correction Scheme
Normally, the synchronization mechanism, i.e., the look-ahead and interpolation tasks, is performed in the same sample period. It is used to ensure the continuity of interpolation. However, for a NURBS curve, the computation intensity of the look-ahead and interpolation modules is still quite high, and it is almost impossible to carry out these two tasks in a short sample period. Hence, a much longer sample period is needed, and this leads to the reduction in the machining accuracy.
In fact, it can be found that the relationship between the look-ahead and interpolation modules is a typical producer–consumer model. The former is designed to produce a smooth feedrate profile with the constrains of chord error and machining dynamics, while the interpolation module consumes the values of feedrate to generate the increment movement for each motion axis. Hence, the look-ahead module can be executed offline in the background continuously, and the interpolation module can be performed online in the foreground periodically. Hence, if the space of the FIFO buffer is big enough, the whole interpolation process could run constantly without any interruptions. Such an asynchronous mechanism takes the strategy space for time, and also removes the time constraint in the common interpolator with a synchronization mechanism.
In addition, according to the functions within the look-ahead module, it can be further divided into the modules of prediction and correction. In this paper, a new interpolator architecture with a prediction–correction scheme is proposed to boost the efficiency of the NURBS curve interpolation. It mainly includes three function modules—the prediction module, the correction module, and the interpolation module. A detailed diagram of the proposed interpolator is shown in
Figure 7.
The prediction module is not only used to calculate the next parameter value with the previous value and command feedrate using Equation (1), but is also applied to predict the trend in the curvature change. Then, it saves the interpolation values into a FIFO buffer before they are ready to be executed. When encountering a sensitive corner, the tool traverses it using adaptive feedrate planning until the endpoint is reached. A corner buffer is constructed to store the newly calculated interpolation values according to the prediction module. The feedrate is adjusted based on chord error to ensure the interpolated data’s accuracy remains within preset limits.
After completing the process of prediction, the interpolator will suspend the prediction module and activate the correction module. This module retrieves and recalculates values in the FIFO buffer for correction, aiming to adjust feedrate, acceleration/deceleration, and jerk to meet machining accuracy and dynamics requirements. Prediction and correction are suspended once the FIFO buffer is full, resuming once space becomes available. The feedrate profile generated by the proposed prediction–correction scheme is shown in
Figure 8, which displays half of a diamond shape.
Finally, as shown in
Figure 7, the interpolation module will be awakened at each sample period and will start to output the interpolation points. Then, it transfers the interpolation data to the CNC, which will translate the values to the servo commands to control the motion of a machine tool. In effect, the production of the prediction and correction is abundant enough to fill the FIFO buffer up, as these two modules are running continually in the background. Meanwhile, the consumption speed of the interpolation module is fairly low, due to the fact that it is performed periodically. Obviously, the proposed prediction–correction scheme replaces the time constraint with a space constraint. This makes it possible to further shorten the sample period in order to improve the accuracy of the tool path.
5. Experiments
To substantiate the efficacy of the proposed method, a comprehensive simulation study was conducted. Utilizing the diamond-shaped example depicted in
Figure 1, this study compared it with two established approaches—adaptive feedrate planning and jerk-limited feedrate planning. The resulting feedrate, acceleration, and jerk profiles post-planning are illustrated in
Figure 9. Due to the symmetrical nature of the diamond shape, only half of the curve is displayed for clarity.
In addition, the simulation results of the total machining time are listed in
Table 2.
Figure 9 presents the parameter domain results for the adaptive, jerk-limited, and proposed feedrate planning methods. The adaptive planning method shows significant acceleration and jerk fluctuations at sensitive corners, with maximum values reaching
and
, respectively. Jerk-limited planning smooths these transitions but sacrifices feedrate, leading to increased machining times, as detailed in
Table 2. The proposed method mitigates these dynamic jumps at sensitive corners while maintaining the feedrate profile of adaptive planning in other areas. Although the acceleration and jerk in the proposed method are higher than in jerk-limited planning, they remain within the predefined limits. This approach effectively combines the benefits of both adaptive and jerk-limited planning, offering a comprehensive solution for feedrate adjustment that balances machining accuracy and machine tool dynamics.
In addition to the simulation, a machining experiment was performed on a mini-milling machine.
Figure 10 displays the setup, where a custom controller manages the machine’s motion axes, switches, and indicators. A self-develop CNC software running on a PC platform interprets the G-code with NURBS curves from the CAM software (UG NX 10) and sends the commands to the controller via the ethernet. The controller’s interpolator then adaptively adjusts the feedrate based on the NURBS curve’s curvature and computes the axis increments to guide the tool along the path.
As shown in
Figure 11, a core with a waved freeform surface in a plastic module is machined as an example to prove the validity and feasibility of the proposed method. The tool path is generated by UG NX8.0, and is then converted to G-code file with NURBS style (compatible with FANUC).
Firstly, an air cutting experiment, removing the tool from the spindle, is carried out to compare the feedrate profiles produced by the adaptive planning and proposed methods. The count values from the encoders of servo motors are recorded at intervals of 5 ms, and then they are integrated into the profile of feedrate, acceleration, and jerk at the cutter location. Due to the fact that the results will not be affected by the cutting condition, they can be used to evaluate the performance of the NURBS interpolator. The measured results are shown in
Figure 12.
According to the results from the air cutting experiment, the total machining time is about 614 s when using the method of adaptive feedrate planning, and about 651 s when using the proposed method. The machining efficiency has a slight reduction—no more than 6%—when using the feedrate profile generated by the proposed method. The acceleration and jerk profiles achieved by the adaptive planning method have much larger amplitudes than the ones from the proposed method, and even exceed the limitation values of predefined acceleration and jerk in some areas. Moreover, the profiles generated by the proposed method have a relatively smooth shape, and thus, both the acceleration and jerk are within the allowable range. This can be ascribed to the linear acceleration/deceleration profile added to the original one generated by adaptive planning, to limit the acceleration and jerk within the threshold. In addition, a wave shape can be observed from the feedrate profile, which happens to be the shape of the machined surface.
Furthermore, the feedrate profile generated by the proposed method displays a wave shape, which corresponds to the shape of the machined surface. As depicted in
Figure 13, two parts were machined using both adaptive planning and the proposed method. The workpiece material was P20HH, with a feedrate set at 1000 mm/min, a spindle speed at 8000 rpm, a cutting depth at 0.05 mm, and a 5 mm diameter solid-carbide cutting tool was used for finish machining.
According to the machined parts, some flaws could be observed from the part machined by the adaptive feedrate planning at the sensitive corner, which result from the overcut caused by the jumps of machining dynamics at the beginning and end areas of the feedrate profile. A smoother surface, in contrast, could be achieved by the proposed feedrate planning method in the same area, while only paying a cost of a less than 6% longer machining time.
Furthermore, the surface roughness data for the area depicted in
Figure 13 are detailed in
Table 3. A MarSurfVD 140 roughness meter, manufactured by Mahr Group, was utilized to measure the roughness at three distinct positions within the machined zone. These measurements serve to assess the machining quality across different planning strategies, thereby providing further validation of the effectiveness of the proposed method.
Therefore, a balance point, among accuracy, machining dynamics, and efficiency, can be attained using the proposed comprehensive solution for the NURBS curve interpolation.
6. Conclusions
In this paper, a comprehensive solution for the interpolation of NURBS curves has been developed. Initially, a polynomial representation for calculating the intermediate points, as well as the first and second derivatives of a NURBS curve, was introduced to enhance computational efficiency. Subsequently, an improved adaptive planning approach was presented to adjust the feedrate at sensitive corners, thereby eliminating the abrupt changes in acceleration and jerk in the profiles generated by adaptive planning. In addition, the proposed method reutilizes the remaining part of the feedrate profile calculated by the look-ahead module, rather than discarding them as is commonly carried out in current approaches. Therefore, it will further improve the computational efficiency of NURBS interpolation. Furthermore, an asynchronous mechanism utilizing a production–consumption model was applied to schedule the interpolation and look-ahead modules during the interpolation process, replacing time constraints with space constraints. In this way, we can set a smaller interpolation sampling period to meet the demands of high-speed and high-precision machining.
Consequently, a balance among machining accuracy, dynamics, and efficiency has been achieved through the proposed comprehensive solution for NURBS curve interpolation. The proposed method synthesizes the advantages of adaptive and jerk-limited planning, offering an integrated solution for adjusting feedrate to meet the demands of machining accuracy, efficiency, and stationarity. The effectiveness and correctness of the proposed method have been demonstrated through simulation tests and machining experiments.