## 3 The First-Phase Control  
The control method of the first stage is as follows. Let the state variable \(x\) be  
Figure 2: Two-phase switching-control process diagram. \[x= \begin{bmatrix}x_{1}\\ x_{2}\\ x_{3}\\ x_{4}\\ x_{5}\\ x_{6}\end{bmatrix} = \begin{bmatrix}q_{1}\\ q_{2}\\ q_{3}\\ \dot{q}_{1}\\ \dot{q}_{2}\\ \dot{q}_{3}\end{bmatrix}  \tag{13}\]  
the state-space expression \(\dot{x}=f(x)+g(x)\tau\), and the specific expression is as follows:  
\[ \begin{bmatrix}\dot{x}_{1}\\ \dot{x}_{2}\\ \dot{x}_{3}\\ \dot{x}_{4}\\ \dot{x}_{5}\\ \dot{x}_{6}\end{bmatrix} = \begin{bmatrix}x_{4}\\ x_{5}\\ x_{6}\\ f_{1}\\ f_{2}\\ f_{3}\end{bmatrix} + \begin{bmatrix}0&0&0\\ 0&0&0\\ 0&0&0\\ g_{11}&g_{12}&g_{13}\\ g_{21}&g_{22}&g_{23}\\ g_{31}&g_{32}&g_{33}\end{bmatrix}\begin{bmatrix}\tau_{1}\\ \tau_{2}\\ 0\end{bmatrix}  \tag{14}\]  
some of the variables in Equation (14) are as follows:  
\[ \begin{cases}\begin{bmatrix}f_{1}\\ f_{2}\\ f_{3}\end{bmatrix}=-M^{-1}(q)H(q,\dot{q})\\ g=\begin{bmatrix}g_{11}&g_{12}&g_{13}\\ g_{21}&g_{22}&g_{23}\\ g_{31}&g_{32}&g_{33}\end{bmatrix}=M^{-1}(q)\begin{bmatrix}1&0&0\\ 0&1&0\\ 0&0&0\end{bmatrix}\end{cases}  \tag{15}\]  
In the following, the corresponding controller is researched for the control target, and the Lyapunov function \(V(x)\) is constructed  
\[V(x)=\frac{1}{2}[P_{1}(x_{1}-x_{1\text{d}})^{2}+P_{2}(x_{2}-x_{2\text{d}})^{2}+ (x_{4}^{2}+x_{5}^{2})] \tag{16}\]  
\(P_{1}\) and \(P_{2}\) are positive constants; \(x_{1\text{d}}=q_{1\text{d}}\) and \(x_{2\text{d}}=q_{2\text{d}}\) are the target state quantities of the first and second actuated links, respectively. Calculating the derivative of the Lyapunov function (16), we get  
\[\dot{V}(x) =x_{4}(P_{1}(x_{1}-x_{1\text{d}})+f_{1}+g_{11}\tau_{1}+g_{12}\tau_ {2}) \tag{17}\] \[+x_{5}(P_{1}(x_{2}-x_{2\text{d}})+f_{2}+g_{21}\tau_{1}+g_{22}\tau _{2})\]  
According to Equation (17), in order to ensure the system state convergence, the control law is  
\[ \begin{cases}\tau_{1}=(P_{1}(-x_{1}+x_{1\text{d}})-f_{1}-D_{1}x_{4}-g_{12}\tau _{2})\delta_{11}^{-1}\\ \tau_{2}=(P_{2}(-x_{2}+x_{2\text{d}})-f_{2}-D_{2}x_{5}-g_{21}\tau_{1})\delta_{ 22}^{-1}\end{cases}  \tag{18}\]  
\(D_{1}>0\) and \(D_{2}>0\) are parameters that can adjust the convergence rate of the system state. Since \(M(q)\) and \(M^{-1}(q)\) are positive-definite matrices, there are \(g_{11}>0\) and \(g_{22}>0\), which can avoid the occurrence of singular problems. Therefore, the control law ensures that the following convergence conditions are established:  
\[\dot{V}(x)=-D_{1}x_{4}^{2}-D_{2}x_{5}^{2}\leq 0 \tag{19}\]  
The following uses the Lasalle invariance principle [30] to prove that the control rate of Equation (18) can achieve the control objective of the first phase of the system. We first outline the definition of an invariant set. **Lemma 2**. : _Let \(x(t)\) be the solution of Equation (14). If there exists a set \(\Omega\) such that, when \(x(0)\in\Omega\), \(x(t)\in\Omega\), and \(\forall t\geq 0\), then \(\Omega\) is called the invariant set of Equation (14)._  
Since \(\dot{V}(x)\leq 0\), then \(\dot{V}(x)\) is bounded and the invariant set is characterized as  
\[\Omega=\left\{x\in\mathbb{R}^{6\times 1}|V(x)\leq\lambda\right\} \tag{20}\]  
\(\lambda\) is the given small positive number. Define the set as  
\[\Phi=\left\{x(t)\in\Omega\Big{|}\dot{V}(x)=0\right\} \tag{21}\]  
let \(W\) be the greatest invariant set in \(\Phi\), and then \(x(0)\in\Phi\), \(x(t)\in W\), \(t\to\infty\). When \(\dot{V}(x)\equiv 0\), then \(x_{4}\equiv 0\) and \(x_{5}\equiv 0\), and it follows that \(\dot{x}_{4}\equiv 0\) and \(\dot{x}_{5}\equiv 0\). Then, it follows from Equation (14) that  
\[ \begin{cases}f_{1}=-g_{11}\tau_{1}-g_{12}\tau_{2}\\ f_{2}=-g_{21}\tau_{1}-g_{22}\tau_{2}\end{cases}  \tag{22}\]  
Substituting Equation (22) into Equation (17) yields \(x_{1}=x_{1\text{d}}\), \(x_{2}=x_{2\text{d}}\).