Real-Time NURBS Interpolation under Multiple Constraints

NURBS interpolation is superior to traditional linear or circular interpolation in terms of code size, surface quality, and machining efficiency. However, with the increasing demands for high-accuracy and efficient machining, NURBS interpolation has faced a growing number of challenges. Many researchers are actively involved in this field with great interest. Due to the special form of NURBS curve, there is a nonlinear relationship between its curve and arc length; feed fluctuations and mechanical shocks which are caused during the interpolation process will seriously affect the surface accuracy and quality of machined parts. To solve these problems, a real-time NURBS interpolation is proposed under multiple constraints (RNIC) in this paper. First, the formulas of the constrained feedrate under geometric errors, kinematic constraints, drive constraints, and contour errors are given. Then, the two stages for the proposed interpolation are established. The former stage is offline preprocessing stage, which aims to quickly find feedrate sensitive areas (FSAs), while the latter online stage is the real-time interpolation, which is responsible for smoothing the velocity. In the preprocessing stage, we utilized FSA scan module and feedrate adjustment module to detect the FSAs and adjust the feedrate at the start/end of each subsegment by a bidirectional scanning algorithm. Each segment contains acceleration and deceleration (some contains uniform speed) stages, which can be well matched with the processing process of acceleration and deceleration. Finally, according to the proposed method and the adaptive speed adjustment method, the simulation of a “butterfly-shaped” NURBS curve using the S-shaped ACC/DEC algorithm is carried out, which verifies the reliability and effectiveness of the proposed algorithm.


