0% found this document useful (0 votes)
15 views8 pages

Embedded Control for Quadrotor UAVs

This conference paper presents the development of an embedded control system for autonomous quadrotor UAVs using low-cost components and open hardware architecture. The system allows users to implement and test new control algorithms, overcoming limitations of existing commercial flight controllers. The paper details the dynamics, control strategies, and hardware components involved in creating a customizable flight controller based on Raspberry Pi.

Uploaded by

samuelutoh293
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views8 pages

Embedded Control for Quadrotor UAVs

This conference paper presents the development of an embedded control system for autonomous quadrotor UAVs using low-cost components and open hardware architecture. The system allows users to implement and test new control algorithms, overcoming limitations of existing commercial flight controllers. The paper details the dynamics, control strategies, and hardware components involved in creating a customizable flight controller based on Raspberry Pi.

Uploaded by

samuelutoh293
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

See discussions, stats, and author profiles for this publication at: [Link]

net/publication/329956488

A Project of an Embedded Control System for Autonomous Quadrotor UAVs

Conference Paper · November 2018


DOI: 10.1109/LARS/SBR/WRE.2018.00091

CITATIONS READS
11 3,428

4 authors, including:

Augusto de Holanda B. M. Tavares Alisson Vasconcelos Brito


Federal University of Paraíba Federal University of Paraíba
11 PUBLICATIONS 69 CITATIONS 134 PUBLICATIONS 642 CITATIONS

SEE PROFILE SEE PROFILE

Tiago P. Nascimento
Federal University of Paraíba
104 PUBLICATIONS 1,357 CITATIONS

SEE PROFILE

All content following this page was uploaded by Tiago P. Nascimento on 02 June 2019.

The user has requested enhancement of the downloaded file.


2018 Latin American Robotic Symposium, 2018 Brazilian Symposium on Robotics (SBR) and 2018 Workshop on
Robotics in Education (WRE)

A Project of an Embedded Control System for Autonomous Quadrotor UAVs

Sarah Pontes Madruga∗ , Augusto de Holanda B. M. Tavares∗ , Alisson Vasconcelos de Brito∗ and Tiago Pereira Nascimento∗
∗ Embedded Systems and Robotics Laboratory (LaSER)
Federal University of Paraiba,
Joao Pessoa, Paraiba, Brazil
Emails: [Link]@[Link], augustotava@[Link], alisson@[Link], tiagopn@[Link]

Abstract—In this paper, we developed an embedded sys- [8], the flight controller was developed using an embedded
tem for a flight controller applied to quadrotor UAVs. Built system based on FPGA; in [9], a navigation control system
with accessible and low cost components, open hardware for indoor quadcopters is proposed, using an APM as flight
architecture and open software, it makes possible the tests
and implementation of new control algorithms by the user, controller and a Raspberry Pi for data processing; in [10],
setting it apart from the most common alternatives available an Arduino based system is used to control UAVs through
on the market. For this device, we developed a sensoring GSM.
system for capturing and recording the quadrotor odometry,
an architecture to send the angular velocity commands to the Given the amount of tasks the UAV has to accomplish and
motors via PWM, and the processing is made on a Raspberry their nature, to operate normally and execute even its most
Pi 3. basic functions, it is necessary to have a group of devices
Keywords-Quadcopter; controller; UAV; embedded system; acting together in an independent and integrated manner, and
the data (position, orientation, or any other sensor essential
I. I NTRODUCTION for the specificity of the mission to be performed) collected
by them need to be processed. Thus, an embedded system
In the last decade, Unmanned Aerial Vehicles (UAV) have
is needed in the UAV to guarantee its autonomy.
been widely used to facilitate human life. They can perform
difficult or dangerous missions, for example, military ones There are some flight controller platforms available on
[1], or make civilian tasks more efficient, like package the market [6], [7]. Among them, we can cite mainly the
delivery. APM and PixHawk series, which are Arduino based and
In spite of the quadrotor simple mechanical configuration, some of the most used by enthusiasts. The main issue
its dynamical behavior makes the aircraft control complex, with those boards is the closed operation of the controller.
because it is, in fact, an underactuated nonlinear system [2]. They use a PID controller, which allows customization only
That is, there are only four rotors to generate input throttles by modifying its gains, and that control law cannot be
to control the six degrees of freedom in the output. substituted. This makes the research for new control methods
Furthermore, quadrotor UAVs are considered classic un- in the UAV area quite complicated, since the accessible and
stable dynamical systems [3]. Hence, the research and well documented devices cannot be used for this purpose.
study of suitable control algorithms to achieve stability is
Some solutions to this matter started to arise in the
indispensable, especially in an area where the interest of the
last year, however, they are not necessarily easy to access.
community only grew in the last few years [4], [5].
MatLab R
provided, in the January 2018 update, integrated
Regardless of the relevance and increase in the study
support for two types of PARROT quadcopters, the Mambo
of control algorithms for UAVs, it is still difficult to find,
Minidrone and the [Link] [11], [12], promising the
in the market, a proper, accessible and adaptable flight
design of control algorithms with the aid of Simulink R
.
controller platform to perform experiments where the user
Despite being a very attractive approach, this option is
can apply their own codes and algorithms. The vast majority
limited to a specific kind of drone, from a specific brand,
of alternatives available, despite having open software, do
and can also be very monetarily expensive. Its recent launch,
not allow the implementation of a new control law, only the
though, shows the relevance and need of platforms to test
tuning of a pre-existent one, because of the way they were
new algorithms for UAVs.
developed and built [6], [7]. These devices were designed
for those users who want to operate their quadcopter, not This paper proposes an open hardware architecture based
necessarily use it for research and tests, that is why we are on Raspberry Pi for a flight controller applied to quadrotors,
faced with those characteristics. where the operation of every component is specified, with
In the available literature, it is possible to find the de- the objective a high-degree of customization in the experi-
velopment of flight controllers based on various boards. In ments, according to the needs of the researcher or user.

