Está en la página 1de 12

MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 1

MODELADO Y CONTROL DE UN
CUADRICOPTERO
Autor: Sevilla Fern andez, Luis
Directores: Zamora Macho, Juan Luis.
Porras Gal an, Jos e.
Fern andez Martnez, Ces areo.
Entidad colaboradora: ICAI Universidad Ponticia Comillas.
ResumenEl objetivo de la lnea de trabajo donde se enmarca este proyecto es modelar y controlar un vehculo a ereo no tripulado
(UAV) provisto de cuatro rotores (cuadric optero) accionados mediante motores brushless. El sistema de control permitir a el vuelo
estacionario, la navegaci on guiada mediante una emisora de radiocontrol y la navegaci on aut onoma mediante sensores de distancia.
Con el n de poder utilizar el vehculo en docencia, se implantar a tanto el modelo como las estrategias de control que se exploren en
el entorno Matlab/Simulink.
Index TermsCuadric optero, UAV, Proyecto, ICAI, Comillas.

1. INTRODUCCI ON
E
N los ultimos a nos hemos sido testigos de un
crecimiento importante en el desarrollo de vehculos
a ereos no tripulados (UAV), especialmente de despegue
y aterrizaje vertical (VTOL), debido a sus m ultiples
aplicaciones tales como vigilancia de instalaciones,
acceso a zonas de riesgo, captaci on de im agenes
a ereas, etc. Adem as este tipo de plataformas son
muy apropiadas para la docencia, pues integran una
gran diversidad de areas de conocimiento tales como
mec anica del s olido rgido (momentos y tensores
de inercia, matrices de rotaci on, angulos de Euler),
matem atica aplicada (cuaterniones), electr onica de
potencia (controladores electr onicos de velocidad),
automatizaci on (el control del vehculo), etc.
El objetivo de la lnea de trabajo donde se enmarca
este proyecto es modelar y controlar un vehculo a ereo
no tripulado provisto de cuatro rotores (cuadric optero)
accionados mediante motores brushless para vuelo en
interiores (ver gura 1). El sistema de control permitir a el
vuelo estacionario, la navegaci on guiada mediante una
emisora de radiocontrol y la navegaci on aut onoma me-
diante sensores de distancia. Con el n de poder utilizar
el vehculo en docencia, se desarrollar a tanto el modelo
de simulaci on, las estrategias de control y estimaci on
de estado y los driver blocks de sensores y generaci on
autom atica de c odigo en el entorno Matlab/Simulink.
Adem as, este proyecto aportar a a la Universidad Ponti-
cia Comillas experiencia en la operaci on de UAV para
facilitar el desarrollo de nuevas lneas de investigaci on
en este ambito.
El cuadric optero empleado en este proyecto (ver gura
1) est a accionado por cuatro motores brushless situados
en los extremos de sus brazos y regulados a trav es
de cuatro controladores electr onicos de velocidad (ESC).
Cuenta con una tarjeta controladora Crius, con un micro-
procesador ATMega 2560 de Arduino, y con una unidad
inercial de medidas (IMU) compuesta por aceler ometros,
gir oscopos y magnet ometros. La comunicaci on entre el
dispositivo y el piloto se realiza a trav es de una emisora
de radio control. Finalmente, la alimentaci on del dispo-
sitivo se realiza mediante una batera LiPo.
Figura 1: Cuadric optero y emisora
2. ESTADO DEL ARTE
Los movimientos de traslaci on y rotaci on de un cua-
dric optero se controlan mediante variaciones en la ve-
locidad de giro de sus rotores que denen las fuerzas
de empuje vertical en cada uno de ellos. As pues,
para que el dispositivo ascienda/descienda se debe
aumentar/disminuir la velocidad de rotaci on de todos
los motores simult aneamente. Las traslaciones en las
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 2
tres direcciones del espacio se producen generando un
empuje diferencial entre dos rotores alternos. As pues,
para producir un desplazamiento en la direcci on x, se
deber a reducir la velocidad del rotor 2 de la gura 2
y aumentar la del 4. Finalmente, el incremento de la
velocidad de rotaci on de los motores 1 y 3 permitir a al
dispositivo realizar una gui nada dextr ogira, mientras
que el aumento de la velocidad de 2 y 4 resulta en una
gui nada lev ogira.
Figura 2: Esquema de los pares generados por los rotores
El modelado matem atico de una aeronave es un tema
ampliamente estudiado en la literatura. En la actualidad,
existe una gran variedad de modelos tanto para vuelos
interiores [1],[2],[3] como para vuelos exteriores, en
cuyo caso se incluyen los efectos aerodin amicos [4],[5].
La correcta denici on de un modelo es crtica tanto
para el dise no de la estrategia de control como para los
estudios de simulaci on.
El control asume la disponibilidad de las variables
de estado, es decir la estimaci on de la orientaci on del
cuadric optero denida a partir de los angulos de Euler.
Los estimadores de estado m as comunes para este tipo
de aplicaci on son:
El ltro complementario [6]: se basa en una pon-
deraci on de la estimaci on de los angulos de Euler
realizada a partir de las medidas de los aceler ome-
tros y los gir oscopos. Hace uso de un ltro paso
bajo para eliminar el ruido del aceler ometro (alta
frecuencia) y de un ltro paso alto para eliminar el
bias de los gir oscopos (baja frecuencia).
El ltro de Kalman [7]: Se trata de un algoritmo de
estimaci on de los angulos de Euler a partir de un
modelo estoc astico del sistema de medida, basado
en los aceler ometros y gir oscopos.
En relaci on a la estrategia de control, existe una
gran variedad de algoritmos propuestos en la
literatura debido a que el modelo del cuadric optero
es multivariable y no lineal. Entre los algoritmos
propuestos destacan los algoritmos basados en la
teora de Lyapunov de H.Voos [1] y Bouabdallah
[3], los controladores por realimentaci on del estado
como el control LQ dise nado por Hoffmann [10] y los
controles PID como el dise nado por Bouabdallah [11].
Es importante remarcar que en internet hay disponible
una gran variedad de rmwares para controladores
de vuelo basados en Arduino como el Multiwii o el
Mega-Pirate disponibles para el controlador Crius y
el rmware APM para el controlador Ardu-Pilot. Sin
embargo, no se conocen versiones disponibles para el
entorno Matlab Simulink.
Finalmente, la aplicaci on de cuadric opteros en cursos
de control avanzado en distintas universidades est a au-
mentando signicativamente durante los ultimos a nos,
como por ejemplo en la Universidad de Hong Kong [12],
la Universodad de Illinois o el Swiss Federal Institute of
Technology, entre otros muchos casos.
3. MODELADO
El modelo matem atico del cuadric optero viene dado
por el conjunto de ecuaciones que describen el compor-
tamiento fsico de la aeronave. En este proyecto se han
desarrollado dos modelos:
Modelo no lineal completo. Conjunto de ecuacio-
nes que permite representar de forma detallada el
comportamiento del cuadric optero en vuelo. Las
entradas del modelo son las tensiones aplicadas a
los cuatro motores brushless, y las salidas son las
posiciones y velocidades en los seis grados de liber-
tad del cuadric optero. La aplicaci on fundamental
de este modelo es comparar diferentes estrategias
de control mediante una simulaci on lo m as realista
posible, como un paso de validaci on previo a la
implantaci on del sistema de control en el equipo.
Modelo simplicado. Este modelo incluye exclusi-
vamente las din amicas correspondientes a la orien-
taci on del cuadric optero, permitiendo dise nar la
estrategia de control que estabiliza la aeronave.
Cada uno de estos modelos requiere de un conjunto
de par ametros (dimensiones, masa, momentos de inercia
y caractersticas din amicas de los sistemas propulsores),
que deben ser adecuadamente estimados. Consecuente-
mente, se ha desarrollado un modelo CAD y se han
realizado pruebas del sistema de propulsi on en un banco
de ensayos.
En este proyecto se ha hecho uso del programa Solid
Edge para obtener la representaci on gr aca (CAD) del
cuadric optero mostrada en la gura 3.
Figura 3: Representaci on CAD de la estructura del cua-
dric optero
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 3
Este programa permite calcular los par ametros
mec anicos de la estructura incluidos en la tabla 1.
Par ametros mec anicos de la estructura
Masa
(Kg)
Volumen
(mm
3
)
Ixx
(Kgm
2
)
Iyy
(Kgm
2
)
Izz
(Kgm
2
)
0.2722 94059.7154 7,83 10
4
7,85 10
4
1,401 10
3
Par ametros din amicos de los rotores
Kv
(rpm/v)
Rm
()
b
(Ns/rad)
d
(Nms/rad)
2900 0.6 5.44e-7 7.32e-9
Tabla 1: Par ametros del cuadric optero
Para la estimaci on de los par ametros din amicos de los
rotores se han realizado pruebas en el banco de ensayos
mostrado en la gura 4. Las variables medidas durante
los ensayos son la tensi on, la corriente, la velocidad de
los motores, la fuerza de empuje y el par de arrastre. A
partir de estas medidas, se han deducido los valores de
los par ametros din amicos de los rotores mostrados en la
tabla 1.
Figura 4: Banco de ensayos
En ninguno de los modelos presentados se han in-
cluido los efectos aerodin amicos que pueden afectar al
dispositivo pues, tras un an alisis de estos (especialmente
el efecto suelo y el efecto techo), se ha demostrado que
no son relevantes en condiciones de vuelo en interiores.
4. ESTIMACI ON DE ESTADOS
En este proyecto se ha hecho uso de un ltro multipli-
cativo extendido de Kalman, ya que resulta m as robusto
de cara a las vibraciones de la estructura. Se trata de un
ltro extendido porque se basa en un modelo no lineal
del sistema de medida. Se dice tambi en que es multipli-
cativo porque, a pesar de que es capaz de realizar es-
timaciones unicamente con gir oscopos y aceler ometros,
pueden incluirse otros sensores (magnet ometros, GPS,
etc). Por contra, este ltro requiere de un alto nivel de
computaci on y por tanto se ha hecho uso de cuater-
niones para la obtenci on de las variables estimadas. Un
cuaterni on [8] es un vector de cuatro componentes que
representa de forma precisa la informaci on contenida en
los angulos de Euler para simplicar las operaciones.
As pues se har a uso de estos elementos matem aticos
para aligerar la carga computacional del conjunto y
ademas evitar el gimbal lock [9].
La aplicaci on de este ltro de Kalman comprende
varias fases de c alculos complejos como se ilustra en
la gura 5 a modo de ilustraci on. Los detalles del
funcionamiento del mismo se pueden encontrar en la
memoria del proyecto.
Figura 5: Esquema de funcionamiento del ltro
En la gura 6 se muestran las estimaciones del angulo
de alabeo realizadas mediante el ltro de Kalman (verde)
y de una variaci on en dicho angulo por el ltro com-
plementario (azul) durante la simulaci on. Se ha incluido
tambi en el valor real del angulo (rojo) para facilitar
la comparaci on. Se puede observar que ambos ltros
son capaces de realizar una estimaci on razonablemente
buena, a pesar de existir ruido en las medidas. Sin
embargo, el ltro de Kalman realiza una estimaci on m as
precisa que el ltro complementario.
9.5 10 10.5 11 11.5 12 12.5 13 13.5 14
8
7
6
5
4
3
2
1
0
1
2
3
Estimacin del angulo de alabeo
Tiempo(s)