Introduction
As one of the international industrial standards of CAD system, NURBS curves play an increasing role in the application fields of computer-aided geometric design (CAGD) with the wide application of this geometric model. Profiting from the ability of changing the shape of local contours and describing complex contours by loworder equations, NURBS interpolations have been increasingly developed in CNC machining. NURBS interpolation is superior to traditional linear and circular interpolation in terms of code size, surface quality, and machining efficiency. However, there are still some challenges in building a successful NURBS interpolator. First, the feedrate along the machining path may be limited by many factors including geometrical, kinematic, and axis dynamics constraints in large curvature areas; these constraints should be reasonably and smoothly adjusted to ensure good machining quality and accuracy. Second, abrupt curvature change will cause ACC/DEC and jerk out of tolerance. Last, there is no mathematical expression between the NURBS curve parameters and displacement, which inevitably leads to a fluctuation between the expected and actual feedrates.
In order to improve machining accuracy and efficiency, Yeh and Hsu [1] adaptively adjust the feedrate considering the constrained chord error, which improves the contour accuracy of parametric curve interpolation. Yong and Narayanaswami [2] proposed the concept of feedrate sensitive corners to confine acceleration and deceleration in offline processing. Nam and Liu [3,4] further limited the effect of jerk on machining in NURBS interpolation. While these efforts are effective, many key constraints are overlooked; various advanced algorithms have been further developed by many researchers. For example, Sencer et al. [5] solved the analytical solution of feedrate in the form of cubic B-spline, but the calculation efficiency of this process is low. Sun et al. [6] proposed a feedrate scheduling method based on drive constraints. Xavier et al. [7] developed a velocity profile optimization method based on iterative calculation of intersection points with given constraints. However, this method ignores the influence of contour accuracy. Jia et al. [8] proposed a NURBS interpolator under kinetic characteristics and contour error constraints, in which the feedrate remained constant in most areas and only changed smoothly in areas with large curvature, but the production efficiency was degraded when utilizing a constant low feedrate without making full use of the motion performance in this method. Ma et al. [9] also considered, from the perspective of axis restriction, maintaining constant feedrate in the sensitive area and smooth transition in the non-sensitive area. Liu et al. [10] used a linear mathematical model to explore the relationship between feedrate and geometric constraints. Liu et al. [11] also developed a new feedrate optimization method under multiple constraints and finally fitted to the smooth spline curve. However, these two methods only considered the influence of geometric and axis dynamics errors. Zhong et al. [12] further limited the axial velocity, axial acceleration, jerk, and contour errors through a look-ahead module.
Moreover, to mitigate the feed fluctuation to further improve the machining accuracy, many methods have been proposed for NURBS interpolation. Liu et al. [13] proposed a NURBS interpolation using approximation errors, but the calculation coefficient polynomial equation is time-consuming. Liu et al. [14] proposed a highly accurate interpolation method by establishing an improved quartic equation related to the curve parameter increment to reduce the feedrate fluctuation caused by approximation errors. However, this method obtains a quartic equation by ignoring the higher-order term (order >4), which has limited adaptability. Ni et al. [15] proposed a round-off error-free feedrate scheduling method. However, this method limits the feedrate to meet the various constraints by increasing the interpolation time, which is not efficient. Song et al. [16] compensates the interpolation parameters in order to improve the calculation accuracy of the parameters for the next interpolation point. Jiang et al. [17] presented an iterative feedback interpolator that consists of estimator and corrector stages to restrain the feedrate fluctuation. Chen et al. [18] developed a NURBS interpolation method for deriving parametric curves based on Steffensen's iterative method to avoid unnecessary feedrate fluctuations. Ji et al. [19] calculated the interpolation point parameters through iterative correction to obtain the accurate position and reduce the federate fluctuates. However, these methods have difficulty guaranteeing convergence when using iterative methods. To reduce feedrate fluctuations, Wang et al. [20] developed a biinterpolation algorithm using two second-order Taylor expansions in one interpolation cycle. However, the time cost of this algorithm is relatively large.
In addition, much effort has been made to develop feedrate optimization techniques, and many fruitful feedrate scheduling methods have been proposed. e feedrate profile of the linear acceleration and deceleration algorithm [21][22][23] is not smooth, and machine vibration will inevitably occur during the movement. In the early days, NURBS interpolation was realized by using the speed adaptive adjustment methods [1,24], but these methods could not meet the tolerance limits of chord error, acceleration, and jerk. Du et al. [25] developed a complete S-shaped NURBS interpolation under confined jerk, acceleration limits, which adopted compensate on strategies to make the federate more continuous and the arc increment more precise. Lin et al. [26] used a look-ahead module to generate smooth feedrate profile to accommodate NURBS curve dynamics. Liu et al. [27] proposed the idea of NURBS curve segmentation to construct a new NURBS interpolator to improve contour error accuracy. Sun et al. [28] optimize short-line segmented machining using S-shaped ACC/DEC algorithm and time optimization function to obtain better machining accuracy and efficiency. Liu and Leng [14,29] proposed a cubic polynomial NURBS interpolation. However, the cubic polynomial ACC/DEC algorithm is inefficient, and the jerk profile is discontinuous, which will impact the machine tool. Liu et al. [30] further improved and proposed the jerkcontinuous NURBS interpolation method, which improved the contour machining accuracy and improved the low flexibility at small curvature sharp corners. However, these methods only consider the influence of the geometric characteristics of the curve and ignore the influence of the dynamic performance and contour error. Ni et al. [31] proposed a jerk-continuous NURBS interpolation. However, the computational load of this method is high, as the algorithm needs to deal with the coexistence of trigonometric functions and polynomial functions at the same time. Zhao et al. [32] applied a jerk-limited method to smooth the sharp corners of the final feedrate profile, which improved the feed correction polynomial to reduce the feed fluctuation. Furthermore, to address the problem of feedrate curve fluctuations in regions of large curvature, Su et al. [33] made full use of the local geometric information and adopted the method of sliding arc tube to optimize the target feedrate.
Traditional method is to subsegment the curve and then perform acceleration and deceleration processing based on local geometric information. In fact, when the arc length is less than the shortest requisite ACC/DEC distance, there are many types of ACC/DEC involved, and the processing is very complicated, which is not conducive to the realization of real-time interpolation. is article innovatively proposes a novel bidirectional scanning algorithm. For the curve subsegment with shorter arc length, directly process it at a uniform speed, discarding the complicated ACC/DEC process; for the long curve subsegment, readjust the acceleration end point or deceleration start point according to the acceleration or deceleration distance to meet the S-curve ACC/DEC requirements. is method is simple and efficient to process shorter curves, which is in line with the actual processing process of the special difficult-to-machine parts of the workpiece. erefore, it can effectively improve the indicated processing quality of the processed part without increasing the hardware cost. Although the processing time 2 Computational Intelligence and Neuroscience is extended to a certain extent, generally speaking, because the arc length of the curve subsegment is shorter, it is meaningful to sacrifice a certain amount of time to obtain higher real-time performance and processing effect.