978-1-5386-7761-2/18/$31.00 ©2018 IEEE 483


DOI 10.1109/LARS/SBR/WRE.2018.00091
Jb is the inertia of the quadcopter relative to the body
frame, and Jxx , Jyy and Jzz are the inertia of the quadcopter
across each body frame axis.
Next, come the thrust and torque coefficient relations.
The thrust T of a single motor/propeller system can be
calculated by Equation 2, where cT is the lumped parameter
thrust coefficient dependent on the rotor specifications, the
air density, the radius of the rotor; and ω is the angular
velocity of the rotor.

T = cT × ω 2 (2)
Figure 1. Axis configuration and details about important variables in the
quadrotor model.
Similarly, it is possible to demonstrate Equation 3, for
the torque coefficient. In this case, cQ refers to the lumped
parameter torque coefficient, Q is the torque, and and ω is
II. M ODELING AND C ONTROL OF A Q UADCOPTER still the angular velocity of the rotor.

The quadcopter is made of a rigid structure generally in Q = cQ × ω 2 (3)


form of X. At the end of each arm, there is a motor and
a propeller with fixed and parallel rotation axis. Opposite With this information, Equation 4 shows a matrix that
motors rotate in the same sense, which should be contrary describes the thrusts and torques on the system, where d is
to the rotation of the other pair of motors. This balances the the distance between the motors and their respective axes of
system torque as a whole and eliminates the need of an extra rotation.
rear rotor, like in traditional helicopters [13]. Figure 1 shows ⎡ ⎤ ⎡ ⎤ ⎡ 2⎤
ΣT cT cT cT cT ω1
an example of a drone structure and the axis configuration
⎢ τφ ⎥ ⎢ 0 [Link] 0 −[Link] ⎥ ⎢
⎢ ω22 ⎥

used in this paper. ⎣ τ ⎦ = ⎣−d.c 0 [Link] 0 ⎦ ⎣ω32 ⎦
(4)
θ T
Even though the quadcopter has six degrees of freedom, τψ −cQ cQ −cQ cQ ω42
there are only four rotors to send control its behavior, that
is, we have and underactuated system. The variables used to Following, it is important to highlight the Throttle Com-
best control the system are: Throttle, Roll, Pitch and Yaw, mand Relation, presented in Equation 5. Here, ωss is the ex-
also specified in Figure 1. pected steady-state motor RPM, (T hrottle%) is the throttle
Table I shows the influence of the motors in the resulting percentage command, cR is the throttle % to RPM conversion
motion of the aircraft. Here, ω is the angular velocity of coefficient, and b is the y-intercept of the linear regression
each rotor. relationship [14].