n
g
u
lo
(
)


Filtro complementario
Filtro de Kalman
Referencia
Figura 6: Estimaci on de angulos de Euler en simulaci on
5. DISE NO DEL SISTEMA DE CONTROL
El sistema de control gestiona la regulaci on del dis-
positivo a trav es de la aplicaci on de unas se nales de
mando (tensiones de los motores). En este estudio se
han dise nado un conjunto de controladores basados
en el modelo simplicado a n de abarcar un mayor
rango de posibilidades. Posteriormente se ha hecho uso
del modelo completo para su comparaci on mediante
simulaci on. Los algoritmos de control dise nados son:
1. Control PID con ponderaci on de la referencia con
mecanismo anti-windup dise nado por respuesta en
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 4
frecuencia. Se ha hecho uso de los ndices signi-
cativos (margen de fase, pulsaci on de cruce, etc)
recomendados por la literatura. La presencia del
mecanismo anti-windup es esencial para evitar la
acumulaci on del error en la integraci on cuando el
mando satura.
2. Control PID incremental. Se trata de una modica-
ci on realizada sobre el control PID anterior en la
que se trabaja con incrementos en vez de con valo-
res absolutos. La principal ventaja es que permite
limitar los incrementos del mando y que simplica
la l ogica del mecanismo anti-windup.
3. Control por realimentaci on de estado por posi-
cionamiento de polos. Los polos del sistema en
lazo cerrado se han seleccionado para optimizar la
respuesta del sistema.
4. Regulador LQ por realimentaci on de estado. Se ha
hecho uso de un modelo estoc astico del sistema
para para obtener la matriz de ganancias de re-
alimentaci on del estado que permita minimizar el
error de seguimiento de la referencia y el esfuerzo
de control.
5. Control LQ por realimentaci on de estado con ac-
ci on integral(LQI). Se ha a nadido una acci on inte-
gral para corregir las perturbaciones en carga que
presenta el sistema.
Adicionalmente, se ha desarrollado un modelo del
cuadric optero sobre una motocicleta (p endulo invertido)
para evaluar los algoritmos de control anteriores a la
hora de estabilizar el cuadric optero, mientras se reduce
el riesgo de da nar el dispositivo ante errores en la
implantaci on y un mal ajuste del control.
6. IMPLEMENTACI ON
Al no existir experiencia previa en el uso anteriores de
cuadric opteros en la UPCO, una gran parte del trabajo
realizado se ha destinado a construir y poner a punto
el cuadric optero. Estas tareas incluyen el montaje de
la estructura, la incorporaci on de los elementos necesa-
rios para su funcionamiento (ESC, rotores, la tarjeta de
control, etc) y el conexionado de los mismos. Adicio-
nalmente se ha dise nado y construido una placa para
monitorizar la tensi on de la batera. Se trata del circuito
mostrado en la gura 7 que incluye un divisor de tensi on
con un buffer.
Figura 7: Esquema del circuito de monitorizaci on de la
tensi on de la batera
Otra de las principales tareas realizadas es la de
dise nar los driver blocks que permiten intercambiar
informaci on entre el algoritmo de control programado
en Simulink y los sensores y actuadores instalados en
el cuadric optero. Estos driver blocks han sido progra-
mados en C++ e integrados en bloques de Simulink, lo
cual supone una dicultad a nadida por la novedad que
supone. Los drivers dise nados son los siguientes:
Driver para la IMU. Con este driver se pretende
acceder a la informaci on disponible en la IMU. Para
su programaci on se ha hecho uso de la librera
FreeIMU, originalmente escrita en C++.
Driver para el transmisor-receptor RC. Este c odigo
es el que establece la comunicaci on entre el receptor
RC y el microcontrolador. Este c odigo programado
hace uso de interrupciones para evitar un exceso
de consumo de memoria por parte del microcon-
trolador. Adicionalmente se ha incluido un ltro de
Savitzky-Golay para reducir el nivel de ruido de las
se nales.
Driver para los ESC. Se trata de generar una se nal
PWM que permite variar la tensi on aplicada al
motor.
Driver para el lector de la tensi on de la bater a.
Este driver permite obtener la medida anal ogica de
la tensi on en la batera.
Finalmente se ha programado un m aquina de estados
para el arranque seguro del sistema y la gesti on de las si-
tuaciones de fallo. Esta m aquina estados ha introducido
al sistema:
1. Elementos de seguridad como control de altura
m axima, arranque del sistema controlado o tensi on
mnima de la batera.
2. Variaciones en el algoritmo de control, como por
ejemplo la desactivaci on de la acci on integral du-
rante el proceso de arranque para evitar que se
acumule el error en la integraci on.
3. Un arranque suave y controlado del sistema.
7. ENSAYOS
Los ensayos realizados sobre el cuadric optero han
demostrado que s olo se precisa seleccionar el algoritmo
de control adecuado para realizar vuelos estables. Por
tanto, el montaje y conexionado de todos los elementos
del equipo es el adecuado. Adem as, la m aquina
de estados que se encarga de gestionar el arranque
del sistema ha sido evaluada ofreciendo resultados
satisfactorios.
Los ensayos realizados sobre todos los drivers
programados han ofrecido tambi en resultados positivos
permitiendo su aplicaci on en futuros estudios. En
el caso de las se nales obtenidas por el receptor RC,
se ha observado cierto nivel de ruido en ella. Por
tanto, se ha dise nado un ltro de Savitzky-Golay
para su cancelaci on. Este ltro se ha usado tambi en
para retrasar la se nal de tensi on en la batera de forma
que sea menos sensible a los picos presentes en la misma.
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 5
La gura 8 muestra la estimaci on de los angulos de
Euler en el sistema real realizada por el ltro de Kalman
dise nado (azul) y la realizada por el estimador de la
IMU (verde). La estimaci on realizada por el ltro de
Kalman es mejor tanto con los rotores desconectados
como activos. Sin embargo se puede apreciar una deriva
o bias en la estimaci on del angulo, debido a que no se
han podido usar los magnet ometros en el ltro. Esta
deriva puede tener un efecto importante en el control
y debe ser estudiada en el futuro.
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
80
60
40
20
0
20
40
Estimacin corregida
Tiempo (s)

