Sunteți pe pagina 1din 12

MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 1

MODELADO Y CONTROL DE UN
CUADRICOPTERO
Autor: Sevilla Fernández, Luis
Directores: Zamora Macho, Juan Luis.
Porras Galán, José.
Fernández Martı́nez, Cesáreo.
Entidad colaboradora: ICAI – Universidad Pontificia Comillas.

Resumen—El objetivo de la lı́nea de trabajo donde se enmarca este proyecto es modelar y controlar un vehı́culo aéreo no tripulado
(UAV) provisto de cuatro rotores (cuadricóptero) accionados mediante motores brushless. El sistema de control permitirá el vuelo
estacionario, la navegación guiada mediante una emisora de radiocontrol y la navegación autónoma mediante sensores de distancia.
Con el fin de poder utilizar el vehı́culo en docencia, se implantará tanto el modelo como las estrategias de control que se exploren en
el entorno Matlab/Simulink.

Index Terms—Cuadricóptero, UAV, Proyecto, ICAI, Comillas.

1. I NTRODUCCI ÓN en los extremos de sus brazos y regulados a través


de cuatro controladores electrónicos de velocidad (ESC).

E N los últimos años hemos sido testigos de un


crecimiento importante en el desarrollo de vehı́culos
aéreos no tripulados (UAV), especialmente de despegue
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ómetros,
y aterrizaje vertical (VTOL), debido a sus múltiples giróscopos y magnetómetros. La comunicación entre el
aplicaciones tales como vigilancia de instalaciones, dispositivo y el piloto se realiza a través de una emisora
acceso a zonas de riesgo, captación de imágenes de radio control. Finalmente, la alimentación del dispo-
aéreas, etc. Además este tipo de plataformas son sitivo se realiza mediante una baterı́a LiPo.
muy apropiadas para la docencia, pues integran una
gran diversidad de áreas de conocimiento tales como
mecánica del sólido rı́gido (momentos y tensores
de inercia, matrices de rotación, ángulos de Euler),
matemática aplicada (cuaterniones), electrónica de
potencia (controladores electrónicos de velocidad),
automatización (el control del vehı́culo), etc.

El objetivo de la lı́nea de trabajo donde se enmarca


este proyecto es modelar y controlar un vehı́culo aéreo
no tripulado provisto de cuatro rotores (cuadricóptero)
accionados mediante motores brushless para vuelo en
interiores (ver figura 1). El sistema de control permitirá el
vuelo estacionario, la navegación guiada mediante una
emisora de radiocontrol y la navegación autónoma me-
diante sensores de distancia. Con el fin de poder utilizar
el vehı́culo en docencia, se desarrollará tanto el modelo Figura 1: Cuadricóptero y emisora
de simulación, las estrategias de control y estimación
de estado y los driver blocks de sensores y generación 2. E STADO DEL A RTE
automática de código en el entorno Matlab/Simulink. Los movimientos de traslación y rotación de un cua-
Además, este proyecto aportará a la Universidad Ponti- dricóptero se controlan mediante variaciones en la ve-
ficia Comillas experiencia en la operación de UAV para locidad de giro de sus rotores que definen las fuerzas
facilitar el desarrollo de nuevas lı́neas de investigación de empuje vertical en cada uno de ellos. Ası́ pues,
en este ámbito. para que el dispositivo ascienda/descienda se debe
El cuadricóptero empleado en este proyecto (ver figura aumentar/disminuir la velocidad de rotación de todos
1) está accionado por cuatro motores brushless situados los motores simultáneamente. Las traslaciones en las
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 2