Table I
ROTOR SPEED INFLUENCE ON QUADCOPTER MOTION
ωss = (T hrottle%)cR + b (5)

ω1 ω2 ω3 ω4 For the final matrix, we also need to take into account the
z (Throttle) ↑ ↑ ↑ ↑ gyroscopic forces resulting on the body, which are governed
θ (Pitch) ↓ - ↑ - by the inertia of each motor rotating components (Jm ), the
φ (Roll) - ↑ - ↓
rolling and pitching rates (P and Q) and the speed of each
ψ (Yaw) ↓ ↑ ↓ ↑
motor/prop system (ωi ). Hence, Equations 6 and 7 present
the gyroscopic torques created by the motors for pitch and
roll action.
A. Quadcopter Dynamics π
For the dynamic modeling, we will start by presenting τφgyro = Jm Q (ω1 − ω2 + ω3 − ω4 ) (6)
30
the inertia matrix for the quadrotor in Equation 1 [14], [15].
This matrix describes the quadcopter mass moment of inertia π
across the axes and is fundamental to the flight dynamics of τθgyro = Jm P (−ω1 + ω2 − ω3 + ω4 ) (7)
30
the system.
Finally, we can construct the final matrix, which refers
⎡ ⎤ to the moments present in the body frame resulting from
Jxx 0 0
the aerodynamics, thrusts, and torques on the system. See
Jb = ⎣ 0 Jyy 0⎦ (1)
Equation 8.
0 0 Jzz

484
⎡ π

[Link] .ω22 − [Link] .ω42 + Jm Q 30 (ω1 − ω2 + ω3 − ω4 )
M = ⎣−[Link] .ω12 + [Link] .ω32 + Jm P 30
π
(−ω1 + ω2 − ω3 + ω4 )⎦
−cQ .ω12 + cQ .ω22 − cQ .ω32 + cQ .ω42
(8)
B. Quadrotor Control Strategy
The Proportional Integral Derivative Control technique is
largely used in quadcopters, especially for attitude control.
Classic or modified PIDs can be easily found in most
commercial flight controllers [6], [7], and also in recent
literature related to the subject [16], [17], [18], [19], [20].
Therefore, this type of controller was chosen as an exam-
ple of a possible application of the architecture and sensoring
proposed in this paper. We would like to emphasize though
that the device developed here allows the user to apply their
own control algorithms to the plant.
The PID controller reads the data from the sensors and
estimates the ideal angular velocity the motors should have
Figure 3. Drone assembled and used in the experiments.
so the aircraft can respond correctly to the commands. The
main goal is to correct the error, that is, the difference
between a measured value (usually by a gyroscope) and a
Firstly, the Trajectory Generator block sends the path
desired value. This error can be minimized by adjusting the
commands (x, y) to the Trajectory Controller. This controller
control inputs at each iteration, so that the outputs be the
outputs the roll, pitch and yaw commands to the Attitude
desired ones.
Controller. The altitude (z or throttle) command comes
de(t) directly from the Trajectory Generator.
Correction = K p × e(t) + Ki × e(t) × dt + Kd × (9) The respective adjustments in the motors angular veloci-
dt
ties to achieve the desired behavior in φ , θ , ψ and z will then
Equation 9 shows the PID control law. K p, Ki and Kd are
be sent to the quadcopter, which must possess the adequate
the controller gains to be tuned according to each system;
sensoring for a good State Input feedback and, thereafter, an
the variable e(t) represents the error in position, altitude or
accurate calculation of the error in the next control loops.
attitude, that is, the errors in x, y, φ , θ , ψ or z.
III. P ROJECT OF THE F LIGHT C ONTROL S YSTEM
An autonomous quadcopter has hardware and software
capable of substituting the human guidance during the flight
[6]. Figure 3 shows the drone built for this paper experi-
ments, connected to the flight controller device developed
here.
The quadcopter can be divided into three main parts: the
flight controller, the propulsion system and the sensoring
system.
The flight controller is the UAV’s main board that pro-
cesses information, sends commands to the motors and
receives data from the sensors. In this project, we used a
Raspberry Pi 3 to run the control algorithm and interpret
the data from the sensors connected to it.
For multirotor UAVs, the propulsion system usually con-
Figure 2. Block diagram of the control strategy. sists of brushless DC motors, controlled by Electronic Speed
Controllers (ESC) that send the velocity commands to the
The block diagram for the complete control system, for
motors. The flight controller sends the controller outputs to
position and attitude, can be seen in Figure 2. It is composed
the ESCs, and they send them to the motors. For the drone
of an external loop to control the trajectory, and an internal
in Figure 3, we used four EMAX MT3510 600kV motors and
loop that controls the attitude that must be respected so that
4 Simonk 30A ESCs.
desired path is followed.
The sensors are necessary to detect changes during the
flight or to collect data during the mission. Many types of