n
g
u
lo
s ()


MEKF
Filtro IMU
Figura 8: Estimaci on del angulo de alabeo
En la gura 9 se muestran las respuestas temporales
superpuestas de los controladores PID, de realimenta-
ci on de estado por posicionamiento de polos y por el
m etodo LQ ante un escal on en la referencia obtenidas
mediante simulaci on. Como se puede observar, los tiem-
pos de establecimiento con el control PID son menores
que los correspondientes a los controles basados en la
realimentaci on del estado.
0 0.5 1 1.5 2 2.5 3
0
1
2
3
4
5
6
7
8
9
10
11
Tiempo (s)

n
g
u
lo
(
)


PID
Realimentacin
LQR
4 4.5 5 5.5 6 6.5 7
0
1
2
3
4
5
6
7
8
9
10
11
Tiempo (s)

n
g
u
lo
(
)
7 7.5 8 8.5 9 9.5 10
0
1
2
3
4
5
6
7
8
9
10
11
Tiempo (s)

n
g
u
lo
(
)
Figura 9: Respuesta de los tres controladores ante esca-
lones de 10
o
La respuesta del control PID presenta un peque no
sobrepaso mientras que las de los otros dos controles
son sobreamortiguadas. Si los angulos a introducir en
la referencia son cercanos al valor unitario, la mejor
respuesta es la proporcionada por el control PID, dado
que su tiempo de establecimiento es el menor. Si por
el contrario, se pretende trabajar con angulos de Euler
mayores la respuesta sufre modicaciones indeseables,
como ocurre con el angulo psi. Sin embargo, las
respuestas de los controladores LQ y por realimentaci on
de estado no sufren este efecto. Consecuentemente,
el control que se ensayar a en el sistema real ser a el
controlador LQ con acci on integral.
Finalmente, se ha incluido la se nal de mando de la
gura 10 proporcionada por el controlador LQ incre-
mental con acci on integral y mecanismo anti-windup al
realizar un ensayo real de estabilizaci on del cuadric opte-
ro. Tal respuesta no permite regular el dispositivo pues
se trata de una se nal que oscila entre los valores de
saturaci on jados en el controlador. Queda como tarea
pendiente en futuros proyectos revisar el estimador de
estado y las ganancias de la cadena de actuaci on para
resolver este problema.
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
120
140
160
180
200
220
240
260
Mandos U1, U3
Tiempo(s)
T
e
n
si
n
(P
W
M
)


