## 4 The Design of Controller
### Nonlinear Controller Design  
In the third step of PPC, sliding mode control was chose for its good advantage in dealing with nonlinear problems. Now we define the sliding mode surface as follows:  
\[\mathbf{s}=\mathbf{\Gamma}\mathbf{\omega}+\dot{\mathbf{\omega}}, \tag{31}\]  
where \(\mathbf{\Gamma}>0\) is control constant. Take the derivative of the sliding surface s with respect to time, we have:  
\[ \begin{array}{rl}\dot{\mathbf{s}}&=\mathbf{\Gamma}\dot{\mathbf{\omega}}+\ddot{\mathbf{ \omega}}\\ &=\mathbf{\Gamma}\left(\eta\left(\dot{\mathbf{e}}-\frac{\dot{\mathbf{e}}\dot{\rho}}{\rho} \right)\right)+\dot{\eta}\left(\dot{\mathbf{e}}-\frac{\dot{\mathbf{e}}\dot{\rho}}{\rho }\right)+\eta\left(\ddot{\mathbf{e}}-\frac{\dot{\mathbf{e}}\dot{\rho}}{\rho}-\frac{ \dot{\mathbf{e}}\dot{\rho}}{\rho}+\frac{\dot{\mathbf{e}}\dot{\rho}^{2}}{\rho^{2}} \right)\\ &=\left(\mathbf{\Gamma}\eta+\dot{\eta}\right)\left(\dot{\mathbf{e}}-\frac{\dot{\mathbf{e }}\dot{\rho}}{\rho}\right)+\eta\left[\mathbf{D}^{-1}\left(\tau+\tau_{d}-\mathbf{H} \dot{\mathbf{q}}\right)-\ddot{\mathbf{q}}_{d}-\frac{\dot{\mathbf{e}}\dot{\rho}}{\rho}-\frac {\dot{\mathbf{e}}\dot{\rho}}{\rho}+\frac{\dot{\mathbf{e}}\dot{\rho}^{2}}{\rho^{2}} \right]\end{array}  \tag{32}\]  
where \(\eta\) is a bounded variable, which satisfies \(0<\eta<\eta_{\pi\mu},\eta\) and \(\dot{\eta}\) can be written as:  
\[\left\{ \begin{array}{l}\eta=\frac{1}{2\rho}\left(\frac{1}{\mathbf{\omega}+\mathbf{ \mu}}-\frac{1}{\mathbf{\omega}-\mathbf{\mu}}\right)\\ \dot{\eta}=-\frac{\dot{\rho}}{2\rho^{2}}\left(\frac{1}{\mathbf{\omega}+\mathbf{\mu}}- \frac{1}{\mathbf{\omega}-\mathbf{\mu}}\right)-\frac{\dot{\mathbf{e}}\rho-\dot{\mathbf{e}}\dot{ \rho}}{2\rho^{3}}\left[\left(\frac{1}{\mathbf{\omega}+\mathbf{\mu}}\right)^{2}-\left( \frac{1}{\mathbf{\omega}-\mathbf{\mu}}\right)^{2}\right]\end{array} \right., \tag{33}\]According to Equation (33), a sliding mode controller containing unknown dynamic terms can be designed as follows:  
\[\tau=-\hat{\Delta}+\mathbf{D}\bigg{(}\ddot{\hat{q}}_{\text{d}}+\frac{\dot{\hat{e}} \dot{\rho}}{\rho}+\frac{\dot{e}\dot{\rho}}{\rho}-\frac{\dot{e}\dot{\rho}^{2}}{ \rho^{2}}-\bigg{[}\bigg{(}\big{(}\mathbf{\Gamma}\eta+\dot{\eta}\big{)}\bigg{(}\dot{ \mathbf{e}}-\frac{\mathbf{e}\dot{\rho}}{\rho}\bigg{)}\bigg{)}+\mathbf{K}\mathbf{s}\bigg{]}\bigg{)}, \tag{34}\]  
where \(\mathbf{K}>0\) is the control gain coefficient. Substitute Equation (34) into Equation (32), we have:  
\[\dot{\mathbf{s}}=-\mathbf{K}\mathbf{s}+\mathbf{\eta}\mathbf{D}^{-1}\widetilde{\Delta}, \tag{35}\]  
Now, we have obtained the sliding mode controller which only includes the inertial matrix \(\mathbf{D}\) of the space robot system represented by Equation (7). For this controller, the following is chosen as Lyapunov function \(V_{S}\) and which can be written as:  
\[V_{S}=\frac{1}{2}\mathbf{s}^{\text{T}}\mathbf{s}+\frac{1}{2}\widetilde{\Delta}^{\text {T}}\widetilde{\Delta}, \tag{36}\]  
The follow Equation (37) is obtained when taking the derivative of Equation (36):  
\[ \begin{array}{ll}\dot{V}_{S}&=\mathbf{s}^{\text{T}}\dot{\mathbf{s}}+\widetilde{ \Delta}^{\text{T}}\dot{\widetilde{\Delta}}\\ &=s^{\text{T}}\Big{(}-\mathbf{K}\mathbf{s}+\eta\mathbf{D}^{-1}\widetilde{\Delta}\Big{)}+ \widetilde{\Delta}^{\text{T}}\Big{(}-\frac{1}{k}\widetilde{\Delta}+\dot{ \Delta}\Big{)}\\ &\leq-\lambda_{\text{min}}(\mathbf{K})\mathbf{s}^{\text{T}}\mathbf{s}+\lambda_{\text{max} }(\mathbf{D})r_{m}\|\mathbf{s}^{\text{T}}\widetilde{\Delta}\|+\widetilde{\Delta}^{ \text{T}}\Big{(}-\frac{1}{k}\widetilde{\Delta}+\dot{\Delta}\Big{)}\\ &\leq-\lambda V_{S}+\
u\end{array}  \tag{37}\]  
where \(\lambda_{\text{min}}(\mathbf{K})\) is the minimum eigenvalue of \(\mathbf{K}\), and \(\lambda_{\text{min}}(\mathbf{D})\) is the maximum eigenvalue of \(\mathbf{D}\), \(\lambda=\min\Bigl{(}2\lambda_{\text{min}}(\mathbf{K})-\lambda_{\text{max}}(\mathbf{D })r_{m},\frac{1}{2k}-\lambda_{\text{max}}(\mathbf{D})r_{m}\Bigr{)}\), \(\
u=\frac{k}{2}\mathbf{\
u}^{2}\).