# Review on System Identification and Mathematical Modeling of Flapping Wing Micro-Aerial Vehicles
## 3 System Identification and Mathematical Modeling of Flapping Wing Micro Air Vehicles (FWMAVs)
### Tailed Flapping Wing Micro-Air Vehicles
#### 3.1.2 System Identification of DelFly II Based on Extended Kalman Filter
The process and measurement equations are given as follows:Process equations:  
\[\dot{\Phi} = (p-b_{p})+(q-b_{q})\sin\Phi\tan\Theta+(r-b_{r})\cos\Phi\tan\Theta\] \[\dot{\Theta} = (q-b_{q})\cos\Phi-(r-b_{r})\sin\Phi\] \[\dot{\Psi} = (q-b_{q})\sin\Phi\sec\Theta+(r-b_{r})\cos\Phi\sec\Theta\] \[\dot{u}_{B} = (r-b_{r})v_{b}-(q-b_{q})w_{b}-g\sin\Theta+a_{z}-b_{ax}\] \[\dot{v}_{B} = -(r-b_{r})u_{b}+(p-b_{p})w_{b}+g\sin\Phi\cos\Theta+a_{y}-b_{ay}\] \[\dot{w}_{B} = (q-b_{q})u_{b}-(p-b_{p})v_{b}+g\cos\Phi\cos\Theta+a_{z}-b_{az}\] \[\dot{b}_{p} = 0\] \[\dot{b}_{q} = 0\] \[\dot{b}_{r} = 0\] \[\dot{b}_{ax} = 0\] \[\dot{\Theta} = (q-b_{q})\cos\Phi-(r-b_{r})\sin\Phi\]0 \[\dot{\Theta} = (q-b_{q})\cos\Phi-(r-b_{r})\sin\Phi\]1  
Measurement equations:  
\[\dot{\Theta} = (q-b_{q})\cos\Phi-(r-b_{r})\sin\Phi\]2 \[\dot{\Theta} = (q-b_{q})\cos\Phi-(r-b_{r})\sin\Phi\]3 \[\dot{\Theta} = (q-b_{q})\cos\Phi-(r-b_{r})\sin\Phi\]4 \[\dot{\Theta} = (q-b_{q})\cos\Phi-(r-b_{r})\sin\Phi\]5 \[\dot{\Theta} = (q-b_{q})\cos\Phi-(r-b_{r})\sin\Phi\]6 \[\dot{\Theta} = (q-b_{q})\cos\Phi-(r-b_{r})\sin\Phi\]7  
where \(x\), \(u\), \(z\), \(v\), and \(w\) are the states, input, output, process, and measurement noise terms of the filter, respectively, and are defined as follows. \[x = \big{[} \begin{array}{ccccccccc}\[PERSON]&\[PERSON]&\[PERSON]&u_{b}&v_{b}&w_{b }&b_{p}&b_{q}&b_{r}&b_{az}&b_{ay}&b_{az}\end{array} \big{]}^{T},\] \[u = \big{[} \begin{array}{ccccccccc}p&q&r&a_{z}&a_{y}&a_{x}\end{array}  \big{]}^{T},\] \[z = \big{[} \begin{array}{ccccccccc}\[PERSON]_{m}&\[PERSON]_{m}&\[PERSON]_{m}&u_{ b}^{*}&v_{b}^{*}&w_{b}^{*}\end{array} \big{]}^{T},\] \[v = \big{[} \begin{array}{ccccccccc}v_{\[PERSON]}&v_{\[PERSON]}&v_{\Psi}&v_{ ub}&v_{vb}&v_{ub}\end{array} \big{]}^{T},\] \[w = \big{[} \begin{array}{ccccccccc}w_{p}&w_{q}&w_{r}&w_{ax}&w_{ay}&w_ {az}\end{array} \big{]}^{T}.\]  
The states were the attitudes (i.e., the Euler angles \([\[PERSON]\,\[PERSON]\,\[PERSON]]\)), body-axis velocities \([u_{b},v_{b},w_{b}]\), and the sensor biases of the gyroscope and accelerometer \(\big{[}b_{p},b_{q},b_{r},b_{ax},b_{ay},b_{az}\big{]}\). The input was the roll, pitch, and yaw rates \([p,q,r]\) and the accelerometer-measured accelerations \(\big{[}a_{x},\,a_{y},\,a_{z}\big{]}\). The output \(z\) were the attitude obtained from the OptiTrack system and velocities. The process noise term \(v\) consisted of the measurement noise in the measured velocities and attitudes. Finally, the measurement noise term \(w\) consisted of the process noise in the rates and accelerations.  
The matrix \(Q\) and \(R\) were tuned to give more weights to the OptiTrack data except at high frequencies, with \(Q\) entries selected to be twice that than was inferred from the data to reduce the confidence in the IMU, and \(R\) was 20% smaller than the noise characteristics of the OptiTrack. This choice led to increasingly small innovation errors and faster filter convergence in the EKF. The final covariance matrices are [134]:  
\[Q=diag(3.06,\,7.30,\,7.12,\,44.21,\,14.80,\,24.20),\]  
\[R=diag\Big{(}9.94\times\,10^{-4},1.07\times\,10^{-3},8.33\times\,10^{-4},9.80 \times\,10^{-3},2.47\times\,10^{-3},6.82\times\,10^{-3}\Big{)}.\]  
Although EKF is well known as a powerful system identification approach that can solve nonlinear estimation problems, it still uses linearized state and/or measurement equations followed by the application of the Kalman filter, and results in a linear estimation problem. Due to the linearization, it yields approximation errors, which tend to underestimate state uncertainties. Therefore, this approach may not be able to capture the nonlinearities and time-varying nature of the dynamics of FWMAVs accurately. This problem can be improved by selecting process equations, which give better descriptions of the dynamics, and in this case, a priori knowledge and engineering insights will be required.