tres direcciones del espacio se producen generando un controles PID como el diseñado por Bouabdallah [11].
empuje diferencial entre dos rotores alternos. Ası́ pues, Es importante remarcar que en internet hay disponible
para producir un desplazamiento en la dirección x, se una gran variedad de firmwares para controladores
deberá reducir la velocidad del rotor 2 de la figura 2 de vuelo basados en Arduino como el Multiwii o el
y aumentar la del 4. Finalmente, el incremento de la Mega-Pirate disponibles para el controlador Crius y
velocidad de rotación de los motores 1 y 3 permitirá al el firmware APM para el controlador Ardu-Pilot. Sin
dispositivo realizar una guiñada dextrógira, mientras embargo, no se conocen versiones disponibles para el
que el aumento de la velocidad de 2 y 4 resulta en una entorno Matlab Simulink.
guiñada levógira.
Finalmente, la aplicación de cuadricópteros en cursos
de control avanzado en distintas universidades está au-
mentando significativamente durante los últimos años,
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. M ODELADO
El modelo matemático del cuadricóptero viene dado
por el conjunto de ecuaciones que describen el compor-
tamiento fı́sico 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
Figura 2: Esquema de los pares generados por los rotores
comportamiento del cuadricóptero en vuelo. Las
El modelado matemático de una aeronave es un tema entradas del modelo son las tensiones aplicadas a
ampliamente estudiado en la literatura. En la actualidad, los cuatro motores brushless, y las salidas son las
existe una gran variedad de modelos tanto para vuelos posiciones y velocidades en los seis grados de liber-
interiores [1],[2],[3] como para vuelos exteriores, en tad del cuadricóptero. La aplicación fundamental
cuyo caso se incluyen los efectos aerodinámicos [4],[5]. de este modelo es comparar diferentes estrategias
La correcta definición de un modelo es crı́tica tanto de control mediante una simulación lo más realista
para el diseño de la estrategia de control como para los posible, como un paso de validación previo a la
estudios de simulación. implantación del sistema de control en el equipo.
Modelo simplificado. Este modelo incluye exclusi-
El control asume la disponibilidad de las variables vamente las dinámicas correspondientes a la orien-
de estado, es decir la estimación de la orientación del tación del cuadricóptero, permitiendo diseñar la
cuadricóptero definida a partir de los ángulos de Euler. estrategia de control que estabiliza la aeronave.
Los estimadores de estado más comunes para este tipo Cada uno de estos modelos requiere de un conjunto
de aplicación son: de parámetros (dimensiones, masa, momentos de inercia
El filtro complementario [6]: se basa en una pon- y caracterı́sticas dinámicas de los sistemas propulsores),
deración de la estimación de los ángulos de Euler que deben ser adecuadamente estimados. Consecuente-
realizada a partir de las medidas de los aceleróme- mente, se ha desarrollado un modelo CAD y se han
tros y los giróscopos. Hace uso de un filtro paso realizado pruebas del sistema de propulsión en un banco
bajo para eliminar el ruido del acelerómetro (alta de ensayos.
frecuencia) y de un filtro paso alto para eliminar el En este proyecto se ha hecho uso del programa Solid
bias de los giróscopos (baja frecuencia). Edge para obtener la representación gráfica (CAD) del
El filtro de Kalman [7]: Se trata de un algoritmo de cuadricóptero mostrada en la figura 3.
estimación de los ángulos de Euler a partir de un
modelo estocástico del sistema de medida, basado
en los acelerómetros y giróscopos.
En relación a la estrategia de control, existe una
gran variedad de algoritmos propuestos en la
literatura debido a que el modelo del cuadricóptero
es multivariable y no lineal. Entre los algoritmos
propuestos destacan los algoritmos basados en la
teorı́a de Lyapunov de H.Voos [1] y Bouabdallah
[3], los controladores por realimentación del estado Figura 3: Representación CAD de la estructura del cua-
como el control LQ diseñado por Hoffmann [10] y los dricóptero
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 3

Este programa permite calcular los parámetros para aligerar la carga computacional del conjunto y
mecánicos de la estructura incluidos en la tabla 1. ademas evitar el gimbal lock [9].
Parámetros mecánicos de la estructura La aplicación de este filtro de Kalman comprende
Masa
(Kg)
Volumen
(mm3 )
Ixx
(Kgm2 )
Iyy
(Kgm2 )
Izz
(Kgm2 )
varias fases de cálculos complejos como se ilustra en
0.2722 94059.7154 7,83 · 10−4 7,85 · 10−4 1,401 · 10−3 la figura 5 a modo de ilustración. Los detalles del
Parámetros dinámicos de los rotores funcionamiento del mismo se pueden encontrar en la
Kv Rm b d
(rpm/v)
2900
(Ω)
0.6
(N s/rad)
5.44e-7
(N ms/rad)
7.32e-9
memoria del proyecto.

Tabla 1: Parámetros del cuadricóptero


Para la estimación de los parámetros dinámicos de los
rotores se han realizado pruebas en el banco de ensayos
mostrado en la figura 4. Las variables medidas durante
los ensayos son la tensión, 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ámetros dinámicos de los rotores mostrados en la
tabla 1.

Figura 5: Esquema de funcionamiento del filtro


En la figura 6 se muestran las estimaciones del ángulo
de alabeo realizadas mediante el filtro de Kalman (verde)
y de una variación en dicho ángulo por el filtro com-
plementario (azul) durante la simulación. Se ha incluido
también el valor real del ángulo (rojo) para facilitar
la comparación. Se puede observar que ambos filtros
son capaces de realizar una estimación razonablemente
buena, a pesar de existir ruido en las medidas. Sin
embargo, el filtro de Kalman realiza una estimación más
precisa que el filtro complementario.

