# A High-Precision Planar NURBS Interpolation System Based on Segmentation Method for Industrial Robot

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Segment NURBS into Bezier Curves Based on Closed-Loop Chord Error Constraint

#### 2.1. Definition of NURBS Curve and Knot Insertion

_{i,k}(u) and has properties similar to those of the k-th normalized B-spline basis function N

_{i,k}(u), such as normality, local support, and differentiability. ${\omega}_{i}$ is the weight factor, and the control points are represented by P

_{i}. Connecting them in order with line segments forms the control polygon.

#### 2.2. Curve Segment Based on Closed-Loop Chord Error

Algorithm 1: Segmentation of NURBS curve with chord error δ_{c}. | |

Input: | Input NURBS curve parameters, Chord error δ |

Output: | Bezier curves that satisfy the δ_{c} |

1: | knot insertion → Bezier curve Bi; |

2: | for i = 1 to Bezier curve number do |

3: | calculate the parameter u with zero curvature in the type-S curve Bi. |

4: | calculate the δ_{max} in the type-C curve Bi. |

5: | If δ_{max} > δ_{c} then |

6: | Bisection method → segment curve Bi → 1 Bi, 2Bi; |

7: | do algorithm 1 for 1Bi; |

8: | do algorithm 1 for 2Bi; |

9: |
else |

10: | return 1Bi, 2Bi; |

11: |
end |

12: | end |

## 3. S-Shaped Feed Rate Profile Generation and Dynamic Speed Adjustment

#### 3.1. S-Shaped Feed Rate Profile

_{s}representing the initial feed rate, v

_{spe}representing the operating feed rate, v

_{e}representing the final feed rate, S representing the specified displacement, V

_{max}representing the maximum feed rate (set to v

_{spe}), A

_{max}representing the maximum acceleration, and J representing the maximum jerk. t

_{s}is defined as the variable time, t

_{ls}is the critical time for acceleration and deceleration, and t

_{sp}represents the duration of constant acceleration during the variable acceleration phase. The corresponding acceleration a(t), feed rate v(t), and displacement S(t) can be calculated based on time and the three acceleration states using the following formulas:

_{s}, v

_{e}, and v

_{spe}, determine if there is constant linear interpolation. If v

_{s}, v

_{e}, and v

_{spe}are equal, it indicates that only constant linear interpolation exists in this planning, so proceed to interpolation with only the constant linear segment d. If the trajectory does not involve constant linear interpolation, proceed to step 2;

_{s}to v

_{spe}, and v

_{spe}to v

_{e}, denoted as S

_{1}. Calculate the variable displacement S

_{2}when directly accelerating from v

_{s}to v

_{e}, without going through v

_{spe};

#### 3.2. Dynamic Speed Control Planning

_{a}

_{0}and the corresponding velocity v

_{a}

_{0}needed to change the initial acceleration a

_{s}to zero.

_{max}represents the maximum acceleration, and J

_{max}represents the maximum jerk. Based on the current v

_{s}and the desired v

_{e}, a determination is made whether to accelerate or decelerate. If acceleration is required, Equation (17) is employed. Conversely, if deceleration is needed, Equation (18) is used. S

_{a}and S

_{d}denote the displacement for acceleration and deceleration, respectively. By ensuring an adequate length of displacement for feed rate lookahead, smooth braking can be achieved. Figure 6 illustrates these two scenarios.

## 4. Bidirectional Feed Rate Scanning of S-Shaped Profile

**V**and the acceleration vector

**A**at any point on the processing trajectory of the manipulator‘s end effector can be expressed as follows:

_{ac}and the curve unit tangent $\tau $, optimized values for the maximum tangential feed rate ${V}_{\mathrm{max}}^{\mathrm{opt}}$ and maximum tangential acceleration ${A}_{\mathrm{max}}^{\mathrm{opt}}$ can be obtained. The formulas are as follows:

Algorithm 2: Bidirectional Scanning. | |

Input: | ${V}_{end,i-1}$ is the end feed rate of the (i − 1)th segment (the start feed rate of the i-th segment); ${L}_{i,list}^{\left(N\right)}$ is the lookahead sublist of segment length; ${F}_{i,list}^{\left(N\right)}$ is the lookahead sublist of feed rates; V_{max} is the maximum feed rate; A_{t,}_{max}/J_{t,}_{max} are the maximum tangential acceleration/jerk; $\delta $ is the maximum chord error; ${\kappa}_{i,max}$ is the curvature at key points along the curve segment; A_{n}_{,max}/J_{n,}_{max} are the maximum normal acceleration/jerk; T_{s} is the sampling period. |