The Presented Interpolation Architecture
2.1. NURBS Parameter Discretization. NURBS curves can be represented by parameters as follows: where i is the index i � 0, 1, . . ., n; Pi { } is the set of control points; ωi { } is the set of weights; and Ni, p(u) is the set of p-order B-spline basic functions defined on the non-uniform knot vector U, U � u0, u1, . . . , un + p + 1 .
e Bspline basic function Ni, p(u) is calculated as e first-order and second-order derivatives of B-spline basic functions and NURBS curves are, respectively, given as e first derivative and second derivative of c(u) can be calculated as For a point c(u) on the NURBS curve, the curvature radius ρ(u) can be calculated by where ‖ · ‖ stands for the Euclidean norm and × means the exterior product. In this paper, the Adams-Bashforth-Moulton method (ABM) is adopted to discretize the parameter vector for NURBS interpolation. e ABM method is as follows: where v(u m ), T, and C ′ (u m ) are the velocity, the interpolation period, and the first derivatives of the NURBS curve; C x (u m ), C y (u m ), and C z (u m ) denote the parameter curve; u m corresponds to each axis component of the interpolation point C(u m ) on the curve. e NURBS interpolation process is continuously affected by geometric errors, motion errors, drive errors, and contour errors. Aiming at the above problems, in the preprocessing stage, under the premise of considering multiple constraints, a real-time NURBS interpolation under multiple constraints (RNIC) is proposed, which can accurately obtain the constrained interpolation feedrate and optimal interpolation points.

Architecture of RNIC NURBS Interpolation.
A systematic NURBS interpolator with smoothing feedrate at the FSA under multiple constraints is developed to enhance the interpolator performance with respect to the machining precision and machining quality. e overall structure of the interpolator is shown in Figure 1. e interpolator has two stages, namely, the preprocessing stage and the real-time interpolation stage. e former preprocessing stage aims to find the FSA quickly, while the latter real-time interpolation implements velocity smoothing and generation of interpolated toolpath points. e interpolator comprehensively considers various constraints, breaking through the geometric constraints, Computational Intelligence and Neuroscience kinematic feature constraints, and machine performance constraints of NURBS interpolation, including various constraints such as chord error, velocity, normal acceleration and jerk, contour error, and command feedrate. ere are two modules in the preprocessing stage, namely, the FSA scan module and the segment feedrate adjustment module, which are used to obtain the geometric features required by the NURBS curve as the input for the next step of real-time interpolation.
e goal of the FSA scan module is to efficiently obtain FSAs of the NURBS curve by introducing the first FSA scan algorithm, then find the critical point in each FSA in the The pre-processing stage  second FSA scan algorithm and divide the FSA curve blocks into subsegments, and further get more detailed information about the geometric features of subsegments. e goal of the segment feedrate adjustment module is to optimize the feedrate profile for segments data generated by the former FSA scan module, which includes short segments processing, long segments backward scanning, and long segments forward scanning. During short segments processing, update the feedrate of the start/end point at the beginning and end of the segment to the same smaller speed, and then keep the entire short segment interpolation speed constant; during long segments processing, use backward and forward directions. In the forward scanning process, in order to simplify the processing flow, first set the start/end speed of the beginning and end to the smaller speed, and then obtain the actual maximum allowable feedrate of each segment; in the backward scanning process, the starting point of deceleration for a long segment is obtained.
In the real-time interpolation stage, it is mainly to obtain the feedrate and calculate the precise coordinates of the next interpolation point. e s-shape based feedrate scheduling is adopted to achieve smooth feedrate profile which can greatly improve the accuracy of interpolation.

Scheduling of the FSA under Multiple Constraints
is paragraph describes the scheduling method of FSA. First, determine the allowable feedrate on the NURBS curve under the constraints of geometric characteristics, dynamic characteristics, etc., and give its corresponding mathematical function formula. en, the FSAs are detected quickly with a two-stage scanning method, which employs FSA scan and feedrate adjustment modules. e goal of the FSA scan module is to quickly find the FSA, including the maximum allowable feedrate calculation, the first scanning stage, the second scanning stage, and the FSA partition. e goal of the FSA feedrate adjustment is to optimize the start/end feedrate of the acceleration/deceleration phase, which includes intersection processing, backward scanning, and forward scanning.

