# 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.2 Integration of SMC and SPO (SMCSPO)  
Integration of SMC into SPO generates SMCSPO [1] which is a robust control against perturbation. SMCSPO uses a perturbation compensation technique. It is a combination of a controller and observer;it estimates the system states and perturbation and uses that information to control an uncertain system. An estimated sliding surface is defined as:  
\[\hat{s}=\hat{\hat{e}}+c\cdot\hat{e} \tag{17}\]  
where \(\hat{e}=\hat{x}_{1}-x_{d}\) is the estimated error and \(c\) is a constant value greater than 0.  
The estimated error of the sliding surface is shown below.  
\[\widetilde{s}=\hat{s}-s \tag{18}\]  
The estimated error of a sliding surface is computed as:  
\[\widetilde{s}=\dot{\widetilde{x}}_{1}+c\cdot\widetilde{x}_{1} \tag{19}\]  
The control \(\overline{u}\) is selected such that it satisfies the following condition during the reaching phase.  
\[\hat{s}\cdot\hat{\hat{s}}\leq 0 \tag{20}\]  
For the above condition, the \(\dot{\hat{s}}\) dynamic is selected as shown below.  
\[\dot{\hat{s}}=-K\cdot sat(\hat{s}) \tag{21}\]  
The definition of sat (\(\hat{s}\)) is defined as:  
\[sat(\hat{s})=\left\{\begin{array}{ll}\frac{\hat{s}}{|\hat{s}|}&\mbox{if}\ \ | \hat{s}|>\varepsilon_{c}\\ \frac{\hat{s}}{\varepsilon_{c}}&\mbox{if}\ \ |\hat{s}|\leq\varepsilon_{c}\end{array}\right. \tag{22}\]  
After taking the derivative of Equation (17) and using Equation (11), we get the following equation:  
\[\dot{\hat{s}}=\alpha_{3}\cdot\overline{u}-\widetilde{x}_{1}\Bigg{\{}\frac{k_ {2}}{\varepsilon_{o}}+\frac{c\cdot k_{1}}{\varepsilon_{o}}-\frac{k_{1}^{2}}{ \varepsilon_{o}^{2}}\Bigg{\}}-\frac{k_{1}}{\varepsilon_{o}}\widetilde{x}_{2} +c\big{(}\hat{x}_{2}-\dot{x}_{d}\big{)}-\ddot{x}_{d}+\
ot{\psi} \tag{23}\]  
In Equation (23), it is assumed that \(\widetilde{x}_{2}=0\) to enforce Equation (20).  
After putting the value of \(\dot{\hat{s}}\) in Equation (21), we get the following control input \(\overline{u}\).  
\[\overline{u}=\frac{1}{\alpha_{3}}[-K\cdot sat(\hat{s})+\widetilde{x}_{1} \Bigg{\{}\frac{k_{2}}{\varepsilon_{o}}+\frac{c\cdot k_{1}}{\varepsilon_{o}}- \frac{k_{1}^{2}}{\varepsilon_{o}^{2}}\Bigg{\}}+\ddot{x}_{d}-c\big{(}\hat{x}_{ 2}-\dot{x}_{d}\big{)}-\
ot{\psi}] \tag{24}\]  
After substituting Equation (24) into Equation (23), the resulting dynamics \(\dot{\hat{s}}\) have the effect of state estimation error as shown.  
\[\dot{\hat{s}}=-K\cdot sat(\hat{s})-\frac{k_{1}}{\varepsilon_{o}}\widetilde{x }_{2} \tag{25}\]  
The above relation shows that during the reaching phase, the \(\dot{\hat{s}}\) dynamics are affected by the estimation error of state \(\widetilde{x}_{2}\). To enforce the condition of Equation (20), the following condition should be fulfilled.  
\[K>\frac{k_{1}^{2}}{\varepsilon_{o}} \tag{26}\]  
As we know that \(|\widetilde{x}_{2}|\leq k_{1}\).  
When the system reached the sliding surface or prescribed manifold \(|\hat{s}|\leq\varepsilon_{c}\), the actual s dynamics was obtained as shown below.  
\[\dot{s}+\frac{K}{\varepsilon_{c}}s=\widetilde{x}_{1}\Bigg{\{}\frac{k_{2}}{ \varepsilon_{o}}-\bigg{(}\frac{k_{1}}{\varepsilon_{o}}-\frac{K}{\varepsilon_ {c}}\bigg{)}\bigg{(}c-\frac{k_{1}}{\varepsilon_{o}}\bigg{)}\bigg{\}}- \widetilde{x}_{2}\Bigg{\{}\frac{K}{\varepsilon_{c}}+c\bigg{\}}-\
ot{\psi} \tag{27}\]