Identification of a UAV and Design of a Hardware-in-the-Loop System for Nonlinear Control Purposes

Myriam Mana¨ ∗ and Andr´ Desbiens ı e Eric Gagnon
‡ †

LOOP, Universit´ Laval, Quebec City, Quebec, G1K 7P4, Canada e

Defence R&D Canada - Valcartier, Val-Belair, Quebec, G3J 1X5, Canada

This article summarizes the modelling of a UAV and the identification of the model parameters in the context of a military project, aiming to develop a nonlinear control for the UAV. More precisely, the use of the output-error approach to identify the parameters that are difficult to measure is presented. Flight tests have been conducted to collect data in order to calculate the model parameters with the output-error approach algorithm. Preliminary results are satisfying since it is possible to adequately predict the roll attitude angle output for various situations. Finally, a hardware-in-the-loop system has been developed for testing purposes and is described. This system allows to connect a computer simulating the UAV model to the real UAV autopilot.

Nomenclature
a UAV acceleration vector due to all forces except the gravitational force, expressed in body-axes B Weighting matrix e The quaternion of finite rotation representing the attitude of the UAV J Inertia matrix fb Total applied force to the UAV (gravitational force excluded) in body-axes gb Earth’s gravitational acceleration (including centripetal acceleration) in body-axes ib Unit vector of the X-axis of the body-axis system jb Unit vector of the Y-axis of the body-axis system kb Unit vector of the Z-axis of the body-axis system Rned2b Rotation matrix expressing the orientation of the body-axis frame relative to the NED frame tb Total applied torque vector to the UAV va Velocity of the air relative to the UAV body or UAV airspeed vned Groundspeed velocity vw Wind velocity, assumed to be constant wabs UAV absolute angular velocity vector in body-axes yM Predicted model output vector y Recorded UAV output vector G Least-squares sum criteria h Altitude above the take off point m UAV mass N Number of recorded samples P UAV roll angular velocity
∗ Master

degree student, Department of Electrical and Computer Engineering, Pavillon Adrien-Pouliot, AIAA nonmember Department of Electrical and Computer Engineering, Pavillon Adrien-Pouliot, AIAA nonmember ‡ Defense Scientist, Precision Weapon Section, 2459 Pie-XI Blvd North, AIAA nonmember
† Professor,

1 of 6 American Institute of Aeronautics and Astronautics

Finally. jb and kb . The Xtra Easy2 is a fixed-wing UAV developed by Hangar 9. The center of this axis system is located at the center of gravity of the UAV. This system is refered to as the hardware-in-the-loop system and will be useful in the next steps of the project. from Unmanned Dynamics. The UAV model is nonlinear with six-degrees-of-freedom and is simulated with Simulink. under the UAV. Y and Z axes are respectively ib . The UAV and its on-Board Autopilot An MP2028 autopilot and a Xtra Easy2 UAV were both purchased from Micropilot. The main objective is to replace some PID controllers by a nonlinear control algorithm based on a physical model of the UAV. 2 of 6 American Institute of Aeronautics and Astronautics . The identification of the stability and control derivatives of the model and of some other model parameters difficult to measure is accomplished using the output-error approach. enumerated in table 1. II. Unit vectors of the X.2Kg.1 The model expresses aerodynamic forces and moments as a sum of several terms using stability and control derivatives. The existing autopilot is based on gain-scheduled PID controllers. The X-axis is directed toward the north. for testing purposes. The XY plane is always tangent to the Earth’s surface and the entire axis system moves with the UAV. This model is based on an existing library and has been slightly modified for our purposes. This model uses both of the following common coordinate systems. The MP2028 is equipped with several sensors. refer to the Aerosym library user’s guide. a system allowing to first control the computer UAV model with the purchased autopilot or with a nonlinear algorithm implemented in the autopilot has been developed. Furthermore.8Kg to 3. The north-east-down axis system (NED frame) is a right-handed orthogonal axis system located on the surface of the Earth. Six-Degrees-of-Freedom UAV Dynamic Model The UAV is represented by a nonlinear six-degrees-of-freedom model available from the Aerosym library.5m2 and an overall weight varying between 2. III.Q R UAV pitch angular velocity UAV yaw angular velocity Subscripts i ith sample Symbols λl Geodetic latitude φ Roll attitude angle or bank angle φl Geodetic longitude ψ Yaw attitude angle or heading θ Pitch attitude angle or elevation angle I. The MP2000 autopilot is the previous version of the MP2028 autopilot. a wing area of 0. the X-axis follows the fuselage and points foward. the Y-axis points toward the east and the Z-axis points downwards. This autopilot was on-board the UAV during the flight tests and its sensors were used to collect data required for the identification of the UAV. An MP2000 autopilot without any sensors was also purchased and used to develop the hardware-in-the-loop system. a nonlinear control will be implemented within this autopilot.75m. the Y-axis points through the right wing and the Z-axis points downwards. with a wingspan of 1. For more details about this library. The axes follow some convenient reference lines of the UAV body. The first step consists in building a UAV model and to identify its parameters. Introduction The purpose of this project is to modify the autopilot of an existing aerial platform to achieve the performances required by military applications. The body-axis system is a right-handed orthogonal axis system fixed to the UAV. As seen by the pilot. in futur works.