Output: | V_{end}_{,i} |

Step 1: | 1.1. If N = 1, stop the lookahead calculation and let V_{end}_{,i} = 0; Otherwise, go to 1.2. |

1.2. Let k = N − 1, ${V}_{end,i}^{\text{}b}$ = 0; | |

Step 2: | 2.1. ${L}_{i,list}^{\left(N\right)}$[0], V_{end}_{,i−1}, ${F}_{i,list}^{\left(N\right)}$[0], J_{t,}_{max}, A_{t,}_{max}, T_{s} are utilized in the backward scanning, recursively backtracking from the last segment of the lookahead window to the second segment, to calculate the end feed rate ${V}_{end,i}^{\text{}b}$ based on the current segment velocity and constraints; |

2.2. The minimum feed rate under the given geometric constraints, as well as the kinematic constraints in both the task space and joint space, is assigned as the end feed rate of the current segment. It is given that ${V}_{end,,i}^{\text{}b}=\mathrm{min}\left({V}_{end,,i}^{\text{}b}{,V}_{\mathrm{max}}^{opt},\frac{2}{T}\sqrt{\frac{2\delta}{{\kappa}_{i,\mathrm{max}}}{-\delta}^{2}},\sqrt{\frac{{A}_{n,\mathrm{max}}}{{\kappa}_{i,\mathrm{max}}}},\sqrt{\frac{{J}_{n,\mathrm{max}}}{{\kappa}_{i,\mathrm{max}}^{2}}}\right)$ | |

Step 3: | Let k = k − 1, if k = 0, go to step 4; Otherwise, go to step 2; |

Step 4: | Let k = 0, ${V}_{end,i}^{\text{}f}$ = 0; |

Step 5: | 5.1. ${L}_{i,list}^{\left(N\right)}\left[k\right]$, V_{end}_{,i−1,} ${F}_{i,list}^{\left(N\right)}\left[k\right]$, J_{t,}_{max}, A_{t,}_{max}, T_{s} are utilized in the forward scanning, recursively from the first segment of the lookahead window to the (N − 1)th segment, to calculate the end feed rate ${V}_{end,i}^{\text{}f}$; |

5.2. Determine the feed rate at the end of the segment by ${V}_{end,i}^{\text{}b}{=\mathrm{min}(V}_{end,i}^{\text{}f}{V}_{end,i}^{\text{}b})$ | |

Step 6: | Let k = k + 1, and if k = N − 1, stop and derive the result; Otherwise, go to step 4. |

## 5. NURBS Interpolation

_{i}

_{+1}, which corresponds to the next position coordinate of the interpolation cycle, based on the current position’s corresponding parameter u

_{i}. Derivatives of the parameter u with respect to time t can be derived, and by expanding these first-order derivatives into a second-order Taylor series, a second-order Taylor direct interpolation formula [35] based on feed rate can be obtained:

_{k}is the curve parameter obtained from the previous interpolation step, and T represents the interpolation period. $\Delta {s}_{i}$ is the arc length increment in the current interval.

## 6. Experiment and Results

#### 6.1. NURBS Interpolator for Butterfly Curve

#### 6.2. Experiment of Robot Path for a Fan NURBS Curve