Estimación del angulo de alabeo


3
Filtro complementario
Filtro de Kalman
2 Referencia

Figura 4: Banco de ensayos 1

En ninguno de los modelos presentados se han in- −1

cluido los efectos aerodinámicos que pueden afectar al −2


Ángulo(º)

dispositivo pues, tras un análisis de éstos (especialmente −3

el efecto suelo y el efecto techo), se ha demostrado que −4

no son relevantes en condiciones de vuelo en interiores. −5

−6

−7

4. E STIMACI ÓN DE ESTADOS −8


9.5 10 10.5 11 11.5
Tiempo(s)
12 12.5 13 13.5 14

En este proyecto se ha hecho uso de un filtro multipli-


cativo extendido de Kalman, ya que resulta más robusto Figura 6: Estimación de ángulos de Euler en simulación
de cara a las vibraciones de la estructura. Se trata de un
filtro extendido porque se basa en un modelo no lineal 5. D ISE ÑO DEL SISTEMA DE CONTROL
del sistema de medida. Se dice también que es multipli-
cativo porque, a pesar de que es capaz de realizar es- El sistema de control gestiona la regulación del dis-
timaciones únicamente con giróscopos y acelerómetros, positivo a través de la aplicación de unas señales de
pueden incluirse otros sensores (magnetómetros, GPS, mando (tensiones de los motores). En este estudio se
etc). Por contra, este filtro requiere de un alto nivel de han diseñado un conjunto de controladores basados
computación y por tanto se ha hecho uso de cuater- en el modelo simplificado a fin de abarcar un mayor
niones para la obtención de las variables estimadas. Un rango de posibilidades. Posteriormente se ha hecho uso
cuaternión [8] es un vector de cuatro componentes que del modelo completo para su comparación mediante
representa de forma precisa la información contenida en simulación. Los algoritmos de control diseñados son:
los ángulos de Euler para simplificar las operaciones. 1. Control PID con ponderación de la referencia con
Ası́ pues se hará uso de estos elementos matemáticos mecanismo anti-windup diseñado por respuesta en
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 4

frecuencia. Se ha hecho uso de los ı́ndices signifi- información entre el algoritmo de control programado
cativos (margen de fase, pulsación de cruce, etc) en Simulink y los sensores y actuadores instalados en
recomendados por la literatura. La presencia del el cuadricóptero. Estos ”driver blocks” han sido progra-
mecanismo anti-windup es esencial para evitar la mados en C++ e integrados en bloques de Simulink, lo
acumulación del error en la integración cuando el cual supone una dificultad añadida por la novedad que
mando satura. supone. Los drivers diseñados son los siguientes:
2. Control PID incremental. Se trata de una modifica- Driver para la IMU. Con este driver se pretende
ción realizada sobre el control PID anterior en la acceder a la información disponible en la IMU. Para
que se trabaja con incrementos en vez de con valo- su programación se ha hecho uso de la librerı́a
res absolutos. La principal ventaja es que permite FreeIMU, originalmente escrita en C++.
limitar los incrementos del mando y que simplifica Driver para el transmisor-receptor RC. Este código
la lógica del mecanismo anti-windup. es el que establece la comunicación entre el receptor
3. Control por realimentación de estado por posi- RC y el microcontrolador. Este código programado
cionamiento de polos. Los polos del sistema en hace uso de interrupciones para evitar un exceso
lazo cerrado se han seleccionado para optimizar la de consumo de memoria por parte del microcon-
respuesta del sistema. trolador. Adicionalmente se ha incluido un filtro de
4. Regulador LQ por realimentación de estado. Se ha Savitzky-Golay para reducir el nivel de ruido de las
hecho uso de un modelo estocástico del sistema señales.
para para obtener la matriz de ganancias de re- Driver para los ESC. Se trata de generar una señal
alimentación del estado que permita minimizar el PWM que permite variar la tensión aplicada al
error de seguimiento de la referencia y el esfuerzo motor.
de control. Driver para el lector de la tensión de la baterı́a.
5. Control LQ por realimentación de estado con ac- Este driver permite obtener la medida analógica de
ción integral(LQI). Se ha añadido una acción inte- la tensión en la baterı́a.
gral para corregir las perturbaciones en carga que Finalmente se ha programado un máquina de estados
presenta el sistema. para el arranque seguro del sistema y la gestión de las si-
Adicionalmente, se ha desarrollado un modelo del tuaciones de fallo. Esta máquina estados ha introducido
cuadricóptero sobre una motocicleta (péndulo invertido) al sistema:
para evaluar los algoritmos de control anteriores a la 1. Elementos de seguridad como control de altura
hora de estabilizar el cuadricóptero, mientras se reduce máxima, arranque del sistema controlado o tensión
el riesgo de dañar el dispositivo ante errores en la mı́nima de la baterı́a.
implantación y un mal ajuste del control. 2. Variaciones en el algoritmo de control, como por
ejemplo la desactivación de la acción integral du-
6. I MPLEMENTACI ÓN rante el proceso de arranque para evitar que se
Al no existir experiencia previa en el uso anteriores de acumule el error en la integración.
cuadricópteros en la UPCO, una gran parte del trabajo 3. Un arranque suave y controlado del sistema.
realizado se ha destinado a construir y poner a punto
el cuadricóptero. Estas tareas incluyen el montaje de 7. E NSAYOS
la estructura, la incorporación de los elementos necesa-
Los ensayos realizados sobre el cuadricóptero han
rios para su funcionamiento (ESC, rotores, la tarjeta de
demostrado que sólo se precisa seleccionar el algoritmo
control, etc) y el conexionado de los mismos. Adicio-
de control adecuado para realizar vuelos estables. Por
nalmente se ha diseñado y construido una placa para
tanto, el montaje y conexionado de todos los elementos
monitorizar la tensión de la baterı́a. Se trata del circuito
del equipo es el adecuado. Además, la máquina
mostrado en la figura 7 que incluye un divisor de tensión
de estados que se encarga de gestionar el arranque
con un buffer.
del sistema ha sido evaluada ofreciendo resultados
satisfactorios.