Phi
Theta
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
120
140
160
180
200
220
240
260
Mandos U2, U4
Tiempo(s)
T
e
n
si
n
(P
W
M
)


U2
U4
Figura 10: Mandos aplicados sobre el dispositivo con el
controlador LQI
8. CONCLUSIONES
A modo de conclusi on general del proyecto se puede
decir que no se ha podido dise nar un controlador capaz
de regular el comportamiento del cuadric optero. Sin em-
bargo, evaluando el volumen de aportaciones realizadas,
s se ha facilitado considerablemente el esfuerzo requeri-
do para alcanzar este objetico en futuros proyectos. Las
tareas realizadas con exito son las siguientes:
Se dispone de los modelos, tanto matem aticos como
en CAD, para dise nar un algoritmo de control
adecuado.
Los drivers programados realizan su funci on de
forma adecuada.
La m aquina de estados gestiona el arranque del
dispositivo adecuadamente.
La monitorizaci on del estado de la batera se lleva
acabo de forma correcta.
Se dispone del diagrama de bloques general di-
se nado para volcar el algoritmo al dispositivo.
El cuadric optero est a listo para volar de forma re-
gulada, a falta de ajustar correctamente el algoritmo
de control y la estimaci on de estado.
La causa principal por la cu al el controlador no es capaz
de regular el dispositivo parece ser la estimaci on de los
angulos de Euler, bien por la deriva que presentan o
bien por una velocidad inadecuada de estimaci on de
los mismos. Existe tambi en la posibilidad de que el fun-
cionamiento incorrecto del controlador sea consecuencia
de la conversi on de la se nal de mando, es decir, la
transformaci on de fuerzas acopladas de empuje a tensi on
en cada motor.
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 6
9. FUTURAS MEJORAS
Las mejoras que se proponen hacen referencia a mejo-
rar el ajuste del algoritmo de estimaci on de estado. Por
tanto se propone:
Incluir magnet ometros en la estimaci on de los angu-
los de posici on de la aeronave. Para ello deber a pro-
gramarse un algoritmo de calibrado de los mag-
net ometros. El c odigo del estimador ya est a prepa-
rado para realizar la ampliaci on.
Implementaci on de un sistema telem etrico para mo-
nitorizar los ensayos en tiempo real.
Dise nar una carcasa que permita absorber las vibra-
ciones de los rotores.
REFERENCIAS
[1] Holger Voos, Nonlinear Control of a Quadrotor
Micro-UAV using Feedback-Linearization. Procee-
dings of the 2009 IEEE International Conference on
Mechatronics. M alaga, Spain, April 2009.
[2] C BALAS and Dr J.F. Whidborne, Modelling and
Linear Control of a Quadrotor. CRANFIELD UNI-
VERSITY, September 2007.
[3] Bouabdallah, S., Murrieri, P. and Siegwart,
R.,Towards autonomous indoor micro VTO,
Autonomous Robots, France, 2005.
[4] Paul Pounds, Robert Mahony, Peter Corke, Mode-
lling and Control of a Quad-Rotor Robot. Australian
National University, 2006.
[5] McKerrow, P.,Modelling the Draganyer four rotor
helicopter. IEEE International Conference on Robo-
tics and Automation, April 2004.
[6] Robert W Klein, Flight control system employing
complementary lter. Grumman Aerospace Corp,
May 1987
[7] James K. Hall, Nathan B. Knoebel, Timothy W.
McLain, Quaternion Attitude Estimation for Minia-
ture Air Vehicles Using a Multiplicative Extended
Kalman Filter. Brigham Young University, Provo, UT
84602.
[8] Nikolas Trawny and Stergios I. Roumeliotis, Indirect
Kalman Filter for 3D Attitude Estimation. A tuto-
rial for quaternion algebra. University of Minnesota,
March 2005.
[9] Manuel Kramer, Douglas J. Dapprich, Gyro stabili-
zed inertial reference system with gimbal lock pre-
vention means. The Charles Stark Draper Laboratory,
Inc. October 1977.
[10] Hoffmann,G.M., Rajnarayan, D.G., Waslander, S.L.,
Dostal, D., Jang, J.S. and Tomlin, C.J., The stanford
testbed of autonomous rotorcraft for multi agent
control. Digital Avionics Systems Conference, 2004.
[11] Bouabdallah, S., Noth, A. and Siegwart, R., PID
vs LQ control techniques applied to an indoor mi-
cro quadrotor. Swiss Federal Institute of Technology,
2004
[12] Igor Gaponov,Anastasia Razinkova, Quadcopter
Design and Implementation as a Multidisciplinary
Engineering Course. IEEE International Conference
on Teaching, Assessment, and Learning for Enginee-
ring (TALE), August 2012.
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 7
MODELLING AND CONTROL OF A
QUADCOPTER
Author: Sevilla Fernndez, Luis
Project managers: Zamora Macho, Juan Luis.
Porras Gal an, Jos e.
Fern andez Martnez, Ces areo.
Partner entity : ICAI Universidad Ponticia Comillas.
AbstractThe objective of the research path where this project is framed is to model and control an unmanned aerial vehicle (UAV)
provided with four rotors (quadcopter) powered by brushless motors. The control system will allow the system to hover, to y guided
by a transmitter and to y autonomously using proximity sensors. As this project is aimed to be applied in future courses within the
university, all the control strategies as well as the models created will be adapted to Matlab/Simulink.
Index TermsQuadcopter, UAV, Thesis, ICAI, Comillas.

