You are on page 1of 13

Development of Guidance, Navigation

and Control System Using FPGA


Technology for an UAV Tricopter
Arturo Cadena, Ronald Ponguillo and Daniel Ochoa

Abstract This paper presents the development of a Guidance, Navigation and


Control (GNC) system for a rotorcraft unmanned aerial vehicle (UAV). The airframe and its associated mathematical model are explained. The vehicle electronics
system is based on a FPGA development board with its peripherals. The GNC
routines were coded using hardware description language VHDL with 32 bits
floating point arithmetic and CORDIC algorithms. An Inertial Navigation System
(INS) complemented by GPS, implemented by an Extended Kalman Filter is
included. A hybrid approach using PID and Fuzzy controllers is proposed for GNC
system design. System identication and calibration was done using a test stand that
includes a gimbal mechanism where the vehicle is xed and a LabVIEW application for control parameters tuning and data visualization purposes. Results
derived from flights tests using the proposed system support our approach for
FPGA based GNC system for the UAV tricopter.
Keywords Unmanned aerial vehicle
navigation system

FPGA

PID

Fuzzy logic

Inertial

1 Introduction
In recent years, small rotor craft UAVs such as Tricopters, Quadcopters and
Hexacopters have been used in an increasing number of applications: aerial
surveillance, reghting, trafc control, precise agriculture, etc. Small UAVs have
A. Cadena (&)  R. Ponguillo  D. Ochoa
Facultad de Ingeniera en Electricidad y Computacin, Escuela Superior Politcnica
del Litoral, Km. 30.5 Va Perimetral, Guayaquil, Ecuador
e-mail: acadena@espol.edu.ec
R. Ponguillo
e-mail: rponguil@espol.edu.ec
D. Ochoa
e-mail: dochoa@espol.edu.ec
Springer International Publishing Switzerland 2017
D. Zhang and B. Wei (eds.), Mechatronics and Robotics Engineering
for Advanced and Intelligent Manufacturing, Lecture Notes
in Mechanical Engineering, DOI 10.1007/978-3-319-33581-0_28

363

364

A. Cadena et al.

simple structures, basic flight capabilities and are intrinsically unstable systems.
External motion perturbations generate linear and angular accelerations that can
cause a collision if are not compensated within few milliseconds. For autonomous
flight, in which a pre-dened path must be followed, these systems combine
guidance and navigation operations into a single unit, hence the name of Guidance,
Navigation and Control (GNC) system.
A GNC system typically consists of a guidance law, a controller and navigation
algorithms. GNC controllers for small UAVs take as input data from low-cost
global positioning devices (GPS) and Micro-electromechanical inertial sensors
(MEMS). Despite its low-accuracy a GPS device provides long term flight stability,
however they are useless in indoor environments. In such case data from inertial
sensors is used instead. The noise of low-cost GPS and MEMS devices degrade the
performance of classic controllers. Usually, to reduce the effect of noise the
Extended Kalman Filter (EKF) is employed to estimate the true position and orientation of the UAV as a preprocessing step.
Several techniques have been proposed to improve the design of GNC controllers for small UAVs: PID (Arducopter 2015), neural based algorithms (Badia
et al. 2007), genetic algorithms (Artale et al. 2014), nonlinear adaptive control (Cai
et al. 2007; Barks 2012; Salazar et al. 2006), etc. Although these techniques have
proven adequate in terms of stabilization accuracy, their practical use is constrained
by the computational resources of the UAVs on-board computer. Ideally, a controller should process input data and compute the controllers output in near real
time with the smallest possible memory usage. Several computing technologies
have been used in UAVs: microprocessors, ASIC and DSPs. Recently, FPGA has
become a viable alternative for control system implementation due to its system
design flexibility and low-power consumption. FPGAs can execute computing tasks
sequentially, concurrently or a combination of both approaches. Hence, complex
GNC routines can be implemented readily. Moreover, FPGA facilitates the integration of additional modules for specic tasks such as in flight data acquisition.
The use of FPGA in small UAVs is not new in Franois et al. (2009) a genetic
algorithm for UAV planning was proposed. However, to the best of our knowledge
this is the rst attempt to implement a stabilization sub-system in this platform. This
paper describes the implementation of a GNC system for a tricopter that runs on a
low-cost FGPA board. The GNC controller uses a PID-Fuzzy controller that
exploits concurrent programming techniques. To improve computation performance each VHDL code module uses 32 bits floating point arithmetic and
high-speed floating-point CORDIC algorithm. The system was simulated and then
tested in a controlled environment.
The paper is organized as follows: First, the methodology used is presented. The
mathematical model of the airframe is described. Section 4 describes the electronic
components. The implementation of a modular GNC using VHDL modules and
experimental results are discussed in Sects. 5 and 6. Finally, conclusions and future
works are given. Our paper has several contributions: a set of criteria for building a

