System Identification and Control for a Tail-Sitter Unmanned Aerial Vehicle in the Cruise Flight

This work presents the implementation of system identification and model predictive control for a tail-sitter unmanned aerial vehicle (UAV) in cruise flight. The mathematical model of longitudinal and lateral directions of the UAV has been derived in the state-space form for grey-box modeling. The least-square regression method is augmented with regulation and solved by applying the trust-region algorithm. Outdoor flight tests were conducted to acquire the data for system identification assisted by a signal generator module. The UAV dynamic was sufficiently excited in both longitudinal and lateral directions during the flight test. The flight data were applied to the grey box system identification, and the parameters were validated by fitting the reconstructed model to a set of flight data with a different excitation waveform. The flight controller with model predictive control was formed using the identified models for flight simulation. The results demonstrate that the system identification results are able to provide reference models for the model-based controller development of the novel-design tail-sitter UAV.


I. INTRODUCTION
Unmanned aerial vehicles (UAVs) are currently popular in both commercial markets and research areas. They have incomparable advantages of low cost, ease of use, and small size. They have already been massively used in search and rescue (SAR) [1], emergency delivery [2], signal relay [3] and light show events, etc. Compared with the general flight controller based on proportional-integral-derivative (PID), a model-based control method can bring a number of advantages for UAV control. A model-based controller with a high-fidelity model can usually outperform a gain-scheduled PID controller in most areas, and it requires lower tuning skill [4]. Wind tunnel experiments and system identification are the two major methods for modeling a UAV system. Wind tunnel experiments can find the parameters that describe the aerodynamic forces and moments in a given flow condition [5]. This method, while widely used, has limitations when applied to a UAV. For example, it is relatively costly and The associate editor coordinating the review of this manuscript and approving it for publication was Dong Shen . time-consuming; additionally, the steady and one direction flow inside the wind tunnel is far too optimal compared to the outdoor environment [6].
System identification can be performed on the specific input and output of flight data to estimate the mathematical model or the parameters within if a physical prototype is available. This technique comprises model structure determination, experimental design, data postprocessing, parameter estimation, and model validation. Compared with wind tunnel experiments, system identification is cheap and timesaving because most of the required data, such as translational and rotational acceleration, attitude, velocity, and airspeed, can be measured by standard UAV avionics and fed to the system identification after data processing. Theoretically, this technique can model any motion that the UAV has experienced during flight as long as the flight mode has been excited. Meanwhile, compared to wind tunnel tests, the results from this technique have a closer resemblance to real flight. Nevertheless, unlike the controlled environment in the wind tunnel, there exists wind disturbance in the outdoor environment, and its effectiveness deteriorates for a slow-flying UAV. However, the disturbance is mostly random and low frequency. Only the low-frequency mode of the dynamic will be influenced, and the system identification process has to adapt to this circumstance. Specifically, designed excitations are needed to stimulate the higher frequency modes. In the experimental design, according to the model structure determination and parameter estimation, it is important to apply appropriate input waveforms to the maneuver.
Apart from the measured input and output signals from the system in the time or frequency domain, system identification requires a model structure, which generally includes black-box and grey-box modeling. The black-box modeling requires an intuitive model only and lets the system identification process fill all the inner content to achieve the best fit without knowing any background dynamics of the identified system. On the other hand, it is a try-and-error process, which estimates the parameters by consistently comparing the system identification results of every attempt. For example, model structure such as state-space model and the number of model states has to be defined first. Then the system identification process will try a range of model orders to find the best fit in mathematical aspect only. Grey box modeling is a system identification technique that estimates unknown parameters by knowing the model structure in advance [7]. The development of a physical-based model requires intimate knowledge of the natural laws of dynamics and kinematics of the system undergoing free or force motion [8]. A grey-box model structure is developed according to the physics and dynamics of the system, and as a result, the model states, order, and some of the parameters are predetermined. Compared to the black-box modeling, the grey-box modeling not only fulfills the mathematical relationship, but also physically reasonable.
For validation, the identified parameters will be used to reconstruct and compare with a new set of flight data that is not used in the identification process. If the validation result shows a good overlap with the new set of flight data, the parameter values can be taken. Otherwise, the estimation process is repeated with a different estimation technique. It is common to use a different shape of the input waveform to reperform this process [9]- [11]. Researchers have applied system identification for UAV modeling in many studies. Dorobantu et al. [12] described a practical system identification procedure for small, lowcost, fixed-wing unmanned aircraft. They used a linear model obtained from the generic nonlinear equation of motion and adopted it as a baseline model for flight experiment design. The parameters of the linear model were identified by fitting the model to the data. The baseline model was compared with the identified model to demonstrate the effectiveness of system identification. Chumalee and Whidborne applied the racetrack maneuver in one flight to obtain a model with sufficient accuracy [13]. In this work, several constant unknown parameters were augmented into the model, and the hardware-in-the-loop simulation was undertaken before the flight. Scheper et al. presented a grey-box model coupled with the vehicle dynamics in both the longitudinal and lateral directions and applied it to system identification [14]. The result showed that the coupled model with identified parameters can reconstruct a response with good fit to the aircraft's response. Gandhi et al. demonstrated a linear regression as a baseline model and a Gaussian process as a black-box model to represent the dynamic of the UAV [15]. This work focused on utilizing system identification to learn a black-box model, and the result demonstrated that the Gaussian Process model could fit the experimental data with high accuracy. The above studies have conducted system identification on UAVs and demonstrated their results by comparing the reconstructed data to real flight data. Most of them have shown good accuracy. However, none of them has directly put the identified model into a model-based control for validation. Model-based control, such as the model predictive control (MPC), requires a dynamic model of the system, in which many of the parameters are hard to acquire. In the meantime, the MPC controller needs a precise model of the dynamic to control the system correctly [16], [17].
In the current study, the tail-sitter UAV considered is modified from a commercial flying wing UAV platform, as shown in Fig. 1. This vertical takeoff and landing tail-sitter UAV was first developed by our group in [18]. It can takeoff vertically and transition into the cruise stage for mission conduction. Before landing, it will transition back to the hover stage and land similar to a quadrotor UAV. As seen, this UAV has only one pair of control surfaces, which act as a combination of elevator and aileron.
Controlling the cruise stage by a traditional PID control may cause a saturation problem on the control surfaces. Because the command to the control surfaces is the overlap of the roll command and pitch command, which are separately generated, their summation may already exceed the maximum control effort. The MPC method can generate optimized actuator inputs within the predefined constraints. Its control inputs are calculated by minimizing the control objectives based on the prediction of the future response according to the UAV model [19]. Keeping all inputs within the constraints is always considered in the objective function. It can usually achieve better performance for a wide range of operating conditions regarding the aspect of lower sensitivity VOLUME 8, 2020 (shown in [20], [21]).
For a UAV in cruise, the real-time situation may change rapidly and become severe. The one-meter wingspan of the studied UAV will easily catch disturbances and brings challenges to the controllability. The consideration of expected and unexpected disturbances in the controller design can do a lot to help [22]. Measurements can be taken to predict and reduce any unwanted wind disturbance [23]. Special treatment on the controller can be designed to improve the robustness and stability under a windy condition [24], [25]. In the transition period, the optimization method has been applied to the altitude variation and energy consumption in [26], [27].
In this work, the system identification is implemented in practice on a novel design quadrotor tail-sitter UAV. The main innovation and contribution include 1. The first work as we know to use system identification to obtain the dynamic model of a novel design tail-sitter UAV from the experimental flight data; 2. A new experiment method by using a training line to transmit external control commands to a UAV during flight for system identification, and no other researchers have attempted this approach before; 3. The implementation of the identified model into an MPC controller to control the tail-sitter UAV in cruise flight and obtained satisfactory results. The goal of this study is to enable a UAV developer who is not familiar with the system identification technique to obtain a useable model to facilitate the design and implementation of a higher-level model-based controller to the UAV platform.
The remaining sections of this article are organized as follows. Section II develops the grey box model of the UAV, which is the Model Structure Construction block in Fig. 2. This section also includes the formulation of the least-square regression for parameter estimation. Experimental design and data acquisition for system identification are established in section III. System identification results and model validation are presented and discussed in section IV. A simulation environment that uses the system identification results in the model predictive control will be shown in section V, followed by the conclusions in section VI.
As shown in Fig. 2, if the model validation result is not accepted, all the previous steps have to be reviewed, for example, incorrect experiment process may collect wrong data; incorrect model selection or regression method implantation will also lead to low-quality modelling.