Los ensayos realizados sobre todos los drivers


programados han ofrecido también resultados positivos
permitiendo su aplicación en futuros estudios. En
el caso de las señales obtenidas por el receptor RC,
se ha observado cierto nivel de ruido en ella. Por
tanto, se ha diseñado un filtro de Savitzky-Golay
Figura 7: Esquema del circuito de monitorización de la
para su cancelación. Este filtro se ha usado también
tensión de la baterı́a
para retrasar la señal de tensión en la baterı́a de forma
Otra de las principales tareas realizadas es la de que sea menos sensible a los picos presentes en la misma.
diseñar los ”driver blocks” que permiten intercambiar
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 5

La figura 8 muestra la estimación de los ángulos de controlador LQ con acción integral.


Euler en el sistema real realizada por el filtro de Kalman
diseñado (azul) y la realizada por el estimador de la Finalmente, se ha incluido la señal de mando de la
IMU (verde). La estimación realizada por el filtro de figura 10 proporcionada por el controlador LQ incre-
Kalman es mejor tanto con los rotores desconectados mental con acción integral y mecanismo anti-windup al
como activos. Sin embargo se puede apreciar una deriva realizar un ensayo real de estabilización del cuadricópte-
o bias en la estimación del ángulo, debido a que no se ro. Tal respuesta no permite regular el dispositivo pues
han podido usar los magnetómetros en el filtro. Esta se trata de una señal que oscila entre los valores de
deriva puede tener un efecto importante en el control saturación fijados en el controlador. Queda como tarea
y debe ser estudiada en el futuro. pendiente en futuros proyectos revisar el estimador de
40
Estimación corregida
estado y las ganancias de la cadena de actuación para
MEKF
Filtro IMU
resolver este problema.
20
Mandos U1, U3
260
Phi
Theta
240

220
0

Tensión(PWM)
200

180
Ángulos (º)

−20
160

140

120
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
−40
Tiempo(s)

Mandos U2, U4
260
−60 U2
U4
240

220

Tensión(PWM)
−80 200
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
Tiempo (s)
180

160

Figura 8: Estimación del ángulo de alabeo 140

120
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
Tiempo(s)

En la figura 9 se muestran las respuestas temporales


superpuestas de los controladores PID, de realimenta- Figura 10: Mandos aplicados sobre el dispositivo con el
ción de estado por posicionamiento de polos y por el controlador LQI
método LQ ante un escalón en la referencia obtenidas
mediante simulación. Como se puede observar, los tiem- 8. C ONCLUSIONES
pos de establecimiento con el control PID son menores A modo de conclusión general del proyecto se puede
que los correspondientes a los controles basados en la decir que no se ha podido diseñar un controlador capaz
realimentación del estado. de regular el comportamiento del cuadricóptero. Sin em-
bargo, evaluando el volumen de aportaciones realizadas,
11
PID
11 11
sı́ se ha facilitado considerablemente el esfuerzo requeri-
Realimentación
10 LQR 10 10
do para alcanzar este objetico en futuros proyectos. Las
9 9 9
tareas realizadas con éxito son las siguientes:
8 8 8