considering the UAV mass is constant:2 1 fb − wabs × vb + gb (2) m where fb is the total applied force vector to the UAV except the gravitational force and is a sum of the aerodynamic force vectors and the propulsion force vector. the propulsion moment vector and the moment vectors due to the fact that aerodynamic forces are not applied directly to the center of gravity. the UAV absolute angular velocity vector is: wabs = P ib + Qjb + Rkb (1) where P is the roll angular velocity. the moment equation is developed with the absolute angular velocity vector of the aircraft and leads to:2 v˙b = ˙ wabs = −J −1 (wabs × (J wabs )) + −J −1 tb (3) where tb is the total applied torque vector to the UAV and J is the inertia matrix. θ is the pitch attitude angle and ψ is the yaw attitude angle. the Euler angles are obtained. By doing so. The total applied torque vector is a sum of the aerodynamic moment vectors. (e0 2 + e2 − ex 2 − ey 2 )] z  ˙    (5)  θ = asin[2(e0 ey − ex ez )]  2 2 2 2 ˙ ψ atan2[2(e0 ez + ey ex ). longitude and altitude are obtained from the groundspeed vector components and from some Earth’s parameters. Q and R. the angular velocity of the Earth through the force equation development is neglected. the quaternion components can be used to get the Euler angle rates of change:3     ˙ φ atan2[2(e0 ex + ey ez ). The rate of change of the attitude of the UAV is computed from its angular velocities P . Q is the pitch angular velocity and R is the yaw angular velocity. but the Euler-Rodrigues quaternion formulation could be used equally:3 vned = Rned2b T vb (6) The geodetic position in term of latitude. Since the UAV is symmetrical with respect to the XZ plane of the body-axis system. 3       e0 0 −P −Q −R e0 ˙       0 R −Q   ex  ˙  ex  1  P (4)  ·  = ·  ey  2  Q −R 0 P   ey  ˙ ez R Q −P 0 ez ˙ The rate of change of the quaternion components can be integrated to obtain the quaternion.1 Determining the attitude of the UAV consists in computing the orientation of the body-axis reference frame relative to the inertial reference frame (NED frame). all expressed in body-axes. given by the following equation:2. leading to the flat-Earth state equations.In the model. the force equation is developed with the UAV relative velocity vector with respect to the Earth and leads to the following expression for the time variation of the relative velocity vector in body-axes. m is the mass of the UAV and gb is the Earth’s gravitational acceleration vector (including centripetal acceleration). In this axis system. The UAV groundspeed vector expressed in the NED frame vned is obtained from a rotation matrix expressing the attitude of the body-axis frame relative to the NED frame. The rate of change of the attitude is thus represented by the rate of change of the components of the quaternion e.4 The Earth’s parameters used through the model 3 of 6 American Institute of Aeronautics and Astronautics . Still in the body-axis system. the force and moment equations are expressed in the body-axis system. To do so. The rotation matrix Rned2b is built from the Euler angles. the Euler-Rodrigues quaternion formulation is used. only the Jxz cross-product has a nonzero value. Then. except for the centripetal acceleration due to the Earth rotation. By integrating the Euler angle rates of change. because it allows avoiding some singularities present in the equations using the Euler angles. Altough this frame is rotating. (e0 + ex − ey − ez )] where φ is the roll attitude angle. It is possible to consider the NED frame on the surface of the Earth as an inertial reference frame. but rather to the UAV aerodynamic center.

(2) are lift. Identification of the UAV Model Parameters The UAV model has several parameters for which values need to be estimated. lift force. The aerodynamic moments in the total applied torque vector tb used in Eq. The acceleration vector of the aircraft due to aerodynamic and propulsion forces is obtained as follows:1 a= and the airspeed vector v a is given by:1 va = vb − vw where vw represents the wind vector that is assumed to be constant. and the wing area. Table 1. A. roll moment and yaw moment coefficients. Then. the sideslip angle. and Eq. using data obtained from flight tests. the actuator angles (elevator. an aerodynamic force or moment can be computed from a nondimensional coefficient. Eq. fb = ax ib + ay jb + az ib m (7) (8) Sensors Two accelerometers * A differential pressure sensor An altimeter Three rate gyros A GPS * The Signals X and Y body-axes accelerations Airspeed in the X-axis Altitude above the take off point Roll. pitch moment. This is the case for the mass of the UAV. MP2000 and MP2028 sensors and the corresponding outputs of the model. The Output-Error Approach The process to be identified is excited by manipulating the inputs while the inputs and the outputs are recorded. Eq. 5. rudder. the model parameters are estimated by minimizing the follwing cost function: N G= i=1 [yM (i) − y(i)] B [yM (i) − y(i)] T (9) 4 of 6 American Institute of Aeronautics and Astronautics . IV. The aerodynamic forces considerated in the total applied force vector fb used in Eq. (4). come from the World Geodetic System WGS-84. Easily measurable parameters are determined by measures. φl . pitch and yaw angular rate Geodetic position and groundspeed Model outputs ax and ay vax h P . According to the small-disturbance theory.2. (3). In general. side force.7–9 The parameters estimated with this method are the stability and control derivatives from which each aerodynamic coefficient is evaluated. such as gravity and radii of curvature along lines of constant longitude and latitude. Q and R λl . (6) are the state equations defining the flat-Earth model. Other parameters are determined with the output-error approach algorithm. The model provides outputs corresponding to all measures generated by the UAV sensors. as detailed in table 1. and yaw moments.equations.4 Equation (2). All force and moment equations used through the model are detailed in the Aerosym user’s guide. the output-error approach is used to find the x position of the aerodynamic center and the Jxz inertia product. and ailerons). 6 The aerodynamic force and moment coefficients are function of the attack angle. and the airspeed. Also. roll. drag. and side forces. Parameter values of the model have to be chosen carefully to adequately represent the behavior of the UAV. that is drag force. the mean aerodynamic chord.1 The model inputs are the actuator angles and the throttle fraction needed to compute the aerodynamic and propulsion forces and moments. its inertia moments and some of its physical dimensions such the wingspan. each of the nondimensional force and moment coefficients are represented by small-perturbation equations and are a sum of several terms formed by nondimensional stability and control derivatives. (3) are pitch. h and vned MP2028 has a third accelerometer providing the Z body-axis acceleration (the Z body-axis acceleration is neither used in the identification nor in the hardware-in-the-loop system).

the ailerons. command and sensor data were sampled and 80 Roll data from the flight test recorded in the autopilot memory. In the hardware-in-the-loop system. For better results. instead of the real UAV. the simulator generates the sensor signals by executing the UAV model with the actuator angles and throttle fraction provided as input. initial estimates are chosen following a reference during the flight test. and the throttle. At the end of the flight.the model with the parameters identified timates in order to be as near as possible of a solution. is compiled with Real Time Workshop of Simulink and is downloaded in the computer in order to allow the computer to run the model in real time. Furthermore. An interface has been conceived to allow a proper communication between the autopilot and the UAV model. Therefore. The computer is connected to the autopilot through digital and analog acquisition cards. along with the roll attitude angle measured during the flight test. B is a weighting matrix . 5 book and from the Aerosonde UAV example provided with the Aerosym library. Maximum and minimum values for each −100 0 20 40 60 80 100 120 parameter are imposed to avoid unstability. The hardware-in-the-loop system is illustrated in figure 3(a). data 60 samples were downloaded in a computer and saved in a data file 40 for identification. Roll data from the model During each flight. To interpret the 5 of 6 American Institute of Aeronautics and Astronautics . implemented with Simulink and based on the identification results. and the −20 ailerons angle. For the by the error-output approach algorithm. the 0 throttle fraction. Results Roll attitude angle.10 C. along with the roll attitude angle measured first attempt. B. the rudder angle. y(i) is the recorded process output vector and yM (i) is the predicted model output vector for the given process inputs. The outputs are all of the sensors listed in table −40 1. the simulator reads the command signals sent by the autopilot to the actuators. s constraint equations were implemented to avoid some parameter combinations for which the model becomes unstable. The autopilot commands. and provides them to the UAV model. Various input amplitudes are also required in presence of nonlinearities. the elevator angle. the rudder. the simulator traduces them in actuator angles and in throttle fraction. The computer plays the role of the UAV and the autopilot can control the model. i.where N is the number of recorded samples. will be to provide the initial estimates from methods contained in the Datcom handbook. sent as puslewidth modulation (PWM) signals. V. as a part of the simulator. using the UAV Simulink model. A second part of the interface is hardware and includes the acquisition cards and some printed circuit boards. The UAV model.1 A next step. The resulting model should be validated with data that were not used for identification. Constraints are taken into account during the mininiza−80 tion of the criteria G.e. Finally. Then. the simulator includes the UAV model plus other Simulink blocks that we created in order to reproduce the sensor outputs and to interpret the autopilot commands. Hardware-in-the-Loop System The hardware-in-the-loop system consists in connecting the autopilot to a computer running the UAV model. The fit is good enough for an eventual nonlinear controller design. 20 The inputs are the commands given to the UAV. The roll attitude angle output of It is important to provide appropriate initial parameter es. some Time. The output-error approach algorithm −60 has been implemented with Matlab . the inputs should be rich at the frequencies where precision is necessary. degrees The roll attitude angle output of the model with the parameters identified by the output-error approach algorithm is shown in figure 1. the altimeter excluded. are read through an NI6601 digital acquisition card. A first part of the interface implementation is software. Experiment An experienced pilot has executed some flights with the UAV. This interface is represented in details in figure 3(b). as an improvement. namely the elevator. The hardware-in-the-loop system can be detailed as follows. Figure 1.

the other part is accomplished with printed circuit boards that we conceived specially for this task. August 2001. February 1992. V. 9 Jategaonkar. It will also be useful for evaluating the performance of the existing autopilot and for analysing the UAV model behavior. January 1991. L.. Dynamics of Flight. Vol. G. while the GPS paquets are sent to the autopilot via RS232 protocol. E. 119–135.. 2nd ed. H. National Aeronautics and Space Administration. January 1999. A. 2nd ed. Version 1. W. Air Force Flight Dynamics Laboratory. J. C. B. L. we present the results obtained for the identification of the UAV model parameters with the output-error approach for one model output. April 1978. Aircraft Control and Simulation. and Thielecke. N. No..Figure 2..1. Also. Automatic Control of Aircraft and Missiles. 6 Etkin. Ohio. pp. and Gebert. Hailey.. L. Hood River. R. System Identification .. 1 Unmanned 6 of 6 American Institute of Aeronautics and Astronautics . April 2000. the pulse widths are then converted in actuator angles and throttle fraction in Simulink. Vol.. January 1996. 38. USA. Flight Control Division.” Journal of Aircraft. 7 Maine. User’s Guide. the model outputs are converted in Simulink under the same form as the sensor outputs. 3rd ed. “Application of Parameter Estimation to Aircraft Stability and Control. The hardware-in-the-loop system. 3 Phillips. the resolution of the NI6703 card is not high enough to represent properly the sensor output for all its range of values. John Wiley & Sons. and Iliff. R.A Tool for Development of Aerodynamic Databases. Upper Saddle River. Virginia. “Review of Attitude Representations Used for Aircraft Kinematics.” NASA Reference Publication 1168. Applied Mathematics in Integrated Navigation Systems. This system will be useful for testing new control algorithms with the UAV model before attempting to apply the control algorithms to the real UAV.Theory for the User . pp. B. June 1986. American Institute of Aeronautics and Astronautics.. W... 3. E. No. that is PWM signals.. 2.” S¯dhan¯ . July 2000. analog voltages and GPS paquets. a a 10 Hoak. Inc. John Wiley & Sons... 718–737. Stability and Control.. In near futur works. 4. 8 Ljung. the output error approach. Then. command signals. Hardware Software Data conversion PCI PWM card PWM Model I/O MP2000 Servo commands: Throttle Ailerons Rudder Elevator UAV simulator Command translation Accelerations UAV model PCBs PCI D/A card Voltage Airspeed Altitude Angular velocities GPS positions GPS groundspeed RS232 GPS paquets Sensor simulation RS232 Throttle Ailerons Rudder Elevator PCI PWM card PWM Actuator angles Throttle position (a) General system. AeroSym Aeronautical Simulation Blockset. USAF Stability and Control Datcom.. 1st ed. References Dynamics LLC. Wright-Patterson Air Force Base. D. Conclusion In this article. and Lewis. F. For some voltage signals. we describe a hardware-in-the-loop system.J. John Wiley & Sons. K. 2 Stevens. D. To reproduce the sensor outputs. 4 Rogers. R. and Finck. L. F. R. only one part of the model outputs is converted in software to reproduce the sensor outputs. Scientific and Technical Information Branch. the roll attitude angle curve. (b) Detailed interface.. “Aircraft Parameter Estimation . Inc. For these signals. Inc. Prentice Hall. M. VI. the PWM signals are sent to the autopilot through an NI6601 digital aquisition card and voltage signals are transmitted through an NI6703 analog acquisition card. in order to obtain a representative model of the entire UAV behavior. we aim to identify the UAV model parameters with this method so that all model outputs enumerated in table 1 be comparable to the UAV sensor outputs recorded during flight tests. 2003... 5 Blakelock.. F. and Reid. Inc. E. F..

Sign up to vote on this title
UsefulNot useful