Development of Guidance, Navigation and Control System

365

low-cost UAV tricopter, a PID-Fuzzy controller implemented on a dedicated FPGA


and statistics about computational resources used in FPGA based implementation of
a GNC system.

2 Methodology
The tricopter used in this work has three rotors and one servo. Based on its kinematic and dynamic model the GNC system was designed. The vehicle has two
operation modes, remotely controlled and fully autonomous. For PID-Fuzzy controller tuning and calibration of INS a test stand is used. This setup allows the
UAVs to move freely while flight dynamics data is collected. The state vectors from
the controller are sent to a computer via radio link and processed to obtain the
controllers optimal parameters. These parameters are then stored in the FPGAs
memory and used during flight. Figure 1 depicts the elements our experimental
setup.

3 Mechanics
The developed tricopter was designed to carry out surveillance missions. The tricopter has a small acoustic emission and a low visual silhouette, basic requirements
for surveillance missions (Lin et al. 2015). Our tricopter has a T shape and it is
made of structural aluminum. The vehicle has three rotors with 10 4.5 mm
propellers and 42 cm distance between each other. The tricopter employs brushless
motors D2836/8 with a peak power of 336 W. The aft rotor has tilting capability to

Fig. 1 Experimental setup for GNC system design

366

A. Cadena et al.

change the tricopters heading, this rotor is mounted on a servomotor controlled


base. The FPGA development board and its peripherals are located at the geometrical center of the airframe. Other hardware components were placed accordingly to keep the center of gravity near to the barycenter the frame. Excessive
vibration negatively affects the performance of the INS. Hence, the Inertial
Measurement Unit (IMU) was mounted in the airframe on a vibration insulator.
Finite Elements Analysis (FEA) was carried out to determine the stress and
structural vibration (Inman 2007) of the frame. Once all components were mounted
the total vehicles weight was 1150 g.
The orientation of an UAV can be described by Euler angles. The orientation of
the airframe with respect to a reference frame is dened by the angles pitch(), roll
(), and yaw() along the y, x, and z axis respectively. The test stand has a central
shaft along the z axis, on the top of this shaft is located a gimbal where the vehicle
is attached with a set of screws, near to the vehicles center of gravity. This
conguration allows three rotational degrees of freedom: pitch, roll and yaw. The
central shaft also can displace up and down along the z axis giving the translational
degree of freedom of heave. The differential equations of the 6 degrees of freedom
describing the translational motion, rotational motion, and kinematics are given
below (Sai and Hla 2015):
u_ rv  qw  g sin h FX =m

v_ ru  pw  g sin cos h Fy =m

w_ qu  pv  g cos cos h Fz =m

p_ Iyy  Izz qr/Ixx L=Ixx

q_ Izz  Ixx pr/Iyy M=Iyy

r_ Ixx  Iyy pq/Izz N=Izz

p q sin tan h r cos tan h

h_ q cos  r sin

_ q sin r cos sec h


W

where (Fx, Fy, Fz) are external forces, (L, M, N) are external moments acting on the
center of gravity, (u, v, w) are translational velocities, (p, q, r) are rotational
velocities and (Ixx, Iyy, Izz) are the inertial moments of the vehicle. These equations
are used to design our PID-Fuzzy control approach as explained in Sect. 5.

Development of Guidance, Navigation and Control System

367

4 Electronics
The tripcoters electronic components are presented in Fig. 2. The main element is
the onboard computer a FPGA development board (TERASIC DE0 nano).
The FPGA reads data from a set of kinematic sensors and radio frequency
(RF) communication devices to generate guidance commands codied as PWM
signals to the ESC (Electronic Speed Controller) and the aft servo motor. The
brushless motors are driven by the ESC with 50 Hz PWM signals, each ESC can
drive currents up to 20 A. The servo is controlled by a 50 Hz PWM signal. The
sensors and communication devices are connected to the FPGA development board
by an IDE port through a daughter card, the port include power supply pins with 5
and 3.3 V.
The sensor suite includes an IMU (Inertial Measurement Unit) CH6 Robotics
UM6 composed by 3 axis accelerometer and gyroscope, a 12 channels GPS
Parallax and a LV Ultrasonic Rangender Maxsonar to measure the distance to the
ground. The communication devices are a XBee Pro 900 MHz radio module and a
six channel 2.4 GHz Radio Control receiver as a backup for manual control. The
same XBee RF device is used to send data to the PC during the calibration phase.
Additionally, there is a serial port in the FPGA development board for GNCs
algorithms debugging. The power supply is a Li-Po battery of 11.1 V, 2500 mAh,
25 C. A step-down voltage regulator feeds with 5.2 V the FPGA development
board. According to our tests this conguration allows for up to 10 min of flight.

