## 3 Hybrid Compensation Scheme
### Active Sliding Mode NDI Controller for Disturbance  
In order to optimize the control effect of the adaptive NDI controller, a sliding mode scheme is added here to improve the adaptive NDI controller and compensate for the influence of disturbance on the system. The nonlinear model of the aircraft under the influence of disturbance can be expressed as  
\[\left\{ \begin{array}{l}\dot{x}=Ax+Bu+d\\ y=Cx+Du\end{array} \right. \tag{40}\]  
\(d(t)\) in Formula (40) is the uncertain disturbance from external sources. According to the cancellation principle in NDI design, in the presence of disturbance and rotational inertia uncertainty, the nonlinear system control law is  
\[u_{*}=B^{+}(-Ax+v-d) \tag{41}\]  
The control \(u\) obtained by ignoring the disturbance solution is just an ideal flight control law. As \(d\) continues to increase, the system will slowly diverge and even become unstable. Aiming at this problem, a sliding mode disturbance observer is introduced to estimate the disturbance value, replacing \(d\) in (41), and then a new active compensation control law is used to repair the disturbance. The block diagram of the sliding mode NDI controller is shown in Figure 3.  
For the MIMO nonlinear uncertain system (40), construct the following sliding mode system with a disturbance observer:  
\[\left\{ \begin{array}{l}s=x-z\\ \dot{z}=Bu-v\\ \dot{d}=-(v+Ax)\end{array} \right. \tag{42}\]  
where \(s=[s_{1},s_{2},s_{3}]^{T}\) is the auxiliary sliding mode surface, and the sliding mode control variable is  
\[v=\left[v_{1}\quad v_{2}\quad v_{3}\right]^{T}=-\phi sign(s) \tag{43}\]  
and  
\[sign(s)=\left[sign(s_{1})\quad sign(s_{2})\quad sign(s_{3})\right]^{T} \tag{44}\]  
\[\phi=diag(\phi_{1},\phi_{2},\phi_{3}) \tag{45}\]  
thence \(v\) can be expressed as (46), \(i=1,2,3\),  
\[v_{i}=-\phi_{i}sign(s_{i}) \tag{46}\]  
\[v=\left[-v_{1}sign(s_{1})\quad-v_{2}sign(s_{2})\quad-v_{3}sign(s_{3})\right]^ {T} \tag{47}\]  
Let  
\[\xi=Ax+\dot{d}=\left[\xi_{1}\quad\xi_{2}\quad\xi_{3}\right]^{T} \tag{48}\]  
when \(\phi_{i}>\left|\xi_{i}\right|\), the observation of disturbance \(\dot{d}\) can uniformly converge asymptotically to the true value. Taking the derivation of the first formula of (42):  
\[ \begin{array}{l}\dot{s}=\dot{x}-\dot{z}\\ =Ax+Bu+d-Bu+v\\ =Ax+d+v\end{array}  \tag{49}\]  
**Theorem 2**. : _If the algorithms (43)-(47) designed for the system (42) satisfy the condition (50), the sliding mode dynamic system (42) is uniformly stable._  
\[\left\{ \begin{array}{l}v_{i}=-\phi_{i}sign(s_{i})\\ \phi_{i}>\left|\xi_{i}\right|\end{array} \right. \tag{50}\]  
**Proof of Theorem 2. ** Take the Lyapunov function  
\[V=\frac{1}{2}s^{T}s\geq 0 \tag{51}\]  
Figure 3: Longitudinal HFV model sliding mode NDI controller. Then  
\[ \begin{array}{l}\dot{V}=s^{T}\dot{s}\\ =\sum\limits_{i=1}^{3}s_{i}\dot{s}_{i}\\ =\sum\limits_{i=1}^{3}s_{i}(\xi_{i}+v_{i})\\ \end{array}  \tag{52}\]  
Define  
\[\dot{V}_{i}=s_{i}(\xi_{i}+v_{i}) \tag{53}\]  
because (50), we can obtain:  
\[ \begin{array}{l}\dot{V}_{i}=s_{i}(\xi_{i}+v_{i})\\ =s_{i}\xi_{i}-s_{i}\phi_{i}sign(s_{i})\\ \leq s_{i}|\xi_{i}|-s_{i}\phi_{i}sign(s_{i})\\ <s_{i}\phi_{i}-s_{i}\phi_{i}sign(s_{i})\\ =\left\{\begin{array}{l}0,s_{i}\geq 0\\ 2s_{i}\phi_{i}<0,s_{i}<0\end{array}\right.\end{array}  \tag{54}\]  
Then we can obtain  
\[\left\{ \begin{array}{l}\dot{V}_{i}<0\\ \dot{V}=\sum\limits_{i=1}^{3}\dot{V}_{i}<0\end{array} \right. \tag{55}\]  
Therefore, s is stable in the equilibrium state at the origin, satisfying the stability condition. \(\square\)  
When the system reaches a stable point, it can be known from Equations (40)-(42) that the observed disturbance value is  
\[\hat{d}=-(v+Ax) \tag{56}\]  
Since \(v\) is a switching function, there will be a lot of chattering during simulation, which will affect the tracking performance. Therefore, the relatively smooth hyperbolic tangent function tanh(s) is used to replace the switching term sign(s) to reduce the chattering.