II. SYSTEM IDENTIFICATION FORMULATION
The system identification problem is formulated by building a grey box model based on the decoupled dynamic of the aircraft. The least-square regression method is taken to fit the measured data to the predicted model response to obtain the unknown aerodynamic parameters. Two extra variables are augmented to regulate the variance of the parameters. The regression problem is solved by applying the Trust-region algorithm.

A. THE UAV PLATFORM
The coordinate system of the body and the wind axis are shown in Fig. 3. Unlike a conventional fixed-wing UAV, the tail-sitter UAV has only one pair of control surfaces that act as elevons, which control the roll and pitch movement simultaneously. Four motor seats were installed, as well as four propulsion systems, and the total mass is approximately 1.6 kg of the aircraft. All motors are directly controlled by the thrust command. As a result, they always rotate at the same speed in the cruise flight mode.

B. GREY GRAY-BOX MODEL OF LONGITUDINAL DYNAMICS
A grey box model for the tail-sitter aircraft dynamic can be described from the equation of motion in the body-axis coordinates. The standard nomenclature is used: x − y − z velocities in body axes are (u, v, w) in m/s; the rotation Euler angles are (φ, θ, ψ) in rad; and the angular rates are (p, q, r) in rad/s. The angle of attack is α, and the sideslip angle is β. The aerodynamic forces on body axes are denoted by X , Y and Z, while the corresponding aerodynamic moments are denoted by L, M, and N . The aircraft inputs consist of angles of control surfaces and the throttle. The combination of the elevator command and the aileron command controls a pair of control surfaces. Their variations around a trim condition are given by the variables δ T , δ e , and δ a , respectively, and are normalized between 0 and 1. The four motors are rotating in different directions, and their gyroscopic effect has been balanced out. The thrust T and weight G are assumed to act at the center of gravity.
The longitudinal equations of motion are shown in (1): where m is the mass and I is the moment of inertia. Meanwhile, the thrust forces T , drag D, and lift L acting on the body can be expressed as (2): The multiplication terms are ignored to simplify the system in the longitudinal direction. Assuming small angles of attack and combining (1) and (2), the model is formed in (3): where γ is the flight path angle. For small angles of attack, the forces and moment can be expressed as (4) by applying Taylor expansion on relevant variables around the trim point.
Replacing the forces and moment in (3) with (4) and applying small-perturbation theory [28], we can have a model around the trim point condition. The model can be written in a statespace form with the state where The lateral equations of motions are shown in (6): Unlike any other traditional aircraft, the configuration of the tail-sitter UAV shown in Fig. 1 has no rudder. As a result, the yaw angular rate r and yaw moment N are not controlled. By applying Taylor expansion on the force and moment, they can be expressed as: The small-perturbation theory is then applied in the equilibrium condition of (6). By substituting (7) into (6), we can have a model around the trim point condition as shown: The model (8) can be written in a state-space form like (5) with the state The simplified state matrix A lat , control matrix B lat and the output matrix C lat can be represented as: Model parameters are obtained by fitting measured data to the predicted model response. The least-square regression is a curve-fitting algorithm for finding a parameter estimateσ , which consists of a vector of unknown model parameters.
That is, the parameter estimates are obtained by minimizing a weighted quadratic norm of the predicted error ε(t, σ ): where t is the time variable and N is the number of data samples. The predicted error ε is computed as the difference between the observed output and the predicted output: in which vector σ is subject to bound contains σ = {σ : lb ≤ σ ≤ ub}. lb is a lower bound, and ub is an upper bound.ŷ ( * ) is the predicted output from the grey box model response, and y is the measured data.
The standard of an accurate model should have a small mean square error (MSE), which is the sum of systematic error (bias) and random error (variance): where the bias can be minimized by using a higher order model because it can fit the observed data with higher accuracy. However, it will cause a higher uncertainty at the same time (i.e., the variance) due to the increase in flexibility. Alternately, systematic errors causing by the model mismatch will dominate MSE if a model is chosen with overly low order. Thus, the minimization is a tradeoff in constraining the model. A flexible (high-order) model gives small bias and large variance, whereas a simpler (low-order) model results in a larger bias and smaller variance errors. In grey-box models as derived above, the order is fixed by the underlying ODEs and cannot be changed. If the data are not rich enough to capture the full range of dynamic behavior, it may lead to high uncertainty in the estimated values. Regularization is the technique for specifying constraints on the flexibility of a model, thereby reducing uncertainty in the estimated parameter values [29]. First, a concept from statistics and machine learning called ridge regression is introduced in (14): where λ is known as the ridge regression coefficient. This term penalizes the parameter values with the effect of keeping the values small. The larger λ is, the higher the bias and lower the variance of σ is. This coefficient can usually increase the resemblance of the prediction model to the validation model [30]. Then, a positive definite matrix R acting as a penalty term is added to (14), which represents the confidence in the prior knowledge of the parameters: The matrix R gives additional freedom for shaping the penalty term λ to each of the parameters in σ . In the grey-box model, some of the estimated parameters in the initial guess may be trustworthy according to the physical model.
To accommodate this phenomenon, the regularization in (15) can be generalized into: where σ * is the initial guesses for the unknown parameters. At this point, λ * R represents confidence in the initial guesses.
Minimizing this cost function has the effect of estimating σ such that some value remains close to the initial guess and some are freed but small.
In the system identification process in section IV, the values of σ * are decided first. For unknown parameters without initial guesses, zero will be taken. There are some states that play a more important role in the control, and as a result, the estimation accuracy of these states should be higher. Thus, the R value is higher in the state ū and θ in the longitudinal direction. The same method is also applied to the lateral model. Last but not least, the λ value is obtained by trial and error.