7 7 7
Se dispone de los modelos, tanto matemáticos como
6 6 6
en CAD, para diseñar un algoritmo de control
Ángulo (º)

Ángulo (º)

Ángulo (º)

5 5 5
adecuado.
4 4 4 Los drivers programados realizan su función de
3 3 3 forma adecuada.
2 2 2 La máquina de estados gestiona el arranque del
1 1 1
dispositivo adecuadamente.
0
0 0.5 1 1.5
Tiempo (s)
2 2.5 3
0
4 4.5 5 5.5
Tiempo (s)
6 6.5 7
0
7 7.5 8 8.5
Tiempo (s)
9 9.5 10 La monitorización del estado de la baterı́a se lleva
acabo de forma correcta.
Figura 9: Respuesta de los tres controladores ante esca-
Se dispone del diagrama de bloques general di-
lones de 10o
señado para volcar el algoritmo al dispositivo.
La respuesta del control PID presenta un pequeño El cuadricóptero está listo para volar de forma re-
sobrepaso mientras que las de los otros dos controles gulada, a falta de ajustar correctamente el algoritmo
son sobreamortiguadas. Si los ángulos a introducir en de control y la estimación de estado.
la referencia son cercanos al valor unitario, la mejor La causa principal por la cuál el controlador no es capaz
respuesta es la proporcionada por el control PID, dado de regular el dispositivo parece ser la estimación de los
que su tiempo de establecimiento es el menor. Si por ángulos de Euler, bien por la deriva que presentan o
el contrario, se pretende trabajar con ángulos de Euler bien por una velocidad inadecuada de estimación de
mayores la respuesta sufre modificaciones indeseables, los mismos. Existe también la posibilidad de que el fun-
como ocurre con el ángulo psi. Sin embargo, las cionamiento incorrecto del controlador sea consecuencia
respuestas de los controladores LQ y por realimentación de la conversión de la señal de mando, es decir, la
de estado no sufren este efecto. Consecuentemente, transformación de fuerzas acopladas de empuje a tensión
el control que se ensayará en el sistema real será el en cada motor.
MODELADO Y CONTROL DE UN CUADRICOPTERO, JUNIO 2014 6

9. F UTURAS MEJORAS Engineering Course. IEEE International Conference


Las mejoras que se proponen hacen referencia a mejo- on Teaching, Assessment, and Learning for Enginee-
rar el ajuste del algoritmo de estimación de estado. Por ring (TALE), August 2012.
tanto se propone:
Incluir magnetómetros en la estimación de los ángu-
los de posición de la aeronave. Para ello deberá pro-
gramarse un algoritmo de calibrado de los mag-
netómetros. El código del estimador ya está prepa-
rado para realizar la ampliación.
Implementación de un sistema telemétrico para mo-
nitorizar los ensayos en tiempo real.
Diseñar una carcasa que permita absorber las vibra-
ciones de los rotores.

R EFERENCIAS
[1] Holger Voos, Nonlinear Control of a Quadrotor
Micro-UAV using Feedback-Linearization. Procee-
dings of the 2009 IEEE International Conference on
Mechatronics. Málaga, 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 Draganflyer four rotor
helicopter. IEEE International Conference on Robo-
tics and Automation, April 2004.
[6] Robert W Klein, Flight control system employing
complementary filter. 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
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án, José.
Fernández Martı́nez, Cesáreo.
Partner entity : ICAI Universidad Pontificia Comillas.

Abstract—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. The control system will allow the system to hover, to fly guided
by a transmitter and to fly 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 Terms—Quadcopter, UAV, Thesis, ICAI, Comillas.

1 I NTRODUCTION control system. Finally, the power supply for the device
will be performed by LiPo batteries.

