You are on page 1of 6

International Conference on Inventive Systems and Control

(ICISC-2017)

Low-cost Arduino based Architecture for Simulation and Control of


Quadrotors
Aditya Khavnekar1 Jinil Gondalia2 Dr. Dhruv Shah3
School of Technology School of Technology School of Technology
Management and Engineering Management and Engineering Management and Engineering
NMIMS university, NMIMS university, NMIMS university,
Mumbai, India. Mumbai, India. Mumbai,India.
adityakhavnekar.nmims@gmail.com jinilgondalia.nmims@gmail.com dhruv.shah@nmims.edu

Abstract— Quadrotor or popularly known as quadcopter is


an unmanned flying robotic platform that is driven by four
fixed rotors. Quadrotors serve as a perfect flying platform in
an anonymous and intricate environments eliminating the need
to jeopardize human life in such hazardous situations. Apart
from serving as a stable flight stage, these can do breath-
taking acrobatic and complex maneuvers that are beyond the
scope of the conventional aerial vehicles. There has been a
tremendous surge in funding for research and development
of such Unmanned Aerial Vehicles (UAV) as the investors
are very well aware of the influence these robots have in
military as well as civilian market. However the flip side
to these overwhelming abilities the quadrotors have is the
need for a robust and an efficient control model. The system
designing process is a complex integration of aero-modeling
and apt control techniques for stability. Multiple parameters
need to be co-ordinated in real time for a smooth control
of a multi rotor vehicle. This generally results in complex
algorithms which increase computation requirements that can
be costly. On the other hand cost reduction implies limitations in
performance or poor control. This paper focuses to solve these
challenges by dramatically simplifying the complexity of control Fig. 1. Cross beam structure for quadrotor[9]
algorithms without compromising on performance parameters
of the quadrotor following strict cost constraints. We streamline
the mathematical model simulations and the use of PD and PID
control techniques by constraint based optimization that results
in a simple, cost-effective and a robust control model. Through
rigorous simulations and testing we not only obtain a faithful
control model but also execute a self-leveling feature making to push the quadrotor in. The quadrotor exhibits six degrees
the quadrotor smart. We also discuss the future possibilities for of freedom (6DOF) which implies three translational and
low-cost autonomous navigation in indoor environments. three rotational motions. The translational motions define the
position of the quadrotor in-terms of Cartesian co-ordinates
I. INTRODUCTION (x, y, z) in the body frame.The rotational motions define
Quadrotors belong to the category of Vertical Take-Off and the behavior of the quadrotor in the inertial frame which
Landing Vehicles (VTOL) which prove to have remarkable consists of Roll(Φ), Pitch(θ ) and Yaw(ψ) movements[3].
advantages over conventional helicopters. The configuration The exciting part for the control design of the quadrotor is
of VTOL vehicles proves to be attractive for applications that it has only 4 inputs and 6DOF rendering it to be an under
involving tight space constraints. The hovering of a conven- actuated system. The angular velocities( Ω1 , Ω2 , Ω3 , Ω4 ) of
tional helicopter involves complex mechanical linkages and the propellers serve as the input parameters to propel the
rotor actuation. This is eliminated due to structural design of quadrotor in the air[3]. The angular velocities of all the
the quadrotor shown in figure-1 resulting in simplification of four rotors must be equally increased. For stable hovering
mechanical hovering. The quadrotor is a structure involving the generated torque(τ) must be in equilibrium i.e.(Ω1 =
cross beam and four fixed rotors. The rotors are placed at Ω2 = Ω3 = Ω4 )so there is no pivoting movement[3]. The
the edge of the cross beam in two pairs in counter rotating pitch forward or pitch backward movement is achieved by
configuration[3]. The green arrow indicates the direction of changing the speed of rear and front rotors respectively. For
the nose of the quadrotor. The orange arrows define the rolling the quadrotor the speed of the rotors on either side
direction that the torque(τ) thats produced by the motor tries (left or right) has to be increased or decreased.

978-1-5090-4715-4/17/$31.00 ©2017 IEEE 1


International Conference on Inventive Systems and Control
(ICISC-2017)