E. TRUST REGION ALGORITHM
Trust region algorithms are a class of reliable and robust algorithms for solving optimization problems by iteration [31]. This algorithm class has the advantage of strong convergence properties.
Assume that the solution of the optimization problem is being guessed according to the initial conditions. Consequently, an approximate model can be constructed near the current guess point. The solution of this approximated model is then taken as the next iteration point. For general nonlinear functions, local approximate models can only fit the original function locally. As a result, the approximate model is only 'trusted' in a region near the current iteration point. The region that the approximate model can be trusted is called the trust region. The trust region is adjusted from iteration to iteration.
A trust-region algorithm contains the following steps: (i) Set up an approximate model along with a trust region from the initial conditions; (ii) Solve the local subproblem with a solution s k , which is called a trial step; (iii) Apply a merit function to decide whether the trial step should be accepted; (iv) Update the next trust-region and choose the new iteration point; (v) Stop the iteration when the reduction of the original objective function is smaller than a user-defined value (e.g., 1 × e −6 ) or when the trust-region no longer increases.
The trust region subproblem lies in each iteration, and a quadratic model is used to approximate the original objective function. Then, the optimization problem is essentially reduced to solve a sequence of trust-region subproblems. At the k th iteration, the subproblem can be expressed as: where g k = ∇ ·V (σ k ) is the Jacobian at the current iteration, H k = ∇ 2 ·V (σ k ) is the Hessian matrix, and r k is the positive trust region radius. Let s k be the solution or the local minimum of the above subproblem. An empirical threshold value ρ k is shown below to decide whether the trial step s k is accepted or not and to adjust the new trust-region radius r k .
for which where O red k is the actual reduction gained by the original objective function and P red k is the predicted reduction expected in the local approximate model. A solution of an approximate model can be taken as the next iteration point. If the current iteration makes a satisfactory reduction in O red k , which means this approximate model fits the original model well, the trust-region can be enlarged in the next iteration. Otherwise, when we achieve a limited improvement at the current iteration, radius r k remains unchanged or even decreases in a worse case.