W I thin 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 fields 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
flights (see figure 1). The control system will allow the
system to hover, to fly guided by a transmitter and
to fly autonomously using proximity sensors. As this Fig. 1: Quadcopter and RC transmitter
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. 2 S TATE OF THE ART
Besides, this project will give the Pontifical University
of Comillas experience in the UAV world in order to The quadcopter translation and rotation movements
ease the development of new research lines within this are performed shifting the rotation speed of its rotors.
subject. Consequently, in order for the UAV to ascend/descend
vertically, the speed of all the motors must be in-
The quadcopter that will be used is powered by four creased/decreased simultaneously. Increasing the angu-
brushless motors, placed at the end of the structures’ lar speed of motors 1 and 3 will make the quadcopter
arms, which are driven by four electronic speed con- to rotate clockwise, whereas the increase in the speed
trollers (ESC). It includes a Crius microcontroller chip of motors 2 and 4 with result in a counter-clockwise
card with an Arduino ATMega 2560 processor, as well as rotation. Finally, the vehicle can be made to fly in either
an inertial measure unit (IMU) made up of gyroscopes, direction horizontally: for instance, reducing the speed
accelerometers and magnetometers. The communication of motor 4 and increasing the speed of motor 2 will result
between the device and the pilot is done by a radio in the frame roll, making the device fly to the left.
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 8

algorithms, easing the implementation of a controller


software to the quadcopter used. Nevertheless, there
are not firmwares 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.

Fig. 2: Schematics on torques generated by each motor


of a quadrotor
3 M ODELLING
The modelling of this kind of devices, where the
mathematical description of the quadcopter is deduced, The mathematical model of the quadcopter is defined
has been widely studied along the last decades. by the set of equations which describe the physics of the
Therefore, now a days there is a wide variety of models spaceship. In this project, there have been developed the
for indoor flights [1],[2],[3] as well as for outdoor flights two following models:
[4],[5] to work with. The main difference between the
two groups is that outdoor flights models include the • Full non-lineal model. Set of equations which allow
aero-dynamical effects. The definition of a precise model to accurately represent the flight behaviour of the
is critical for both the design of the controller and the quadcopter. The inputs to the model are the four
simulation tests. 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
The control strategy assumes that the state variables
main use for this algorithm is to compare different
are available, that’s to say, the estimation of the quad-
control strategies in order to make the simulation as
copter attitude from the Euler angles. The most common
much accurate as possible, thus it can be seen as a
state observers within this subject are:
validation test before using it in the real device.
• The complementary filter [6]: The estimation of
• Simplified model This model includes the
the attitude angles, done with the measures of dynamics corresponding to the attitude of the
both accelerometers and gyroscopes, is properly quadcopter exclusively, allowing to design the
weighted in order to obtain an accurate and control strategy which makes the spaceship stable.
relatively noise-free estimation. The noise carried in
the accelerometer measures (high frequency noise) Each of these models requires a set of parameters
is filtered by a low pass filter, as well as the bias (dimensions, mass, inertia momentums and the thrust
from the gyroscopes (low frequency) is removed by systems dynamics) which must be accurately estimated.
a high pass filter. Consequently, a CAD model has been developed and
• A Kalman filter [7]: It is an algorithm used to some tests have been carried out over the thrust systems
estimate the Euler angles of a device based on the on the test bench built for this purpose. In this project, it
stochastic model of the measure system, using the has been used Solid Edge in order to obtain the graphic
accelerometers and the gyroscopes included in the representation (CAD) of the quadcopter shown in figure
IMU. 3.

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].
Fig. 3: CAD representation of the quadcopter structure
It may be important to highlight that there are many
PID controller firmwares available in the Internet. The This program allows to compute the mechanical pa-
Arduino based controller chip cards such Crius or rameters of the structure, which have been included in
the Ardu-Pilot offer the Multiwii or the Mega-Pirate the table 1.
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 9

Mechanical parameters for the structure


