# Efficient Control of a Non-Linear System Using a Modified Sliding Mode Control
## 2 Control Design
### Sliding Mode Control with Sliding Perturbation Observer (SMCSPO)
#### 2.2.1 Sliding Perturbation Observer (SPO)  
SPO is a non-linear observer that uses partial state feedback (position) to estimate the system states and perturbation [1]. The structure of the second order system can be presented as:  
\[ \begin{array}{c}\dot{x}_{1j}=x_{2j}\\ \dot{x}_{2j}=f_{j}(x)+\sum_{i=1}^{n}b_{ji}(x)u_{i}+\psi_{j}(x,t)\end{array}  \tag{4}\]  
where \(\psi_{j}(x,t)\) is the perturbation which is defined in Equation (2). Where \(X=[x_{1}x_{2}]^{T}\) is the state vector and \(x_{1}\) is the only measurable state of encoder data from the hydraulic link joint (system output). The observer's function was to estimate state vector \(X\) despite uncertainties. The term \(f_{j}(x)\) corresponds to non-linear driving terms. So the estimation state of the system is defined as:  
\[ \begin{array}{c}\dot{x}_{1j}=\hat{x}_{2j}\\ \dot{\hat{x}}_{2j}=f_{j}(\hat{x})+\sum_{i=1}^{n}b_{ji}(\hat{x})u_{i}+\hat{\psi }(\hat{x},t)\end{array}  \tag{5}\]  
where \(\hat{\psi}_{j}(\hat{x},t)\) is the estimated perturbation. Before integrating the sliding observer into SMC, it was convenient to decouple the control variable using the following transformation [2], as shown below:  
\[f_{j}(\hat{x})+\sum_{i=1}^{n}b_{ji}(\hat{x})u_{i}=\alpha_{3j}\cdot\overline{u }_{j} \tag{6}\]  
In above Equation (6), \(\alpha_{3}\) is a positive constant and \(\overline{u}\) is a new control variable. \(\overline{u}\) has the same unit as the control input \(u\) (N.m). The control input \(u\) can be defined as:  
\[u=B^{-1}col\left[\alpha_{3}\cdot\overline{u}-f_{j}(\hat{x})\right] \tag{7}\]  
where \(u=[u_{1}\ldots u_{n}]^{T}\) and \(B=\left[b_{ji}(\hat{x})\right]_{n=n}\) are control input vectors, and Col means column vector. The difference \(b_{ji}(\hat{x})-b_{ji}(x)\) is considered as a part of the term \(\Delta b_{ji}\) in Equation (2). Equation (7) allows the system dynamics to be rewritten as:  
\[\ddot{x}_{1} = \alpha_{3}\cdot\overline{u}+\psi_{j}. \tag{8}\] \begin{table}
\begin{tabular}{c c c} \hline \hline
**Serial No** & **Moment of Inertia (kg\(\cdot\)m\({}^{2}\))** & **Damper (kg\(\cdot\)m\({}^{2}\)/s)** \\ \hline
1 & 303 & 15,355 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Hydraulic link parameters. A new state variable was introduced to estimate the perturbation and the relation between this new variable and perturbation is shown in the following equation:  
\[x_{3j}=\alpha_{3j}\cdot x_{2j}-\frac{\psi_{j}}{\alpha_{3j}} \tag{9}\]  
The derivative of the above relation is shown below:  
\[\dot{x}_{3j}=\alpha_{3j}\cdot\dot{x}_{2j}-\frac{\dot{\psi}_{j}}{\alpha_{3j}} \tag{10}\]  
We assume that the constant \(\alpha_{3}\) is selected as a larger value such that \(\frac{\dot{\psi}_{j}}{\alpha_{3}}\) becomes negligible as compared with other terms in the equation. The sliding perturbation observer (SPO) equations can be described as:  
\[\dot{\xi}_{1} = \dot{x}_{2}-k_{1}\cdot sat(\widetilde{x}_{1})-\alpha_{1}\cdot \widetilde{x}_{1}\] \[\dot{\xi}_{2} = -k_{2}\cdot sat(\widetilde{x}_{1})+\alpha_{3}\cdot\overline{u}- \alpha_{2}\cdot\widetilde{x}_{1} \tag{11}\] \[\dot{\xi}_{3} = \alpha_{3}^{2}\cdot(\alpha_{3}\cdot\dot{x}_{2}+\overline{u}- \dot{x}_{3})\] \[\dot{\psi} = \alpha_{3}(\alpha_{3}\cdot\dot{x}_{2}-\dot{x}_{3}) \tag{12}\]  
where \(k_{1},k_{2},\alpha_{3},\alpha_{1},\alpha_{2}\) are constant and their values are greater than 0 and sat (\(\dot{\xi}_{1}\)) is the saturation function which is defined below. \[sat(\widetilde{x}_{1})=\left\{ \begin{array}{cl}\frac{\widetilde{x}_{1}}{| \widetilde{x}_{1}|}&\mbox{if}\ \ |\widetilde{x}_{1}|>\varepsilon_{o}\\ \frac{\widetilde{x}_{1}}{\varepsilon_{o}}&\mbox{if}\ \ |\widetilde{x}_{1}|\leq \varepsilon_{o}\end{array} \right. \tag{13}\]  
where \(\widetilde{x}_{1}=\dot{\xi}_{1}-x_{1}\) is the state estimation error and \(\varepsilon_{o}\) is the boundary layer of the sliding observer. It is assumed that the observer starts at the sliding surface and remains when time (t = 0) \(\widetilde{x}_{1}=0\), \(\widetilde{x}_{2}=0\).