## 4 Bidirectional Feed Rate Scanning of S-Shaped Profile
The formulas are as follows:  
\[\mathbf{V}_{\max}^{opt}=\min\left(\mathbf{V}_{\max},\frac{\ddot{\mathbf{\theta}}_{\max}}{{J _{ac}}^{-1}\mathbf{\tau}}\right) \tag{23}\]  
\[A_{\max}^{opt}=\min\left(A_{t,\max},\frac{\ddot{\theta}_{\max}+{J^{-1}}\dot{J} \left({J^{-1}V}\right)}{{J^{-1}\mathbf{\tau}}}\right) \tag{24}\]  
Figure 7: The schematic diagram of bidirectional scanning. Assuming the current iteration is the \(i\)-th segment, with a lookahead window length of \(N\), the end feed rate of the \((i-1)\)th segment (the start feed rate of the \(i\)-th segment) is denoted as \(V_{\text{end},i-1}\). The lookahead sublist of segment length is represented as \(L_{\text{i,list}}^{(N)}=\{L_{0},L_{1},\cdots,L_{i},\cdots,L_{N}\}\), and the lookahead sublist of feed rates is denoted as \(F_{i,\text{list}}^{(N)}=\{F_{0},F_{1},\cdots,F_{i},\cdots,F_{N}\}\). Additionally, the forward scanning feed rate is calculated as \(V_{\text{end},i}^{f}\) and the backward scanning feed rate as \(V_{\text{end},i}^{b}\). Considering all velocity constraints and optimization strategies, the dynamic lookahead bidirectional scanning algorithm follows the workflow outlined Algorithm 2 below:  
``` \(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_{\text{i,list}}^{(N)}\) is the lookahead sublist of segment length; \(F_{i,\text{list}}^{(N)}\) is the lookahead sublist of feed rates; \(V_{\text{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. \(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. Let \(k=N-1\), \(V_{end,i}^{b}=0\); 2.1. \(L_{\text{i,list}}^{(N)}[0]\), \(V_{end,i-1}\), \(F_{i,\text{list}}^{(N)}[0]\), \(I_{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}^{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}^{b}=\min\left(V_{end,i}^{b}\,V_{\text{max}}^{opt}\,\frac{2}{\Gamma} \,\frac{2\delta}{\kappa_{i,\max}}-\delta^{2},\sqrt{\frac{A_{t,\max}}{\kappa_{ i,\max}}},\sqrt{\frac{I_{t,\max}}{\kappa_{i,\max}}}\right)\) Step 3: \(\text{



the forward scanning anew based on the current situation, the execution efficiency of the actual program is improved. ## 5 NURBS Interpolation

After segmenting the NURBS curve into Bezier curves, the derivative of the Bezier curve cannot be used directly for Taylor expansion since it does not satisfy the C2 continuity condition. Thus, each segment of the Bezier curve has to be mapped back to the original NURBS curve to obtain the parameter continuity defined by the knot vector. Assuming \(u\) as the curve parameter of a discrete Bezier curve and \(u\) as the corresponding parameter on the NURBS curve, \(u\) can be expressed as \(f_{i}(\mu)\), where \(f_{i}(\cdot)\) is a mapping function that maps the NURBS curve parameter \(u\in[m_{j},n_{i}]\) to the Bezier curve parameter \(u\in[0,1]\). The knot vector interval of the \(i\)-th Bezier curve segment, obtained by decomposing the original NURBS curve through node insertion, is represented by \([m_{i},n_{i}]\). Consequently, the following formula can be derived.