III. EXPERIMENTAL SETUP
The aircraft is instrumented with a Pixhawk 4 Mini open-source flight control unit that is small and lightweight. It has a main flight management unit (FMU) processor and a built-in inertia measurement unit (IMU), which consists of two accel/gyro sensors, a magnetometer, and a barometer. The autopilot has an SD card to record all the UAV states and communication messages as digital data during flight. The flight data logs from the SD card were used for the system identification process. No extra sensor is installed onboard because the built-in sensors provide enough data for the system identification process. The major physical properties of the tail-sitter UAV are summarized in Table 1.
The shape of an input signal has a major impact on the excitation of the aircraft, and it can strongly affect the accuracy of the estimation [32], [33]. In the flight experiment, the aircraft is required to fly at a trim condition and to maneuver one actuator at a time. Apart from the waveforms, the amplitudes need special care to excite certain dynamic modes [11]. The input can be a frequency sweep [12], doublet and 3-2-1-1 waveforms [34]- [36], etc. It has been suggested in [11] that the maneuvers should not exceed ±5 • angles of attack, ±20 • /s angular rates and ±0.3 g translational accelerations. Therefore, a signal generator module was designed and built to input the desired signal shape and magnitude.

A. SIGNAL GENERATOR MODULE THROUGH THE TRAINING LINE
The training line of radio control transmitter is used to send the specifically designed input to the aircraft safely. As shown in Fig. 4 (a), two people work together, with one acting as a student and the other acting as a coach. The student holds a simple remote control with four buttons, and he can choose the desired input waveform. A receiver will transmit the signal from the student's remote control to an Arduino Nano microcontroller board, which recognizes the signal and generates the corresponding input waveform. A pulse-width modulation (PWM) driver converts the waveform signal into the PWM signal. Because the training line port takes only the pulse position modulation (PPM) signal, a PPM encoder is used to convert the PWM signal into the PPM signal before feeding to the training line. In Fig. 4 (b), a programmable signal generator has been built and attached to the back of the coach's remote transmitter. This position is close to the training line port, and it will not interrupt the coach. VOLUME 8, 2020 The coach is responsible for flying the aircraft, keeping it safe, and trying to seize opportunities to implement the designed input. When the coach switches to the training line, he will temporarily give up his control, and the flight controller will receive the signal from the training line. As long as the coach notices any unusual or unsafe behavior of the aircraft, he can regain control immediately by a click of the switch to save the aircraft from a crash. Among all types of methods that can implement the series of designed input signals for the aircraft, this method can ensure safe flight during identification flights. Alternately, this method can be implemented for any other types of aircraft very easily because the onboard flight controller remains untouched and the hardware package is small and portable and has been stacked on the back of our remote control. Figure 5 (a) is recorded by the flight log showing that doublet waveforms were successfully generated and sent to the flight controller. Meanwhile, the frequency sweep of a sin wave is presented in Fig. 5 (b). Notice that the input signal apart from the designed waveforms is manual input by the pilot.
The flights were performed under closed-loop control conditions. That means that the UAV will be automatically controlled by the onboard flight controller even though the inputs from the radio control in Fig. 4 were injected. This allows a UAV to maintain flight velocity and remain stable in the presence of external disturbances. The radio control on the throttle and pitch angle will be fused and distributed into airspeed and altitude control by the flight controller. The input deflection of control surfaces designed here for the purpose of gathering system identification data will affect the UAV but not in a direct way. As a result, the control command of throttle and elevon from the log data may not have the same pattern (as shown in Fig. 7 and Fig. 8 later). Figure 6 (a) shows the entire flight path, in which the UAV took off vertically at the origin. The transition to cruise flight occurred at the height of 50 m. The red section of the flight path with a period of 31 seconds was selected for system identification purposes. There is both a straight flight path for longitudinal direction movement and a turning flight path for lateral direction maneuvers. The black section of the flight section with a period of 28 seconds for validation usage also has the characteristics mentioned above.