## 7. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Abbasnejad, G.; Yoon, J.; Lee, H. Optimum kinematic design of a planar cable-driven parallel robot with wrench-closure gait trajectory. Mech. Mach. Theory
**2016**, 99, 1–18. [Google Scholar] [CrossRef] - De Souza, A.F.; Coelho, R.T. Experimental investigation of feed rate limitations on highspeed milling aimed at industrial applications. Int. J. Adv. Manuf. Technol.
**2007**, 32, 1104–1114. [Google Scholar] [CrossRef] - Piegl, L.; Tiller, W. The NURBS Books, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 1996. [Google Scholar]
- Elber, G.; Cohen, E. Tool path generation for freeform surface models. In Proceedings of the Second ACM Symposium on Solid Modeling and Applications, Montreal, QC, Canada, 19–21 May 1993; pp. 419–428. [Google Scholar]
- Lasemi, A.; Xue, D.; Gu, P. Recent development in CNC machining of freeform surfaces: A state-of-the-art review. Comput. Aided Des.
**2010**, 42, 641–654. [Google Scholar] [CrossRef] - Sarkar, S.; Dey, P.P. A new iso-parametric machining algorithm for free-form surface. Proc. IMechE Part E J. Eng. Manuf.
**2014**, 228, 197–209. [Google Scholar] [CrossRef] - Lee, R.S.; She, C.H. Tool path generation and error control method for multi-axis NC machining of spatial cam. Int. J. Mach. Tools Manuf.
**1998**, 38, 277–290. [Google Scholar] [CrossRef] - Hua, L.; Huang, N.; Yi, B.; Zhao, Y.; Zhu, L. Global toolpath smoothing for CNC machining based on B-spline approximation with tool tip position adjustment. Int. J. Adv. Manuf. Technol.
**2023**, 125, 3651–3665. [Google Scholar] [CrossRef] - Bi, Q.; Huang, J.; Lu, Y.; Zhu, L.; Ding, H. A general, fast and robust B-spline fitting scheme for micro-line tool path under chord error constraint. Sci. China Technol. Sci.
**2019**, 62, 321–332. [Google Scholar] [CrossRef] - Huang, N.; Hua, L.; Huang, X.; Zhang, Y.; Zhu, L.; Biermann, D. B-spline-based corner smoothing method to decrease the maximum curvature of the transition curve. J. Manuf. Sci. Eng.
**2022**, 144, 054503. [Google Scholar] [CrossRef] - Ward, R.A.; Sencer, B.; Jones, B.; Ozturk, E. Five-axis trajectory generation considering synchronization and nonlinear interpolation errors. J. Manuf. Sci. Eng.
**2022**, 144, 081002. [Google Scholar] [CrossRef] - Shi, Z.; Zhang, W.; Ding, Y. A local toolpath smoothing method for a five-axis hybrid machining robot. Sci. China Technol. Sci.
**2023**, 66, 721–742. [Google Scholar] [CrossRef] - Lin, M.T.; Tsai, M.S.; Yau, H.T. Development of a dynamics-based NURBS interpolator with real-time look-ahead algorithm. Int. J. Mach. Tools Manuf.
**2007**, 47, 2246–2262. [Google Scholar] [CrossRef] - Du, X.; Huang, J.; Zhu, L.M. A complete S-shape feed rate scheduling approach for NURBS interpolator. J. Comput. Des. Eng.
**2015**, 2, 206–217. [Google Scholar] [CrossRef] - Huang, J.; Du, X.; Zhu, L.M. Parallel acceleration/deceleration feedrate scheduling for computer numerical control machine tools based on bi-directional scanning technique. Proc. IMechE Part B J. Eng. Manuf.
**2019**, 233, 937–947. [Google Scholar] [CrossRef] - Xinhua, L.; Junquan, P.; Lei, S.; Zhongbin, W. A novel approach for NURBS interpolation through the integration of acc-jerk-continuous-based control method and look-ahead algorithm. Int. J. Adv. Manuf. Technol.
**2017**, 88, 961–969. [Google Scholar] [CrossRef] - Bollinger, J.G.; Duffie, N.A. Computer Control of Machines and Processes; Addison-Wesley Longman Publishing Co. Inc.: Reading, MA, USA, 1988. [Google Scholar]
- Ishizaki, K.; Shamoto, E. A new real-time trajectory generation method modifying trajectory based on trajectory error and angular speed for high accuracy and short machining time. Precis. Eng.
**2022**, 76, 173–189. [Google Scholar] [CrossRef] - He, S.; Yan, C.; Deng, Y.; Lee, C.H.; Zhou, X. A tolerance constrained G2 continuous path smoothing and interpolation method for industrial SCARA robots. Robot Comput. Integr. Manuf.
**2020**, 63, 101907. [Google Scholar] [CrossRef] - Barnett, E.; Gosselin, C. A Bisection Algorithm for Time-Optimal Trajectory Planning along Fully Specified Paths. IEEE Trans. Robot.
**2020**, 37, 131–145. [Google Scholar] [CrossRef] - Mora, P.R. On the Time-Optimal Trajectory Planning along Predetermined Geometric Paths and Optimal Control Synthesis for Trajectory Tracking of Robot Manipulators; University of California: Berkeley, CA, USA, 2013. [Google Scholar]
- Lee, A.C.; Lin, M.T.; Pan, Y.R.; Lin, W.Y. The feedrate scheduling of NURBS interpolator for CNC machine tools. Comput. Aided Des.
**2011**, 43, 612–628. [Google Scholar] [CrossRef] - Lai, J.Y.; Lin, K.Y.; Tseng, S.J.; Ueng, W.D. On the development of a parametric interpolator with confined chord error, feedrate, acceleration and jerk. Int. J. Adv. Manuf. Technol.
**2008**, 37, 104–121. [Google Scholar] [CrossRef] - Nam, S.H.; Yang, M.Y. study on a generalized parametric interpolator with real-time jerk-limited acceleration. Comput. Aided Des.
**2004**, 36, 27–36. [Google Scholar] [CrossRef] - Nguyen, K.D.; Ng, T.C.; Chen, I.M. On algorithms for planning s-curve motion profiles. Int. J. Adv. Robot. Syst.
**2008**, 5, 11. [Google Scholar] [CrossRef] - Bai, Y.; Chen, X.; Yang, Z. A generic method to generate AS-curve profile in commercial motion controller. In Proceedings of the ASME 2017 International Design Engineering Technical Conferences and Computers and Information in Engineering Conference, Cleveland, OH, USA, 6–9 August 2017. [Google Scholar]
- Shpitalni, M.; Koren, Y.; Lo, C.C. Realtime curve interpolators. Comput. Aided Des.
**1994**, 26, 832–838. [Google Scholar] [CrossRef] - Yeh, S.S.; Hsu, P.L. Adaptive-feedrate interpolation for parametric curves with a confined chord error. Comput. Aided Des.
**2002**, 34, 229–237. [Google Scholar] [CrossRef] - Tikhon, M.; Ko, T.J.; Lee, S.H.; Kim, H.S. NURBS interpolator for constant material removal rate in open NC machine tools. Int. J. Mach. Tools Manuf.
**2004**, 44, 237–245. [Google Scholar] [CrossRef] - Erwinski, K.; Paprocki, M.; Karasek, G. Comparison of NURBS trajectory interpolation algorithms for high-speed motion control systems. In Proceedings of the 2021 IEEE 19th International Power Electronics and Motion Control Conference (PEMC), Gliwice, Poland, 25–29 April 2021; pp. 527–533. [Google Scholar]
- Huang, J.; Zhu, L.M. Feedrate scheduling for interpolation of parametric tool path using the sine series representation of jerk profile. Proc. IMechE Part B J. Eng. Manuf.
**2017**, 231, 2359–2371. [Google Scholar] [CrossRef] - Fang, L.; Liu, G.; Li, Q.; Zhang, H. A high-precision non-uniform rational B-spline interpolator based on S-shaped feedrate scheduling. Int. J. Adv. Manuf. Technol.
**2022**, 121, 2585–2595. [Google Scholar] [CrossRef] - Boehm, W. Inserting new knots into B-spline curves. Comput. Aided Des.
**1980**, 12, 199–201. [Google Scholar] [CrossRef] - Lei, W.T.; Sung, M.P.; Lin, L.Y.; Huang, J.J. Fast real-time NURBS path interpolation for CNC machine tools. Int. J. Mach. Tools Manuf.
**2007**, 47, 1530–1541. [Google Scholar] [CrossRef] - Zhao, H.; Zhu, L.M.; Ding, H. A real-time look-ahead interpolation methodology with curvature-continuous B-spline transition scheme for CNC machining of short line segment. Int. J. Mach. Tools Manuf.
**2013**, 65, 88–98. [Google Scholar] [CrossRef]

