## 5 Simulation
### Case 1  
When the initial velocity of all the links of the planar PPR underactuated robot is 0, the initial state is set to the target state as follows: \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Link \(r\)** & \(m_{r}\)**/kg** & \(L_{r}\)**/m** & \(l_{r}\)**/m** & \(J_{r}\)**/kg \(\cdot\) m\({}^{2}\)** \\ \hline \(r=1\) & 1 & 1 & 0.5 & 0 \\ \(r=2\) & 1 & 1 & 0.5 & 0 \\ \(r=3\) & 0.5 & 0.5 & 0.25 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameter values of the planar PPR underactuated robot model. Figure 5: MATLAB/Simulink simulation block diagram. \[ \begin{cases}x_{0}=[0.7&0.6&0.8&0&0&0]^{\text{T}}\\ x_{\text{d}}=[0.5&0.35&2.4&0&0&0]^{\text{T}}\end{cases}  \tag{43}\]  
Figure 6a demonstrates that the first prism-actuated link stabilizes to the desired state and stops moving, while the third underactuated rotating link stabilizes to the desired state with the second prism-actuated link. The velocity of the planar PPR underactuated robot link starts from 0, and, when the motion velocity of the first link converges to 0, the first prism-actuated link stabilizes and stops moving. At the moment of 20 s, under the open-loop iteration strategy, the second link oscillates and drives the third underactuated rotating link to eventually converge and stabilize to the target state. The control torque applied during the whole motion process remains at \([-1.0,1.0]\) N \(\cdot\) m and eventually converges to 0. Figure 6b shows that the control torque of the PPR system is subjected to the external interference of 0.01 N \(\cdot\) m from 10 s to 12 s, and the initial velocity of the link is zero. The stability control can also be realized in the end. The first prism-actuated link stabilizes to the target state and stops moving. Even with external interference, the third underactuated link can still stably converge under the drive of the second prism-actuated link. When the initial velocity of the third link of the planar PPR underactuated robot is 0.01 rad /s, the initial state is set, and the target state is as follows:  
\[ \begin{cases}x_{0}=[0.7&0.6&0.8&0&0.01]^{\text{T}}\\ x_{\text{d}}=[0.5&0.35&2.4&0&0&0]^{\text{T}}\end{cases}  \tag{44}\]  
Figure 6: Simulation results of case 1: (**a**) no interference and zero initial velocity; (**b**) 0.01 N \(\cdot\) m torque interference and zero initial velocity. Figure 7a shows that the PPR system can also realize the stable control of three links under the proposed control strategy when the initial velocity of the third underactuated link is 0.01 rad/s without interference. Figure 7b shows that the control torque of the PPR system is subjected to external interference of 0.01 N \(\cdot\) m for 10 s to 12 s, and the initial velocity of the third underactuated link is 0.01 rad/s. The whole system still achieves successful stability. Table 3 shows the comparative analysis of the four simulations in case 1. Figure 8a shows that the first prism-actuated link achieves stability in the first phase. At the moment of 23 s, under the open-loop iteration strategy, the second link oscillates and drives the third underactuated rotating link to finally converge and stabilize to the target state. The torque of the whole motion process is maintained at \([-5,5]\) N \(\cdot\) m and eventually converges to 0. Figure 8b shows that the control torque of the planar PPR underactuated robot is subjected to the external interference of 0.05 N \(\cdot\) m from 13 s to 15 s, and the starting velocity of the link is 0. Even in the presence of external interference, the whole system can still converge stably. When the starting velocity of the first link of the planar PPR underactuated robot is 0.02 m/s, the starting and desired states at this point are as follows:  
\[ \begin{cases}x_{0}=[0.7&0.6&0.8&0.02&0&0]^{\mathrm{T}}\\ x_{\mathrm{d}}=[2.1&1.9&1.8&0&0&0]^{\mathrm{T}}\end{cases}