Fig. 2 Tricopter electronics components layout

368

A. Cadena et al.

5 Guidance, Navigation and Control System


All functions of the vehicle are implemented on VHDL modules that run on the
FPGA development board at 50 MHz. The VHDL modules were divided in two
layers:
A low layer that implements communication protocols for sensors and communications devices, RAM (Random Access memory) managing and generation
of PWM signals.
An upper layer that implements the Guidance, Navigation and Control System.
The VHDL modules layout is depicted in Fig. 3.

Fig. 3 VHDL hardware layout

Development of Guidance, Navigation and Control System

369

Each sensor has an associated communication protocol, the IMU uses SPI, the GPS
uses NMEA 0183 and the ultrasonic range nder uses RS232 with TTL levels. The
communication protocols were implemented in independent VHDL modules.
These VHDL modules send its lectures to a pair of RAM called RAM A and RAM B
every 20 ms through a data bus of 16 bits and have alarm flags in case of sensor
malfunction. The RAM has 64 words of 16 bits and they are implemented with FPGA
M9K Embedded Memory Blocks. The write and read processes are driven by a VHDL
module. RAM A is accessed by the upper layer and a VHDL module that manages RF
communications. The RAM B is accessed by a VHDL module that controls serial
communications between the FPGA development board and a PC.
The communication routines with the RF XBee devices are splitted in two
modules for transmission and reception tasks respectively. The RF XBee Tx
module reads the content of the RAM A after the update process and generates a
data frame with a checksum. This data frame is processed by the LabVIEW
application, running on a PC that logs flight parameters. The RF XBee Rx
module receives a data frame from a PC. The data frame is encrypted and contains
commands from the operator such as update flight trajectory or return to base. The
transmission time of the data frames between the RF modules is less than 17 ms.
The Radio Control Receiver module reads the PWM signals from the Receiver
allowing to the operator a manual flight operation with line of sight. The PWM
signal generator module generates 50 Hz PWM control signal for the ESC and aft
servo with 8 bits of resolution, with a duty cycle that in the [1500 1900] s range.
The upper layer is formed by a single VHDL module that contains several
sub-modules that implement logic and mathematical operations for GNCs tasks.
The mathematical operations are based on IEEE 754 32 bit floating point arithmetic
(Grover and Soni 2014). The trigonometric functions are implemented by high
speed floating-point CORDIC algorithm (Singh and Bhad 2013). The implementation of the operations addition, subtraction, multiplication, division and CORDIC
using VHDL code take advantage of the FPGA design flexibility to decide what
process will be concurrent or sequential. All algorithms were simulated with
ModelSim to avoid overflows and singularity points. Implementation was done
using logic operators and states machines to achieve processing time below 20 ms.
This ensures real time capability for UAV applications and reduce the number
FPGA logic elements.
The vehicle uses a classical GNC architecture that is shown in Fig. 4. The
function of guidance system is to determine the reference coordinates where the
tricopter has to go. We used a fairly simple algorithm called Line of Sight (Caccia
2004) that generates the reference yaw angle.
wref arctan 2yref  yest ; xref  xest

10

The mission manager provides the list of coordinates of a flight path. The INS
estimates position, velocity and attitude of the vehicle with respect the reference
frame. Since the INS uses low cost IMU input data presents errors such as bias,
scale factors, random walk noise and temperature internal compensation.

370

A. Cadena et al.

Fig. 4 Guidance, navigation and control system architecture