1 INTRODUCTION
W
Ithin the last years, we have witnessed a great
growth on the development of unmanned aerial
vehicles, specially the vertical take-off landing kind.
This is due to their multiple applications such as facility
surveillance, access to risk areas, aerial imaging, etc.
Besides, this kind of devices are quite useful within
the academical world as they cover a wide range of
knowledge elds such as mechanics, mathematics,
power electronics, control theory, etc.
The objective of the research path where this project
is framed, is to model and control an unmanned aerial
vehicle (UAV) provided with four rotors (quadcopter)
powered by brushless motors constrained to indoor
ights (see gure 1). The control system will allow the
system to hover, to y guided by a transmitter and
to y autonomously using proximity sensors. As this
project is aimed to be applied in future courses within
the university, all the control strategies as well as the
models created will be adapted to Matlab/Simulink.
Besides, this project will give the Pontical University
of Comillas experience in the UAV world in order to
ease the development of new research lines within this
subject.
The quadcopter that will be used is powered by four
brushless motors, placed at the end of the structures
arms, which are driven by four electronic speed con-
trollers (ESC). It includes a Crius microcontroller chip
card with an Arduino ATMega 2560 processor, as well as
an inertial measure unit (IMU) made up of gyroscopes,
accelerometers and magnetometers. The communication
between the device and the pilot is done by a radio
control system. Finally, the power supply for the device
will be performed by LiPo batteries.
Fig. 1: Quadcopter and RC transmitter
2 STATE OF THE ART
The quadcopter translation and rotation movements
are performed shifting the rotation speed of its rotors.
Consequently, in order for the UAV to ascend/descend
vertically, the speed of all the motors must be in-
creased/decreased simultaneously. Increasing the angu-
lar speed of motors 1 and 3 will make the quadcopter
to rotate clockwise, whereas the increase in the speed
of motors 2 and 4 with result in a counter-clockwise
rotation. Finally, the vehicle can be made to y in either
direction horizontally: for instance, reducing the speed
of motor 4 and increasing the speed of motor 2 will result
in the frame roll, making the device y to the left.
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 8
Fig. 2: Schematics on torques generated by each motor
of a quadrotor
The modelling of this kind of devices, where the
mathematical description of the quadcopter is deduced,
has been widely studied along the last decades.
Therefore, now a days there is a wide variety of models
for indoor ights [1],[2],[3] as well as for outdoor ights
[4],[5] to work with. The main difference between the
two groups is that outdoor ights models include the
aero-dynamical effects. The denition of a precise model
is critical for both the design of the controller and the
simulation tests.
The control strategy assumes that the state variables
are available, thats to say, the estimation of the quad-
copter attitude from the Euler angles. The most common
state observers within this subject are:
The complementary lter [6]: The estimation of
the attitude angles, done with the measures of
both accelerometers and gyroscopes, is properly
weighted in order to obtain an accurate and
relatively noise-free estimation. The noise carried in
the accelerometer measures (high frequency noise)
is ltered by a low pass lter, as well as the bias
from the gyroscopes (low frequency) is removed by
a high pass lter.
A Kalman lter [7]: It is an algorithm used to
estimate the Euler angles of a device based on the
stochastic model of the measure system, using the
accelerometers and the gyroscopes included in the
IMU.
Related to the control strategy, there have been
developed a wide variety of algorithms due the fact
that the quadcopter model is a multi-variable non-
linear model. Within the proposed algorithms, the
Lyapunov based controllers developed by H.Voos[1]
and Bouabdallah [3] stand out, although it may be also
used state-feedback controllers such as the LQ regulator
designed by Hoffman [10] or the PID controller designed
by Bouabdallah [11].
It may be important to highlight that there are many
PID controller rmwares available in the Internet. The
Arduino based controller chip cards such Crius or
the Ardu-Pilot offer the Multiwii or the Mega-Pirate
algorithms, easing the implementation of a controller
software to the quadcopter used. Nevertheless, there
are not rmwares available for the Matlab Simulink
environment.
The use of this kind of devices on advanced control
courses in different Universities is increasing along the
last few years, such as the Hong Kong University [12],
the Illinois University or Swiss Federal Institute of Tech-
nology, among others.
3 MODELLING
The mathematical model of the quadcopter is dened
by the set of equations which describe the physics of the
spaceship. In this project, there have been developed the
two following models:
Full non-lineal model. Set of equations which allow
to accurately represent the ight behaviour of the
quadcopter. The inputs to the model are the four
voltages applied to the bushless motors, and the
outputs are the position and speed values along
the six degrees of freedom of the quadcopter. The
main use for this algorithm is to compare different
control strategies in order to make the simulation as
much accurate as possible, thus it can be seen as a
validation test before using it in the real device.
Simplied model This model includes the
dynamics corresponding to the attitude of the
quadcopter exclusively, allowing to design the
control strategy which makes the spaceship stable.
Each of these models requires a set of parameters
(dimensions, mass, inertia momentums and the thrust
systems dynamics) which must be accurately estimated.
Consequently, a CAD model has been developed and
some tests have been carried out over the thrust systems
on the test bench built for this purpose. In this project, it
has been used Solid Edge in order to obtain the graphic
representation (CAD) of the quadcopter shown in gure
3.
Fig. 3: CAD representation of the quadcopter structure
This program allows to compute the mechanical pa-
rameters of the structure, which have been included in
the table 1.
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 9
Mechanical parameters for the structure
Mass
(Kg)
Volume
(mm
3
)
Ixx
(Kgm
2
)
Iyy
(Kgm
2
)
Izz
(Kgm
2
)
0.2722 94059.7154 7.83 10
4
7.85 10
4
1.401 10
3
Dynamic parameter for the motors
Kv
(rpm/v)
Rm
()
b
(Ns/rad)
d
(Nms/rad)
2900 0.6 5.44e-7 7.32e-9
TABLE 1: Parameters for the quadcopter
In order to estimate the dynamic parameters for the
rotors, there have been performed a set of tests on the
test bench shown in gure 4. The variables measured
during the test are the voltage, the current, the rotational
speed, the thrust and the torque. The values of the
parameters shown in table 1 has been deduced from the
set of measures that were described above.
Fig. 4: Test bench
None of the models introduced above includes the
aero-dynamical effects which may affect the dynamics
of this kind of devices, because it has being proved that
they are not relevant for indoor ights.
4 STATE ESTIMATION
In order to achieve a proper estimation of the attitude
angles, a multiplicative extended Kalman lter has been
designed. This robust algorithm, able to handle a signi-
cant noise in the measures, is able to achieve the attitude
estimation using only gyroscopes and accelerometers
although it can also use other sensors such as the mag-
netometers, a GPS, etc. Besides, it is said that this is an
extended lter because it is based on a non-lineal model
of the measures system. On the other hand, this lter
requires a high computational cost. Therefore, quater-
nions have been used in order to obtain the estimated
variables. A quaternion [8] is a four dimensional vector
which accurately represents the information contained
in the attitude angles. Thus, this mathematical elements
will be used in order to reduced the computational cost
of the system as well as to avoid the gimbal lock [9].
The mathematical process of the Kalman lter involves
a number of complex computation steps as it is shown,
as an illustration, in gure 5. The detailed process is
deeply described in the proyect memory.
Fig. 5: Estimation process for the Kalman lter
Figure 6 shows the attitude estimation of the pitch
angle gathered by the Kalman lter designed (green) as
well as the estimation performed by the complementary
lter (blue) during the simulation. The real value of
that angle (red) has also been included in order to ease
the comparison. As it can be seen, both lters are well
capable of performing an accurate estimation, despite
the noise contained in the measures. Nevertheless, the
Kalman lter performs a more precise estimation than
the complementary lter.
9.5 10 10.5 11 11.5 12 12.5 13 13.5 14
8
7
6
5
4
3
2
1
0
1
2
3
Estimacin del angulo de alabeo
Tiempo(s)

