Professional Documents
Culture Documents
Grade
N. Melhegeug
D. Djarah
W.Benzaoui
M.R. Kafi
Z. Tidjani
MAA
MAA
A
MAA
MAA
Quality
President
Examiner
Examiner
Advisor
Co-Advisor
University
KASDI MERBAH
KASDI MERBAH
KASDI MERBAH
KASDI MERBAH
KASDI MERBAH
Dedications
I dedicate my dissertation work to, before anyone else, the heart and soul of my entire
existence:
My beautiful mother for the silent heartfelt prayers Mum! You are and always will be
a symbolism of hope, faith and love in my life.
And my wonderful father for the endless giving and the unconditional support.
I will always cherish what you two have done for me and I I equally love you forever
and ever.
I also dedicate this piece of work to my loving brothers and sisters,
Chaouki and Akrem Im totally incomplete without you by my side
My sister Imene you are not just a sister to me; you are actually a valuable part of my
world.
To my source of joy and laughter my precious little sister Sirine.
And my grandmother Safia and my aunt Nadia both mean the world to me.
I dedicate this work and give thanks to all my friends; especially my lifetime
friends Also, I cannot forget my friends in college with
you was such an amazing time.
Finally, I genuinely dedicate my graduation dissertation to anyone has ever believed in
me and helped channel my talent here on Earth.
A.I. KAFI
Dedications
I dedicate my dissertation work to, before anyone else, the heart and soul of my entire
existence:
My beautiful mother for the silent heartfelt prayers Mum! You are and always will be
a symbolism of hope, faith and love in my life.
And my wonderful father for the endless giving and the unconditional support.
I will always cherish what you two have done for me and I I equally love you forever
and ever.
I also dedicate this piece of work to my loving brothers and sisters,
Krimou, Chaouki, and Abdelkader Im totally incomplete without you by my side
My big sisters Mounia You are not just a sister to me; you are actually a valuable part
of my world.
And her husband Steve thanks for everything.
To my source of joy and laughter my precious little sister Lina (I love you
to pieces!)
And to the cute baby's angel my nieces Jasmine, Sarah and my hero Adam you gave me
the unique gift of being
To my grandfather, Abdelkader (may Allah rest their soul in peace)
And my grandmothers Fatima and kouya you both mean the world to me.
To my uncles and aunts; mainly, my Aunt Fatima zahra and my uncle Med.Laid With
special feelings
I dedicate this work and give thanks to all my friends; especially my lifetime
friends Nabil, Badri, Islem Also, I cannot forget my friends in college with
you was such an amazing time.
Finally, I genuinely dedicate my graduation dissertation to anyone has ever believed in
me and helped channel my talent here on Earth.
M.B.AOUN
Acknowledgements
We would like to fully acknowledge and thank Allah for all the blessings and
guidance we are granted. Very special thanks go to our supervisors
Mr KAFI Med Radouaane and, Mr. TIDJANI Zakaria
Who were more than generous with their expertise and precious time.
Also, we give lots of credit to all the personnel and teachers staff of Kasdi
Merbah University for all the facilities they have provided through all the
process of making this project.
Contents
Main used symbols
List of figure
List of tables
General Introduction.. 01
Chapter I: Overview on quadrotors and Problem statement
I.1 Historical...... 03
I.2 Quadrotor concepts ...... 06
I.2.1 Quadrotor manoeuvring ......... 06
I.2.2 Common quadrotor applications ..... 09
I.3 Problem Statement.... 09
Chapter II: Quadrotor control platform design
I.1 Introduction 11
I.2 Hardware architecture .. 11
I.3 Quadrotor structure 11
I.4 Sensors unit . 13
I.4.1 Overview on quadrotor sensors 13
I.4.2 Sensors selection.. 17
I.5 Actuators Unit........ 20
I.6 Wireless communication unit........ .. 22
I.7 Power unit........ ... 23
I.8 Control unit.. 24
I.9 Ground station unit........ ... 26
I.10 Programming of microcontrollers... 28
I.11 Conclusion........ ............... 29
Chapter III: Quadrotor dynamics modeling
III.1Introduction.........
30
30
31
32
III.3 Discussion 34
III.4 Determination of quadrotor parameter...
34
34
43
III.6 Conclusion... 45
Chapter IV: Control design and software implementation
IV.1 Introduction....
46
51
52
Lift slope
Thrust factor
Propeller chord
Cd
CH
CQ
Drag coefficient
CRm
CT
Thrust coefficient
Drag factor
Hub force
Motor current
Ixx, yy, zz
Inertia moments
Jm
Motor inertia
Jr
Rotor inertia
Jt
Overall mass
mbat
Battery mass
Number of propellers
Drag moment
Rotation matrix
Rrad
Rotor radius
Rm
Rolling moment
Thrust force
Motor input
Control inputs
x, y, z
X, Y, Z
Position vector
Pitch angle
Pitch of incidence
tw
Twist pitch
Inflow ratio
Speed vector
Air density
Solidity ratio
Induced velocity
Roll angle
Yaw angle
Acronyms
UAV:
IMU:
MEMS:
VTOL:
PID:
dsPIC:
EKF:
UART:
SPI:
I2C:
Inter-Integrated Circuit
SRF:
ESC:
BLDC:
Brushless motors
PWM:
MCU:
DMA:
PCB:
PLL:
List of figures
Figure (I.1):
Figure (I.2):
Figure (I.3):
Figure (I.4):
Figure (I.5):
Figure (I.6):
Figure (I.7):
Figure (I.8)
Figure (I.9):
03
14
21
22
24
25
25
27
27
28
29
30
34
35
35
36
Figure (III.6): Quadrotor frame set 1 and set 2 size and weight. 37
Figure (III.7): Quadrotor central set size and weight..
38
38
39
41
42
43
44
46
47
48
49
49
50
51
53
56
57
59
60
61
62
42
55
58
General introduction
General introduction
General Introduction
Today, several families of flying machines exist: fixed-wing aircrafts, rotary-wing
aircrafts, flapping-wing aircrafts and many others. Rotary-wing aircrafts use rotating wings (i.e. a
rotor with blades spinning about a shaft) to provide lift, they belong to the family of Vertical
Take-Off and Landing (VTOL) vehicles which are not only able to vertically take-off and land,
but also hover motionless in the air.
Unmanned aerial vehicles (UAV) where the computers replace human pilots exist as a
consequence of technological advances on electronic embarked systems and sensors, advances in
automatic control and artificial intelligence; they have become a widely used for many
applications for which human operation are considered unnecessary or dangerous.
It is a structure with a four rotors in a cross configuration. Each rotor is responsible for a
certain amount of thrust and torque about its center of rotation. This cross structure is quite thin
and light.
In order to define a quadrotor's orientation (or attitude) around its center of mass,
aerospace engineers usually define three dynamic parameters, the angles of yaw, pitch and roll.
This is very useful because the forces used to control the aircraft act around its center of mass,
causing it to pitch, roll or yaw.
Several works have been dedicated to quadrotor control especially for angle variables and
altitude regulation. But, majority of them used an existing platform (developed before or
purchased), where the designer has the only task to develop its proper control and implement it.
However, in our case we are in face of no exiting quadrotor system.
In this work; our goal is the design of control platform for UAV quadrotor; this last,
classified among the family of (RWVTOL) vehicles, must achieve quadrotor attitude and altitude
control by an onboard microcontroller (dsPIC). Most important quadrotor information has to be
collected and visualized in ground station, used also to start quadrotor flying.
The platform has been developed by creating a system of interconnected devices.
Two sensors have been used for measuring the quadrotor attitude and its height from the ground
reference. For the first purpose, an Inertial Measurement Unit (IMU) has been chosen, while the
distance has been estimated with sonar range finder module. The data processing and the control
algorithm are handled in the Micro Control Unit (MCU) dsPIC which provides the signals to the
motor drivers which are needed to amplify the power delivered to the motors.
This memory is organized as follows:
In first chapter, we will give a brief historical on quadrotor and an overview.
1
General introduction
The second chapter will be dedicated to develop the hardware part of the quadrotor. So, the
structure of the quadrotor and needed devices are examined. Furthermore, we will present the
selected devices and their main properties.
To take an overview on quadrotor behavior, the problem of dynamical modeling will be
addressed in third chapter. Also, it will facilities the determination of the control algorithm
parameter to achieve a better stabilization. The most parameters of our prototype including
moment of inertia, propeller constants, and motor characteristics will be calculated. The whole
system will be examined in Matlab Simulink.
In the fourth chapter, the concept followed in this thesis for system control was to
evaluate a control technique, tune its parameters in simulation and evaluate it experimentally.
Here, we will examine devices setting according to needed functionality.
Finally, we will conclude our work by conclusion and perspectives.
Chapter I
I.1 Historical
I.2 Quadrotor concepts
I.2.1 Quadrotor manoeuvring
I.2.1 Common quadrotor applications
I.3 Problem Statement
Chapter I
Chapter I
hydrogen-filled balloon to provide both stability and lift. His second aircraft, the Oemichen No.
2, as illustrated in Figure (I.2), had four rotors and eight propellers, supported by a cruciform
steel-tube framework layout. Five of the propellers were meant to stabilize the machine laterally,
another for steering and two for forward propulsion.
Although rudimentary, this machine achieved a considerable degree of stability and
controllability, having made more than a thousand test flights in the middle of that decade. It was
even possible to maintain the aircraft several minutes in the air. In the 14th of May, the machine
was airborne for fourteen minutes and it flew more than a mile. But Oemichen was not satisfied
with the poor heights.
Chapter I
Chapter I
possible due to the availability of cheap electronics and lightweight resistant materials available
to the public.
Chapter I
Another important situation is the hovering fly (attitude and altitude stabilization) which
occur when the lift force is equal to the quadrotor weight (F=Mg). Otherwise, we distingue two
cases:
1. F > Mg: rising flight.
2. F < Mg: falling flight
The quadrotor movements are the resultant of the interaction of the following produced force and
torques with respect to a fixed body frame:
a- Throttle force (U1 [N]):
This command is provided by increasing (or decreasing) all the propeller speeds by the
same amount. As shown in Figure (I.6), it leads to a vertical force which raises or lowers the
quadrotor.
Chapter I
Chapter I
the Z axis. When the overall torque is unbalanced, the quadrotor turns on itself around Z axis.
This command leads only to yaw angle acceleration like shown in Figure (I.9).
Chapter I
01
Chapter II
II.1 Introduction
II.2 Hardware architecture
II.3 Quadrotor structure
II.4 Sensors unit
II.4.1 Overview on quadrotor sensors
II.4.2 Sensors selection
II.5 Actuators Unit
II.6 Wireless communication unit
II.7 Power unit
II.8 Control unit
II.9 Ground station unit
II.10 Programming of microcontrollers
II.11 Conclusion
Chapter II
II.1 Introduction
This chapter discusses the hardware architecture of the quadrotor and the specification of
all parts and devices used in this project which includes: mechanical structure design, electronic
units, sensors and actuators. At the first, the selected hardware architecture will be presented.
Then, according to this architecture, the appropriate components should be selected depending
on available products from the local market and our objectives.
11
Chapter II
POWER UNIT
ACTUATORS UNIT
SENSORS UNIT
BLDC+ESC
IMU+SONAR
RANGE
CONTROL UNIT
COMMUNICATION
UNIT
dsPIC
WIRELESS MODULE1
GROUND STATION
PCB CARD
WIRELESS MODULE2
12
Chapter II
Chapter II
Damped mass on a
spring
2. Gyroscopes:
A gyroscope detects mechanical rotation and provides the measurement of the angular
velocity about its axis. A three-axis gyroscope strapped on a vehicle can measure the three
components of the angular velocity of a frame attached to the vehicle relative to an inertial
frame. Gyroscopes make use of the Coriolis Effect, which describes the effect that in a frame of
reference rotating at an angular velocity ( ), a mass (m) moving with velocity ( ) experiences a
force as shown in figure (II.4).
(
Chapter II
3. Magnetometers:
A magnetometer provides measurements of the intensity and/or direction of a magnetic
field. In particular, they can be used to measure the direction of the Earths magnetic field.
However, the major inconvenience of these sensors is the influence of magnetic perturbations on
their measurements. As example, electric motors can generate parasite magnetic field that can be
sufficient to disturb measurements.
4. Global Positioning System (GPS):
The GPS is a satellite-based navigation system developed by the United States of
America 'US' at department of defense in the early 1970s. Initially, it was developed as a military
system to fulfill US military needs, and it has been available to civilians since 1995. The GPS
consists, normally, of a constellation of 24 operational satellites which are placed such that at
any location on the Globe one can observe simultaneously from four to eight satellites.
Knowing distance from one satellite places the object to locate somewhere on a spherical surface
that's centered on the satellite. Knowing distances from two satellites places this object
somewhere along a circle that's between the two satellites, see figure (II.5).
Satellite2
Satellite1
Chapter II
to a system containing a three-axis accelerometer and a three-axis gyroscope. Some IMU also
contain a three-axis magnetometer and/or a GPS for the improved accuracy of attitude and
position estimation
6. Barometric altimeters:
A barometric altimeter measures the atmospheric pressure at its level and converts the
pressure measurement to an indication of altitude above sea level. As the air pressure decreases
at altitudes above sea level, the actual reading of the instrument is dependent upon its location.
7. Sonar range finder:
Sonar range finder measures the distance to an object based on the time of flight method.
They transmit ultrasonic waves and measure the time that it takes to reflect, if there is an object
in the path of these waves; part or all of these waves will be reflected back to the transmitter and
can be detected through the receiver path as shown in figure (II.6). By measuring the difference
in time between the transmitted waves and the received one, it is possible to determine how far
away the object is. They are rarely used due to their limited ranges. But they are often used for
automatic landing of VTOL vehicles or indoor applications.
16
Chapter II
17
Chapter II
Power supply
Pins
Additional
extra Pins
Regulated 3.3
Voltage
UART Pins
(Rx, Tx)
The CHR-6dm makes 6 extra pins available, which can be configured as digital inputs,
Chapter II
The CHR-6dm uses a continuous-discrete implementation of the EKF, where rate gyro
measurements are used to drive the prediction step, and the accelerometer and magnetometer are
used for drift correction in the update step.
2. Sonar range finder:
The Devantech SRF range finder family is the most popular choice; it has a simple interface
defined on the Inter-Integrated Circuit (I2C) bus, provides measurement at 15 HZ rate and
demonstrates high flexibility of configuration. In our project the SRF10, shown in Figure (II.9),
was chosen as it presents many features:
5V supply voltage;
Provide 15 Hz reading rate for 6m range;
Configurable rate and range.
Figure (II.10): Sonar range finder SRF10 pin connection (Back View)
19
Chapter II
20
Chapter II
Brushless DC motors are a type of synchronous motor. This means the magnetic fields
generated by both the stator and the rotor rotates at the same frequency. These motors do not use
brushes for commutation; instead, they are electronically commutated by specialized circuit.
In the radio control hobby brushless motor is controlled by an Electronic Speed
Controllers (or ESC); it constitutes an easy interface between processor control unit and
brushless motor. Based on internal microcontroller, it receives signal control in PWM form and
generates corresponding powered signal sequence to adjust correctly the motor speed.
In our case the motors and ESCs are available with the GAUI 330x kit. It is dotted with
four (04) Scorpion (1050KV) brushless motors as illustrated in Figure (II.12); as stated by the
manufacturer, this type of motor, of weight 40g, is able to rotate at 11655 RPM when free of
load.
Phases wire
to be
connected to
esc
21
Chapter II
Also, as part of the kit, ESCs in number of four (4) ensure motor speed control. With light
weight of 9g and small size they can support current up to 10A from various battery types (Liion /Li-Poly 2-4 cell) and (NiMH/NiCd 5-12 cell). The frequency of PWM received signal from
processor can be set up to 400 Hz. Such rate minimizes considerably motor vibration and control
performance.
ESC must be wired to battery, motors and processor according to Figure (II.14).
Motors wire
Power supply
(Orange wire)
Regulated 5v output
(Black and red wires)
Figure (II.14): Electronic Speed Controllers (ESCs)
II.6 Wireless communication unit
Through this unit the quadrotor is able to communicate with a ground station, accepting
commands and reporting data. We need two modules one for the quadrotor and another in the
ground station computer that will handle all telemetry for system identification and control
purposes.
Many wireless protocols exist, but in our situation we must choose the one which gives
less power consumption with acceptable transmission speed. After reading some thesis and
articles we found that accommodate choice is the Zigbee protocol.
The Zigbee protocol is a wireless network protocol specifically designed for low data rate
sensors and control networks. There are a number of applications that can benefits from the
Zigbee including: building automation networks, home security systems, industrial control
networks, and remote metering and PC peripherals [Zig06].
22
Chapter II
From available products, we recite the famous Xbee module which is equipped with this
protocol at rate up to 250Kbps. However, communication with the host controller is achieved
through serial interface.
To minimize the execution time of the control loop as possible, choosing a wireless
module which can communicate to the host at high speed is recommended. We are going to use
the Easybee3 module from Mikroelektronika company shown in Figure (II.15). It is developed
around the MRF24j40MA transceiver from microchip and equipped with 3.3v regulator. This
module has a SPI bus which allows us to communicate faster than the UART (RS232)
implemented on the Xbee.
Control socket
Data socket
With typically operating Voltage as 3.3V and low current consumption, the data transmission
rate is up to 250Kbps.
II.7 Power unit
This unit provides necessary power for all units. It is recommended to choose a light
weight rechargeable battery to minimize the power consumption and increase the flight time.
Among the most used batteries in drone applications, especially quadrotor and helicopter,
we recite: Nickel Cadmium (NiCd), Nickel Metal Hydride (NiMh) and Lithium Polymer (Li-Po).
We decide to choose Lithium-ion Polymer GAUI 3s (LiPo3s) battery shown in Figure (II.16). It
is adequate with our prototype in view of dimension; under 11.1V as voltage, it has a capacity of
2000mAh with discharging factor equal to 20C and weight 150g.
23
Chapter II
Power supply
Wires
Charger
Connector
So, we decide to use the dsPIC 128gp710 from microchip. Mikroelektronika Company presents
Micro Controller Unit 'Mcu' cards equipped with this microcontroller as shown in Figure (II.17).
The dsPIC128gp710 provides the following features:
Up to 40 MIPS operation (at 3.0-3.6V);
Dsp engine;
Flash program memory, up to 256 Kbytes;
Data SRAM, up to 30 Kbytes (includes 2 Kbytes of DMA RAM);
8-channel hardware DMA;
24
Chapter II
dspic128gp710
10 MHZ oscillator
Pins
Figure (II.17): dsPIC card
In addition to the purchased MCU, we had developed a PCB card that connects all
devices (MCU, sensors and ESCs). It is equipped with 3.3V voltage regulator to give necessary
power to MCU card. Figure (II.18) illustrates the two sides of the developed PCB.
Chapter II
Zigbee Module
IMU emplacement
Emplacement
(UART1)
UART2
General purpose
ESCs
emplacement
26
Chapter II
Variables
rates
Flying time
ON/OFF
button
Chapter II
Picready board is a solution for fast and simple development of microcontroller applications. It is
equipped with FTRL232 circuit that ensures the conversion from serial to usb and the adaptation
of logical level between PC and pic.
II.10 Programming of microcontroller:
To program the dsPIC and pic18f4520, two development boards were utilized: Easypic6
and the Lv24-33. These boards are shown in Figure (II.22).
These widely used boards are development tools suitable for programming and
experimenting the PIC microcontrollers from MICROCHIP, includes an on-board programmer
microICD support (in-circuit debugger) providing an interface between the microcontroller and
the PC. We are simply expected to write a code in a compiler, generate a hex file and program
our controller using the PICflash programmer. Numerous on-board modules, such as 128x64
graphic LCD display, 2x16 LCD display, led array and push button etc. allow us to easily
simulate the operation of the microcontroller and to determine the software bugs quickly.
PICflash usb
cable
Microcontroller emplacement
For safety reason we decided to add protection frame around the quadrotor to minimize
the risk of damage in case of crash. The figure (II.23) shows the assembled structure.
28
Chapter II
III.11 Conclusion:
In this chapter, all necessary hardware parts was selected, every choice was justified
according to available products and objectives. As main consideration, we focus on the
possibility that all devices work together in the system. The cost of the platform system was
reduced as possible. Additional to the selected devices a PCB card was developed; setting,
configuration and test of devices will be treated in chapter (IV).
29
Chapter III
III.1 Introduction
III.2 Modeling with Newton-Euler Formalism
III.2.1 Aerodynamic Forces and Moments
III.2.2 General Moments and Forces
III.3 Discussion
III.4 Determination of quadrotor parameter
III.4.1 Inertial moments
III.4.2 Propeller constants
III.5 Conclusion
Chapter III
III.1 Introduction
In this chapter, the derivation of the quadrotor model is provided. To derive the dynamic
model, we must write the physical equations that describe the quadrotor motions; this approach
makes it easy to build dynamic models of the system, since we dont have to perform closed loop
identification in flight.
Newton-Euler formalism, moment of inertia calculus, blade element and momentum theories
were used to model the quadrotor. The developed model assumes the following:
The structure is supposed rigid;
The structure is supposed symmetrical;
The propellers are supposed rigid;
Thrust and drag are proportional to the square of propellers speed.
The dynamics of a rigid body under external forces applied to the center of mass and expressed
in the body fixed frame are in Newton-Euler:
+[ ]
`30
* +
(III.1)
Chapter III
and
: inflow ratio
a: lift slope
v: induced velocity
: air density
(III.2)
2. Hub force ( ):
This force is the resultant of the horizontal forces acting on all the blade elements.
3. Drag moment (
(III.3)
This moment about the rotor shaft is caused by the aerodynamic forces acting on the blade
elements.
The horizontal forces acting on the rotor are multiplied by the moment arm and
integrated over the rotor.
Drag moment determines the power required to spin the rotor.
`31
(III.4)
Chapter III
4. Rolling moment (
):
The rolling moment of a propeller exists in forward flight when the advancing blade is
producing more lift than the retreating one. It is the integration over the entire rotor of the lift of
each section acting at a given radius.
(III.5)
(III.6.a)
(III.6.b)
(III.6.c)
(III.6.d)
(III.6.e)
Pitching moments:
Body gyro effect
(III.6.f)
(III.6.g)
(III.6.h)
(III.6.i)
(III.6.j)
Yawing moments:
Body gyro effect
Inertial counter-torque
(III.6.k)
(III.6.l)
(III.6.m)
(III.6.n)
(III.6.o)
`32
Chapter III
Actuators action
(III.6.p)
(III.6.q)
| |
Friction
(III.6.r)
Actuators action
(III.6.s)
(III.6.t)
| |
Friction
(III.6.u)
Actuators action
(III.6.v)
Weight
(III.6.w)
The equations of motion are derived and all the forces and moments listed in Subsection
as below:
| |
`33
| |
(III.7)
Chapter III
III.3 Discussion
The previous dynamical model shows that quadrotor has four inputs (
outputs (
and six
. First of all, the structure of the quadrotor has to be modeled as several components with
Chapter III
(Z)
M4
M3
M1
M2
22mm
(Y)
(x)
11mm
154mm
1. Motors:
Each motor can be modeled as a solid cylinder. The four motors show a high degree of
symmetry; therefore the computation were done just on the front motor and then transposed to
the other ones. In Figure (III.4), we consider a simplified geometry of the motor.
Cylinder A
)
[
]
`35
Chapter III
m=41g
l =20mm
r =14mm
`36
Chapter III
m=7g
A=177mm
C=26mm
m=2g
B=22mm
Figure (III.6): Quadrotor frame set 1 and set 2 size and weight
Frame set 1:
h1=11mm, h2=100mm.
Frame set 2:
h=154mm.
3. Central frame:
The central frame was modeled as rectangular parallelepiped as the figure (III.7) illustrate.
h=11mm.
`37
Chapter III
m=10g
L=85mm
4. dsPIC card:
The dsPIC card was modeled as a rectangular plate.
m=30g
A=130mm
B=50
mm
{
`38
Chapter III
5. Battery:
The battery was modeled as rectangular parallelepiped as shown in figure (III.9).
m=150g
A=130mm
C=35mm
B=20mm
At last, it is possible to compute the overall three body moments of inertia IXX, IYY and IZZ by
adding all the components around the same corresponding axis.
`39
Chapter III
6. Rotor inertia:
Rotor inertia is the total moment of inertia around the motor axis (parallel to the Z axis).
It is composed of two constants: the inertial rotational moment of the motor and of the propeller
[Tom08]. It is given by:
The propeller was modeled as a flat cylinder with variable density; this shape has been chosen
because it comes from a rotating (flat plate) propeller, furthermore the density depends on the
radius and it decreases by getting far from the center, so :
`40
Chapter III
The rotor
Permanent magnet
Figure (III.10): The Developed Speed Sensor
The table (III.1) summaries the obtained result:
Table (III.1): Experimental results of Trust test.
Rotational speed (rad/s)
120
0.0784
130
0.1764
233
0.3430
311
0.6370
388
0.9898
446
1.3426
496
1.6660
571
2.2834
676
3.1458
Evolution of lift force versus rotor speed is illustrated in graph of figure (III.11)
`41
Chapter III
Using the Curve Fitting Tool of Matlab; the value of the trust factor is found
.
Note that the obtained result respects the relation
2. Drag factor:
To estimate the drag factor, we use the following relation [qua08]:
(
Numerical application gives d=9.3E-8
))
0.68
0.18 m
arm length
thrust coefficient
`42
Chapter III
drag coefficient
9.3E-8
motor inertia
Propeller inertia
Rotor inertia
inertia on x axis
inertia on y axis
inertia on z axis
twist pitch
0.07 rad
pitch of incidence
0.35 rad
propeller chord
0.018 m
`43
Chapter III
In this simulation, the initial values of all quadrotor variables are taken equal to zero;
except roll rate which is equal to 0.5 rad/s; the input control vector is chosen as U=[m.g 0 0 0]
where m.g is the quadrotor total weight. We obtain the following results depicted on Figure
(III.13).
From these figures, we see that all variables are unstable. The roll angle decreases with
negative values. The coupling effect which is due to gyroscopic effect appears in common
10
0.5
pitch (rad)
roll (rad)
-10
-20
-30
-40
4
6
Time (s)
-1.5
10
4
6
Time (s)
10
4
6
Time (s)
10
4
6
Time (s)
10
10
0
altitude(rad)
0.3
0.2
0.1
0
-10
-20
-30
-40
4
6
Time (s)
-50
10
200
150
y(m)
100
x(m)
yaw (rad)
-0.5
-1
0.4
-0.1
50
-2
-4
4
6
Time (s)
10
-50
`44
Chapter III
III.6 Conclusion
In this chapter, we developed dynamical model of the quadrotor; we suggested the
modelling of quadrotor components with geometrical forms. It allows us to compute needed
physical quantities as inertia moments. Also, we proposed and performed an experimental test to
determine trust factor; the graphical representation of lift force versus rotor speed, in hyperbolic
form, is in accordance with theoretical law.
From previous theoretical development, the quadrotor can be considered as MIMO
nonlinear system with high coupling effect between angles and positions. With four inputs, we
are able to control only four variables from six at choice; so the quadrotor is considered as under
actuated system. Consequently, remained variables will change as solution of dynamical model
equations. Open loop simulation shows the instability of quadrotor.
In the aim to stabilizing quadrotor, in next chapter, we will investigate the design of
control law and perform their software implementation on the developed quadrotor system
platform.
`45
Chapter IV
IV.1 Introduction
IV.2 Platform devices configuration and setup
IV.3 Ground station
IV.4 Development of the dsPIC code
IV.5 Control Design
IV.6 Experimental results
IV.7 Encountered problems
Chapter IV
IV.1 Introduction
This chapter treats the configuration and the setup of all devices to build a full system
that can stabilize the quadrotor. The stabilization requires the implementation of a control law;
we will perform synthesis of two control laws and tuning their parameters in the Simulink
Matlab.
We will explain in detail the architecture of the full software which will manage all the
functionality of the system. Finally the obtained parameters will be injected on the real system. If
necessary, these parameters will be tuned.
Chapter IV
by motor wires; this will minimize the yaw drift. All previous set up was done using the
configuration interface.
The IMU communicates with microcontrollers using two packets RX and TX; the structure of
both packets is shown in figure (IV.2).
Value
's'
'n'
'p'
PT
Byte
1-3
CHK
6
N+5
N+6 N+7
Each received packet must begin with the three-byte (character) sequence
"snp" to signal the beginning of a new packet.
6-(N+5)
(N+6)-(N+7)
to
2. Easybee3 module:
The Zigbee module has many parameters which must be set; these parameters define the
operation mode and the identification of the module in the network. The Table (IV.1) summaries
the parameters of identification:
Table (IV.1): Easybee3 identification parameter
Parameter
Description
Long address
Short address
PAN ID
The memory of the device is divided into control registers and buffers which are accessible
through SPI bus with two addressing modes:
Short Addressing: give access to registers locate between 0X00 and 0X3F.
Long Addressing: give access to registers locate between 0X000 and 0X38F.
Each parameter can be set by writing the desired value in its appropriate control register.
The Figure (IV.3) explains case of short address read and writes procedure.
47
Chapter IV
Chapter IV
49
Chapter IV
Chapter IV
imu3 (4): calculate roll and roll rate from data provided by (read sensors);
alt (5): calculate altitude and altitude rate from data provided by (read sensors);
Cmd (6): calculate commands and rotor speeds from data provided by (read sensors);
The Figure (IV.7) illustrates the emplacement of each subVIs on the block diagram.
(1)
(2)
(1)
(3)
(6)
(4)
(5)
's'
'n'
'p'
0x01
0x00
Byte
51
0x01 0x52
6
Chapter IV
The DMA channel 1 is dedicated to data transfer from DMA ram to IMU through the
UART; this allows the dsPIC to execute the program code when the DMA channel work
in background.
b. Reading the data provided by the IMU in the previous transfer; the DMA channel 2 is
responsible of data reading;
c. Reading the data from the sonar every four sample time;
d. Sending all available states to the ground station every six sample time;
e. Calculus both of commands and PWM if ON command was received; sending the PWM
to ESCs
f. Stopping control loops and motors if OFF command was received;
The diagram shown in Figure (IV.8) illustrates the code implemented on the dsPIC.
IV.5 Control Design:
In this section, we will synthesis a controller for altitude and attitude stabilization
followed by simulation results. This will be useful in implementation of an adequate real
controller. Therefore, we will develop a Proportional Integral Derivative controller (PID).
1. Modeling for control purpose:
The model developed in section (III.2) describes the differential equations of the system.
For control design we must simplify the model. Hence, hub forces and rolling moments are
neglected when thrust and drag coefficients are supposed constant. The system can be rewritten
in state space form with U as inputs vector and X as state vector chosen as follows:
State vector:
[
We obtain after simplification:
52
Chapter IV
Begin
While (1)
False
4 SP occur
True
Reading data from the sonar
False
6 SP occur
True
Sending data to the ground station
False
ON command
True
Run the control loop
False
OFF command
True
Stop the control loop and motors
53
Chapter IV
(IV.1)
(
(
(IV.2)
(IV.3)
(IV.4)
(IV.5)
So, on the full model; the four commands were done by the following expressions:
(
(
(
(
)
(
(
)
)
)
(
(
54
(IV.6)
)
)
(IV.7)
(IV.8)
Chapter IV
(IV.9)
b. Simulation results:
For simulation purpose, we apply the previous controllers with following parameter values:
Z controller
controller
controller
controller
0.5
1.5
1.5
1.5
0.3
0.5
0.5
0.5
The desired values for angles are all zero, when that for altitude is 40 cm.
The altitude controller is composed of two parts: one to compensate the gravity effect which is
constant and equal to the quadrotor weight. However, the second part is the PID controller with
previous parameter values. It is to note that controller output is scaled with the factor
(cos( ).cos( )). This will reduce the coupling effect with roll and pitch angles.
The simulation results of angles and altitude evolution are presented in Figure (IV.9). After
transitory time, the controlled variables converge to their desired values. So, Roll and Pitch as
Yaw angles converges to zero values which correspond to quadrotor horizontal orientation.
Even the altitude evolution show a relatively slow convergence to the desired value (40 cm) in
08 seconds, it remains characterized by some amount of oscillations which reflect the difficulties
that the controller encounter in quadrotor stabilizing.
55
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
pitch (rad)
Roll (rad)
Chapter IV
0.2
0.2
0.1
0.1
-0.1
-0.1
-0.2
-0.2
4
6
Time (s)
10
4
6
Time (s)
10
0.05
1.2
-0.05
0.8
altittude (m)
yaw (rad)
1.4
-0.1
0.6
-0.15
0.4
-0.2
0.2
-0.25
-0.2
4
6
time (s)
10
4
6
time (s)
10
Chapter IV
permanent regime when hovering occurs. The torques u2, u3 and u4 are affected by
measurement noise, but their mean values are kept in zero neighborhood. They contribute mainly
to adjust deviation from desired angles.
1
12
0.5
10
-0.5
u1 (N)
u2 (N.m)
14
-1
-1.5
-2
4
6
time (s)
-2.5
10
4
6
time (s)
10
4
6
time (s)
10
1.4
1.2
0.5
1
0.8
0
u4 (N.m)
u3 (N.m)
0.6
-0.5
0.4
0.2
-1
0
-0.2
-1.5
-0.4
-2
4
6
time (s)
-0.6
10
57
Chapter IV
Z controller
controller
controller
controller
0.5
1.2
0.5
0.5
0.5
The desired values of angles and attitude are: [roll=0, pitch=0, yaw=0, altitude50cm]
During experimental test, we recorded, through Labview program, the quadrotor information
given in figure (IV.11) and Figure (IV.13).
The attitude and altitude variables, given in figure (IV.11), are maintained in vicinity of their
corresponding desired values.
58
Chapter IV
59
Chapter IV
Relatively, the best results are obtained for roll and pitch angles where they error remain
inferior to 04 deg. furthermore, their controller respond quickly to perturbations introduced
manually at instants t=27, 34, 40, and 44 seconds for roll angle and at instants t= 33, 52 and 56
seconds for pitch angle. They are rejected and the desired values are reached again.
The Yaw deviation is with maximum of 10 deg in neighborhood of zero. This may be the
consequence of drift in magnetometer measurement. It can be reduced by an accurate adjustment
of Kalman filer. Peak appearing at moments t=32, 52 and 58 seconds are due to applied
perturbation; the controller arrive to compensate them.
The altitude is oscillating around desired value where the error is maintained inferior to
10 cm, at most time. The controller arrive to bring the quadrotor in vicinity of required altitude
(50 cm) even when perturbation is applied as in moments t=33, 44, 55 and 67 seconds.
The obtained results, especially roll and pitch are acceptable; in comparison with the work of
Bouabdallah [design and control of quadrotors with application to autonomous flying].
60
Chapter IV
61
Chapter IV
The control inputs associated to roll and pitch are more influenced by measurement
noise, which appear in control inputs through derivative action in the PID controller. It is to note
that control inputs remain admissible.
The torque u4 that influences on Yaw angle is less affected by noise but it is in
permanently applied, which may be necessary to compensate drifts.
IV.7 Encountered problems:
1. Integral windup:
Nonlinear effects require care, such as actuator saturation; this can lead to closed loop
instability, especially when the process is unstable in open loop. This problem occurs when
starting from huge initial conditions; this will charging more the integral action and the
discharging action will take lot of time. Firstly, we enable the integral action into small interval
(-10, 10); but the problem stays present; the second solution is the implementation of antiwindup algorithm [Bou07] shown in the Figure (IV.14) which gives good results.
If
+ * sampling period
Else if U1*
> 0 then
0
Else
End if
Figure (IV.14): Anti windup algorithm
2. Yaw drift:
Our IMU suffers from yaw drift, this problem due to the motors wires; we try to reduce
the diagonal elements of EKF; in spite of the problem was not resolved, but the PID controller
stabilizes the yaw angle.
3. Wireless communication problem:
In the development of code to manage the wireless communication, we were able to send
data from the quadrotor embarked system to the ground station, but when trying to send
commands from the ground station to the quadrotor, the dsPIC can't read the correct data, at
present we can't find the causes; but we think that is a code compatibility problem.
62
Chapter IV
IV.8 Conclusion:
In this chapter, we explained the configuration of all devices to make the system works
properly, also the main subVIs on the Labview code was illustrated; then the PID controller was
applied in order to stabilize the quadrotor in both altitude and attitude position; the simulation
result show that all desired values can be achieved with acceptable.
Experimental results show the validity of both developed platform and control. dsPIC
communicate with all onboard devices. Quadrotor information are collected from on board
sensors, treated and transmitted to ground station.
Graphical interface in ground station offer a useful tool to follow variable evolution, to
enhance control design and certainly to record all necessary variables.
The attitude angles and altitude were controlled to be maintained near their desired
values. Roll and Pitch control show good performance, where Yaw angle control is also
maintained near its desired value but it needs to be enhanced to reduce oscillation.
Altitude control was realized by means of PD control. Except, slow oscillations, the
control error is less than 10 cm.
Control inputs remained bounded and admissible except noises caused mainly by used
instrumentation.
At last we recited some encountered problems and some solutions.
63
General conclusion
General conclusion
General conclusion
The goal of this thesis is to design and realize a control platform for an UAV quadrotor;
in order to stabilize the system and create a prototype that permits implementation of different
identification and control algorithms.
In the design of the platform, we had built a full system composed of different sensors
which communicate in various protocols with the host controller. Communication between
devices is established trough serial protocols as UART, I2C, and SPI which worked properly.
Protocol configuration was done in the main code of dsPIC. Furthermore, the system design
guarantees the adequate power for each device. With selected communication rate, the sampling
time was kept below 05 ms.
At next, we developed a dynamical model that describes all the forces and moments
acting on the quadrotor. This model revealed nonlinearities with coupling effect. Furthermore,
we computed our model parameters which are used later in control design. We tuned the
parameters of the controllers in SIMULINK and implement them in the real system.
In experimental test, the communication between quadrotor and ground station allowed
us to visualize and follow quadrotor variable evolution. So, the developed graphical interface
simplifies diagnostic of control design scheme.
The implemented PID controllers to regulate the four variables (Roll, Pitch, Yaw and
Altitude), had shown an acceptable performance. In despite of nonlinearities, the controlled
variables were stabilized near the desired values.
The controlled angles response were better than altitude one particularly the Roll and
Pitch.
At the end of this work, we give the following advices for future work:
Using longer propellers to save the power consumption;
Identify the drag factor by experimentation;
Update the IMU code to work with the SPI bus; this will reduce the sample time,
implement a control loop for motors speed (cascade loop)
Solve the wireless communication problem.
64
Bibliography
[ And 04]
[Bou 07]
[Chr datasheet]:
www.chrobotics.com
[Min09]:
[Mrf datasheet]
ww1.microchip.com/downloads/en/DeviceDoc/39776C.pdf
[Tom 08]
[ Seg 011 ]
[Jor09]
[Vin 06]
[Zig06]
http://ww1.microchip.com/downloads/en/AppNotes
/ZigBee2006%20Application%20Note%20AN1232A.pdf
Abstract :
The idea of this work was born in the context to produce an autonomous and intelligent
quadrotor UAV. So we have developed an embedded real time control system based on:
microcontroller, inertial measurement unit used as attitude sensor, a power stage containing
four speed controllers and two modules Zigbee for the wireless communication. We have
implemented PID controller to stabilize the quadrotor.
Rsum :
Lide de ce travail est ne dans le contexte de produire un quadrotor autonome et intelligent.
Pour ce faire, nous avons dvelopp un systme de commande en temps rel embarqu
contenant : une unit de commande que nous avons ralis base de microcontrleur, une
unit de mesure inertielle utilise comme capteur dattitude, un tage de puissance base de
quatre variateurs de vitesse et deux modules Zigbee pour la communication sans fils. Nous
avons implment une loi de commande PID pour la stabilisation.
:
. .
''Microcontrleur''
.'' PID'' '' Zigbee''