485
Figure 4. Complete flight controller device.
Figure 5. Controller scheme with sensors and components.

sensors can be connected to the system, according to the


Aiming to apply this system to an autonomous drone,
desired functionality. We chose to implement the sensors
the roll, pitch, yaw and altitude commands are generated
most used by the community, in our system.
in the program code, inside the Raspberry Pi, and sent to
The Inertial Measurement Unit (IMU) is the major navi-
the controller function. The controller then uses the data
gation component in the UAV. It provides and accelerometer
received from the sensors to calculate the error between
and a gyroscope to estimate the quadrotor attitude, that
the current state and the command. The adequate calculated
is, roll, pitch and yaw vallues in real time to provide
velocities are transmitted to the PWM Module, that sends
feedback to the controller. It also has a barometer, used to
them to the motor/ESC ensemble. The sensoring sends a
measure atmospheric pressure and calculate the altitude of
feedback of the corrected states to the controller, and the
the aircraft, and a magnetometer, which measures magnetic
loop restarts, until the operation is interrupted by the user
fields and can be used in sensor fusion for better accuracy.
or the mission finishes. See Figure 5.
For the sensoring of our quadcopter, we used the GY-86
module, which consists of: IV. E XPERIMENTAL R ESULTS
• IMU MPU6050, that contains a 3-axis accelerometer A. Gyroscope and Accelerometer
and a 3-axis gyroscope. The graphics shown in Figures 6 and 7 trace the results
• Barometer MS5611, pressure sensor with centimeter-
of a bench test, made while rotating the drone in various
level accuracy. directions and examining the readings from the IMU. The
• 3-axis HMC5883L magnetometer.
collected data result from a simple sensor fusion between
To arrive at the motors, the velocity commands need the gyroscope and the accelerometer, in order to eliminate
to pass through the ESCs, which receive them from the some of the noise from the readings.
controller via Pulse Width Modulation (PWM). We used the First the quadcopter was kept in a flat, leveled position,
PWM Module Adafruit PCA9685 connected to the Raspberry facing the north direction (considered zero degrees by the
Pi to send the PWM signals, instead of using the Raspberry IMU); then, a pitch movement was performed, forward and
Pi own PWM, for precision reasons. backwards, followed by a yaw motion, a roll, both ways,
Both the GY-86 and the PWM PCA9685 boards use the and finally returning to the original zero-degree position in
I2 C protocol to communicate with the Raspberry Pi. Each all axis. This activity is clearly represented, in this order, in
ESC is connected to one respective channel on the PWM Figures 6 and 7.
PCA9685 and then to the motors. The system is powered
by a 4 cell LiPo battery. B. Barometer
For the simple and safe connection of all components, a This experiment aimed to obtain an accurate altitude
Printed Circuit Board (PCB) was designed specifically for measurement, using the atmospheric pressure data from the
this system. The Raspberry Pi is connected to the rear part barometer, and verify its centimeter-level precision. These
of the PCB, while the other sensors go on the front part, were bench tests limited to an altitude of 30cm, precisely to
as usual. We have then a “sandwich” connection between check the measurements precision.
boards that, while unorthodox when speaking of PCBs, It is possible to derive the altitude from the pressure using
proved itself quite safe and stable when tested among the Equation 10, where P stands for atmospheric pressure, d
vibrations of the quadcopter. Figure 4 shows the developed is the air density, g is the acceleration of gravity, and h
device highlighting all the components. is the altitude. The gathered results are represented in the