n
g
u
lo
(
)


Filtro complementario
Filtro de Kalman
Referencia
Fig. 6: Attitude angles estimation during the simulations
5 CONTROL SYSTEM DESIGN
The control systems handles the regulation of the device
through the controller signal applied in the motors. In
order to cover a wider range of possibilities, it has been
developed a set of controllers based on the simplied
model. Afterwards, the full model has been used to
validate them through simulations. The control algo-
rithms designed are:
1) Referenced weighted PID controller with anti-
windup, design through frequency response. The
design has used the meaningful indicators (phase
margin, cross frequency, etc.) recommended by the
literature. The anti-windup mechanism is critical
in order to avoid the error accumulation in the
integral action of the controller, when a saturation
takes places in the actuators.
2) Incremental PID controller. It is a slight modica-
tion over the former PID controller as it works with
increments instead of absolute values. The main
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 10
advantage of this modication is that it allows to
set a constraint on the control signal as well as it
simplies the anti-windup logic.
3) State feedback controller designed by pole place-
ment. The close loop poles of the system habe been
chosen to optimize the system response.
4) State feedback LQ regulator. The stochastic model
of the system has been used to obtain the state
feedback gain matrix which allows to minimize the
reference tracking error and the control effort.
5) State feedback LQ regulator with integral action
(LQI). An integral action has been added to the
former LQ controller in order to reject the load
disturbances present in the system.
In addition, it has been developed a model of the
quadcopter placed on a Lego Motorbike (modelled as
a inverted pendulum) in order to test the control al-
gorithms while stabilizing the device. This new model
reduces the risk of damaging the quadcopter against
implementation errors or an inappropriate t of the
quadcopters paramenters.
6 IMPLEMENTATION
As there is no previous experience on the use of quad-
copters within the UPCO, a great amount of the job done
has gone to build and set the device. This tasks include
the assembly of the structure, the placing of the required
elements (ESC, rotors, controller chip card, etc.) as well
as their connection. In addition, a chip card has been
both designed and built to monitor the battery charge.
The circuit, shown in gure 7, is made up of a voltage
divisor with a buffer.
Fig. 7: Layout of the monitoring circuit for the battery
charge
Another set of tasks is the design of the driver blocks
which allow to exchange information between the con-
trol algorithm programmed in Simulink and the sensors
and actuators placed on the quadcopter. These drivers
have been programmed in C++ and integrated into
Simulink blocks, thus they add additional challenges due
to the newness introduced.
Driver for the IMU. This driver is intended to access
to the information available in the IMU. In order to
ease its programming, the library FreeIMU has been
used, originally programmed in C++.
Driver for the RC system. This code sets the
communication between the RC receptor and the
microcontroller card. The programmed code uses
interruptions in order to lighten the memory con-
sumption of the microprocessor. In addition, a
Savitzky-Golay lter has been designed in order to
reduce the amount of noises carried by the signals.
Driver for the ESC. It produced a PWM signal
which allows to shift the voltage applied in the
motors.
Driver for the monitoring system of the battery
charge. This driver gets the analogue measure of
the battery voltage.
Finally, a state machine has been programmed in order
to ensure a safe and smooth start up as well as the
management of the fault situations. The state machine
has introduced to the system:
1) Safety features such as the maximum altitude
control, the regulated start up and the minimum
charge of the battery.
2) Variations over the control algorithm, such as the
disconnection of the integral action during the start
up process in order to avoid the error accumulation
in the integral action.
3) A smooth and regulated start up.
7 TESTS
The tests performed over the quadcopter have shown
that it only requires to choose the proper control
algorithm to perform stable ights. Therefore, the
assembly and connection of all the system elements
have been properly done. Besides, the state machine in
charge of handling the start up of the system has been
tested throwing positive results.
The tests carried out over the programmed drivers
have also shown positive results, allowing to be used in
future studies among this eld. Regarding the obtained
signals from the RC receptor, it has been identied a
signicant amount of noise. Thus, a Savitzky-Golay
lter has been designed in order to reject it. This lter
has also been used to set up a delay in the voltage
signal coming from the battery, so that I will be less
sensitive to the present peaks.
Figure 8 shows the estimation of the Euler angles in
the real system, done by the Kalman lter designed
(blue) and by the IMU estimator (green). The estimation
performed by the Kalman lter is better than the one
done by the other estimator, even if the motors are
turned on. Nevertheless, a drift on the estimation can be
appreciated, due to the lack of magnetometer measures
during the estimation process. This drift may have an
important effect on the control efciency and should be
studied in the near future.
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 11
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
80
60
40
20
0
20
40
Estimacin corregida
Tiempo (s)

