## 3 Trajectory Planning
### Trajectory Planning  
A PPO motion in Figure 2 can be divided into the following phases. 1. When EE moves along segment \(AB\) in the vertical direction, the EE's velocity is specified as the polynomial motion law. \[v_{1}(\Phi)=v_{10}+v_{11}\Phi+v_{12}\Phi^{2}+v_{13}\Phi^{3}+v_{14}\Phi^{4}+v_ {15}\Phi^{5},\] (14) where \(\Phi=t_{1}/T_{1}\) and \(\Phi\in[0,1]\), \(T_{1}\) is the total time from point \(A\) to point \(B\) and \(t_{1}\) is the current time in this segment. According to the boundary conditions, \(s_{1}(0)=0,\ v_{1}(1)=V_{B}\), \(v_{1}(0)=0\), \(v_{1}^{\prime}(1)=0\), \(v_{1}^{\prime}(0)=0\), \(v_{1}^{\prime\prime}(1)=0\), \(v_{1}^{\prime\prime}(0)=0\), we can get \(v_{1}(\Phi)=10V_{B}\Phi^{3}-15V_{B}\Phi^{4}+6V_{B}\Phi^{5}\). From \(s_{1}(1)=j\), we can get \(T_{1}=2j/V_{B}\), where \(V_{B}\) represents the velocity of point \(B\), which acceleration is 0. 2. When EE moves along the PH curve on segment \(BC\), the velocity of end effector, which is dependent on the PH curve parameter \(\gamma\), is as follows. \[v_{2}(\gamma)=v_{20}+v_{21}\gamma+v_{22}\gamma^{2}+v_{23}\gamma^{3}+v_{24} \gamma^{4}+v_{25}\gamma^{5}.\] (15) From the above phase 1, we can get \(v_{2}(0)=V_{B}\). Since the PPO trajectory is symmetrical, we can get \(v_{2}(1)=V_{B}\). In order to ensure the acceleration's continuity, the boundary prerequisites \(v_{2}^{\prime}(0)=0\), \(v_{2}^{\prime}(1)=0\) need to be satisfied. The velocity of point \(N\), \(v_{2}(0.5)\), can be seen as the minimum velocity, \(V_{N}\). So the coefficients can be calculated as follows: \(v_{20}=V_{B}\), \(v_{21}=0\), \(v_{22}=16(V_{N}-V_{B})\), \(v_{23}=32(V_{B}-V_{N})\), \(v_{24}=16(V_{N}-V_{B})\), \(v_{25}=0\). \(T_{2}\) is the total time from point \(B\) to \(C\), \(t_{2}\) is current time in this segment. So  
\[v_{2}(\gamma)=V_{B}+16(V_{N}-V_{B})\gamma^{2}+32(V_{B}-V_{N})\gamma^{3}+16(V_{ N}-V_{B})\gamma^{4}. \tag{16}\]  
In order to get \(\gamma_{i}\) at time \(t_{2}=i\Delta t\), where \(\Delta t\) is time interval, \(i=1,2,3,...N\), \(N=\left\lfloor T_{2}/\Delta t\right\rfloor\), \(\frac{\mathrm{d}\gamma}{\mathrm{d}t}\) can be calculated by  
\[\frac{\mathrm{d}\gamma}{\mathrm{d}t}=\frac{\mathrm{d}\gamma}{\mathrm{d}s} \frac{\mathrm{d}s}{\mathrm{d}t}=\frac{1}{\sigma(\gamma)}v_{2}(\gamma), \tag{17}\]  
where  
\[ \begin{split}\sigma(\gamma)&=(4{u_{2}}^{2}+2\sqrt {2}u_{2}^{2})\gamma^{4}-(8{u_{2}}^{2}+4\sqrt{2}u_{2}^{2})\gamma^{3}\\ &+(12{u_{2}}^{2}+2\sqrt{2}u_{2}^{2})\gamma^{2}-8{u_{2}}^{2} \gamma+2{u_{2}}^{2},\end{split}  \tag{18}\]  
where  
\[{u_{2}}^{2}=\frac{5(18-3\sqrt{2})}{34}m. \tag{19}\]  
According to (17), we can get the following equation. \[\int_{0}^{\gamma_{i}}\frac{\sigma(\gamma)}{v_{2}(\gamma)}\mathrm{d}\gamma= \int_{0}^{t_{2}}\mathrm{d}t=i\Delta t. \tag{20}\]  
Bringing Equations (16), (18), and (19) into (20), we can get the following formula  
\[ \begin{split}&\int_{0}^{\gamma_{i}}\left(1+\frac{\beta^{2}( \sqrt{2}-2)\left(8-32\gamma+32\gamma^{2}\right)-V_{B}}{\left[\alpha+4\beta \gamma(1-\gamma)\right]\left[\alpha-4\beta\gamma(1-\gamma)\right]}\right) \mathrm{d}\gamma\\ &=\frac{8(5-2\sqrt{2})i\Delta t(V_{N}-V_{B})}{15m},\end{split}  \tag{21}\]  
where \(\alpha=\sqrt{V_{B}}\), \(\beta=\sqrt{(V_{B}-V_{N})}\). The fractions on the left of (21) can be factorized, then the following equation can be derived. \[ \begin{split}&\frac{(2-\sqrt{2})(V_{N}-V_{B})\left(8-32\gamma+3 2\gamma^{2}\right)-V_{B}}{\left[\alpha+4\beta(1-\gamma)\gamma\right]\left[ \alpha-4\beta(1-\gamma)\gamma\right]}\\ &=\frac{(4\sqrt{2}-8)\chi-\frac{\alpha}{2}+4(\sqrt{2}-2)\beta}{ \left[\alpha+4\beta(1-\gamma)\gamma\right]}\\ &+\frac{(4\sqrt{2}-8)\chi-\frac{\alpha}{2}-4(\sqrt{2}-2)\beta}{ \left[\alpha-4\beta(1-\gamma)\gamma\right]},\end{split}  \tag{22}\]  
where \(\chi=\frac{(V_{B}-V_{N})}{\sqrt{V_{B}}}\). So  
\[