486
C. PWM Module
The PWM Module Adafruit PCA9685 is responsible for
sending the motor velocity commands to the ESCs, which
translate the PWM to a throttle response. Hence, to verify its
behavior, throttle commands were converted to PWM inside
the Raspberry Pi, sent to the ESCs and from them to the
motors. The angular velocity was validated with the help of
a laser tachometer.
The motors response was consistent to the commands and
formed the graphic shown in Figure 9. Notice the initial part
of the curve, that stays at zero value until 7% throttle. This
happens because the motor needs a minimum amount of
Figure 6. Roll, pitch and yaw data. throttle to overcome inertia. This is a unique constant for
each kind of motor and must be obtained experimentally.

Figure 7. Angular Velocities P, Q, R.


Figure 9. Graphical representation of the motors response to the PWM
commands.
graphic in Figure 8. Observe that the reading is indeed very
accurate on a centimeter-level, and that the sensor has a good D. PID Tuning
response to rapid changes in altitude, even if they are small. After establishing the good performance of all com-
ponents that comprise the whole system, we began the
P = dgh (10) practical experiments to determine the adequate tuning for
our controller. To fulfill these tests, it is imperative that all
parts of the system are connected, sending and receiving in-
formation correctly, otherwise the controller will not gather
the necessary data to run the algorithm, and the process is
interrupted.
Unlike other robotic applications, the tuning adjustment of
a quadcopter flight controller cannot be made from scratch
without a test bench, on account of safety, for if the gains are
not adequate, the drone may fly wildly and hurt someone,
or it can fall and damage the components. Especially in a
case like the one proposed in this paper, where there are 12
gains to tune, because there are 4 PIDs running, for roll,
pitch, yaw and altitude.
Therefore, to collect the following data, we made an
adaptation, immobilizing two axis of motion (x and z), while,
in the free axis (y), the values for the controller gains were
Figure 8. Altitude derived from the barometer data. tested, aiming to stabilize the aircraft.

487
Figure 10 presents the output commands from the PID V. C ONCLUSION
controller to one of the motors, white it tries to balance the
drone with the proposed tuning. The process is similar for Throughout this paper, we presented a project of an
the other three motors. embedded system for a flight controller applied to an
autonomous quadcopter. Amidst its advantages, we can
In Figure 11, the PID commands were converted to the
highlight open software and hardware architecture, easy
interval of the PWM signals used here and sent to the ESCs
access components to build the controller on your own,
and motors through the PCA9685 board. Note that they are
and complete user autonomy to implement and test their
limited to a maximum value, to guarantee the safety of the
own control algorithms, unlike the majority of alternatives
system.
available on the market.
For future work, we suggest firstly the implementation and
test of more complex controllers on the device developed
here, for UAVs position, attitude and altitude. Furthermore,
the design and making of an adequate test bench to tune the
controllers correctly.

R EFERENCES

[1] P. G. Fahlstrom and T. J. Gleason, Introduction to UAV


Systems, 4th ed. John Wiley & Sons, 2012.

[2] Y. Bouktir, M. Haddad, and T. Chettibi, “Trajectory planning


for a quadrotor helicopter,” in 2008 16th Mediterranean
Conference on Control and Automation, June 2008, pp. 1258–
1263.

Figure 10. PID outputs sent to the PWM Module. [3] M. T. Hussein and M. N. Nemah, “Modeling and control of
quadrotor systems,” in 2015 3rd RSI International Conference
on Robotics and Mechatronics (ICROM), Oct 2015, pp. 725–
730.

[4] S. MRC, “Uav drones - global market outlook (2017-2023),”


Stratistics MRC, Tech. Rep., 2017.

[5] M. Mazur, A. Wisniewski, and J. McMillan. Clarity


from above: Pwc global report on the commercial
applications of drone technology. [Online]. Available:
[Link]

[6] E. Ebeid, M. Skriver, and J. Jin, “A survey on open-source


flight control platforms of unmanned aerial vehicle,” in 2017
Euromicro Conference on Digital System Design (DSD), Aug
2017, pp. 396–402.