Mass Volume Ixx Iyy Izz
(Kg) (mm3 ) (Kgm2 ) (Kgm2 ) (Kgm2 )
0.2722 94059.7154 7.83 · 10−4 7.85 · 10−4 1.401 · 10−3
Dynamic parameter for the motors
Kv Rm b d
(rpm/v) (Ω) (N s/rad) (N ms/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 figure 4. The variables measured
during the test are the voltage, the current, the rotational
speed, the thrust and the torque. The values of the Fig. 5: Estimation process for the Kalman filter
parameters shown in table 1 has been deduced from the
set of measures that were described above. Figure 6 shows the attitude estimation of the pitch
angle gathered by the Kalman filter designed (green) as
well as the estimation performed by the complementary
filter (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 filters are well
capable of performing an accurate estimation, despite
the noise contained in the measures. Nevertheless, the
Kalman filter performs a more precise estimation than
the complementary filter.

Estimación del angulo de alabeo


3
Filtro complementario
Filtro de Kalman
2 Referencia

−1

−2
Ángulo(º)

Fig. 4: Test bench −3

−4

None of the models introduced above includes the −5

aero-dynamical effects which may affect the dynamics −6

of this kind of devices, because it has being proved that −7

they are not relevant for indoor flights. −8


9.5 10 10.5 11 11.5
Tiempo(s)
12 12.5 13 13.5 14

4 S TATE ESTIMATION Fig. 6: Attitude angles estimation during the simulations

In order to achieve a proper estimation of the attitude


angles, a multiplicative extended Kalman filter has been
5 C ONTROL SYSTEM DESIGN
designed. This robust algorithm, able to handle a signifi- The control systems handles the regulation of the device
cant noise in the measures, is able to achieve the attitude through the controller signal applied in the motors. In
estimation using only gyroscopes and accelerometers order to cover a wider range of possibilities, it has been
although it can also use other sensors such as the mag- developed a set of controllers based on the simplified
netometers, a GPS, etc. Besides, it is said that this is an model. Afterwards, the full model has been used to
extended filter because it is based on a non-lineal model validate them through simulations. The control algo-
of the measures system. On the other hand, this filter rithms designed are:
requires a high computational cost. Therefore, quater- 1) Referenced weighted PID controller with anti-
nions have been used in order to obtain the estimated windup, design through frequency response. The
variables. A quaternion [8] is a four dimensional vector design has used the meaningful indicators (phase
which accurately represents the information contained margin, cross frequency, etc.) recommended by the
in the attitude angles. Thus, this mathematical elements literature. The anti-windup mechanism is critical
will be used in order to reduced the computational cost in order to avoid the error accumulation in the
of the system as well as to avoid the gimbal lock [9]. integral action of the controller, when a saturation
The mathematical process of the Kalman filter involves takes places in the actuators.
a number of complex computation steps as it is shown, 2) Incremental PID controller. It is a slight modifica-
as an illustration, in figure 5. The detailed process is tion over the former PID controller as it works with
deeply described in the proyect memory. increments instead of absolute values. The main
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 10

advantage of this modification is that it allows to interruptions in order to lighten the memory con-
set a constraint on the control signal as well as it sumption of the microprocessor. In addition, a
simplifies the anti-windup logic. Savitzky-Golay filter has been designed in order to
3) State feedback controller designed by pole place- reduce the amount of noises carried by the signals.
ment. The close loop poles of the system habe been • Driver for the ESC. It produced a PWM signal
chosen to optimize the system response. which allows to shift the voltage applied in the
4) State feedback LQ regulator. The stochastic model motors.
of the system has been used to obtain the state • Driver for the monitoring system of the battery
feedback gain matrix which allows to minimize the charge. This driver gets the analogue measure of
reference tracking error and the control effort. the battery voltage.
5) State feedback LQ regulator with integral action
Finally, a state machine has been programmed in order
(LQI). An integral action has been added to the
to ensure a safe and smooth start up as well as the
former LQ controller in order to reject the load
management of the fault situations. The state machine
disturbances present in the system.
has introduced to the system:
In addition, it has been developed a model of the
quadcopter placed on a Lego Motorbike (modelled as 1) Safety features such as the maximum altitude
a inverted pendulum) in order to test the control al- control, the regulated start up and the minimum
gorithms while stabilizing the device. This new model charge of the battery.
reduces the risk of damaging the quadcopter against 2) Variations over the control algorithm, such as the
implementation errors or an inappropriate fit of the disconnection of the integral action during the start
quadcopters’ paramenters. up process in order to avoid the error accumulation
in the integral action.
3) A smooth and regulated start up.
6 I MPLEMENTATION
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 7 T ESTS
the assembly of the structure, the placing of the required
elements (ESC, rotors, controller chip card, etc.) as well The tests performed over the quadcopter have shown
as their connection. In addition, a chip card has been that it only requires to choose the proper control
both designed and built to monitor the battery charge. algorithm to perform stable flights. Therefore, the
The circuit, shown in figure 7, is made up of a voltage assembly and connection of all the system elements
divisor with a buffer. 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 field. Regarding the obtained
signals from the RC receptor, it has been identified a
significant amount of noise. Thus, a Savitzky-Golay
Fig. 7: Layout of the monitoring circuit for the battery filter has been designed in order to reject it. This filter
charge has also been used to set up a delay in the voltage
signal coming from the battery, so that I will be less
Another set of tasks is the design of the driver blocks sensitive to the present peaks.
which allow to exchange information between the con-
trol algorithm programmed in Simulink and the sensors Figure 8 shows the estimation of the Euler angles in
and actuators placed on the quadcopter. These drivers the real system, done by the Kalman filter designed
have been programmed in C++ and integrated into (blue) and by the IMU estimator (green). The estimation
Simulink blocks, thus they add additional challenges due performed by the Kalman filter is better than the one
to the newness introduced. done by the other estimator, even if the motors are
• Driver for the IMU. This driver is intended to access turned on. Nevertheless, a drift on the estimation can be
to the information available in the IMU. In order to appreciated, due to the lack of magnetometer measures
ease its programming, the library FreeIMU has been during the estimation process. This drift may have an
used, originally programmed in C++. important effect on the control efficiency and should be
• Driver for the RC system. This code sets the studied in the near future.
communication between the RC receptor and the
microcontroller card. The programmed code uses
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 11