The Baseline of the Navigation System is the EKF that fuses data captured from the
IMU, GPS and range nder sensors. The EKF was constructed using the discrete
Kalman lter equations described in (Welch and Bishop 2001). The EKF requires a
dynamical model of the vehicle and the noise process in order to minimize the
errors of the estimated state vector. The estimated state vector by the EKF is send to
the PC.
The vehicles automatic control is based on PID and a Fuzzy controller, this
architecture allows a faster and precise response. The automatic control drives four
vehicles degree of freedom: the Euler angles and the altitude. For this application
the gain of the integral controller is zero. The architecture of the proposed controller
is presented in Fig. 5.
The PID controllers are implemented by the discrete equation type A (Szafranski
and Czyba 2011)
Kd
ek  2ek  1 ek  2
Ts
Kp ek  ek  1 Ki Ts ek

uk uk  1

11

where k is the sample number, e(k) error signal, u(k) controller output, Ts sampling
period, Kp proportional gain, Ki integral gain and Kd derivative gain. This equation
was implemented with VHDL code. For Fuzzy controller implementation there are
many membership function (Vuong et al. 2006), the most commonly used for
UAVs are the triangular, trapezoidal and gaussian membership functions. We chose
the triangular and trapezoidal functions. These functions are suitable for VHDL
implementation using IFTHEN sentences. The proposed membership rules to
describe the flight dynamics are:

Too negative: m_neg


Negative: neg
Zero: zero
Positive: pos
Too positive: m_pos

Development of Guidance, Navigation and Control System

371

Fig. 5 Automatic control system architecture

Fig. 6 Membership function for

d
dt et

Figure 6 shows the membership function for dtd et. We used the centre of
gravity as the defuzzication method. The GNC system was simulated using
MATLAB/Simulink and then tested on the test stand. The PID-Fuzzy controller
was optimized to fulll three objectives: (1) stability generally measured in the
frequency domain, (2) steady-state accuracy and (3) transient response, rise time,
overshoot and settling time (Rys et al. 2011).

6 Results
The total time to compute an update state vector by the VHDL hardware was less
than 1 ms. Hardware Resource Consumption of the DE0 nano FPGA development
board was 60 % of FPGAs logic elements, 2 PLL, 5 embedded multipliers, 2176
bits of embedded memory and 24 pins of the IDE port. The GNC tests are divided
in three stages. The rst stage checks correct performance of the VHDL modules of
the lower layer and simulation of the GNC algorithms using MATLAB/Simulink.
Every communication protocol for sensors and RF devices was veried after the
implementation of the corresponding VHDL module using applications that runs on
a PC like Hyperterminal and LabVIEW. In the second stage a calibration process
was carried out using the test stand for system identication, development of the

372

A. Cadena et al.

PID-Fuzzy controllers and INS. The vehicle was rigidly adjusted to the gimbal by a
set of screws and then the vehicle executed predetermined maneuvers. The information obtained from sensors was used to generate the numeric constants for tuning
the controller. The setup for calibration process using the test stand is shown in
Fig. 1. The data of the test flight was captured from the onboard sensors through the
XBee RF data link. The step response of the PID-Fuzzy controllers was obtained
during the indoor test flight and is shown in Fig. 7. The step response fullls the
controller design requirements. During the indoor test flight was found the optimal
calibration values for the EKF to obtain a performance of accumulative navigation
error of less than 10 % since last GPS position update after 1 h.
Finally, outdoor test flight with winds between 5 and 8 knots was carried out.
Previously were dened two flight trajectories by the waypoints (Suzuki et al.
2012). The rst trajectory is a simple square, the second trajectory is a lemniscate,

Fig. 7 a Indoor flight test. b Outdoor flight test

Fig. 8 Flight test results: outdoor way point and followed path

Development of Guidance, Navigation and Control System

373

path commonly used for surveillance purposes. The coordinates were downloaded
to the RAM of the FPGA. The vehicle followed the waypoints successfully compensating external perturbation by winds. Figure 8 shows the paths followed by the
vehicle during the test. After the PID-Fuzzy tuning process for the roll and pitch
channels, the resulting values of the Kd gain are a bit higher than expected. Usually
a high value of Kd generates a fast response with an overshoot (Srikanth et al. 2013)
but is compensated by the fuzzy logic controller, this characteristic is useful in flight
with heavy wind condition. The vibration affects the performance of the INS,
during the tests was necessary to relocate the IMU along the central body of the
airframe to obtain a better performance (Fig. 9).

Fig. 9 Flight test results: controller step response

374

A. Cadena et al.

7 Conclusions and Future Works