[7] E. Ebeid, M. Skriver, K. H. Terkildsen, K. Jensen,


and U. P. Schultz, “A survey of open-source uav flight
Figure 11. Angular velocity commands sent to the ESc/motor by the PWM controllers and flight simulators,” Microprocessors and
Module. Microsystems, vol. 61, pp. 11 – 20, 2018. [Online]. Available:
[Link]

The only assured way of tuning the controller correctly [8] N. Monterrosa, J. Montoya, F. Jarqun, and C. Bran, “Design,
is using a test bench that allows the drone to move in development and implementation of a uav flight controller
several degrees of freedom, as what is shown in [21] and based on a state machine approach using a fpga embedded
[16]. The quadcopter is a highly nonlinear underactuated system,” in 2016 IEEE/AIAA 35th Digital Avionics Systems
Conference (DASC), Sept 2016, pp. 1–8.
system, tuning each axis separately does not work perfectly,
because the nonlinearities do not allow the application of
[9] Y. Luo, M. J. Er, L. L. Yong, and C. J. Chien, “Intelligent
the superposition principle. Building a test bench to perfectly control and navigation of an indoor quad-copter,” in 2014 13th
tune and test quadcopters was out of the scope of this project International Conference on Control Automation Robotics
though. Vision (ICARCV), Dec 2014, pp. 1700–1705.

488
[10] G. N. Solidakis, F. M. Tsokas, M. C. Batistatos, N. C. Sagias,
G. V. Tsoulos, D. A. Zarbouti, and G. E. Athanasiadou, “An
arduino-based subsystem for controlling uavs through gsm,”
in 2017 6th International Conference on Modern Circuits and
Systems Technologies (MOCAST), May 2017, pp. 1–4.

[11] MathWorks. Parrot minidrones support from simulink.


[Online]. Available: [Link]
support/[Link]

[12] ——. [Link] 2.0 support from embedded coder. [Online].


Available: [Link]
[Link]

[13] T. Bresciani, “Modelling, identification and control of a


quadrotor helicopter,” Ph.D. dissertation, Lund University, 10
2008.

[14] D. Hartman, K. Landis, M. Mehrer, S. Moreno, and


J. Kim. Parameter driven simulink model for quadcopter
simulation and control system design. [Online]. Available:
[Link]
quad-sim

[15] R. Mahony, V. Kumar, and P. Corke, “Multirotor aerial


vehicles: Modeling, estimation, and control of quadrotor,”
IEEE Robotics Automation Magazine, vol. 19, no. 3, pp. 20–
32, Sept 2012.

[16] E. Paiva, J. Soto, J. Salinas, and W. Ipanaqu, “Modeling,


simulation and implementation of a modified pid controller
for stabilizing a quadcopter,” in 2016 IEEE International
Conference on Automatica (ICA-ACCA), Oct 2016, pp. 1–6.

[17] E. A. Paiva, J. C. Soto, J. A. Salinas, and W. Ipanaqu,


“Modeling and pid cascade control of a quadcopter for trajec-
tory tracking,” in 2015 CHILEAN Conference on Electrical,
Electronics Engineering, Information and Communication
Technologies (CHILECON), Oct 2015, pp. 809–815.

[18] M. O. R.A. Garca, F.R. Rubio, “Robust pid control of the


quadrotor helicopter,” in IFAC Proceedings Volumes, 2012,
pp. 229–234.

[19] M. A. Lukmana and H. Nurhadi, “Preliminary study on un-


manned aerial vehicle (uav) quadcopter using pid controller,”
in 2015 International Conference on Advanced Mecha-
tronics, Intelligent Manufacture, and Industrial Automation
(ICAMIMIA), Oct 2015, pp. 34–37.

[20] N. H. Abbas and A. R. Sami, “Tuning of pid controllers for


quadcopter system using hybrid memory based gravitational
search algorithm particle swarm optimization,” 2017.

[21] H. Wang, D. Azaizia, C. Lu, B. Zhang, X. Zhao, and Y. Liu,


“Hardware in the loop based 6dof test platform for multi-
rotor uav,” in 2017 4th International Conference on Systems
and Informatics (ICSAI), Nov 2017, pp. 1693–1697.

489

View publication stats

You might also like