Allowable Feedrate for Chord Error Constraint.
Considering the chord C(u i ), C(u i+1 ) is a tiny segment in Figure 2, the arc approximation method can be used to calculate the chord error. In Figure 2, P(u i ) is a point on the circle, C(u i ) is a point on the curve, P(u i ) and C(u i ) are the coincident interpolation points, and the parameter vectors are both u i . P(u i+1 ), C(u i+1 ) are the next estimated interpolation points, and their parameter vectors are both u i+1 . Considering

Allowable Feedrate for the Normal Acceleration and
Normal Jerk Constraints. Acceleration is the rate at which the speed and direction of an object are changing; it can be broken into its tangent and normal components. Here we first consider the normal acceleration; it can be expressed as erefore, the allowable feedrate v c2 (ρ(u i )) by the normal acceleration constraint is given as where a n, max is the maximum normal acceleration. e normal jerk is calculated as Hence, the allowable feedrate v c3 (ρ(u i )) for the normal jerk constrained can be derived as where j n, max is the maximum normal jerk.

Curve
Circle Computational Intelligence and Neuroscience

Allowable Feedrate for the Contour Error Constraint.
e contour error directly affects the machining effect of the workpiece. For this reason, we include the contour error constraint in the preprocessor process to effectively limit the contour error from the source. Accurate estimation of contour errors has a significant impact on the quality of contour control. e contour error should satisfy the following formula: where ε lim is the given contour error.
e servo-lag induced contour error in real machining is considered as an additional constraint accompanied by the geometric and drive constraints during feedrate scheduling, so that the contour error can be bounded from the source. According to the literature [8], the feedrate constraint formula under the limitation of contour error is introduced as follows:    Computational Intelligence and Neuroscience us, the constrained interpolation feedrate v cons (u) can be obtained as v con (u i ) is the allowable feedrate under multiple constraints. It can be seen that the constrained feedrate is only related to the curvature of the point. However, due to the continuous influence of curve curvature fluctuation, NURBS interpolation will still be affected by the tolerance of tangential acceleration and jerk in the large curvature part. en, a novel curve subsegmentation method was proposed during the preprocessing stage using a two-stage FSA scan method to obtain sufficient geometric characteristics of the curve. Compared with the existing methods, this method not only considers the optimal speed under various constraints, but also uses the preprocessing process to obtain enough curve geometric characteristic information without adding additional hardware.

e Preprocessing Stage
3.2.1. Curve Splitting at Breakpoints. During acceleration and deceleration on real-time interpolation of NURBS curves, the remaining curve distance needs to be calculated. e adaptive Simpson method can be used to calculate the length of the subsegment of the curve [8,27]. But if there are breakpoints that appear to be discontinuous, C1 continuity is not satisfied which is a necessary condition for adaptive Simpson method. erefore, the key is to find the breakpoints on the curve and segment the curve with the breakpoint as the boundary.
ere are roughly two types of breakpoints [3]. e first type is the points of C0 continuity. e second type is the points with C1 continuity when there are multiple corresponding control points. en, the NURBS curve can be segmented into blocks according to these two kinds of breakpoints, and the buffer [u blocki s , u blocki e ] represented as the parameter interval of i-th block.