Fig. 3. Sub-system for simplification of one of the equations of motion


Fig. 2. Quadcopter configurations[9]

where m=mass of the quadrotor and a=acceleration. The


II. DYNAMIC MODELING AND SIMPLIFICATION OF rotational motion is given by the equation
E QUATIONS OF MOTION (EOM)
A. Mathematical Modeling
∑ τ = J ω̇ (2)

The mathematical modeling of the quadrotor is based Based on the above assumptions and simplifications we
on the vast amount of work that has been carried out derive our dynamic model which is a set of equations
by C. Balas[3], S. Bouabdallah[4] and using the Euler- of motion. These are highly coupled non-linear dynamic
Lagrangian and Newtonian approaches. We use the standard equations[3]; however we dramatically simplify them but
approaches and obtain our own derived dynamic model. keep them effective for governing the control over the
Standard assumptions have been taken into consideration and quadrotor. The standard model equations[4] are as follows
we make a few of our own assumptions that are realistic and which describe the moment of inertia along the axes of the
reasonable. The standard assumptions are as follows- The quadrotor.
structure of quadrotor is rigid in nature. It is symmetrical
and the origin of the frame and center of gravity coincide. Ixx φ̈ = θ̇ ψ̇(Iyy − Izz ) + Jr θ̇ Ωr + τx (3)
Few pre-requisites are needed for a clear understanding of the Iyy θ̈ = φ̇ ψ̇(Ixx − Izz ) + Jr Ω̇r + τy (4)
dynamics, these are - The dynamic modeling of the quadrotor
is always carried out with the aid of body frame and inertial Izz ψ̈ = θ̇ φ̇ (Ixx − Iyy ) + τz (5)
frame.
τx = bl(Ω24 − Ω22 ) (6)
The figure-2 shows a plus (+) and X type alignment. The
body frame is defined by the orientation of the quadrotor τy = bl(Ω23 − Ω21 ) (7)
whereas the inertial frame is governed by the earth/ground.
(negative z-axis pointing towards ground). The relation be- τz = d(Ω21 − Ω22 + Ω23 − Ω24 ) (8)
tween the body frame and inertial frame is given by the  
rotation matrix R. The state vector is X = φ φ̇ θ θ̇ ψ ψ̇ zż yẏ xẋ
R= In the above equations θ̇ ψ̇(Iyy − Izz ) = body gyro effect
  and Jr θ̇ Ωr = propeller gyro effect.
 cθ cψ cθ sψ −sθ 

−cθ sψ + sφ sθ cψ cφ cψ + sφ sθ sψ sφ cθ 
 B. Simplifying EOM using Matlab
 sφ sψ + cφ sθ cψ −sφ cψ + cφ sθ sψ cφ cθ 
The ability of the quadrotor to do acrobatic maneuvers
where ’c’ denotes cos and ’s’ denotes sin. Another important results in complex non-linear dynamic equations[1]. There
parameter to the flight dynamics is the Inertia matrix which are six complex equations of motion.This creates compli-
describes the mass moment of inertia across the assumed cations in analyzing the behavior of any system. In our
axes of the rotor. This matrix plays a major role in dynamics approach we aimed at simplifying these complex equations
of both translation and rotational motion. The way the mass using MATLAB-SIMULINK[2]. A far better insight to this
is distributed along the axes holds a remarkable significance. is presented in the section-V.
The parallel axis theorem is used to obtain the Inertia matrix. The model in figure-3 is a subsystem of the Equations of
Jb= ⎛ ⎞ motion model that demonstrates one of the six equations of
Jx 0 0
⎝ 0 Jy 0 ⎠ motion implemented in Simulink. The function block rep-
resents the instantaneous equation taken into consideration.
0 0 Jz
The equation needs to be integrated twice to obtain position
where Jx, Jy and Jz are the mass moments of inertia along and velocity data. We extract the state space model as it
X, Y and Z axis respectively. The translational motion is serves as an effective approach to not only simplify the
defined by higher order systems but also gives us realistic and equitable
∑F = m∗a (1) results.

