# Enhanced Trajectory Tracking via Disturbance-Observer-Based Modified Sliding Mode Control
## 2 Control Design
### Extended-State Observer  
The ESO estimates system states and perturbation. The estimated perturbation is sum of system modeled and unmodeled dynamics, nonlinearity, and external disturbance. It is easy to design ESO for the nonlinear system as it requires minimal information about the system. The goal of this research is to design model-free control for the system. Consider the following second-order system:  
\[\dot{x}_{1}=\dot{x}=x_{2} \tag{1}\] \[\dot{x}_{2}=u+g\big{(}x,\dot{x},t\big{)}+\Delta g\big{(}x,\dot{x}, t\big{)}+d,\]  
where \(x\) presents the system states \([x_{1}x_{2}]\), \(g\big{(}x,\dot{x},t\big{)}\) represents the system dynamics, \(\Delta g\big{(}x,\dot{x},t\big{)}\) is the uncertainty in system dynamics, \(d\) is the external disturbance, and \(u\) is the control input. The control objective is to achieve the desired position in satisfactory time. **Assumption 1**. : _In (1), it is assumed that system dynamics, its uncertainty, and external disturbance are unknown. Therefore, the unknown terms are defined as the extended state of the system:_  
\[x_{3}=g\big{(}x,\dot{x},t\big{)}+\Delta g\big{(}x,\dot{x},t\big{)}+d, \tag{2}\]  
_where\(\dot{x}_{3}=\text{Gis assumed to be an unknown but bounded function. The system (1) can be rewritten as:_  
Figure 1: Idea-flow diagram of proposed method. \[\dot{x}_{1}=x_{2}, \tag{3}\]  
\[\dot{x}_{2}=u+x_{3}, \tag{4}\]  
\[\dot{x}_{3}=G. \tag{5}\]  
Now the system has three states: \(x_{1}\), \(x_{2}\), and \(x_{3}\). The observer's task is to estimate the system states. The mathematical structure of nonlinear ESO is expressed as:  
\[\dot{\hat{x}}_{1}=\hat{x}_{2}+l_{1}\text{sat}\Big{(}\widetilde{x}_{1}\Big{)}, \tag{6}\]  
\[\dot{\hat{x}}_{2}=\hat{x}_{3}+l_{2}\text{sat}\Big{(}\widetilde{x}_{1}\Big{)}+u, \tag{7}\]  
\[\hat{x}_{3}=l_{3}\text{sat}\Big{(}\widetilde{x}_{1}\Big{)}, \tag{8}\]  
where \(\hat{x}_{1}\), \(\hat{x}_{2}\), and \(\hat{x}_{3}\) are the estimated state of the system; \(l_{1}\), \(l_{2}\), and \(l_{3}\) are the observer gains selected through pole-placement method [38]; and \(\widetilde{x}_{1}\) is the estimation error of the state (\(\widetilde{x}_{1}=x_{1}-\hat{x}_{1}\)). Sat is the saturation function, defined as:  
\[\text{sat}\Big{(}\widetilde{x}_{1}\Big{)}= \begin{cases}\frac{\widetilde{x}_{ 1}}{\big{|}\widetilde{x}_{1}\big{|}}\Big{|}\widetilde{x}_{1}\Big{|}\geq\varepsilon _{o}\\ \frac{\widetilde{x}_{1}}{\varepsilon_{o}}\Big{|}\widetilde{x}_{1}\Big{|}< \varepsilon_{o}\end{cases} , \tag{9}\]  
where \(\varepsilon_{o}\) is the boundary-layer thickness. By using Equations (3)-(8), the estimation error of the states can be calculated as:  
\[\dot{\widetilde{x}}_{1}=\widetilde{x}_{2}-l_{1}\text{sat}\Big{(}\widetilde{ x}_{1}\Big{)}, \tag{10}\]  
\[\dot{\widetilde{x}}_{2}=\widetilde{x}_{3}-l_{2}\text{sat}\Big{(}\widetilde{ x}_{1}\Big{)}, \tag{11}\]  
\[\dot{\widetilde{x}}_{3}=G-l_{3}\text{sat}\Big{(}\widetilde{x}_{1}\Big{)}, \tag{12}\]  
**Assumption 2**. : _In order to calculate the observer gain, it is assumed that the estimation error (\(\widetilde{x}_{1}\)) is within the boundary layers (\(\Big{|}\widetilde{x}_{1}\Big{|}<\varepsilon_{o}\)). Therefore, the saturation function can be written as (according to Equation (9)):_  
\[\text{sat}\Big{(}\widetilde{x}_{1}\Big{)}=\frac{\widetilde{x}_{1}}{ \varepsilon_{o}}, \tag{13}\]  
_based on Assumption 2, Equations (10)-(12) can be updated as follows:_  
\[\dot{\widetilde{x}}_{1}=\widetilde{x}_{2}-l_{1}\Bigg{(}\frac{\widetilde{x}_{ 1}}{\varepsilon_{o}}\Bigg{)}, \tag{14}\]  
\[\dot{\widetilde{x}}_{2}=\widetilde{x}_{3}-l_{2}\Bigg{(}\frac{\widetilde{x}_{ 1}}{\varepsilon_{o}}\Bigg{)}, \tag{15}\]\[\dot{\widetilde{x}}_{3}=G-l_{3}\Bigg{(}\frac{\widetilde{x}_{1}}{\varepsilon_{o}} \Bigg{)}. \tag{16}\]  
The state-space dynamics of the above Equations, (14)-(16), can be presented as:  
\[\dot{\widetilde{x}}=A\widetilde{x}+EG, \tag{17}\]  
where  
\[A= \begin{bmatrix}\frac{-l_{1}}{\varepsilon_{o}}&1&0\\ \frac{-l_{2}}{\varepsilon_{o}}&0&1\\ \frac{-l_{3}}{\varepsilon_{o}}&0&0\end{bmatrix} ,\ E=