e Two-Stage FSA Scan.
Although NURBS curves are roughly divided into blocks according to breakpoints, the interpolation of each block will continue to be affected by the change of curve curvature. In order to realize smoothness interpolation, ACC/DEC feedrate profile needs to be adopted in the interpolation. e more geometrical characteristic obtained, the better the acceleration and deceleration effect.
is paper creatively proposes a two-stage feedrate sensitive area (FSA) scanning method that can efficiently obtain sufficient geometrical characteristic without adding extra burden to real-time interpolation module. FSA represents a special area of the curve, which reflects the area where the allowable feedrate on the curve is less than the commanded feedrate. e first stage of an FSA scanning method is to obtain the FSAs of the curve, and the second stage is to get more detailed information of FSAs, such as the parameter of the start/end point, critical point, and the corresponding constrained feedrate of the FSAs.
In the first stage scanning, the input data is the curve block parameter interval [u block s , u block e ] which is the output of Ssection 3.1. Firstly, the parameter interval is discretized into a set of elements u i by step size Δu.
en, the constrained feedrate v con (u i ) of each point C(u i ) is calculated according to (15). If v con (u i ) < v F , then the point C(u i ) belongs to the feedrate sensitive area (FSA); otherwise, it belongs to the feedrate insensitive area (FIA). erefore, the points of the curve block can be classified to FSA and FIA datasets through the first stage scanning. If the FSA set is not empty, it indicates that there are some feedrate sensitive areas in the curve block, and the constrained feedrates of the points in FSA are lower than the command feedrate. If the FIA set is not empty, it indicates that there are some feedrate insensitive areas in the curve block, and the constrained feedrates of the points in the FIA can reach the command value v F . e step size Δu is important in the first stage scanning; the larger the step size is, the fewer the points are. If the step size is very large, some FSAs will be lost, and if the step Set V max � V act max−i . 10: i ++ Computational Intelligence and Neuroscience size is too small, the processing time will be increased. In actual processing, the step size shall be flexibly selected according to experience and curve characteristics.
After that, the second scanning stage is performed; the input data is the FSA and FIA datasets of the first stage scanning. In this stage, the curve blocks are further divided into subsegment, and it is necessary to obtain the geometrical characteristics information, such as the start/end point of the FSA.
Suppose there are four points C(u a ), C(u b ), C(u i ), C(u j ) on a curve block, where the parameters u a , u b ∈ FGA m , and u i , u j ∈ FIA m , C(u a ) and C(u b ) are the adjacent points. If u a < u i < u j < u b , there must exist a feedrate sensitive area in the parameter interval [u a , u b ]. So the second stage scanning is carried out for the detailed information of the FSA.
In the second stage scanning, the parameter interval [u a , u b ] is discretized into a set of elements u i i�1...n by step size Δu ′ , and the corresponding curve is divided into n Updating v s and v e as follows  e constrained velocity of each point C(u i ) is calculated according to equation (6). If v con (u i−1 ) �� v F and v con (u i ) < v F , it means that the velocity of the previous point C(u i−1 ) is exactly equal to the command velocity v F and the velocity of the current point C(u i ) is lower than the command velocity v F , and the current point C(u i ) is considered to be the start point of the FSA; if v con (u i ) < v F and v con (u i+1 ) �� v F , it means that the velocity of the next point e critical point has minimum radius of curvature and lowest feedrate in an FSA. erefore, the critical point can be regarded as the start/end point of the acceleration/deceleration process in ACC/DEC feedrate profile. Between the two adjacent critical points, there is only one acceleration process and one deceleration according to the characteristics of NURBS curve. Hence, the curve block can be divided into several subsegments by critical points.
is will greatly simplify feedrate planning for the feedrate profile of each subsegment has only one acceleration and one deceleration process.
After the seconde stage scanning, e NURBS curve block can be partitioned into subsegments by critical points with the datasets u , which can be calculated by the adaptive simpson method [8,27]. e flow chart of the two-stage scanning method is shown in Figure 3.