978-1-5090-4715-4/17/$31.00 ©2017 IEEE 2


International Conference on Inventive Systems and Control
(ICISC-2017)

Fig. 4. Our quadrotor implementation

III. C ONTROLLER D ESIGN


A. Hardware Requirements
The selection of low cost yet reliable components was the
primary goal for the test-bed design of the quadrotor. The
figure-4 shows our quadrotor test-bed. The frame is a cross
beam made of lightweight material. The development board
used is an Arduino Uno (Atmega 328p microcontroller) as
it is low-priced and has significant characteristics suited for
quadrotor test-bed. Brushless DC motors (BLDC) of 1000kV
rating are used to propel the quadrotor. The reason behind
selecting a lower kV rating motor is the remarkable torque
they produce. After a lot of tests we found the ideal propeller Fig. 5. Control Methodology
size for the above kV rating is 10*45. Electronic speed
controllers (ESCs) are used to control the motor, generic
ESCs have an ampere rating of 30A which is sufficient
to avoid any damage to the motors. We build our own (φ ∗ , θ ∗ , ψ ∗ )should be equal. These Euler angles are our
Inertial Measurement Unit using the MPU 6050 gyro which constraints for control process. For stabilized hovering of
provides us the angular rates (φ , θ , ψ) along X, Y and Z axis the quadrotor the angular rates should ideally be zero. This
respectively[7]. The gyro is 5V compatible and doesn’t need implies we are controlling angular velocities and not the
a level converter for the data signals. The battery selected is a linear velocities. The linear velocities can be derived from
lightweight 3S-2200mAh Lipo with a discharge rate of 30C; the angular velocities however we experience noisy readings
these specifications met the power to weight ratio necessities. due to vibrations from the motors.
A 6 channel Flysky receiver and transmitter are used for pilot The software system we use is the open source Arduino
to give the commands to the control board. Four channels out Integrated Development Environment due to the widespread
of the six are need for thrust, pitch, roll and yaw. An added range of facilities it provides while developing the code.
feature of self-leveling is triggered by the fifth channel. The Since the quadrotors are very unstable by nature, an appropri-
performance evaluation of the test bed yielded us satisfactory ate control technique is needed. The PD and PID technique
results which are discussed in section-V. are amongst the favorite processes for achieving stability.
The implementation of PD technique was simple but was
B. Control Design and PID process found to be inadequate to meet the complex needs of the
A sound knowledge of mathematical modeling supports quadrotor. We then resorted to the most admired method i.e.
a lot in developing a suitable controller for the physical the PID technique. The figure-5 gives an abstract idea of our
implementation of the quadrotor. The drive behind deriving control algorithm. The software program consists of a main
the dynamic model was to achieve a robust and an effective loop and an interrupt routine. The pilot uses a transmitter
controller. The angular velocities of each rotor (Ω1 − Ω4) consisting of sticks for throttle, yaw, pitch and roll. A change
are the input to our system[7]. As we wanted to reduce in position of these sticks generates pulse width modulated
computational overheads we use only a MPU-6050 Gyro signals (PWM). These signals lie in the range of 1000usec-
and make our own Inertial Measurement Unit (IMU). The 2000usec which control the ESCs. The receiver sends these
figure-5 shows a control philosophy for the quadrotor. In PWM signals to the digital pins on the arduino and if there is
order to perfectly control the quadrotor the angular rates a state of change on the digital pin; the subroutine as shown
from the gyro (i.e. φ , θ , ψ) and from the transmitter (i.e. in the figure-5 is executed. Interrupt vector (PCINTO) is

978-1-5090-4715-4/17/$31.00 ©2017 IEEE 3


International Conference on Inventive Systems and Control
(ICISC-2017)

Fig. 6. Simulating equations of motion


Fig. 7. Overview of the quadrotor model

responsible for activating the interrupt routine. The execution


of interrupt routine implies that there has been a change in
the receiver values (φ ∗ , θ ∗ , ψ ∗ ).The MPU6050 gyro is a 3-
axis angular rate sensor. The output data rate of the gyro is
set at 100Hz as it introduces less noise. The angular data
is a 16-bit value that divided over two registers of 8-bits.
The aim of the PID controller is to keep the angular data
rate same as the receiver rate by minimizing the error signal
e(t). The Three-term control- P corresponding to the present
error kp(t), I is governed by the accumulation of past errors
˙
i.e. e(t) and D is the prediction of future errors i.e. e(t).
The calculations require only 700usec complying to the time
constraints. The corrected pulses are then sent to the ESCs Fig. 8. Performance testing setup
which alter the rotor speeds for a stable flight.

P = (φ , θ , ψ − φ ∗ , θ ∗ , ψ ∗ ) ∗ Pgain (9) techniques used are PD and PID control. Various perfor-
mance metrics have been taken into consideration to ensure
a robust adaptive system.
I = I + (φ , θ , ψ − φ ∗ , θ ∗ , ψ ∗ ) ∗ Igain (10)
B. Performance evaluation
The performance analysis of the quadrotor is done by
D = (φ , θ , ψ) − (φ ∗ , θ ∗ , ψ ∗ ) − (m) − (n) ∗ Dgain (11) tuning the control parameters and observing their effects
on the system. Performance metrics like stability, peak
where m= previous value of φ , θ , ψ (from gyro) overshoot, rise time, settling time and steady state error are
n= previous value of φ ∗ , θ ∗ , ψ ∗ (from transmitter) key parameters in our evaluation methodology. We made a
IV. S IMULTAION AND IMPLEMENTATION RESULTS small comparative analysis of the effects of tweaking the
control parameters on these performance metrics. These are
A. Simulation in Matlab presented in a tabular format in table-II. Remarks have been
For simulating our quadrotor’s dynamics, the platform we made on the same in discussions section. The graphs ob-
have used is MATLAB-Simulink. Simulink proves to be an tained of the performance evaluation results of our quadrotor
appropriate choice as it offers ease of use and unparalleled system in figure-9 to figure-18 exhibit a good response and
processing power[8]. As the quadrotor is a highly non-linear
complex system we made two simulation models. The first
model in figure-6 is an implementation of the six equations
of motion.
This simulation serves as a ground zero for the user to
understand the mathematics and dynamics related to flight.
The user gets a glimpse of the aerodynamic aspects related Fig. 9. Stabilizing phi to reference input with PID
to the quadrotor.
This builds a concrete foundation for the second simu-
lation as shown in figure-7 which is the full-fledged archi-
tecture model of the quadrotor. The various system blocks
can be seen; however these further contain sub-systems (not
visible in the figure) and other parameters. The controlling Fig. 10. Stabilizing theta to reference input with PID

978-1-5090-4715-4/17/$31.00 ©2017 IEEE 4


International Conference on Inventive Systems and Control
(ICISC-2017)

stable system. The red dotted plot is the command signal


given by user and the blue plot is the actual response of our
system. The table-I shows the values that we found best for
our quadrotor system. The values may vary due to parameters
Fig. 11. Stabilizing psi to reference input with PID like symmetry of the structure, Centre of gravity, balacing
of propellers etc.
TABLE I
VALUES FOR PID

Fig. 12. Altitude self-leveling(no change in stick position of transmitter)


Roll Pitch Yaw
Kp= 4 Kp= 4 Kp= 20
Ki= 0.1 Ki= 0.3 Ki= 0.5
Kd= 1.2 Kd= 1.2 Kd= 10

C. Discussions
A comparative analysis of PD and PID technique can be
done from the results obtained. We observed that the PD
Fig. 13. PD vs PID response for Phi(step input) technique was easier to implement but was not sufficient
to cope-up with the complex flight dynamics. With the
PID controller the problem of integral wind-up was faced
which is eliminated by optimal tuning values. We faced the
following occurrences during our testing- An increment in
Kp would many times lead to overshoot and reduce the
stability however it increased response speed for controlling
action. Increment in Ki lead to a slower stable system. Kd
would serve as the most important parameter as it would take
corrective actions on overshoot due to P and in such real
Fig. 14. PD vs PID response for Theta(step input) time applications like a flying vehicle tuning this is critical.
With a large amount of experimental tests carried out we
came up with PID values that proved best for our system and
also we tweaked them to make the quad do some complex
maneuvers.
TABLE II
P ERFORMANCE METRICS

Parameter Kp Ki Kd
Fig. 15. PD vs PID response for Psi (step input) Stability Reduces Reduces Increases
Accuracy Increases Increases Increases
Response speed Increases Reduces Increases

V. C ONCLUSION
Fig. 16. PID response for complex maneuvers (roll variations)
A robust control model is designed with constraint opti-
mization approach. An efficient controller has been achieved
by making an IMU using low cost MPU 6050 sensor with
use of PD and PID control techniques. The simulations and
hardware results show the system as a stable platform and no
trade-offs in performance of the quadrotor even while doing
Fig. 17. PID response for complex maneuvers (pitch variations)
complex maneuvers. Also an additional PID algorithm on
the Z-axis gives a self-leveling feature if there is no control
action from transmitter. Our Arduino based architecture can
be modified to implement other control techniques like IDA-
PBC and back-stepping control. Even though using low cost
components our controller design and algorithm results in
Fig. 18. PID response for complex maneuvers (yaw variations) stable flights and do some aggressive maneuvers. For future

978-1-5090-4715-4/17/$31.00 ©2017 IEEE 5


International Conference on Inventive Systems and Control
(ICISC-2017)

work we aim to apply visual technique like Simultaneous


Localization and Mapping (SLAM) to mimic the function of
human eyes making the quadrotor aware of the environment.
It would also serve for autonomous navigation in GPS denied
indoor environments which would be very useful in perilous
situations.
R EFERENCES
[1] S. Omari, M.D. Hua and G. Ducard, Hardware and software architec-
ture for nonlinear control of multirotor helicopters, IEEE Transactions
on Mechatronics, vol. 18, no.6, December 2013.
[2] D. Gheorghita, I. Vintu, L. Mirea and C. Braescu, Quadcopter control
system modelling and implementation, 19th International conference
on system theory,control and computing (ICSTCC), Romania, October
2015.
[3] C. Balas, Modelling and linear control of quadrotor, M.Sc. thesis,
Cranfield University, UK, 2007.
[4] S. Bouabdallah, Design and control of quadrotors with applications
to autonomous flying, Phd thesis, Ecole Polytechnique Federale De
Laussane (EPFL), Switzerland, 2007.
[5] P. Castillo, R. Lozano and A. Dzul, Stabilization of mini rotorcraft
with four rotors, IEEE Control Systems Magazine, vol. 25, no.6, pp.
45-55, December 2005.
[6] M.D. Hua, T. Hamel, P. Morin and C. Samsom, A control approach for
thrust-propelled under-actuated vehicles and its applications to VTOL
drones, IEEE Transactions on Automation Control, vol. 54, no.8, pp.
1837-1853, August 2009.
[7] R. Leishman, C. John, R. Beard and T. Mclain, Quadrotors and
accelerometers: State estimation with an improved dynamic model,
IEEE Control Systems Magazine, vol. 34, no.1,pp28-41, February
2014.
[8] D. Hartman, K. Landis, M. Mehrer, S. Moreno and J. Kim, Quadcopter
dynamic modeling and simulation, project presented at MATLAB and
Simulink student design challenge, 2014.
[9] M. Khan, Quadcopter flight dynamics, International Journal of Scien-
tific and Technology Research, vol.3,no.8, August 2014.
[10] A. Cooke, I. Cowling, S. Erbsloeh and J. Whidborne, Low cost system
design and development towards an autonomous rotor vehicle, 22nd
International conference on Unmanned air vehicle systems, Bristol,
UK, April 2007.
[11] S. Bouabdallah, P. Murrieri and R. Siegwart, Design and control of
an indoor micro quadrotor, IEEE International conference on Robotics
and automation, New Orleans, April 2004.
[12] www.quadcopter101.blogspot.com.
[13] www.arduino.cc

978-1-5090-4715-4/17/$31.00 ©2017 IEEE 6

You might also like