This paper presented a FPGA-based real time GNC implemented by VHDL
modules. The FPGA accomplished the required computational resources demanded
by the GNC algorithms using 32 bits floating point arithmetic and CORDIC
algorithms. The GNC development process was showed. The tricopter was successfully controlled by the GNC based on EKF and PID-Fuzzy algorithms. The
stability control and waypoint navigation using the INS were successfully veried
by the flight tests. The PID-Fuzzy controller showed good resistance against wind
obtaining a steady flight. The future work will be to improve the GNC with a
self-tuning PID-fuzzy controller based on neural networks or genetic algorithms.

References
Arducopter manual on-line http://copter.ardupilot.com/wiki/tuning/, visited 2015.
Artale, V., Milazzo, C., Calogero, O., & Ricciardello, A. (2014). Genetic algorithm applied to the
stabilization control of a hexarotor. In Proceedings of the International Conference on
Numerical Analysis and Applied Mathematics 2014 (ICNAAM-2014). doi:10.1063/1.4912983
Badia, S., Pyk, P., & Verschure, P. (2007). A fly-locust based neuronal control system applied to
an unmanned aerial vehicle: The invertebrate neuronal principles for course stabilization,
altitude control and collision avoidance. The International Journal of Robotics Research July
2007, 26, 759772.
Barsk, K. (2012). Model predictive control of a tricopter. Master thesis, Linkopings Univer-sitet,
Linkoping, Sweden.
Caccia, M. (2004) Preliminary sea trials of SESAMO: An autonomous surface vessel for the study
of the air-sea interface. CNR-ISSIA Sez. Di Genova, Tech. Rep. Rob-04-SESAMO pt.
Cai, G., Chen, B., Peng, K., Dong, M., & Lee, T. (2007). Design and implementation of a
nonlinear flight control law for the yaw channel of a UAV helicopter. In 2007 46th IEEE
Conference on Decision and Control (pp. 19631968), December 1214, 2007.
Franois, C., Mohamed, T., Gilles, L., & Giovanni, F. (2009). FPGA implementation of genetic
algorithm for UAV real-time path planning. Journal of Intelligent and Robotic System 2009,
54, 3. doi:10.1007/s10846-008-9276-8
Grover, N., & Soni, M. (2014). Design of FPGA based 32-bit Floating Point Arithmetic Unit and
verication of its VHDL code using MATLAB. International Journal of Information
Engineering and Electronic Business, 1, 114.
Inman, D. (2007). Engineering vibration (3rd Ed.). London: Pearson.
Lin, E., Tan, B., Goh, J., Mok, N., Vengadashalapathy, L., Yoong, T., & Srigrarom, S. (2015).
Development of UGS tilt-rotor surveillance tricopter UAV. Journal of Applied Science and
Engineering, 18(2), 177186.
Rys, A., Czyba, R., & Szafranski, G. (2011). Practical aspects of trirotor MAV development. In
Proceedings of the International Micro Air Vehicles Conference 2011 (Summer Ed., pp. 64
69), Harde, The Netherlands.
Sai, K., & Hla, M. (2015). Modeling and analysis of tri-copter (VTOL) aircraft. International
Journal of Emerging Engineering Research and Technology, 3(6), 5462.
Salazar, S., Kendoul, F., Lozano, R., & Fantoni, I. (2006). Real-time control of a small-scale
helicopter having three rotors. In International Conference on Intelligent Robots and Systems
(pp. 29242929), Beijing, China.

Development of Guidance, Navigation and Control System

375

Singh, A., & Bhad, D. (2013). Analysis of simple CORDIC algorithm using MATLAB.
International Journal of Scientic & Engineering Research, 4(6).
Srikanth, G., Tarun, A., Sai, K., Suraj, C., Ramesh, G., & Veena, D. (2013). Design of multicopter
test bench international. Journal of Modeling and Optimization, 3(3).
Suzuki, S., Ishii, T., Okada, N., Iizuka, K., & Kawamura, T. (2012). Autonomous navigation,
guidance and control of small electric helicopter. INTECH International Journal of Advanced
Robotic Systems.
Szafranski, G., & Czyba, R. (2011). Different approaches of PID control UAV type quadrotor. In
Proceedings of the International Micro Air Vehicles conference 2011 (Summer Ed.).
Vuong, P., Madni, A., & Vuong, B. (2006). VHDL implementation for a fuzzy logic controller.
World Automation Congress (WAC), Budapest, Hungary.
Welch, G., & Bishop, G. (2001). An introduction to the Kalman lter. In Computer graphics.
Annual conference on computer graphics & interactive techniques. Addison-Wesley, Los
Angeles, CA, USA: ACM Press. SIGGRAPH 2001 course pack edition, course No. 8.

You might also like