A Bidirectional Scanning Approach for the Subsegments.
e curve is divided into subsegments according to the critical point following the above method. If the arc length is not long enough, the feedrate cannot reach the command feedrate before deceleration. In addition, when the arc length is too short, even if the feedrate keeps accelerating or decelerating, it cannot reach the end velocity before reaching the endpoint of the subsegment. To deal with the short curve segments, there are seventeen types of feedrate profiles in [25], leading to the complex and time consume processing. In another paper, the authors proposed a new method that the scheduled feedrate keeps constant at most areas [8]; this method greatly simplifies the processing process, but the machining efficiency is also greatly reduced. For is the deceleration displacements, and v F is the command feedrate.
ere will exits a constant feedrate profile between acceleration and deceleration when n > 0 for. e minimum required ACC/DEC displacement is obtained if n � 0 as follows: And if it means that the arc length l seg i is shorter than minimum required ACC/DEC displacement, and the feedrate profile of the segment cannot achieve the command federate v F during the ACC/DEC procedure. If the arc length l seg i is longer than minimum required ACC/DEC displacement, the feedrate profile can accelerating from v i s to v F and decelerating from v F to v i e . In this case, the start point of the deceleration should be decided precisely for the real-time interpolation.  Computational Intelligence and Neuroscience erefore, we propose a bidirectional scanning method to further process the subsegment curve which consists of two stages: (1) forward scanning; (2) backward scanning. e forward scanning is to reduce the types of feedrate profiles and improve time efficiency for short subsegment. First, the feedrate of the start/end point of the subsegment is set to be the same value, so that all subsegment can be regarded as the superposition of acceleration and mirror deceleration processes. Without loss of generality, the acceleration distance from the start point to the end point is exactly half of the arc length of the subsegment; that is, the acceleration from the start point to the end point just reaches the actual maximum feedrate. is not only takes into account the efficiency, but all short subsegments can use the same method to simplify the processing method. After forward scanning, each subsegment updates feedrate of the start/end point and gets the maximum allowable feedrate V max that can actually be achieved and obtains the output dataset u segi s , v i s , l seg i , V max , u segi e , v i e . e backward scanning is to obtain the deceleration start point of each subsegment. For the long subsegment, the deceleration feedrate profile is decelerating from the command velocity to the velocity of the end point, while the short subsegment is decelerating from the actual maximum velocity to the velocity of the end point. e deceleration velocity profile is just the opposite of the acceleration velocity profile. e deceleration process can be regarded as the inverse process of acceleration, so as to get the start point of the deceleration. rough the backward scanning, the deceleration starting point can be found and gets the output dataset u e bidirectional scanning algorithm is mainly to adapt to the changing curvature characteristics of the NURBS curve. It uses the forward scanning to handle the feedrate at the start and end of the curve segment, as well as the actual maximum feedrate. It uses the backward scanning to get the deceleration starting point. However, the limitation of the bidirectional scanning algorithm is that if the velocities of the start and end points are different, the velocities at the convergence point of forward and backward interpolation need to be calculated, and the acceleration needs to be readjusted to make the velocity transition smoothly. In this paper, the feedrate of the start and end point of the subsegment is set to be the same value, so that all subsegments can be regarded as the superposition of acceleration and mirror deceleration processes. e pseudocode representation of the forward scanning and backward algorithm are shown in Tables 1 and 2, and the specific steps are as follows.
(A) Forward scanning: Step 1. Let i � 0, i is the counter; Step 2. Get the arc length l seg i , the starting feedrate v i s , and the ending feedrate v i e of the i-th subsegment; Step 3. Calculate the minimum required ACC/DEC displacement S min seg (v i s , v i e ) of the i-th subsegment accelerating from v i s to v F (command feedrate) and decelerating from v F to v i e under an S-shape ACC/ DEC feedrate profile described in reference 26 with acceleration and jerk of A and J;  If the velocity at the starting/ ending point of the previous subsegment is updated, the velocity at the starting/ending point of the adjacent subsegment should be updated to a lower velocity by an iterative method.
Step 6. Recalculate the new maximum achievable feedrate V act max−i to satisfy S(v i s , V act max−i ) � l seg i /2 that accelerated from v i s to V act max−i and the displacement is half of the subsegment arc length, set V max � V act max−i . Step 7. If i< N, N represents the number of subsegments, set i � i+1; then go to Step 2; otherwise, end the program.
(B) Backward scanning: Step 1. Set i � N; N represents the number of subsegments.
Step 2. Get the arc length l seg i , maximum feedrate V max , and the end feedrate v i e of the i-th subsegment from the forward scanning output.
Step 3. If V max �� v F (command Feedrate), take the velocity of the ending point as the starting velocity, and v F as ending velocity. e deceleration start point u i dec calculated reversely from u i e is the deceleration start point under S-shape ACC/DEC method described in reference 26; if V max < v F , take the velocity of the ending point as starting velocity, and V max as ending velocity, l i seg /2 as the displacement. Calculate the deceleration start point u i dec from u i e reversely.
Step 4. If i � 1, program ends; otherwise, set i � i−1, and go to Step 2.
After bidirectional scanning, the dataset of the final preinterpolation is obtained as u

