## 3 Hybrid Control Design and Analysis
### Pid-Ida-Pbc  
In this section, the mechanical subsystem table is first written in the form of a PCH. Then, the state error PCH system is constructed by the IDA-PBC control strategy, and the PID outer loop controller is designed to improve the anti-interference ability and steady state performance of the control system. Finally, the asymptotic stability of the subsystem is proved. The dynamics model of the mechanical subsystem can be expressed in the form of a PCH system as follows [19]  
\[\left\{ \begin{array}{l}\dot{x}=\left[\mathcal{J}(x)-\mathcal{R}(x)\right] \frac{\partial H(x)}{\partial x}+g(x)\tau_{pbc}\\ y=g^{T}(x)\frac{\partial H(x)}{\partial x}\end{array} \right. \tag{13}\]  
where \(x=(q,\theta,p_{q},p_{\theta})^{T}\). Hamiltonian function is set as  
\[H(q,\theta,\ p_{q},p_{\theta})=\frac{1}{2}{p_{q}}^{T}M^{-1}(q)p_{q}+\frac{1}{2}{ p_{\theta}}^{T}J_{m}p_{\theta}+V_{g}(q)+V_{k}(q,\theta) \tag{14}\]where \(p_{q}=M\left(q\right)\dot{q}\), \(p_{\theta}=J_{m}\dot{\theta}\) are momentum, \(V_{g}(q)\) is gravitational potential energy, \(V_{k}(q,\theta)=\frac{1}{2}K(\theta-q)^{2}+\frac{1}{2}D(\dot{\theta}-q)^{2}\) is elastic potential energy, \(J_{m}\) is a positive number that is not zero. Define the state error of the system as \(\hat{x}=x-x_{d}\). Then, the feedback control law \(\tau^{\prime}{}_{pbc}=\beta(x)\) is obtained by the IDA-PBC control strategy, and the closed-loop state error PCH system is obtained as follows [20]  
\[\hat{x}=[\mathcal{J}_{d}(\hat{x})-\mathcal{R}_{d}(\hat{x})]\frac{\partial H_{ d}(\hat{x})}{\partial\hat{x}} \tag{15}\]  
where \(J_{d}(\hat{x})\) is a skew-symmetric matrix, \(R_{d}(\hat{x})\) is a positive semi-definite matrix. The new Hamiltonian function is set as \(H_{d}(\hat{x})=\frac{1}{2}\hat{p}_{q}^{T}M_{d}^{-1}(\hat{q})\hat{p}_{q}+\frac{ 1}{2}\hat{p}_{\theta}^{T}J_{md}^{-1}\hat{p}_{\theta}+V_{g}(q)+V_{k}(q,\theta) -V_{g}(\theta)\). System (15) is a PCH system that is asymptotically stable at equilibrium point \(\hat{x}=0\). The designed state feedback control law can be expressed as  
\[ \begin{array}{c}\tau^{\prime}{}_{pbc}=K(\theta-q)+D(\dot{\theta}-\dot{q})- \lambda_{1}M_{d}^{-1}(\hat{q})\hat{p}_{q}-\lambda_{2}J_{md}^{-1}\hat{p}_{ \theta}\\ -\frac{J_{md}}{J_{md}}\left[K(\theta-q)+D(\dot{\theta}-\dot{q})+k_{d}\dot{q}-g( q)\right]\end{array}  \tag{16}\]  
where \(\lambda_{1},\lambda_{2},J_{md},k_{d}\) are positive diagonal matrix, \(J_{md}\) is a positive number that is not zero. In this paper, in order to improve the steady state performance and the disturbance-resistance performance of the system. We consider the system (15) to be expressed as [22]  
\[\hat{x}=[\mathcal{J}(\hat{x})-\mathcal{R}(\hat{x})]\frac{\partial H_{d}(\hat{ x})}{\partial\hat{x}}+g(x)v \tag{17}\]  
where \(v\) is is a dynamic controller to improve the anti-interference performance of the system. Introduce the globally defined transform of coordinates \(z=\psi(\hat{x},\gamma)\) given by  
\[ \begin{array}{c}z_{1}=\hat{q}\\ z_{2}=\hat{\theta}\\ z_{3}=\hat{p}_{q}\\ z_{4}=\theta(\hat{x},\gamma)\\ z_{5}=\gamma\end{array}  \tag{18}\]  
where \(\gamma\in R^{n}\) is the state of the outer loop controller. An extended PCH system consisting of a new variable \(z\) can be expressed as  
\[\left[ \begin{array}{c}\dot{z}_{1}\\ \dot{z}_{2}\\ z_{3}\\ z_{4}\\ z_{5}\end{array} \right]=\left[ \begin{array}{cc}&0\\ \mathcal{J}_{d}(\hat{x})-\mathcal{R}_{d}(\hat{x})&-\eta_{2}\\ &0\\ &-\eta_{1}\\ 0&\eta_{2}&0\\ \end{array} \right]\frac{\partial H_{z}(z)}{\partial z} \tag{19}\]  
\[H_{z}(z)=\frac{1}{2}z_{3}{}^{T}M_{d}^{-1}(q)z_{3}+\frac{1}{2}z_{4}{}^{T}J_{md }^{-1}z_{4}+\frac{1}{2}z_{5}{}^{T}\eta_{3}z_{5}+V_{d}(z) \tag{20}\]  
where \(\zeta=J_{md}^{-1}J_{m}\eta_{1}\eta_{2},\eta_{1},\eta_{2},\eta_{3}\) are positive diagonal matrix.