AIAA SciTech 13-17 January 2014, National Harbor, Maryland AIAA Modeling and Simulation Technologies Conference AIAA 2014-1342 Frequency-Domain System Identification and Simulation of a Quadrotor Controller Wei Wei 1 University of Cincinnati, Cincinnati, Ohio 45221 Mark B. Tischler 2 Aviation Development Directorate AFDD US Army Research, Development and Engineering Command (AMRDEC) Moffett Field, California 94035 and Nicholas Schwartz 3, Kelly Cohen 4 University of Cincinnati, Cincinnati, Ohio 45221 Using frequency-domain system identification techniques, the closed-loop dynamic model of a quadrotor unmanned aerial vehicle is extracted using the computer program CIFER. The resulting dynamic model is verified by comparing its predicted response against previously collected flight-test data. The results show that an accurate model was successfully extracted, which could be utilized for simulations and control system development. Simulation of the extracted model and analysis of the transient response are also provided. = vertical velocity = lateral input = longitudinal input = directional input = vertical input Nomenclature I. Introduction n the aerospace industry today, there is a large focus on aircraft and rotorcraft simulation. Simulators not only Iprovide safety and efficiency when training pilots, but also greatly reduce costs when developing a control system for a particular vehicle. By having the ability to simulate an aircraft or rotorcraft response, flight controls engineers have the capability of designing and testing controller designs on the ground through computer simulations, greatly reducing the flying time and cost associated with controller development. In order to effectively utilize this capability, however, an accurate dynamic model of the system being analyzed is crucial. Recently, there has been a high interest in utilizing unmanned aerial vehicles (UAVs) for many different tasks. In particular, the demand for quadrotor UAVs has dramatically increased. Their ability to be easily scaled down and low cost make quadrotors an optimal choice for a variety of missions. As its configuration is naturally unstable, a feedback control system is required to stabilize the quadrotor so that it can be easily piloted. 1 Graduate Student, Department of Aerospace Engineering and Engineering Mechanics, Student Member AIAA. 2 Senior Scientist and Flight Control Group Lead, AFDD, Ames Research Center, T12B-2, Associate Fellow AIAA. 3 Undergraduate Student, Department of Aerospace Engineering and Engineering Mechanics, Student Member AIAA. 4 Associate Professor, Department of Aerospace Engineering and Engineering Mechanics, Associate Fellow AIAA. 1 Copyright 2014 by Wei Wei, Mark B. Tischler, Nicholas Schwartz, Kelly Cohen. Published by the, Inc., with permission.
Using traditional modeling methods, the aerodynamic, inertial, and structural characteristics of an aircraft or rotorcraft are analyzed to predict a dynamic model. After this preliminary model is acquired, it is then simulated and compared with flight-test data. Based on these comparisons, additional fine-tuning of the model is usually required to improve its accuracy. Though this traditional modeling method is practical for aircraft configurations, it is rather difficult for small-scale rotorcraft configurations their high vulnerability to turbulence and complex coupled aerodynamic forces greatly complicate the modeling process. In order to avoid these inaccuracies and minimize modeling time, a system identification approach is chosen to obtain a closed-loop dynamic model of a quadrotor configuration. II. System Identification Methodology The system identification process is one that is well suited and provides low cost when developing the dynamic model of a quadrotor. The method of system identification utilizes measured input and output time history data gathered during flight-testing to capture the dynamic characteristics of a particular system. 1 A generic mathematical architecture of the model is assumed prior to flight-testing. Flight-test data is then collected and processed through a system identification computer program, which obtains various dynamic coefficients through a process similar to statistical learning. A resulting dynamic mathematical model is then calculated and used to simulate the quadrotor dynamics. A frequency-domain system identification analysis was chosen for this project to obtain a linear representation of the quadrotor dynamics. Compared to time domain analyses, frequency-domain identification reduces the errors associated with bias effects and processing noise, resulting in a robust model. 1 Coherence functions also assist in determining the accuracy of the identified dynamic model throughout various frequencies of interest. For the scope of this project, it was desired to apply the method of system identification using the Comprehensive Identification from FrEquency Response (CIFER ) 1 program to develop a closed-loop dynamic model of a given quadrotor configuration. CIFER has been successfully implemented and applied in the system identification of commercial and military aircraft and rotorcraft configurations, including the XV-15, Bell-214ST, BO-105, AH-64, UH-60, V-22, AV-8 Harrier, and OH-58D. 1 In addition, CIFER has also been utilized to successfully extract dynamic models of scaled down model aircraft 2 and single-rotor model helicopter configurations. 3 When the frequency response is acquired in CIFER, it is imperative to check the validity of the data. In CIFER, the frequency response data validity is determined by evaluating its coherence, which is an indication of how well the output and input data are correlated. The definition of coherence is given as where,,, and represent the auto spectral densities of the input, output, and cross-spectral density of the input and output, respectively, and is the frequency point. A perfect correlation between input and output would result in a coherence value of unity, while poor coherence typically falls below a value of 0.6. 1 After the coherence of the data is validated, the data must be decoupled such that the inputs provided by off-axis commands are eliminated from the output on the axis of interest. During flight-testing it would be ideal to excite one axis while the other axes of interest remain trimmed. However, this very rarely occurs. In order to maintain total craft stability during a test maneuver, the pilot may be required to use slight inputs from the other axes. These slight inputs from the other axes must be removed from the data before system identification, so that they are not included in the extracted model. The multiple single output system estimation can be expressed in Eq. (2), where is the system estimation. (1) (2) Then the partial coherence of the th of inputs and the output can be written as (3) 2
where each quantity involves spectral matrix manipulations. 4 The partial coherence directly gives an evaluation of the on-axis input-output linear relation with the influence of other off-axis inputs removed. In the system identification process, the transfer functions of each axis will be acquired first, followed by state space representations, and complete system analysis. The Single Input-Single Output (SISO) transfer function identification cost function can be defined as [ ( ) ( ) ] (4) where represents the number of frequency points, and are the starting and ending frequencies of fit, and are the magnitude (db) and phase (degrees) at each frequency, and, and are the total, magnitude, and phase weights, respectively. and represent the estimated and actual value of each fit point, respectively. III. Experimental Setup For the experiment, an AeroQuad Cyclone quadrotor was selected for testing (Fig. 1). The frame is constructed with aluminum plates in the center that contain most of the electronic components. Four hollow aluminum square tubes construct the motor arms, having dimensions of 5/8 in. x 5/8 in. x 13 in. Four XXD A2217 950KV motors powered by 30 amp electric speed controllers (ESC) are attached at the ends of each motor arm. These motors directly drive four APC 12 x 3.8 propellers. Figure 1. AeroQuad UAV. A. Quadrotor Control For this project, the principal axes were positioned with the four rotor arms aligned with the X and Y axes, depicted in Fig. 2. For a quadrotor to achieve a stable hover, the rotational direction of the propellers must be altered such that the overall rotational torque is eliminated. To achieve this, the forward and aft motors rotate in a clockwise motion, while the port and starboard motors rotate in a counterclockwise motion. For a fixed propeller setup, the overall control of the quadrotor is achieved by directly altering the rotation speed of each individual motor. Figure 2. Quadrotor coordinate system and motor numbering. 3
B. Instrumentation and Data Collection The layout of the AeroQuad control system is outlined in Fig. 3. The sensors used onboard the AeroQuad include an ITG-3200 gyro, ADXL345 accelerometer, HMC5883L magnetometer, BMP085 barometer, and MaxSonars EZ0 ultrasonic sensor. These sensors provide adequate data-collection capability and record the necessary parameters required for closed-loop system identification. The onboard controller consists of an ATmega2560 Arduino -based platform. The radio controller used for this configuration is a Futaba T12MZ 2.4 GHz transmitter, coupled with a R6008HS receiver onboard the AeroQuad. For wireless flight data transmission, a pair of Digi XBee-PRO 900MHz modules was utilized. The data was transmitted through the XBee-PRO modules at a frequency of 40 Hz and was collected through MATLAB on a standalone computer. MOTOR1 MOTOR2 MOTOR3 MOTOR4 ESC1 ESC2 ESC3 ESC4 Quadrotor CPU RS-232 A/D IIC Figure 3. AeroQuad instrumentation and system layout. Due to its configuration, a great amount of vibration on the AeroQuad existed due to the rotating propellers. To suppress vibration noise so to not compromise onboard sensor performance, the motor mounts and electronic bay were isolated from the main frame using rubber vibration insulators. A traditional PID controller was applied to the longitudinal and lateral axes of the AeroQuad so that it could be easily piloted during flight-testing. Prior to flight-testing, the PID inputs were altered and tested such that good handling qualities of the AeroQuad resulted. After these gains were determined, they were not altered throughout the entire system identification process. Fig. 4 displays the resulting closed-loop system of the AeroQuad including this PID controller. With the instrumentation present on the AeroQuad, the pilot inputs, motor command, Euler angles (ϕ, θ, ), angular rates (p, q, r), linear accelerations (,, ), altitude, battery level, and elapsed time were able to be directly measured during flight-testing. For this paper, the angular rate responses of each axis were the only subjects of interest of the closed-loop dynamic model. As such, only the pilot commands, angular rates, and elapsed time were extracted from the flight-test data and used for the closed-loop system identification. XBEE IMU ULTRASONIC BAROMETER RECEIVER 900 MHz 2.4 GHz Figure 4. Quadrotor control system layout. C. Flight-test Procedure As CIFER was chosen to be the primary software used in the system identification process, a flight-test procedure was devised based on frequency-domain system identification guidelines provided by Tischler et. al. 1 For 4
frequency-domain system identification, the individual axes of the quadrotor were excited using frequency sweep maneuvers. In order to obtain a good data set, four frequency sweeps were carried out in the roll, pitch, and yaw axes during flight-tests. Based on a coherence analysis, the two best maneuvers for each axis of interest are selected for system identification. The selected input and output time history data is then concatenated and used in CIFER to generate the dynamic model. Fig. 5 below depicts an example of a roll sweep flight data with three axes inputs and outputs. Figure 5. Example roll sweep input. Figure 6. Roll rate power spectral density. Fig. 6 shows the power spectral density (PSD) of the roll rate signal given in Fig. 5. Integration under the PSD curve between 1-20 rad/s yields a root mean square (RMS) value of 0.354 rad/s (i.e., about 20 deg/s), associated with the sum of the forced response content (i.e., signal) and noise. The PSD between 20 to 120 rad/s with an associated RMS of 0.04057 rad/s (i.e., about 2 deg/s), reflects the measurement noise content. Then, the associated coherence function can be expressed as a function of the noise to signal ratio 5 (5) where = 0.04057 / (0.354-0.0457) = 0.129 is measurement noise to signal ratio. The resulting coherence is found to be 0.98, which is consistent with the high coherence of the roll rate frequency response shown in Fig. 7a, though there is additional loss in the frequency-response coherence due to process noise (e.g., atmospheric turbulence). This suggests a very low noise to signal ratio and is a very interesting result given the small scale of the vehicle and the inexpensive instrumentations onboard. In order to validate the accuracy of extracted models, it is desired to compare the predicted output provided by the dynamic model against the outputs of the actual system, using the same inputs and initial conditions. Therefore, it is required during flight-testing to perform doublet maneuvers in each axis of interest. Though not used in the system identification process, the doublet data collected will be used solely for model verification purposes. The accuracy of the model will be directly correlated to how well the response of the system is predicted. IV. Results A. System Identification Model Extraction After flight-testing, the dynamic models of the longitudinal, lateral, directional, and vertical axes were extracted from CIFER in the form of transfer functions. 5
The resulting magnitude, phase and coherence of the above longitudinal, lateral, directional, and vertical transfer functions are shown in Fig. 7. An examination of Fig. 7 shows a good coherence ( ) for a frequency range of 0.3-35 rad/s for the lateral and longitudinal axes, 0.5-30 rad/s for the directional axis, and 2-9 rad/s for the vertical axis. This implies the dynamics of the system were well excited in these corresponding axis frequency ranges with excellent signal to noise ratio. Therefore, the system can be well represented by a linear model. a) b) c) d) Figure 7. Frequeny response of a) lateral, b) longtitudinal, c) directional, and d) vertical axes and flight-test data. The resulting transfer functions are displayed in Eqs. (6-9) below. Notice that the lateral and longitudinal transfer functions have similar layouts as expected considering the symmetrical configuration of the quadrotor. (6) (7) (8) (9) 6
The identified roll and pitch dynamics show a lightly damped behavior with very small time delay (about 60 ms). The identified directional and vertical models are simply first-order systems. Transfer function identification cost guidelines 1 are acceptable (cost<100), excellent (cost<50). The cost functions shown in Table 1 suggest that all parameters are identified with excellent confidence. The poles and zeros of each axis are depicted in Fig. 8. The corresponding natural frequencies and damping ratios for each pole are listed in Table 1. As the lateral and longitudinal dynamics were identified as third order transfer functions, each transfer function contains one real pole and a pair of complex poles. The identified directional dynamics is a simple first-order system, and therefore contains only one pole. The resulting pole locations indicate that all three axes are stable, which was expected from the closed-loop system. Figure 8. AeroQuad closed-loop poles and zeros. Table 1 Identified model characteristics. Pole Axis Undamped Natural Damping Frequency (rad/s) Ratio Cost 1 Lateral 4.7273 1.00 2-3 Lateral 15.7934 0.2141 24.46 4 Longitudinal 4.0189 1.00 5-6 Longitudinal 18.9800 0.1574 28.84 7 Directional 7.2886 1.00 3.38 8 Vertical - - 54.41 B. Model Verification The extracted models were verified in the time-domain with doublet maneuvers collected during flight-testing. Again, these maneuvers were not used in the system identification process when extracting the dynamic models. The measured inputs and initial conditions were input into the models, which then predicted the outputs on each axis of interest. The simulation outputs are then compared with the outputs gathered during flight-testing. These verification results are presented below in Fig. 9. It is seen that the extracted dynamic models have excellent comparison to flight-test data in all axes. There exists a slight variation between the flight-test data and model prediction for the lateral and longitudinal axes at the higher frequencies. As these extracted models are only valid in a frequency range of 0.36 35 rad/s, it is expected to see these small discrepancies at the higher frequencies. Due to the large responses of the small-scale quadrotor compared to full sized rotorcrafts, the verification cost is scaled by 1/5. The resulting costs are 0.4(directional), 0.72(lateral), 0.36(longitudinal), and 0.16(vertical), which is below the 1.0 to 2.0 guideline 1 for rotorcraft model verification. These results show that the closed-loop dynamic model of the AeroQuad was successfully extracted and is accurate to actual system response. 7
a) b) c) d) Figure 9. Input and response of a) lateral, b) longitudinal, c) directional, and d) vertical axes extracted transfer functions compared to flight-test data. C. Simulation A Simulink model was constructed using the extracted transfer function models from system identification. The simulation results are shown below in Fig. 10. Given the model is for trimmed hover flight conditions, initial states are set to be 0. A 10% lateral input is applied at time 1 s and the roll rate and roll angle responses are plotted. Because the quadrotor was set to be flying in the attitude mode, a step roll input will command the vehicle to corresponding roll angle. It can be seen from Fig. 10 that the roll angular rate response is influenced by both the lightly damped short period model and the roll subsidence mode. The roll subsidence mode has a time constant of 0.21 s, which makes the roll rate converge quickly. The roll angle settles in about 0.67 s after the command is applied. Figure 10. AeroQuad closed-loop poles. 8
V. Conclusions A closed-loop dynamic model of a quadrotor UAV was successfully extracted using the frequency-domain system identification program CIFER. This model was compared against flight-test data not used in the system identification process, and was shown to have good correlation to the actual quadrotor response. These results show that an accurate dynamic model of a closed-loop quadrotor system can be successfully extracted using system identification, thereby decreasing modeling time and complexity when compared to traditional modeling techniques based on first principles. Simulation of the identified model is presented with analysis of the transient response behavior. In future work, the process of system identification will be applied to extract a bare-airframe dynamic model of a quadrotor configuration, using the motor inputs and outputs. With an accurate bare-airframe model, a custom controller for the quadrotor wil be developed and the handling qualities will be analyzed. References 1 Tischler, M. B., and Remple, R. K., Aircraft and Rotorcraft System Identification: Engineering Methods with Flight-Test Examples, 2 nd ed., AIAA Education Series, AIAA, Reston, VA, 2012. 2 Woodrow, P., Tischler M. B., Hagerott, S. G., Mendoza G. E., and Hunter, J. M., Low Cost Flight-Test Platform to Demonstrate Flight Dynamics Concepts using Frequency-Domain System Identification Methods, AIAA Atmospheric Flight Mechanics Conference, AIAA, Washington, DC, 2013. 3 Bhandari, S, Flight Validated High-Order Models of UAV Helicopter Dynamics in Hover and Forward Flight using Analytical and Parameter Identification Techniques, Ph.D. Dissertation, Department of Aerospace Engineering, University of Kansas, ProQuest, Ann Arbor, MI, 2007. 4 Otnes, R.K., and Enochson, L., Basic Techniques, Applied Time Series Analysis, Vol. 1, Wiley, New York, 1978. 5 Bendat, J. S., and Piersol, A. G., Engineering Applications of Correlation and Spectral Analysis, 2 nd ed., Wiley, New York, 1993. 9