Simulation and Results
e proposed NURBS interpolator is simulated on an Intel Core i7-8565U 1.8 GHz laptop. e butterfly-shaped curve is used for the proposed method shown in Figure 5. e proposed real-time NURBS interpolation under multiple constraints (RNIC) and adaptive feedrate interpolation (AFI) are adopted for comparison. e two methods are implemented for the butterfly-shaped curves, and the parameters are shown in Tables 3 and 4. e curvature of the test curve is shown Figure 6. e test curve has high curvature and low curvature regions. In the low curvature area, due to the constraint of curvature, the velocity will not be able to feed at the command velocity, which can be a good verification of our proposed method.
Both preprocessing and online interpolation routines are developed in C. Additionally, we use MATLAB software to quantitatively analyze the actual velocity, tangential acceleration, and tangential jerk, which can be expressed as follows:  Figure 5 shows FSAs detected by the proposed scheme (RNIC) indicated by asterisk and hollow circle, where the asterisk marked points are the starting/ending point of a FSA, and the hollow circle marked points are the minimum velocity point of the FSAs, called the critical points. e NURBS curve block can be partitioned into subsegments by critical points. All information of segments for the test curve is listed in Table 5. ere are 21 segments on the test curve, where U_start and U_end are the parameters of starting/ ending point of segment, and V_start and V_end are the velocity of starting/ending point of the segment. Required arc length is the minimum length for the complete S curve acc/dec profile from U_start to U_end at the test curve. Acture arclength is the length of the curve from the U_start to U_end at the test curve. e complete S curve profile field shows that the curve segment can complete a complete acceleration and deceleration process when the value is 1, or cannot complete when the value is 0. e optimized velocity profile by two methods is shown in Figures 7 and 8, and the corresponding tangential acceleration/tangential jerk profiles are presented in Figures 9-12. As depicted in Figures 7 and 8, the feedrate is under the command feedrate by two methods. However, as shown in Figure 7, the starting speed of the feedrate profile in AFI method is rising directly from 0 to the command feedrate, which will cause a large feedrate vibration and affects the processing quality. A similar situation exists at the ending point in Figure 7. In the AFI method, the feedrate can meet the contour error limit adapted by the chord error, but the tangential acceleration exceeds the given tolerance at most of the time as shown in Figure 9. e maximum tangential acceleration is 0.0076 mm/s 2 by AFI method, as shown in Table 5, which is seven times more than the maximum allowable value. At the same time, the fluctuation of acceleration also causes the tangential jerk to exceed the maximum allowable value. e maximum tangential jerk is 0.0382 mm/s 3 by AFI, as shown in Table 6, which is 380 times more than the maximum allowable value.
Compared with the AFI method, As shown in Figure 8, the initial speed of the feedrate profile in the proposed RNIC method starts at zero and then accelerates to the command speed. Correspondingly, at the end of the feedrate profile, the speed decelerates to zero. In the feedrate scheduling process, the feedrate is optimized under multiple constraints. erefore, from Figures 10 and 12, the tangential acceleration and tangential jerk by the FSA method can met system requirements; all tangential kinematic constraints of the proposed method are satisfied perfectly as shown in Table 6. us, the smoothness of the speed of the interpolation process is ensured. e proposed RNIC method comprehensively considers the constraint of chord error, normal acceleration, normal jerk, and contour error in the preprocessing stage and directly introduces S-shaped ACC/DEC to the curve segments in the real-time interpolation. Compared with the AFI method, the proposed RNIC method adds a preprocessing module, which can realize the optimal feed under various constraints. It can be seen from the simulation results that the former has a greater improvement in speed smoothness than the latter. From the perspective of real-time processing, the former arranges non-real-time tasks to be completed in the preprocessing stage which can greatly reduce the working load of the real-time interpolation module, so that high-speed and high-precision machining with a smaller interpolation period can be achieved. In this sense, the real-time performance is significantly improved.

Conclusion
In this paper, a real-time NURBS interpolation is proposed under geometric errors, normal kinematic constraints, and drive constraints. e preprocessing process is used to solve the problem that the velocity in NURBS interpolation is difficult to deal with under the condition of multiple constraints. e comparison and simulation analysis of the proposed RNIC method and the AFI method show that the proposed method has greatly improved in terms of velocity smoothness, acceleration, and jerk continuity. e simulation results show that the proposed algorithm is effective and greatly improves the real-time performance of the NURBS interpolator.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.