# Fractional-Order Sliding Mode with Active Disturbance Rejection Control for UAVs
## 3 Flight Controller Design
### Inner Loop Controller (Active Disturbance Rejection Controller Design)  
The conventional ADRC consists of a tracking differentiator (TD), an extended state observer ((ESO), and a nonlinear state error feedback (NLSEF). Its core components are disturbance estimation and dynamic compensation [25], as shown in Figure 2. The tracking differentiator arranges the transition process for the desired signal input to the control system, providing a trade-off between the overshoot of the system control and the fast response of the system control and reducing the overshoot of the control system caused by large changes in the given signal. The mathematical expression for the tracking differentiator for a second-order system is shown in Equation (20). \[ \begin{cases}\text{fh}=\text{fhan}(v_{1}(k)-v_{d}(k),v_{2}(k),r_{0},h_{0})\\ v_{1}(k+1)=v_{1}(k)+T\cdot v_{2}(k)\\ v_{2}(k+1)=v_{2}(k)-T\cdot\text{fh}\end{cases}  \tag{20}\]  
where \(T\) is the sampling period of the control system and \(v_{1}\) and \(v_{2}\) are the system states. \(v_{d}\) is the expected value of the system, and \(\text{fhan}(v_{1},v_{2},r_{0},h_{0})\) is the most rapid synthesis function, which is defined as shown in Equation (21):  
\[ \begin{cases}d=r_{0}h_{0}^{2}\\ a_{0}=h_{0}x_{2}\\ y=x_{1}+a_{0}\\ a_{1}=\sqrt{d(d+8\mid y\mid)}\\ a_{2}=a_{0}+\frac{\text{sign}(y)(a_{1}-d)}{2}\\ s_{y}=\frac{\text{sign}(y+d)-\text{sign}(y-d)}{2}\\ a=(a_{0}+y-a_{2})s_{y}+a_{2}\\ s_{a}=\frac{\text{sign}(a+d)-\text{sign}(a-d)}{2}\\ \text{fhan}=-r[\frac{a}{d}-\text{sign}(a)]s_{a}-r_{0}\text{sign}(a)\end{cases}  \tag{21}\]  
where \(r_{0}\) and \(h_{0}\) are adjustable parameters related to the tracking performance, where \(r_{0}\) is the speed factor. Increasing \(r_{0}\) speeds up the response and reduces the transition process, but too large a value of \(r_{0}\) makes the tracking signal close to the desired input signal and loses the significance of the transition process. \(h_{0}\) is the filtering factor; increasing the value of \(h_{0}\) value can improve the filtering effect but produces phase delay. \(sign(x)\) is the sign function. ESO takes the input and output variables of the control system as the inputs of the observer and adopts a nonlinear combination to observe the disturbances of the system, expanding a new state variable on top of the original state variable of the system, which is regarded as the total disturbance variable. ESO does not need the mathematical model of the controlled object [26] and only estimates the total disturbances of the system based on the system's inputs and outputs. The total disturbance of the system is estimated and compensated to the controller, which is the core part of ADRC; the mathematical expression of ESO is shown in Equation (22):  
\[ \begin{cases}\varepsilon_{1}=z_{1}(k)-y(k)\\ z_{1}(k+1)=z_{1}(k)+T[z_{2}(k)-\beta_{01}\varepsilon_{1}]\\ z_{2}(k+1)=z_{2}(k)+T[z_{3}(k)-\beta_{02}\text{fal}(\varepsilon_{1},\alpha_{1 },\delta)+bu]\\ z_{3}(k+1)=z_{3}(k)-T\beta_{03}\text{fal}(\varepsilon_{1},\alpha_{2},\delta) \end{cases}  \tag{22}\]  
where \(\text{fal}(x,\alpha,\delta)\) is a nonlinear function defined as shown in Equation (23):\[\text{fal}(x,\alpha,\delta)= \begin{cases}\frac{x}{\delta^{(1-\alpha)}},&\mid x\mid \leqslant\delta\\ \\ \text{sign}(x)\mid x\mid^{\alpha},&\mid x\mid>\delta\end{cases}  \tag{23}\]  
where \(\delta\) is a constant that affects the filtering effect and \(\alpha\) is an adjustment parameter for the length of the nonlinear interval of the function number. \(\alpha_{1},\alpha_{2}\) is a variable parameter related to the nonlinear interval of the \(\text{fal}(x,\alpha,\delta)\) function, which is generally taken as \(\alpha_{1}=0.5,\alpha_{2}=0.25\); \(\beta_{01},\beta_{02},\beta_{03}\) are determined by the sampling step of the system.