## 3 Design of the Compound Controller
### Neural Network Extend State Observer  
#### 3.2.1 Designs of Neural Network State Observer  
Then the NNSO is designed for the new system:  
\[\dot{\hat{X}}=A\hat{X}(t)+BU(t)+f\Big{(}\hat{X}(t)\Big{)}+L\Big{(}Y(t)-C\hat{X}(t )\Big{)}, \tag{9}\]  
where \(L\in R\) is observer gain matrix, \(\hat{X}(t)\) is state observation, \(f\Big{(}\hat{X}(t)\Big{)}\) is total disturbance observation, and the state error is defined as:  
\[\widetilde{X}(t)=X(t)-\hat{X}(t), \tag{10}\]  
and we can get the error dynamic equation of observer state as follows  
\[\dot{\widetilde{X}}=(A-LC)\widetilde{X}(t)+f\Big{(}\widetilde{X}(t)\Big{)}, \tag{11}\]  
where \(f\Big{(}\widetilde{X}(t)\Big{)}=f(X(t))-f\Big{(}\hat{X}(t)\Big{)}\). Let \(L=[L_{1},L_{2},\cdots,L_{n}]^{T}\) satisfy \(A-LC\) Hurwitz condition and \(L_{i}=\beta_{i}/\varepsilon^{i}\), where \(\varepsilon>0\). Equation (12) is an error dynamic equation and can be regarded as a constant coefficient differential equation with input \(f\Big{(}\widetilde{X}(t)\Big{)}\) to describe a linear system. The solution of this equation is  
\[\dot{\widetilde{X}}=e^{(A-LC)t}\widetilde{X}(0)+\int_{0}^{t}e^{(A-LC)(t- \tau)}f\Big{(}\widetilde{X}(\tau)\Big{)}d\tau, \tag{12}\]  
The basic idea of NNSO is to use the input and output of the system to observe all states including the original state variables and disturbances of the system. The core of the ADRC control strategy is to estimate \(f(X(t))\) and eliminate it. Since the radial basis function (RBF) neural network can approach the nonlinear function with accuracy, we introduce the neural network to approach \(f(X(t))\), so that NNSO can accurately observe the total disturbance in the system. The block diagram of the neural network is shown in Figure 5.  
Figure 4: Time response of the tracking differentiator (TD).  
and the error dynamic equation of observer state is  
\[\dot{\overline{X}}(t)=(A-LC)\overline{X}(t)+\widetilde{W}^{T}\sigma\big{(}\dot{ \overline{X}}\big{)}+\omega(t), \tag{19}\]  
\[\widetilde{Y}(t)=C\overline{X}(t), \tag{20}\]  
Using the gradient descent calculation method, we define the network learning objective function as  
\[J=\frac{1}{2}\widetilde{Y}^{T}\widetilde{Y}, \tag{21}\]  
and the network learn equation is  
\[\dot{\bar{W}}=-\eta\bigg{(}\frac{\partial J}{\partial\dot{\bar{W}}}\bigg{)}- \kappa|\overline{Y}||\dot{W}, \tag{22}\]  
where \(\kappa>0\), \(\eta>0\) is the learning rate of neural network. Differentiating Equation (22) gives  
\[\frac{\partial J}{\partial\dot{\bar{W}}}=\frac{\partial J}{\partial\dot{ \overline{Y}}}\frac{\partial\overline{X}}{\partial\dot{\overline{X}}}\frac{ \partial\overline{X}}{\partial\dot{\bar{W}}}=-\widetilde{Y}^{T}C\frac{ \partial\overline{X}}{\partial\dot{\bar{W}}}, \tag{23}\]  
In order to simplify the training algorithm and avoid complex gradient calculation, let \(\dot{\bar{X}}(t)=0\), invoking Equation (20)  
\[\frac{\partial\overline{X}}{\partial\dot{\bar{W}}}\approx(A-LC)^{-1}\frac{ \partial\overline{X}}{\partial\dot{\bar{W}}}, \tag{24}\]  
Considering Equations (16), (24) and (25), we get the adaptive law  
\[\dot{\bar{W}}=-\eta\big{(}\overline{X}^{T}C^{T}C(A-LC)^{-1}\big{)}^{T}\sigma \big{(}\dot{\overline{X}}\big{)}-\kappa\|C\overline{X}\|\dot{W}, \tag{25}\]