**Figure 1.**A sample NURBS: (

**a**) NURBS curve with 6 control points; (

**b**) using knot insertion method, segment NURBS curve into 3 Bezier curves and C.P.1-4 is control points.

**Figure 2.**Segmentation results: (

**a**) one type-S Bezier2 curve segmented into two type-C curves by zero curvature point; (

**b**) the max value on y-axis of the curve is the chord error.

**Figure 3.**Simulation for NURBS curve. Each of the adjacent curves are distinguished by different colors: (

**a**) NURBS curve segmented into type-C curve by zero curvature point; (

**b**) NURBS curve segmented into 143 type-C curves that satisfy $\delta =$ 0.001 mm.

**Figure 6.**Schematic diagram of dynamic speed control planning. Acceleration control case: (

**a**) feed rate curve; (

**b**) acceleration curve; (

**c**) jerk curve; deceleration control case: (

**d**) feed rate curve; (

**e**) acceleration curve; (

**f**) jerk curve.

**Figure 10.**Simulation for butterfly NURBS curve: (

**a**) butterfly NURBS curve; (

**b**) curve segmented into type-C curve by zero curvature point; (

**c**) type-C curves that satisfy $\delta =$ 0.001 mm; (

**d**) comparison with/without chord error constraint; (

**e**) NURBS interpolation displacement; (

**f**) NURBS interpolation feed rate.

