Bhandari 2016
Bhandari 2016
AIAA SciTech
4-8 January 2016, San Diego, California, USA
AIAA Modeling and Simulation Technologies Conference
Edward Gomez1, Daniel Garcia2, Matias Piana3, Matthew Ritterbush4, and Subodh Bhandari5
Cal Poly Pomona, Pomona, CA, 91768
(UASs), entirely using open source material. This simulation system involves the integration
of multiple existing programs, including Athena Vortex Lattice, FlightGear, and JSBsim.
CAD models of existing UAV’s are created and integrated into a virtual environment. A built-
in feature of the ardupilot software is used in conjunction with the physics engine, JSBsim,
and developed collision avoidance algorithm to create a closed loop where aircraft inputs and
states such as position, heading, and velocity are passed through a collision avoidance
algorithm into the autopilot software. Outputs from the autopilot software are sent into the
flight simulator in the form of GPS waypoints for the motion visualization of the UAV’s
involved.
Nomenclature
a = angle of attack
b = sideslip angle
CD = drag coefficient
CL = lift coefficient
Cl = rolling moment coefficient
Cm = pitching moment coefficient
Cn = yawing moment coefficient
CY = y-force coefficient
d1 = aileron
d2 = elevator
d3 = rudder
e = span efficiency factor
Ixx = moment of inertia about x axis, slug-ft2
Iyy = moment of inertia about y axis, slug-ft2
Izz = moment of inertia about z axis, slug-ft2
Xnp = neutral point
δa = aileron input, deg
δe = elevator input, deg
δr = rudder input, deg
ϕ = airplane bank angle, deg
ψ = airplane heading angle, deg
θ = airplane pitch attitude angle, deg
( )a = derivatives with respect to angle of attack
( )b = derivatives with respect to sideslip angle
1
Undergraduate Student, Aerospace Engineering Department, and AIAA Student Member.
2
Undergraduate Student, Computer Science Department.
3
Undergraduate Student, Aerospace Engineering Department, and AIAA Student Member.
4
Undergraduate Student, Aerospace Engineering Department, and AIAA Student Member.
5
Professor, Aerospace Engineering Department, 17-2116, and AIAA Senior Member.
1
American Institute of Aeronautics and Astronautics
Copyright © 2015 by the American Institute of Aeronautics and Astronautics, Inc. All rights reserved.
( )d1 = derivatives with respect to aileron
( )d2 = derivatives with respect to elevator
( )d3 = derivatives with respect to rudder
( )p = derivatives with respect to roll rate
( )q = derivatives with respect to pitch rate
( )r = derivatives with respect to yaw rate
I. Introduction
U nmanned aerial vehicles (UAVs) have risen in popularity in recent years for both military and civilian
applications. With their low operating cost and ability to operate autonomously for long periods of time and in
Downloaded by KUNGLIGA TEKNISKA HOGSKOLEN KTH on January 15, 2016 | http://arc.aiaa.org | DOI: 10.2514/6.2016-0947
dangerous environments, UAVs are utilized for various applications including but not limited to search and rescue,
intelligence, surveillance, and reconnaissance (ISR), surveillance of disaster hit areas, aerial photography, cargo
delivery, precision agriculture, powerline inspection, and 3-D mapping. However, the lack of matured collision and
obstacle avoidance capabilities have limited the use of these vehicles.1-3 In order to be able use these vehicles for
widespread applications, these vehicles must be integrated into the National Airspace System (NAS), which in turn
requires fool-proof collision and obstacle avoidance capabilities and increased situational awareness among other
requirements.
Cal Poly Pomona is currently working on several projects that involve developing and flight testing the capabilities
for collision and obstacle avoidance system for various types of unmanned aerial vehicles for operation in both indoor
and outdoor environments.2-4 However, for the safety of the vehicles and expensive onboard sensors, these capabilities
must be tested in simulation for verification and validation prior to flight testing.7 This paper presents a simulation
environment for testing autonomous collision avoidance algorithm for UAVs, both software-in-the-loop (SIL) and
hardware-in-the-loop (HIL) simulation environments. Using a simulation environment allows for new UAV systems
to be tested without the risks involved with using a physical aircraft. Also, implementing a simulation environment
allows for rapid prototyping of new UAV designs, which significantly reduces the cost and time during the testing
and verification phases. The purpose of the ongoing project is to develop SIL and HIL simulation capabilities in order
to test collision avoidance algorithms for UAVs in simulation. Testing collision avoidance programs can be
particularly dangerous due to the inherent danger in flying two aircraft in close quarters. To validate a system will in
fact avoid a collision, it is necessary for a collision course to be created. By using simulations, any real damage due
to failures in the collision avoidance system being tested can be evaded.
The paper is organized as follows. Second II talks about unmanned aerial systems being used for the research,
autopilots, and vehicle management system. Section III presents the various software used for the modeling and
simulation as well as for mission planning. Aircraft modeling process is discussed in Section IV. Software-in-the-loop
simulation environment is presented in the fifth section along with the simulation results collision avoidance maneuver
and simulation data. Also presented in the fifth section is the architecture for the hardware-in-the-loop simulation
followed by conclusion and future work in the last section.
II. Hardware
The hardware used for this project include two unmanned aerial vehicles, autopilots, and vehicle management
systems. As discussed below, the flight dynamics models of these UAVs are used for this project for the simulation
environment.
A. Airframe
The aircraft used for this project are a Sig Kadet Senior and a Telemaster Senior, as shown in Figure 1. Both
airplanes are conventional, high-winged monoplane trainers flown by model aircraft enthusiasts. The Sig Kadet Senior
wingspan is 80 inches and has a maximum gross weight of 18 pounds. The Telemaster Senior has wingspan of 95
inches and has a maximum gross weight of 20 pounds. The Sig Kadet Senior has a tricycle type landing gear while
the Telemaster Senior has a tail dragger style of landing gear. Their control surfaces include ailerons, elevator and
rudder with a steerable nose gear. These physical and mass characteristics of these aircraft are used to determine flight
dynamics models for these UAVs. These models are then used for the software-in-the-loop (SIL) and hardware-in-
the-loop (HIL) simulations.
2
American Institute of Aeronautics and Astronautics
Downloaded by KUNGLIGA TEKNISKA HOGSKOLEN KTH on January 15, 2016 | http://arc.aiaa.org | DOI: 10.2514/6.2016-0947
3
American Institute of Aeronautics and Astronautics
Downloaded by KUNGLIGA TEKNISKA HOGSKOLEN KTH on January 15, 2016 | http://arc.aiaa.org | DOI: 10.2514/6.2016-0947
III. Software
The paragraphs below describe the various software used for the modeling and simulation including FlightGear
Flight Simulator,7 which is used to simulate the vehicle motion for collision avoidance in the software-in-the-loop
simulation environment.
C. JSBSim
JSBSim is an XML-based physics engine, which FlightGear uses in order to create a realistic flight environment.
The Flight dynamics models for every aircraft are created in order to determine the flight characteristics of the aircraft
by incorporating stability and control derivatives along with the aircraft’s physical and mass characteristics. The
reason for using the JSBSIM file for this project was because several flight simulators including the FlightGear
recognize the JSBSIM file types. JSBSim is also equipped with a custom scripting language called Nasal, which can
be used to output specific data into FlightGear.
D. Ardupilot Software
Ardupilot software tool is used to provide navigation and telemetry to a variety of autonomous vehicles. The
version specific to fixed-wing aircraft is called ArduPlane, which is the software used on the flight control system.
4
American Institute of Aeronautics and Astronautics
The software is also used within the simulation environment to replicate the behavior of the FCS. Being able to
realistically replicate the behavior of the actual hardware is vital to the SIL simulation discussed in this paper. As part
of the source code, a binary version of ArduPlane can be complied. This allows all the functions performed by
ArduPlane needed to realistically control the UAVs completely in the SIL simulations.
SolidWorks. The last step is combining the geometric model and the flight dynamics model into a simulator program,
in this case the FlightGear Flight Simulator.
Mass properties such as center of gravity and moments of inertia can be found in a number of ways. Three of those
ways are using a trifilar pendulum,7,9 using the mass properties feature of CAD programs, and by hand calculations
based on the parallel axis theorem. Geometric properties such as the length of the wing can either be measured or
found on aircraft specification sheets. Table 1 shows the moments of inertia determined using trifilar pendulum for
both the aircraft as well as the center of gravity (cg) locations.
In order to determine an aircraft’s flight dynamics characteristics,10 AVL needs several characteristics of the
aircraft being modeled. The most important being the geometric characteristics of the aircraft such as that of lifting
surfaces, control surfaces, high lift devices, and fuselage.11 The geometry of the aircraft’s lifting surfaces are created
by defining two dimensional planes, which are then shaped to a selected airfoil design. The program creates a lattice
representation of the surfaces of the aircraft. Figure 4 shows the AVL model of the Sig Kadet Senior UAV. The mass
properties of the aircraft, including mass, center of gravity, and moments of inertia, are then input into the program.
Being independent from the dynamics model, a geometric model must be created using CAD software, in order
for the simulated model to look like the actual aircraft. This model is primarily for the sake of the visualization purpose
as it will not affect the behavior of the aircraft. It is necessary for the visualization of a simulated collision avoidance
with another aircraft. Proper sizing is required to see when two aircraft would actually collide. The CAD models used
for the geometric model are shown in Fig. 6 below.
6
American Institute of Aeronautics and Astronautics
Downloaded by KUNGLIGA TEKNISKA HOGSKOLEN KTH on January 15, 2016 | http://arc.aiaa.org | DOI: 10.2514/6.2016-0947
Figure 6. CAD models of the Sig Kadet (red) and Telemaster (green)
Once the stability and control derivatives are obtained, they can be integrated into a JSBSim file. This allows the
aircraft within FlightGear to have the same flight dynamic characteristics as the real aircraft would in actual flight.
And upon the completion of a geometric model created with the desired geometric qualities, it can be integrated with
the dynamic model into a simulated aircraft within the FlightGear as shown in Fig. 7 below.
Figure 7. Developed UAV model of the Sig Kadet Senior (left) and Telemaster within FlightGear
V. Software-in-the-Loop Simulation
A software-in-the-loop simulation (SIL) environment is created with only computer software. No hardware is
involved in the simulation. The two principal components in the SIL simulation are the JSBSim and Ardupilot
software. The communication between these two components form the loop implied in the name. The Ardupilot
receives aircraft data from the JSBSim via User Datagram Protocol (UDP), and uses this data to deflect control
surfaces of the aircraft in simulation. The deflection commands are sent back to the JSBSim, and translate into
simulated motion of the airplane.7 As a result of this motion, the aircraft is in a new state. The new aircraft data is fed
7
American Institute of Aeronautics and Astronautics
back into the Ardupilot software, which in turn generates new control surface deflection commands. This process is
iterated in an infinite loop. This forms the basis for the software-in-the-loop simulation. In the case of this simulation,
additional components were added into the loop to allow for more capabilities. In addition to flight command, the
developed SIL simulation capability allows for the addition of mission specific algorithms including collision
avoidance, image processing, target identification, and payload delivery algorithms. Outputs from these algorithms
such as geolocation and new waypoints sent via MAVLink protocol directly to the Ardupilot software.12 Figure 8
shows the SIL simulation architecture.
Downloaded by KUNGLIGA TEKNISKA HOGSKOLEN KTH on January 15, 2016 | http://arc.aiaa.org | DOI: 10.2514/6.2016-0947
Moreover, it is possible to add a MavProxy, which is a program that emulates commands received from a Ground
Control Station (GCS). FlightGear Flight Simulator is added to visualize the aircraft motion in simulation including
autonomous mission and collision avoidance maneuver. Figure 9 shows the user interface created using MavProxy as
well as the simulated environment created in FlightGear Flight Simulator.
To test the collision avoidance between two aircraft in simulation, two independent SIL simulations were required.
However, due to processing power limitations on the computers used, simulating two aircraft in two software-in-the-
loops was not possible. Instead, two computers can be used where each computer supports its own aircraft simulation.
Communication between computers was accomplished over an Ethernet cable using serial UDP. This allows for each
instance of JSBSim to be aware of the flight data of the other instance. This allows the second aircraft to be seen
within FlightGear simulation of the first aircraft. It also allows the collision avoidance algorithm for each aircraft to
receive needed data about the other aircraft’s position and heading, which are needed to properly avoid a collision.
The SIL simulation environment allows for the custom simulation involving a prepared list of waypoints, or
waypoints procedurally generated by added algorithm such as a collision avoidance algorithm. The results of a sample
simulation are shown in figures below. The sample simulation involved both aircraft, the Sig Kadet and the
Telemaster, and the figures below show the motion of each aircraft while avoiding collision with each other. After
avoiding collision, the Telemaster was heading east while the Sig Kadet moved west. The Telemaster then makes a
sharp turn north while the Sig Kadet makes a turn south. This example shows the capabilities of this simulator and the
type of data that can be collected from a simulated flight test.
The collision detection is simulation is performed within the developed collision avoidance algorithm. The Sense
function within the algorithm determines if the two UAV’s are in collision course or not.4
8
American Institute of Aeronautics and Astronautics
Downloaded by KUNGLIGA TEKNISKA HOGSKOLEN KTH on January 15, 2016 | http://arc.aiaa.org | DOI: 10.2514/6.2016-0947
Figure 9. Software-in-the-loop simulation interface showing MavProxy (left) and FlightGear (right)
Figure 10 shows the longitude and latitude of the Sig Kadet Senior after the collision avoidance maneuver in
Simulation.
149.165 -35.362
149.1645
-35.363
149.164
Longitude (deg)
Lattitude (deg)
-35.364
149.1635
-35.365
149.163
-35.366
149.1625
149.162 -35.367
0 10 20 30 40 50 0 10 20 30 40 50
Time (s) Time (s)
Figure 10. Sig Kadet Senior latitude and longitude after collision avoidance
Figure 11 shows the heading and bank angles of the Sig Kadet senior after the simulated collision avoidance
maneuver. Also shown in the plot are aileron and rudder deflection angles.
9
American Institute of Aeronautics and Astronautics
0.5 0.5
δa (deg)
δr (deg)
0
-0.5
-0.5 -1
0 10 20 30 40 50 0 10 20 30 40 50
400 50
Downloaded by KUNGLIGA TEKNISKA HOGSKOLEN KTH on January 15, 2016 | http://arc.aiaa.org | DOI: 10.2514/6.2016-0947
φ (deg)
ψ (deg)
200 0
0 -50
0 10 20 30 40 50 0 10 20 30 40 50
Time (s) Time (s)
Figure 11. Sig Kadet Senior attitude after simulated collision avoidance
Figure 12 shows the altitude, speed, and pitch attitude variation after the collision avoidance maneuver. It is seen
that the change in speed and altitude is less significant compared to roll and heading angle change. The turn can be
assumed to be nearly level.
0 120
Altitude (m)
110
δe (deg)
-0.5
100
-1 90
0 10 20 30 40 50 0 10 20 30 40 50
4 80
Speed (m/s)
2 75
θ (deg)
0 70
-2 65
0 10 20 30 40 50 0 10 20 30 40 50
Time (s) Time (s)
Figure 12. Sig Kadet Senior speed, pitch attitude, and altitude variation after collision avoidance
Figure 13 shows the longitude and latitude of the Telemaster Senior after the collision avoidance maneuver in
Simulation.
10
American Institute of Aeronautics and Astronautics
149.1645 -35.358
149.164 -35.359
-35.36
149.1635
Longitude (deg)
Lattitude (deg)
-35.361
149.163
-35.362
149.1625
Downloaded by KUNGLIGA TEKNISKA HOGSKOLEN KTH on January 15, 2016 | http://arc.aiaa.org | DOI: 10.2514/6.2016-0947
-35.363
149.162 -35.364
149.1615 -35.365
0 10 20 30 40 50 0 10 20 30 40 50
Time (s) Time (s)
Figure 13. Telemaster Senior longitude and latitude after simulated collision avoidance
Figure 14 shows the heading and bank angles of the Telemaster airplane after the simulated collision avoidance
maneuver. Also shown in the plot are aileron and rudder deflection angles.
0.5 0.5
0
δa (deg)
δr (deg)
0
-0.5
-0.5 -1
0 10 20 30 40 50 0 10 20 30 40 50
400 50
300 0
φ (deg)
ψ (deg)
200 -50
100 -100
0 10 20 30 40 50 0 10 20 30 40 50
Time (s) Time (s)
Figure 14. Telemaster Senior attitude after simulated collision avoidance
Figure 15 shows the altitude, speed, and pitch attitude variation after the collision avoidance maneuver for
Telemaster Senior. Similar to the Sig Kadet Senior, the altitude and speed nearly remain constant during the collision
avoidance maneuver.
11
American Institute of Aeronautics and Astronautics
0 120
Altitude (m)
110
δe (deg)
-0.5
100
-1 90
0 10 20 30 40 50 0 20 40 60 80 100
10 80
Downloaded by KUNGLIGA TEKNISKA HOGSKOLEN KTH on January 15, 2016 | http://arc.aiaa.org | DOI: 10.2514/6.2016-0947
Speed (m/s)
5 75
θ (deg)
0 70
-5 65
0 10 20 30 40 50 0 20 40 60 80 100
Time (s) Time (s)
Figure 15. Telemaser Senior speed, pitch attitude, and altitude variation after collision avoidance
From Figures 10, 11, 13, and 14, it is clear that the two aircraft turn into opposite directions after collision
avoidance maneuver. The simulation environment is thus capable to perform the desired function of simulating the
UAV collision avoidance.
A. Hardware-in-the-Loop Simulation
The next stage in simulation is Hardware-in-the-Loop (HIL) simulation. This system is developed to use the
physical onboard FCS and onboard vehicle management system (VMS) to perform navigation simulations rather than
only using the software of these two components. Based on HIL simulation architecture shown below in Fig. 16, the
FCS software is replaced by the actual FCS by using a serial interface.
Future work will involve validating the flight dynamics model with flight data. The aircraft will be flown in doublet
maneuvers, and collected data will be compared with the response of the flight dynamics model to check the accuracy
of the identified models. If the simulated models are shown to be accurate and the collision avoidance algorithm is
tested in the HIL simulation and is performing successfully, the final step will be a flight test where the two vehicles
will be flown in such a way that they are in a collision course in order to physically test the ability for the two aircraft
to autonomously avoid each other.
Currently, work on adding a ground control station for actively illustrating the activity of both aircraft at once,
adding collision animations to the simulator, and actively generating waypoints are underway.13 Showing both
airplanes executing their mission from a single instance of the ground control station would be beneficial because,
both aircraft states could be monitored by a single operator. This is not possible without setting up and integrating a
new ground control station that supports multiple vehicle display. Currently, there is no visual animation for a collision
between two or more aircraft. Collision are determined by seeing that the two vehicles occupy the same location, but
by adding visual display of both the aircraft and their motion, the potential collision and collision avoidance could be
monitored on the ground control station.
Acknowledgments
The authors would like to acknowledge the continued funding support from Northrop Grumman Corporation for
the projects on unmanned systems.
References
1Schaeffer, R., “A Standards-Based Approach to Sense-and-Avoid Technology,” AIAA 3rd Unmanned Unlimited Technical
Conference, Workshop and Exhibit, September, 2004.
2Geyer, C., Singh, S., and, Chamerlain, L., “Avoiding Collisions between Aircraft: State of the Art and Requirements for UAVs
operating in Civilian Airspace”, Tech. Report, CMU-RI-TR-08-03, Robotics Institute, Carnegie Mellon University, March, 2008.
3“Sense-and-Avoid Equivalent Level of Safety Definition for Unmanned Aircraft Systems”, NASA Dryden Flight Research
Vehicles,” Proceedings of the AUVSI Unmanned Systems 2015, Atlanta, GA, 4-7 May 2015.
5
Richards, B., Gan, M., Bhandari, S., et al., “Collision Avoidance System for UAVs using Computer Vision,”Proceedings
of AIAA Invotech@Aerospace Conference, FL, 5-9 January 2015.
6Wagster, J., Bhandari, S., et al., “Obstacle Avoidance System for a Quadrotor UAV,”Infotech@Aerospace, Garden Grove,
using Piccolo II Autopilot,” AIAA Atmospheric Flight Mechanics Conference, Honolulu, HI, August 18-21, 2008.
8Meier, L., “PX4 Autopilot Project – Pixhawk,” PX4 Autopilot.
9Wagner, E.R., and Cooney, C.E., “Mass Polar Moment of Inertia (Appendix J),” Universal Joint and Driveshaft Design
Manual, Advances in Engineering Series, No. 7, SAE, Warrendale, PA, pp. 401-405, 1979.
10Roskam, J., “Airplane Flight Dynamics and Automatic Flight Controls,” Lawrence, Kansas, DAR Corporation, 1998.
11Matthew, R., Bhandari, S., et al., “Development and Validation of Flight Dynamics Model of a UAV
Data Visualization,” Proceedings of AIAA Invotech@Aerospace Conference, Kissimmee, FL, 5-9 January 2015.
13
American Institute of Aeronautics and Astronautics