Estimación corregida Mandos U1, U3


40 260
MEKF Phi
Theta
Filtro IMU 240

220

Tensión(PWM)
200
20

180

160

140
0

120
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
Tiempo(s)
Ángulos (º)

−20 Mandos U2, U4


260
U2
U4
240

220

Tensión(PWM)
−40
200

180

160

−60
140

120
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
Tiempo(s)

−80
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
Tiempo (s)

Fig. 10: Control signals applied in the device with the


Fig. 8: Pith angle estimation LQI controller

Figure 9 shows the simulated overlapped time 8 C ONCLUSIONS


responses of the PID controller, the state feedback con- The general conclusion of this project is that it has
troller designed by pole placement and by the LQ not been possible to design a proper controller able to
method, when a step is introduced in the reference. As regulate the quadcopter behaviour. Nevertheless, look-
it can be seen, the settling times for the PID controller ing to the volume of contributions done, it can be said
responses are smaller than the controllers based on a that this project has considerably eased the required
state feedback. effort to achieve the main goal of this project in fu-
ture works. The tasks successfully performed are the
11 11 11
following:
PID

10
Realimentación
LQR 10 10
• It has been created a set of models both mathe-
9 9 9 matical and graphical (CAD) which can be used to
8 8 8 design a proper controller.
7 7 7 • The programmed drivers work properly.
6 6 6
• The state machine handles the start up of the device
Ángulo (º)

Ángulo (º)

Ángulo (º)

5 5 5
appropriately.
• The monitoring of battery charge is done correctly.
4 4 4

3 3 3
• It has been designed a detailed block diagram pre-
2 2 2

1 1 1
pared to be loaded into the quadcopter’s microcon-
0 0 0
troller card.
0 0.5 1 1.5 2 2.5 3 4 4.5 5 5.5 6 6.5 7 7 7.5 8 8.5 9 9.5 10
Tiempo (s) Tiempo (s) Tiempo (s)
• The quadcopter is ready to fly properly controlled
Fig. 9: Time response of the three main controllers when as long as the proper algorithm and state estimation
a 10o step is applied in the system is provided.
The main cause of the controller inability to regulate
The PID controller response shows a small overshoot the device seems to be the incorrect estimation of the
while the responses of the other two controlles are over- attitude angles, rather by the drift they show up or
damped responses. If the angles that will be introduced by the inappropriate estimation speed of these angles.
in the reference are close to the unitary values, the best There is also the chance that the incorrect operation of
response is the PID’s as its settling time is the smallest. the controller is due to conversion chain of the control
If, instead, the angles introduced as references are bigger signal, changing from coupled thrust forces to each
than the unit, then the response suffers undesirable motor voltage.
modifications, as it happens with the yaw angle.
Nevertheless, the state feedback controlled responses 9 F UTURE IMPROVEMENTS
do not suffer this shift. Consequently, the controller that The improvements proposed lead into an improvement
will be tested in the real system will be the LQI regulator. of the state estimation algorithm. Therefore, it is recom-
mended to:
Finally, the control signal to stabilize the quadcopter • Include the magnetometers into the attitude estima-
with the incremental LQI with anti-windup has been tion of the quadcopter. In order to achieve such a
included in figure 10. That response shows that the task, a calibration algorithm for the magnetometer
control is unable to regulate the device as the signals should be programmed. The Kalman filter code is
ranges between the minimum and maximum saturation already prepared for this enlargement.
values set in the controller. Therefore, the state estimator • Implement a telemetric system in order to monitor
and the gains from the actuator chain should be studied in realtime the tests performed.
in future research among this field, in order to solve • Design a casing which allows to absorb the vibra-
these problems. tions from the rotors.
MODELLING AND CONTROL OF A QUADCOPTER, JUNE 2014 12

R EFERENCES
[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 Draganflyer four ro-
tor helicopter. IEEE International Conference on
Robotics and Automation, April 2004.
[6] Robert W Klein, Flight control system employing
complementary filter. 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.

S-ar putea să vă placă și