**Figure 13.**Fan NURBS curve: (

**a**) fan curve segmentation result by using chord error segmentation method; (

**b**) the feed rate of bidirectional feed rate scanning of S-shaped profile; (

**c**) overhead view; (

**d**) side view.

Curve Types | Control Points $\mathbf{\left[}\begin{array}{c}\mathit{x}\\ \mathit{y}\end{array}\mathbf{\right]}$ | Node Vectors |
---|---|---|

NURBS | $\left[\begin{array}{c}\begin{array}{cccc}5& 6& 11& \begin{array}{ccc}8& 12& 11\end{array}\end{array}\\ \begin{array}{cccc}4& 12& 10& \begin{array}{ccc}4& 3& 9\end{array}\end{array}\end{array}\right]$ | $\left[\begin{array}{ccc}0& 0& \begin{array}{cccc}0& 0& 1/3& \begin{array}{cccc}2/3& 1& 1& \begin{array}{cc}1& 1\end{array}\end{array}\end{array}\end{array}\right]$ |

Bezier 1 | $\left[\begin{array}{cc}5& \begin{array}{cc}6& \begin{array}{cc}8.5& 9.25\end{array}\end{array}\\ 4& \begin{array}{cc}12& \begin{array}{cc}12& 9.5\end{array}\end{array}\end{array}\right]$ | $\left[\begin{array}{cccc}0& 0& 0& \begin{array}{cccc}\begin{array}{cc}0& 1\end{array}& 1& 1& 1\end{array}\end{array}\right]$ |

Bezier 2 | $\left[\begin{array}{cc}9.25& \begin{array}{cc}10& \begin{array}{cc}9& 9.5\end{array}\end{array}\\ 9.5& \begin{array}{cc}8& \begin{array}{cc}6& 4.75\end{array}\end{array}\end{array}\right]$ | $\left[\begin{array}{cccc}0& 0& 0& \begin{array}{cccc}\begin{array}{cc}0& 1\end{array}& 1& 1& 1\end{array}\end{array}\right]$ |

Bezier 3 | $\left[\begin{array}{cc}9.5& \begin{array}{cc}10& \begin{array}{cc}12& 11\end{array}\end{array}\\ 4.75& \begin{array}{cc}3.5& \begin{array}{cc}3& 9\end{array}\end{array}\end{array}\right]$ | $\left[\begin{array}{cccc}0& 0& 0& \begin{array}{cccc}\begin{array}{cc}0& 1\end{array}& 1& 1& 1\end{array}\end{array}\right]$ |

Parameters | X.D. [14] | L.H. [8] | L.F. [32] | Ours |
---|---|---|---|---|

Number of iterations | 0 | 9 | 0 | 5 |

Iterations’ computational time (s) | 0 | 8 | 0 | 0.7 |

Max chord error (mm) | 1.8 | 0.03 | 2 | 0.001 |

End value of u | 0.997 | 0.997 | 0.999 | 1 |

Truncation error (mm) | 0.001 | 0.001 | 0 | 0 |

Bidirectional scanning (s) | 0.01 | 0.1 | 0.01 | 0.3 |

Once s-shaped feed rate profile (s) | 0.00006 | 0.00006 | 0.00006 | 0.00007 |

Interpolation time (s) | 9 | 10 | 13 | 10 |

Total duration time (s) | 10 | 19 | 14 | 12 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Liu, X.; Xu, Y.; Cao, J.; Liu, J.; Zhao, Y.
A High-Precision Planar NURBS Interpolation System Based on Segmentation Method for Industrial Robot. *Appl. Sci.* **2023**, *13*, 13210.
https://doi.org/10.3390/app132413210

**AMA Style**

Liu X, Xu Y, Cao J, Liu J, Zhao Y.
A High-Precision Planar NURBS Interpolation System Based on Segmentation Method for Industrial Robot. *Applied Sciences*. 2023; 13(24):13210.
https://doi.org/10.3390/app132413210

**Chicago/Turabian Style**

Liu, Xun, Yan Xu, Jiabin Cao, Jinyu Liu, and Yanzheng Zhao.
2023. "A High-Precision Planar NURBS Interpolation System Based on Segmentation Method for Industrial Robot" *Applied Sciences* 13, no. 24: 13210.
https://doi.org/10.3390/app132413210