n
g
u
lo
s ()


MEKF
Filtro IMU
Fig. 8: Pith angle estimation
Figure 9 shows the simulated overlapped time
responses of the PID controller, the state feedback con-
troller designed by pole placement and by the LQ
method, when a step is introduced in the reference. As
it can be seen, the settling times for the PID controller
responses are smaller than the controllers based on a
state feedback.
0 0.5 1 1.5 2 2.5 3
0
1
2
3
4
5
6
7
8
9
10
11
Tiempo (s)

n
g
u
lo
(
)


PID
Realimentacin
LQR
4 4.5 5 5.5 6 6.5 7
0
1
2
3
4
5
6
7
8
9
10
11
Tiempo (s)

n
g
u
lo
(
)
7 7.5 8 8.5 9 9.5 10
0
1
2
3
4
5
6
7
8
9
10
11
Tiempo (s)

n
g
u
lo
(
)
Fig. 9: Time response of the three main controllers when
a 10
o
step is applied in the system
The PID controller response shows a small overshoot
while the responses of the other two controlles are over-
damped responses. If the angles that will be introduced
in the reference are close to the unitary values, the best
response is the PIDs as its settling time is the smallest.
If, instead, the angles introduced as references are bigger
than the unit, then the response suffers undesirable
modications, as it happens with the yaw angle.
Nevertheless, the state feedback controlled responses
do not suffer this shift. Consequently, the controller that
will be tested in the real system will be the LQI regulator.
Finally, the control signal to stabilize the quadcopter
with the incremental LQI with anti-windup has been
included in gure 10. That response shows that the
control is unable to regulate the device as the signals
ranges between the minimum and maximum saturation
values set in the controller. Therefore, the state estimator
and the gains from the actuator chain should be studied
in future research among this eld, in order to solve
these problems.
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
120
140
160
180
200
220
240
260
Mandos U1, U3
Tiempo(s)
T
e
n
si
n
(P
W
M
)


