## 4 The Second-Phase Control
### Design of Controller  
In this stage, the underactuated link is driven by the second prismatic actuated link based on Equation (34). We set \(t=0\) as the initial time, and the actuated link is able to return to the desired state at zero speed. The auxiliary control input \(A(t)\) should satisfy the following conditions:  
\[\begin{cases}\int_{0}^{\text{T}}A(t)\text{d}t=0\\ \int_{0}^{\text{T}}\int_{0}^{t}A(b)\text{d}b\text{d}t=0\end{cases} \tag{35}\]  
According to Equations (34) and (35), \(z_{1}(T)=T,z_{2}(T)=z_{3}(T)=0\), and the following error relation can be obtained:  
\[\begin{cases}\Delta q_{3}=q_{3}^{\text{II}}-q_{3}^{\text{I}}=q_{3}^{\text{I}}z _{1}(T)=q_{3}^{\text{I}}T\\ \Delta q_{3}=q_{3}^{\text{II}}-q_{3}^{\text{I}}=C^{2}\sin 2q_{3}^{\text{I}} \end{cases} \tag{36}\]  
\(C=m_{3}l_{3}/(m_{3}l_{3}^{2}+l_{3})\), \(q_{3}^{\text{II}}\) and \(q_{3}^{\text{II}}\) indicate the angle and angular velocity of the underactuated link at the end of each cycle, respectively. \(q_{3}^{\text{d}}\) represents the desired angle of the underactuated link.  
By calculating Equations (34) and (36), it can be obtained as  
\[\Delta q_{3}=-C^{2}\sin q_{3}^{\text{I}}\cos q_{3}^{\text{I}}\int_{0}^{\text{ T}}z_{2}^{2}(t)\text{d}t+C\left(q_{3}^{\text{I}}\right)^{2}\sin q_{3}^{\text{I}} \int_{0}^{\text{T}}z_{3}(t)\text{d}t \tag{37}\]  
In light of the preceding analysis, the following auxiliary control inputs are designed:  
\[A(t)=\begin{cases}-E\cos(4\pi t/T),&t\in\left[0,\frac{T}{2}\right)\\ \\ E\cos 4\pi(t-\frac{T}{2})/T,&t\in\left[\frac{T}{2},T\right]\end{cases} \tag{38}\]where E represents the highest absolute value observed in each cycle, and the cycle control input is illustrated in Figure 4.  
According to Equations (35)-(38),  
\[\Delta q_{3}=\frac{E^{2}T^{3}C^{2}\sin 2q_{3}^{1}}{64\pi^{2}} \tag{39}\]  
Establish the subsequent relationships to guarantee that the underactuated link undergoes iterative contraction during each cycle:  
\[\begin{cases}\left|q_{3}^{\text{d}}-q_{3}^{\text{H}}\right|\leq\eta_{1}\left|q_ {3}^{\text{d}}-q_{3}^{\text{I}}\right|\\ \left|q_{3}^{\text{Li}}\right|=\eta_{2}\left|q_{3}^{\text{I}}\right|\end{cases} \tag{40}\]  
the convergence coefficients \(\eta_{1}\) and \(\eta_{2}\) are in the range \([0,1)\).  
By combining Equations (36), (39) and (40), we can obtain  
\[\begin{cases}T=(1-\eta_{1})(q_{3}^{\text{d}}-q_{3}^{1})/q_{3}^{\text{Li}}\\ E=\frac{8\pi}{C}\sqrt{q_{3}^{1}(1-\eta_{2})}/T\text{sin}2q_{3}^{1}\end{cases} \tag{41}\]  
Equation (41) satisfies \(0<\text{T}\), and E \(<\infty\).  
The simultaneous Equations (26), (29), (30) and (33) can be obtained  
\[\tau_{2}^{*}=(m_{2}+m_{3}-Cm_{3}l_{3}\sin^{2}q_{3})A(t)-m_{3}l_{3}q_{3}^{2}\cos q _{3} \tag{42}\]  
The actuated link achieves the position control goal in the first phase, and the underactuated link is in a free rotating state. At this time, the second-phase controller should be used to iteratively operate the actuated link by using the control torque, as in Equation (42).  
When the designed supplementary control input \(A(t)\) is applied to the aforementioned controller, \(i\) iteration cycles \(T\), \(t_{\text{d}}=t_{0}+i(i=1,2,\cdots,n)\), must be experienced during the process from iteration start time \(t_{0}\) to iteration end time \(t_{d}\). At the end of each cycle, the angle contraction of the third underactuated link is closer to the target state, and the states of the actuated link and underactuated link at the final of each iteration cycle are regarded as the initial state of the next cycle, and the iteration continues until the virtual planar PR underactuated robot stabilizes to the target state after \(n\) iteration cycles.