## 3 Experimental Flight and System Identification
### Linear Model Refinement in System Identification  
System identification processes were performed with the help of system identification tools in MATLAB(r). The dynamic model generated from the system identification using the black box model approach was found to be very complex. It could not be matched with real physical parameters of the KUBeetle. Thus, this research only focused on the system identification using the gray box model approach. The gray box model approach with direct and indirect methods was tested to refine open- and closed-loop dynamic models. Two different pairings were considered for the direct and indirect methods, respectively. Firstly, the control input was given as input, while the pitch rate and pitch angle were given as outputs. Secondly, the reference command was given as input, while the pitch rate and pitch angle were given as outputs. Equations (4) and (5) present the structure of the system and input matrices of the dynamic model as fixed for the open-loop dynamic model, while Equations (9) and (10) present those for the closed-loop dynamic model. In addition, given values of parameters in Equations (4)-(10), obtained from computations and measurements, were used as the initial values for system identification. The pitch angle output was given higher weighting, because it had smaller noise compared to the pitch rate output which had larger high-frequency noise that could affect the accuracy of the identified dynamic model. According to the experimental flight setup and data, the obtained dynamic model mainly represented the dynamic of KUBeetle during hover and forward flights with pitch angle under 0.3 radian. Adaptive Gauss-Newton (GNA), Levenberg-Marquardt (LM), and gradient search (GRAD) methods were utilized for model refinements. Table 2 summarizes the general characteristics of each identification method [90; 91; 92]:  
The total iteration for each search method was limited to 2000 iterations, as further iterations provided negligible improvement. Results from each search method were compared and evaluated. One of the indicators used was the fit percentage of the responses of the identified dynamic model to the experimental flight data. It was defined as:  
\[Fit\;Percentage=100\left(1-\frac{\sqrt{\sum_{i=1}^{N}\left(y_{measured}-y_{ model}\right)^{2}}}{\sqrt{\sum_{i=1}^{N}\left(y_{measured}-\overline{y_{measured}}\right)^{2}}} \right), \tag{11}\]  
where, \(N\) was the number of samples, \(y_{measured}\) was the experimental flight data measured, \(y_{model}\) was the simulated response of the dynamic model identified, and \(\overline{y_{measured}}\) was the mean of experimental flight data measured. Figure 6: Experimental flight data and simulation results for system identification with irregular square reference inputs: (**a**) pitch angle responses, and (**b**) pitch rate responses. Firstly, system identification using the gray box model approach with the direct method was conducted. Closed-loop system identification with the direct method is often used, because it works regardless of the complexity of the regulator. In addition, it does not require knowledge of the characteristic of the feedback [79]. However, the system identification result depended on the quality of the disturbance model, which should also be identified during model refinement. The open-loop CFD dynamic model in Equations (4) and (5) was used as the initial dynamic model. However, the direct method was found to be unsuitable for the system identification of the KUBeetle using the current experimental flight data as the disturbance model could not be identified well, which caused responses of the identified model not to match experimental flight data. Note that some working identification methods for open-loop system identification may fail when they are applied to a closed-loop system identification [79].