Phi
Theta
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
120
140
160
180
200
220
240
260
Mandos U2, U4
Tiempo(s)
T
e
n
si
n
(P
W
M
)


U2
U4
Fig. 10: Control signals applied in the device with the
LQI controller
8 CONCLUSIONS
The general conclusion of this project is that it has
not been possible to design a proper controller able to
regulate the quadcopter behaviour. Nevertheless, look-
ing to the volume of contributions done, it can be said
that this project has considerably eased the required
effort to achieve the main goal of this project in fu-
ture works. The tasks successfully performed are the
following:
It has been created a set of models both mathe-
matical and graphical (CAD) which can be used to
design a proper controller.
The programmed drivers work properly.
The state machine handles the start up of the device
appropriately.
The monitoring of battery charge is done correctly.
It has been designed a detailed block diagram pre-
pared to be loaded into the quadcopters microcon-
troller card.
The quadcopter is ready to y properly controlled
as long as the proper algorithm and state estimation
is provided.
The main cause of the controller inability to regulate
the device seems to be the incorrect estimation of the
attitude angles, rather by the drift they show up or
by the inappropriate estimation speed of these angles.
There is also the chance that the incorrect operation of
the controller is due to conversion chain of the control
signal, changing from coupled thrust forces to each
motor voltage.
9 FUTURE IMPROVEMENTS
The improvements proposed lead into an improvement
of the state estimation algorithm. Therefore, it is recom-
mended to:
Include the magnetometers into the attitude estima-
tion of the quadcopter. In order to achieve such a
task, a calibration algorithm for the magnetometer
should be programmed. The Kalman lter code is
already prepared for this enlargement.
Implement a telemetric system in order to monitor
in realtime the tests performed.
Design a casing which allows to absorb the vibra-
tions from the rotors.
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 12
REFERENCES
[1] Holger Voos, Nonlinear Control of a Quadrotor
Micro-UAV using Feedback-Linearization. Proceed-
ings of the 2009 IEEE International Conference on
Mechatronics. Mlaga, Spain, April 2009.
[2] C BALAS and Dr J.F. Whidborne, Modelling and
Linear Control of a Quadrotor. CRANFIELD UNI-
VERSITY, September 2007.
[3] Bouabdallah, S., Murrieri, P. and Siegwart,
R.,Towards autonomous indoor micro VTO,
Autonomous Robots, France, 2005.
[4] Paul Pounds, Robert Mahony, Peter Corke, Mod-
elling and Control of a Quad-Rotor Robot. Australian
National University, 2006.
[5] McKerrow, P.,Modelling the Draganyer four ro-
tor helicopter. IEEE International Conference on
Robotics and Automation, April 2004.
[6] Robert W Klein, Flight control system employing
complementary lter. Grumman Aerospace Corp,
May 1987
[7] James K. Hall, Nathan B. Knoebel, Timothy W.
McLain, Quaternion Attitude Estimation for Minia-
ture Air Vehicles Using a Multiplicative Extended
Kalman Filter. Brigham Young University, Provo, UT
84602.
[8] Nikolas Trawny and Stergios I. Roumeliotis, Indirect
Kalman Filter for 3D Attitude Estimation. A tuto-
rial for quaternion algebra. University of Minnesota,
March 2005.
[9] Manuel Kramer, Douglas J. Dapprich, Gyro stabi-
lized inertial reference system with gimbal lock pre-
vention means. The Charles Stark Draper Laboratory,
Inc. October 1977.
[10] Hoffmann,G.M., Rajnarayan, D.G., Waslander, S.L.,
Dostal, D., Jang, J.S. and Tomlin, C.J., The stanford
testbed of autonomous rotorcraft for multi agent
control. Digital Avionics Systems Conference, 2004.
[11] Bouabdallah, S., Noth, A. and Siegwart, R., PID
vs LQ control techniques applied to an indoor mi-
cro quadrotor. Swiss Federal Institute of Technology,
2004
[12] Igor Gaponov,Anastasia Razinkova, Quadcopter
Design and Implementation as a Multidisciplinary
Engineering Course. IEEE International Conference
on Teaching, Assessment, and Learning for Engineer-
ing (TALE), August 2012.

También podría gustarte