B. FLIGHT PATH SELECTION
In Fig. 6 (b), climbing and declining for up to 30 meters in height is included in the training set (red). In the meantime, excitation in pitch and throttle during this straight flight period caused significant fluctuation in height from 60 seconds to 80 seconds. In the aspect of lateral direction, the UAV made two turns. The first turn was rapid, and the other was gentle. This motion was strong enough to excite the lateral direction dynamic to capture different modes of it.

IV. SYSTEM IDENTIFICATION RESULTS
Before conducting the system identification, a postprocessing procedure of flight data is essential so that the flight data can be better fit into the grey box model, and the accuracy of the parameter estimation can be increased. The data are extracted from the flight log. The measurements are at different frequencies. For example, the airspeed sensor measures at 100 Hz, the attitude is recorded at approximately 40 Hz, and the GPS records at less than 10 Hz. To conduct system identification, the data size of each parameter has to be the same. The parameter with a small data size is interpolated to increase its data size without changing its characteristics. The grey box models were designed as first-order models. It is undesirable for it to fit a high-frequency response. Therefore, the data were low pass filtered. The cut-off frequency for the first-order model is set at 4 Hz to 5 Hz according to [10,13]. Because a state-space model is being used to describe the measured responses in this research, bias and scale factor errors should also be removed.
The time histories of measured and reconstructed longitudinal and lateral state variables are depicted in Fig. 7 and Fig. 8. The reconstructed data (red line) is the identified model output. The excitation introduced to the dynamic system in the longitudinal direction between flight time 60s-75s and 112s-122s can be seen from the fluctuating blue lines in Fig 7 (a) and (b). As we can see from these two periods in the figure, the pitch angular rate q and pitch angle θ has significant variations, the airspeedū and the angle of attack α also show a coherence reaction to the excitation. On the other hand, the oscillation of Z-direction in these two periods shown in Fig. 6 (b) also demonstrates the effect of this excitation.
In the lateral direction, the UAV turned twice during the period of 50s-60s and 132s-140s. In Fig. 8, the flight data in roll angle φ stays at about 0.5 rad (28 degrees) during these two periods. These maneuvers excited the dynamic of the UAV for better system identification. Meanwhile, the pattern shown in the sideslip angle β is coherent to the roll angle.
By comparing the measured data (blue line) and the reconstructed data (red line) in Fig.7, there are small errors in the pitch angular rate q and the pitch angle θ are shown in Fig. 7 (a). In this case, θ was set to have the highest weighting, such that its fitness is the best of all. Although the reconstructed data are not fit tightly with the flight data in the nondimensional heading velocityū in the body frame and the angle of attack α, their mean features are successfully captured. The wind disturbance can easily cause these deviations during the flight because a consistent wind or a sudden wind disturbance can strongly affectū and α. Figure 7 (b) shows a comparison between the validation data and the reconstruction data from the identified model. It can be seen that q has a good resemblance, while the characteristics of the other three states are mostly captured in the validation data.
In the lateral direction, the roll angle φ was set to have the highest weighting. As a result, the best fit was observed between the flight data and the reconstructed data in Fig. 8 (a). Similar to the longitudinal dynamics, the wind effect is also crucial in the lateral motion because a crosswind is very likely to affect β significantly. Figure 8 (b) demonstrates the resemblance of the validation data to the reconstructed data VOLUME 8, 2020 Summarily, the state-space longitudinal and lateral models of (6) and (10) are concluded in (17) and (18), which will be used in model predictive control in section V.

