## 3 S-Shaped Feed Rate Profile Generation and Dynamic Speed Adjustment  
### S-Shaped Feed Rate Profile  
In this section, we introduce the double \(S\)-shaped feed rate profile briefly. The S-shaped ACC/DEC profile, which consists of seven phases (\(T1\), \(T2\), \(T3\), \(T4\), \(T5\), \(T6\), \(T7\)), is shown in Figure 4.  
Figure 4: The \(S\)-shaped profile with seven sections.  
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.  
The parameters include: \(v_{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:  
\[a(t)=\left\{\begin{array}{l}\mathrm{sign}(v_{e}-v_{s})Jt,0\leq t\leq\frac{t _{s}-t_{sp}}{2}\\ \frac{1}{2}\mathrm{sign}(v_{e}-v_{s})J\big{(}t_{s}-t_{sp}\big{)},\frac{t_{s}- t_{sp}}{2}<t\leq\frac{t_{s}+t_{sp}}{2}\\ \mathrm{sign}(v_{e}-v_{s})J(t_{s}-t),\frac{t_{s}+t_{sp}}{2}<t\leq t_{s}\end{array}\right. \tag{11}\]  
\[v(t)=\left\{\begin{array}{l}v_{s}+\frac{1}{8}\mathrm{sign}(v_{e}-v_{s})Jt^{2 },0\leq t\leq\frac{t_{s}-t_{sp}}{2}\\ v_{s}+\frac{1}{8}\mathrm{sign}(v_{e}-v_{s})Jt_{ls}^{2}\\ +\frac{1}{2}\mathrm{sign}(v_{e}-v_{s})Jt_{ls}\big{(}t-\frac{t_{ls}}{2}\big{)},\frac{t_{s}-t_{sp}}{2}<t\leq\frac{t_{s}+t_{sp}}{2}\\ v_{s}+\frac{1}{4}\mathrm{sign}(v_{e}-v_{s})Jt_{ls}t_{sp}-\frac{1}{2}\mathrm{sign }(v_{e}-v_{s})J(t_{s}-t)^{2},\frac{t_{s}+t_{sp}}{2}<t\leq t_{s}\\ \end{array}\right. \tag{12}\]  
\[S(t)=\left\{\begin{array}{l}v_{s}t+\frac{1}{6}\mathrm{sign}(v_{e}-v_{s})Jt^ {3},0\leq t\leq\frac{t_{s}-t_{sp}}{2}\\ v_{s}t+\frac{1}{48}\mathrm{sign}(v_{e}-v_{s})Jt_{ls}^{3}+\frac{1}{8}\mathrm{ sign}(v_{e}-v_{s})Jt_{ls}^{2}\big{(}t-\frac{t_{ls}}{2}\big{)}\\ +\frac{1}{4}\mathrm{sign}(v_{e}-v_{s})Jt_{ls}\big{(}t-\frac{t_{ls}}{2}\big{)}^{ 2},\frac{t_{s}-t_{sp}}{2}<t\leq\frac{t_{s}+t_{sp}}{2}\\ v_{s}t+\frac{1}{4}\mathrm{sign}(v_{e}-v_{s})J\big{(}-\frac{1}{2}t_{ls}^{2}- \frac{3}{2}t_{ls}^{2}t_{sp}-t_{sp}^{2}t_{ls}+t_{ls}^{2}t+2t_{ls}t_{sp}t\big{)} \\ +\frac{1}{6}\mathrm{sign}(v_{e}-v_{s})J(t_{s}-t)^{3},\frac{t_{s}+t_{sp}}{2}<t \leq t_{s}\end{array}\right. \tag{13}\]  
The implementation process is as follows:  
Step 1: Based on the input motion parameters and the relationship between \(v_{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;  
Step 2: According to the relevant formulas mentioned above, calculate the sum of displacements from \(v_{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}\);  
Step 3: Based on the parameter relationships described above, perform classification and judgment, as shown in the flowchart in Figure 5.