V. MODEL PREDICTIVE CONTROL DEVELOPMENT
The schematic diagram demonstrates the application of the MPC controller in the longitudinal and lateral directions in Fig. 9. Apart from the state-space model defined in Section II and the model parameter obtained in Section IV, the objective function for optimization is defined as: { e T y (k + i)Qe y (k + i) where Q is the output variable weights matrix, R u is the input increment weights matrix, k is the time instant and i is the horizon. The output error e y and input increment u are defined as: where r is the reference output trajectory. The quadratic programming decision z k is defined as: where the control input u will be calculated within the control horizon H and remain the same until the prediction horizon P.  The longitudinal MPC controller will receive the heading speed command u cmd in the body frame and a pitch angle command θ cmd generated by an altitude PID controller. The model in the longitudinal MPC controller is constructed according to the model in (5) and the identified parameters in (17). The same process also applies to the lateral MPC controller. After that, the longitudinal MPC controller will generate control inputs of thrust δ T and elevator δ e , while the lateral MPC controller will produce an aileron input δ a . An actuator map will distribute these three control inputs into correct throttle commands η 1∼4 of the four motors and the degrees 1∼2 of the two control surfaces. The states that the MPC controller needs will be measured from the dynamic model and fed to the controller. The detailed parameter settings are presented in Table 2 and Table 3 for longitudinal and lateral MPC controller, respectively A simulation environment and the simulation model of this tail-sitter UAV have been developed in our early works [22], [37] for hovering controller development. This simulation model includes not only the basic dynamic and characteristics of this tail-sitter UAV but also a theoretical-based aerodynamic model and an experimentalbased propulsion model. In this study, we have applied this developed dynamic model to cruise control to validate the accuracy and practicability of the identified model.
To demonstrate the ability for practical usage, the PX4 fixed-wing position mode logic is imitated in the simulation. In this closed-loop logic, the pilot controls the left joystick to change the airspeed and the spin angle, while the right joystick controls the climbing/descent rate and the roll angle. The airspeed command determines the heading speed u cmd in Fig. 9. The climbing/descent rate determines the pitch angle θ cmd by a PID controller. The spin angle is neglected because this UAV does not have a rudder.
The simulation result is shown in Fig. 10. At this point, there is no wind effect included in the simulation because, in this study, we are focusing on model validation rather than controller development. The altitude reference z ref is given in place, between the 10 th and 30 th seconds. The pitch angle reference θ ref generated by the altitude PID controller is consequently given to the longitudinal MPC controller and closely followed. During this time, the airspeed has a small variation around the trim point condition of 16m/s. After that, between the 40 th and 50 th seconds, an increase in heading speed reference u ref is given to the longitudinal MPC controller.
We can see that the UAV can increase the speed as the reference, but it cannot slow down as much as the reference. This is due to the characteristics of a fixed-wing UAV. There is no breaking mechanism onboard, and the only way to slow down is by drag force. As a result, it is reasonable for the tail-sitter UAV to have this performance in the heading speed variation. Last but not least, a roll command reference φ ref is given to the lateral MPC controller in between the 60 th and 80 th seconds. The result has shown a good fit of the measured value to the reference value. Above all, the three control inputs of the attitude controller have been tested and the results show acceptable control performance.

VI. CONCLUSION
In this study, system identification has been conducted on a novel-design tail-sitter UAV. Grey box longitudinal and lateral models have been developed in state-space forms according to the dynamics and kinematics of the UAV. The system identification was set up as the least-squares regression problem and augmented with regulation. The importance of each unknown variable can be separately adjusted. To solve the problem, the trust-region algorithm was taken to get the optimal solution.
A signal generator module has been designed and set up to feed specific control commands to a flying UAV. This training line method can excite most of the dynamic of the UAV while ensuring the safety of the UAV. Two sections within a flight log have been selected for system identification and validation. The result has shown that both identified models can capture most of the characteristics in the validation data. To further examine the identified models, they have been implemented in two MPC controllers for longitudinal and lateral controls of the UAV in cruise flight under a simulation environment. The results have shown that the MPC controllers can precisely control the UAV. The identified models are demonstrated to be sufficiently accurate. In the next step, outdoor flight tests of this UAV will be carried out for model validation and controller development.