Professional Documents
Culture Documents
1650-8580
Abstract
Quadrocopter is an aerial vehicle platform which has become very popular
among researchers in the recent past due to the advantages it offers over conventional helicopters. Quadrocopter is very simple and unique, but it is inherently unstable from aerodynamics point of view. In recent past researchers
have proposed many control schemes for quadrocopter. In this thesis we present
fuzzy logic controller for quadrocopter. After brief introduction brief hardware
details are given that is used in this thesis. After that design procedure for the
fuzzy controller is presented. Then the designed fuzzy controller is tested in
Hardware In Loop (HIL) setup. The experimentation to validate the functionality and applicability of the designed controller were performed in contrained
setup due to some technical problems. The results of the experiments were satisfactory and it is concluded that it is possible to stabilize quadrocopter with
fuzzy logic controller.
Acknowledgements
I would like to thank those who helped during my thesis work. Without their
support, I could have never accomplished this work.
I take this special occasion to thank my parents. I dedicate this work to my
parents. It would have been simply impossible to start, continue and complete
without the support of my parents who, unconditionally provided the resources
to me.
I am eternally indebted to my supervisor Ivan Kalaykov for all the help,
invaluable guidance and generous support throughout my thesis work. I have
been very fortunate to be associated with such a kind and good person and it
would take more than a few words to express my sincere gratitude.
I also like to thank Bo-lennart and Boyko Iliev for their enlightening suggestions and advices. Their professionalism, guidance, dedication and inspirations
will always serve me as an example in my professional life.
iii
Contents
1 Introduction
1.1 Objectives . . . . . . . . . . .
1.2 Concept of Quadrocopter . .
1.3 Brief History . . . . . . . . .
1.4 Modern Quadrocopters . . .
1.5 Advantages and disadvantages
1.6 Outline of this document . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
1
2
3
3
4
5
2 Hardware Description
2.1 The Quadrocopter at Orebro University
2.2 Onboard System . . . . . . . . . . . . .
2.2.1 Micro-controller . . . . . . . . .
2.2.2 YGE motor controllers . . . . . .
2.2.3 Motors . . . . . . . . . . . . . .
2.2.4 Propellers . . . . . . . . . . . . .
2.2.5 Sensors on-board . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7
7
8
8
8
9
9
10
3 Background
3.1 Different control strategies used for quadrocopters . . . . . . .
3.2 Major Research/Educational Projects . . . . . . . . . . . . . .
3.2.1 European Aeronautic Defense and Space Company . .
3.2.2 Pennsylvania State University . . . . . . . . . . . . . .
3.2.3 Middle East Technical University . . . . . . . . . . . .
3.2.4 Australian National University . . . . . . . . . . . . .
3.2.5 University of British Columbia Vancouver, BC, Canada
3.2.6 Cornell University . . . . . . . . . . . . . . . . . . . .
3.2.7 Swiss Federal Institute of Technology . . . . . . . . . .
3.2.8 University of Technology in Compiegne, France . . . .
3.2.9 Stanford University . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
15
15
15
15
16
17
17
18
19
19
21
22
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
CONTENTS
vi
.
.
.
.
.
.
.
.
.
.
.
27
27
27
30
31
31
32
32
34
35
35
36
39
39
40
46
53
53
53
53
54
54
54
References
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
55
List of Figures
1.1 Quadrocopter dynamics. . . . . . . . . . . . . . . . . . . . . . .
1.2 Early Quadrocopters . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Modern manned quadrocopters . . . . . . . . . . . . . . . . . .
2
3
4
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
4.1
4.2
4.3
4.4
4.5
4.6
4.7
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7
9
10
11
11
12
12
13
29
30
30
31
32
33
34
LIST OF FIGURES
viii
4.8
4.9
4.10
4.11
4.12
.
.
.
.
.
.
.
.
.
.
35
35
36
36
37
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9
5.10
5.11
5.12
5.13
List of Tables
ix
List of Algorithms
xi
Chapter 1
Introduction
An unmanned aerial vehicle (UAV) is an unpiloted aircraft which can either fly
autonomously or it can be remotely controlled based on program downloaded
into on-board computers. Unmanned aerial vehicles have very vast area of applications in military for missions that are too dull, dirty, or risky for human
piloted aircraft. They are also used in a growing number of civil applications
such as aireal inspection.
UAVs can be divided basically into two categories, fixed wing UAVs and rotatory wing UAVs. Rotatory wing (or helicopter) UAVs have some advantages
over fixed wing UAVs that they can take off and land vertically, and that they
also can maintain their position at a fixed point in 3D space. Maintaining a position at a fixed point is called hovering. One very successful design for smaller
UAVs is an helicopter with four horizontal rotors with no tailrotor, such an
helicopter is called quadrocopter or quadrotor. Quadrocopters have some advantages over conventional single blade helicopter that they can be controlled
by changing the speed of the rotors and thus fixed-pitch blades are used that
simplifies the design and controlling of the quadrocopters. Secondly, the use of
four rotors allows each individual rotor to have a smaller diameter than the
equivally capable single blade conventional helicopter rotor, for a given vehicle
size, allowing them to attain less kinetic energy during flights. The most important advantage is that they can make manuevers that conventional helicopters
can not make.
1.1 Objectives
The objective of this thesis is to design a fuzzy flight controller for a quadrocopter that will control quadrocopter orientation in 3DOF namely; Pitch, Roll
and YAW. The controller is tested in Hardware In Loop (HIL) simulation. To
reach this objective:
Three gyros, one 3DOF accelerometer, a heading sensor and a GPS module have to interfaced with the on-board micro-controller
1
CHAPTER 1. INTRODUCTION
A simulink model for the fuzzy controller has to be developed and downloaded into dSPACE computer
A wired or wireless connection has to be made between on-board computer and dspace system
An Experiment setup has to be developed that is used to limit the 6DOFs
to 3DOFs namely; Pitch, Roll, and YAW
Figure 1.1: Quadrocopter motion, the arrow width is proportional to propeller rotational speed
CHAPTER 1. INTRODUCTION
is solely used to compensate for the gravity and not to counteract the torque,
because the four rotors neutralize the gyroscopic effect, so thrust is completely
used to produce the lift.
For micro quadrocopters, four rotors results in a very small rotor diameter,
which decreases the efficiency and increases energy requirment to get equal lift.
Also the dimensions and weight of a quadrocopter with equal payload is more
than a conventional helicopter. The simplifications in developing and control
which is offered by the design, makes it still a very favourable option for UAVs.
Chapter 2
Hardware Description
2.1 The Quadrocopter at Orebro University
This thesis can be regarded as the sequel of previous thesis work at AASS on
quadrocopter titled as, "Modeling and Simulation of Quadrotor Aircraft" [7].
The purpose of that thesis at Orebro University and the Applied Autonomous
Sensor Systems Lab (AASS) was to establish an experiment installation, which
enables students of the program Automation Engineering to apply and test the
skills they have gained in control engineering courses. The experiment installation is depicted in Fig. 2.1. It is supposed to cover the development chain
in control engineering reaching from mathematical modelling and control parameter determination over a pure virtual simulation to hardware-in-the-loop
simulation and testing. This thesis is about the hardware-in-the-loop simulation.
The Quadrocopter platform at Orebro University is a commercially available UAVP. The main features of the kit are:
Micro-controller
PIC16F876A is used as the main processor on-board. All the sensors in the
project are interfaced with this controller. Controller reads sensory data from
sensors on every iteration of code burned into it. This data is sent to dspace
computer in the form of 12 bytes, two bytes for each sensor reading. The communication between on-board computer and dSPACE computer is initialized
by dSPACE.
2.2.2
The YGE motor controllers are designed to convert the input value into an output PWM signal powering the motors and shifting phases on the motor inputs.
Each motor has its own YGE controller. Each YGE controller is powered with a
voltage 7.5-17V. The YGE controllers has the feature of undervoltage detection
resulting in a reduced power of the motors for safe landing in case the supply
voltage lies below a certain threshold.
The input PWM specification for the YGE controllers is 50Hz carrier frequency with pulses between 1.18ms and 1.8ms resembling zero throttle and
full throttle. The duty cycle therefore ranges between 0.059 and 0.09.
When switching on the motor controllers the throttle has to be set to zero
and the corresponding PWM values have to be send to the YGE. In this case
the YGE initializes correctly and gives 3 ascending beeps.
The YGE motor controlles feature also an I2 C bus input. This input can also
be used to communicate set values and also to programme the YGE controllers.
This is currently not used.
The YGE motor controllers can be programmed by moving the throttle and
waiting for acknowledgement beeps of the YGE. The featured programming
modes and options can be looked up in the YGE manual.
2.2.3
Motors
Since the motors are brushless, the phases of the AC supply have to be shifted
circularly in the three supply wires in order to rotate the motor. Since the motor
features not only three poles but 14, the motor rotation per 2
3 = 60 phase
2.2.4
Propellers
The propellers in use are EPP1045 propellers by Maxx Ltd. out of composite material with a length of 10 inches and a pitch of 4.5 inches per revolution. Mounted are two sets of counter rotating propellers. The shaft diameter
is 3mm.
10
2.2.5
Sensors on-board
11
Figure 2.4: Timing diagrram of reading two bytes from the HMC6352 (slave)
Gyro Sensor
A stable hovering control requires 3 gyro sensors: Pitch, Roll, and Yaw. ADXRS300
gyro sensors by Analog Devices are found to be most suitable for UAV application, but not usable without special soldering equipment. Therefore already
mounted sensors to break-out-PCBs are used.
12
13
the module can be configured to ubx or NMEA standards. However, it is configured to NMEA protocol. The C function downloaded into micro-controller
can translate one of the nine NMEA messages namely, GPGGA. GPGGA message gives sufficient information for autonomous flight, for example: Longitude, Latitude and hight.
Chapter 3
Background
3.1 Different control strategies used for
quadrocopters
For the control of UAVS there are several methodologies used in the literature.
Control systems that are used for the control of a helicopter type flying machine are: robust feedback controllers based on H techniques [14], fuzzy control, PD controllers [5], back-stepping controllers [5], Neural-Network Adaptive Flight Control [5]. For the experimentation done on the Stanford draganflyer UAVS, nonlinear control methods are used that uses discrete-time dynamic
inversion, under input saturation [10]. Another study done at the University
of Pennsylvania showed another control example, which used a vision based
control methodology for the control of UAVS [4].
3.2.1
15
CHAPTER 3. BACKGROUND
16
kilogram. It can fly with in the range of one kilometer. Its IMU (Inertial Measurment Unit) comprised of six inertial sensors for its six degrees of freedom. In
addition to these six sensors one GPS unit and air data sensors (gas sensors) is
also interfaced. Total IMU weighing 65 grams, consumes about three watts at
5 V. The system can be stored in a small space, as the motors can be detached
easily [20].
Figure 3.1: Quadrocopter developed by European Aeronautic Defense and Space Company
3.2.2
Pennsylvania State university have conducted two different studies on quadrocoptors [6] [4]. One is a master thesis work that was focused on a quadrocopter
test bench, shown in figure 3.2. The IMU for this quadrocopter was consist of
three gyro sensors and one accelerometer. Attitude of the quadrocopter was
controlled with PI control law.
Second work done in university of Pennsylvania used commercially available DraganFlyer as a testbed. This quadrocopter setup has an external pan-tilt
ground and on-board cameras in addition to the IMU. One camera was set on
the ground to capture the motion of five 2.5 cm colored pointers attached underneath the DraganFlyer, to obtain pitch, roll and yaw angles and the position
of the UAV by using a tracking algorithm. Algorithm routines ran in ground
computer. GPS or other accelerometers could not be interfaced to the system
due to the weight limitations. The controller used only cameras to obtain the
relative positions and velocities. Figure 3.3 shows the experiment setup for this
research.
Two control techniques were studied in this research, one using a series
of mode-based, feedback linearizing controllers and the other using a back-
17
3.2.3
Researchers at Middle East Technical University utilized three orthogonal piezoelectric gyros in their quadrocopter setup to control the attitude of the quadrocopter [2]. The attitude was controlled by a LQR (Linear Quadratic Regulator)
and PD controller. Frame was built of 45 cm rectangular aluminum profiles.
Figure 3.4 shows the experiment setup for this research.
3.2.4
The testbed used in Australian National University (ANU) was named as X4Flyer. The X4-Flyer [17] consists of a HC-12 a single board computer that
was used as the signal conditioning system. This card uses two HC-12 processors and outputs pulse width modulated (PWM) signals to control the speed
of motors directly, inputs PWM signals from an R700 JR Slimline RC receiver
allows direct plot input from a JP 3810 RF transmitter and has two separate
RS232 serial ports, one is used to communicate with the inertial measurement
unit (IMU) and the other is used as an asynchronous data linked to the ground
computer.
In IMU, the most suitable unit considered was the EiMU embedded inertial
measurement unit developed by the robotics group in QCAT, weighs 50 to 100
18
CHAPTER 3. BACKGROUND
grams. Crossbow DMU-6 is also used in the prototype. It weighs about 500
grams
The pilot augmentation control system is used. A double lead compensator
is used for the inner loop. The final setup is shown in Figure 3.5.
3.2.5
19
3.2.6
Cornell University
3.2.7
20
CHAPTER 3. BACKGROUND
21
3.2.8
University of Technology in Compiegne used commercially available quadrocopter system, developed by the Draganfly Innovations Inc.for their research
on quadrocopters [16]. The four control signals were transmitted by a Futaba
Skysport 4 RF transmitter.
The transmitter and the ground computer were connected by data acquisition cards (ADVANTECH PCL-818HG and PCL-726). The connection in the
radio is directly made to the joystick potentiometers for the collective attitude
control. To simplify the tuning of the controller and for flight security , several
switches were added in the PC-transmitter interface so that each control input
can be operated either in manual mode or in automatic mode. Therefore the
control inputs that are generated manually were selected by the human operator while the other control inputs were generated by the ground PC.
The Polhemus was interfaced through RS232 to the PC. This type of sensor
was reported to be very sensitive to electromagnetic noise and it was install as
far as possible from the electric motors and their drivers. The quadrocopter had
3 onboard gyros that helped the vehicle stabilization.The proposed controller
CHAPTER 3. BACKGROUND
22
was based on Lyapunov analysis using a nested saturation algorithm. Figure 3.9
shows the experimental setup for this research.
3.2.9
Stanford University
23
STARMAC I
STARMAC I has a total of 1 kilogram of thrust and can hover for not more
than ten minutes at full throttle. The onboard electronics were replaced with
PCB to have complete control over motors, power supply and sensor readings.
An upgrade to lipo batteries has increased both flight payload capacity and
hovering time and has considerably enhanced the capacity of the system. For
inertial measurement the Microstrain 3DM-G motion sensor was used, with
3-axis gyro, accelerometer and heading sensor information. For velocity and
position measurement, a Trimble Lassen Low Power GPS receiver was used.
To improve altitude information the downward-pointing SOnic Detection And
Ranging (SODAR) the Devantech SRFO8 was used, specially for difficult tasks
such as take off and landing.All of the onboard sensing is controlled through
two Microchip 40 MHz micro-controllers. Position estimation uses both GPS
position and velocity measurements, as well as orientation information in a
Extended Kalman Filter (EKF) to update the position and velocity estimates at
10 Hz. The GPS data is used to compensate integration bias of the small angle
approximated accelerations derived from the information from gyro sensors.
Attitude of the vehicle is controlled on board at 50 Hz and communicated
to a base sta- tion on the ground, communicating via a Bluetooth Class II device
with a range of over 150 feets. Designed to replace serial cable and therefore operates at a bandwidth of 115200bps. This bandwidth of 115.2 kbps is shared
by all (of four) flyers. The base station on the ground performs Differential
GPS (DGPS) and waypoint tracking tasks for all four flyers, and sends appro-
24
CHAPTER 3. BACKGROUND
priate attitude values to the flyers for stable flight. Human piloted flight and
pre planned control is performed via the ground station laptop using Labview.
To control height a sliding mode control is designed and the attitude loop
was designed LQR techniques. Angular deviations were penalised more than
rate deviations. Also, the pitch and roll loops were penalised identically, with
a reduced penalty on the yaw deviations. On the STARMAC I platform also
more advanced controller types are tested, such as integral sliding mode and
reinforcement learning [21].
STARMAC II
The STARMAC II testbed is a sequel of first version with improvements at
several points:
25
Thrust capabilities: Old motors and propellers were replaced with Brushless motors and more rigid plastic propellers to double the output and
enhance the total thrust up to a total of 4 kilograms.
On-board computation resources: With the increased lift capabilities, it
became possible to increase onboard computing power. Computation and
control are managed at two separate levels. The low level control that
performs real-time control loop execution and control motor speeds, occurs on a micro-controller board based on the Atmega 128 processor.
The high level planning, estimation and control occurs on a lightweight
Cross- bow Stargate 1.0 single board computer (SBC) running embedded
Linux. Alternatively an Advanced Digital Logic ADL855 PC104 running
Kubuntu Linux can also be implemented, providing more computational
power, at the cost of additional weight and hence shortened flight times.
Communication reliability and bandwidth: The old Bluetooth was replaced with a WiFi network, enables much greater bandwidth and improved communication channel management through a wireless router at
the central ground station. This has shown considerable improvements
in communication between the ground computer and quadrocopters as
compared with the Bluetooth capabilities of first version.
Position measurement accuracy: Three-dimensional position and velocity
measurements are now done using a carrier phase differential Novatel
Superstar II GPS unit with a resulting position accuracy of less than 2cm.
For indoor flights, an overhead USB camera can be attached, with blob
tracking software, to provide position sensing without GPS. The camera
system gives less than 2 cm accuracy at 10 Hz rate, and provides a drop-in
replacement for GPS input to the EKF.
Instead of the LQR used in the STARMAC I in the STARMAC II ProportionalIntegral- Derivative (PID) control was implemented for attitude, altitude and
position control. Not only the hardware was improved but also the mathematical model of the quadrocopter. Three extra effects where quantified that relate
to motion of the vehicle relative to the free stream.
Chapter 4
28
ulation. The article [3] reports the use of three inputs namely; acceleration,
velocities and accumulation of past commands around two horizontal axes X
and Y to maintain quadrocopter in hovering position. To design the fuzzy controller we adopted a different approach than the one proposed in article [3].
We took the quadrocopter angles and the rates of angle change as input to our
fuzzy controllers. And we did not use any third input as used in article [3]. And
unlike article [3] we tested our controller on quadrocopter in HIL simulation
setup.
In design process of fuzzy controller, designers usually try to inject the expertise of experienced human operator into their controller so that, their controller
control the plant in a same way as experienced human operator do. To design
the fuzzy controller for quadrocopter we found a set of guidelines presented
in article [3] that describe how human operators control the quadrocopter.
These guidelines were formulated after interviewing experienced quadrocopter
operators. These guidelines were written for how human operators perceive
the velocities and acceleration along different axes, and how they control the
quadrocopter based on their perception. Despite we are not using velocities
and accelerations as inputs, but we can use the same set of guidelines for our
controller with angles and the rates of angle of change as inputs as the velocities and accelerations are directly propotional to the angles and rates of angle
change respectively. So we can mold the presented guidlines for our controller
with angles and rates of angle change as inputs.
The molded guidelines are given below:
1. Control of quadrocopter is done by observing the bank angles and the
rate of change of bank angles of the vehicle from the point of view of the
observer.
2. Only qualitative information of the bank angles and the rate of change of
bank angles are available to the external pilot.
3. Except in high aerobatic maneuvers roll, pitch and yaw control of the
vehicle are handled separately and independently.
4. When the observed angles of the vehicle are small (i.e. near hovering
point) more attention is paid to the angles of the quadrocopter than the
rate of change.
5. When the observed angles of the quadrocopter are large more attention
is paid to the vehicle angle change rate and more effort goes in to compensating the rate than that to the angles.
6. Control commands issued by the human operator could be any of the
four quantitative commands namely roll, pitch, thrust and yaw.
29
7. Observable angles and the rates of angle change are understood by the
human operator as either small, medium or big. Accumulation of control
commands is perceived as zero, small, medium and big.
We started designing the fuzzy controller for the quadrocopter in the light of
above stated guidelines. Guideline 1 defines the inputs of the controller, namely
the angles and the rate at which angles change. Guideline 7 suggest five membership functions for each input. We used triangular or trapezoidal shapes for
membership functions to avoid computational and programming complexities,
as there is a plan to translate the designed controller to C language in future.
We started with uniform distribution of membership functions as shown in
Fig. 4.1. Then in search of better performance we increased the input gains by
contracting the membership function closer to zero as shown in Fig. 4.2. But for
this setting we got oscillatory response, plus too high input gains also amplifies
the noise and can cause serious disturbances specially when the input values
are small. So, to rectify oscillations and avoid noise amplification we started reducing input gains by stretching membership functions gradually. After testing
the system with several membership functions settings, the input membership
functions setting presented in Fig. 4.3 were found best. The same procedure
was repeated for the second input and we got best results at the same settings
used for the first input.
The same design process was repeated for output membership function.
Guideline 7 suggest seven membership functions for output of each controller.
We started with uniform distribution of all seven membership functions. Then
we increased output gains gradually to minmize the steady state error. But on
high output gains we got oscillatory response. So we had to find the settings
where the steady state error is minimized without oscillatory behavior. Figure 4.4 shows the settings for output membership functions where we found
such response.
30
Figure 4.2: input variable roll angle with high input gains
The rule base of the controller was also designed in the light of the above
guidelines. Guidelines 5, 6 and 7 suggest a subset of the rule base for the fuzzy
logic controller. We used 25 rules in our rule base that are presented in Fig. 4.5
Figure 4.6 shows the control surface produced by the rules presented in Fig
4.5.
The implemented fuzzy controller is an equivalent of position PD controller
as clear from Fig. 4.5. But it can be seen how easily it is designed, even without
mathematical model of the quadrocopter. In addition to this it has a big advantage over conventional PD controller that it is non-linear. The same controller
can be regarded as equivalent to velocity PI controller.
Pitch and yaw axes controllers are designed in a same way as roll controller.
4.3 Implementation
The fuzzy logic controller and sensory data processing are modeled in Matlab
using Simulink. The Simulink model are then downloaded to dSPACE computer
before experimentation. We prefered to use Mamdani type fuzzy controller as it
is the simplest and more intuitive [19] specially when controller design is based
on a set of guidelines describing the human behavior. Guideline 3 suggests that
31
the controller for each axes can be designed separately. So, we designed three
similar fuzzy controllers for the pitch, yaw and roll axis of the quadrocopter.
4.4.1
Data acquisition
dSPACE RTI toolbox provides two blocks namely; "Serial setup" and "Serial
recieve" that are used to recieve sensory data from on-board computer. These
blocks recieve 12 bytes data in every program cycle. They keep the data into
buffer until all 12 bytes are recieved. When all 12 bytes are recieved the data is
forwarded serially as per FIFO scheme.
32
4.4.2
De-multiplexing
A very commonly used block "Demux" is used for de-multiplexing of data. The
block recieves 12 bytes serially, and it sends them forward in parallel fashion.
4.4.3
33
34
4.4.4
Controllers
35
4.4.5
In step 5, only gains blocks are used with a value of 0.00031 to scale the output
of the controllers between the range of 0.059 and 0.09, because YGE motor
drivers takes 0.059 and 0.09 as stop and full throttle, respectively. That is the
reason every controller output is multiplied by a factor of 0.0031 to lie with in
range understood by YGE motor drivers. The controllers may generate signal
of value 20 at maximum. The remaining 80 percent of power is in user hands.
4.4.6
All the outputs of the controllers and user inputs are mixed before generating
PWM signals for motors. As YGE motor controllers consider 0.059 as 0, a
direct input of 0.059 is fed to all the motors. In addition to this, user can give
input to the system to produce 80 percent of thrust through dSPACE GUI. The
output of Y controllers are fed to all motors as to control altitude all motors are
required to produce more thrust equally to increase altitude or reduce equally
to decrease altitude. The outputs of X controller and roll controllers are fed
to motors 2 and 4 with a sign change.The outputs of Y controller and pitch
36
controllers are fed to motors 1 and 3 with a sign change. And the output of
Yaw controller is fed to all motors, motor 1 and 3 are fed with opposite sign as
of motor 2 and 4.
4.4.7
After mixing all the control signals and user input, PWM signals has to be generated for motors to operate them in a desired way. To generate PWM signals
"DS1103SL DSP PWM" block, provided by dSPACE RTI toolbox in simulink,
is used.
37
Chapter 5
40
the objectives of the thesis. The YGE controller for motor 1 has burned out, so
motor 1 cannot be operated. As motor 1 cannot be operated, we have to stop
motor 3. With remaining two motors it is certainly not possible to perform
experiments for any of 6 axes except roll axes. To perform experiment for roll
axis, we built an experiment setup with the intension to limit the DOF to only
one axis that is the roll axis. The setup we built for experimentation is shown
in Fig. 5.1 in which it can be seen the quadrocopter is tied with ropes from top
and from down. Only the roll axes is left free.
5.2 Results
As stated in the last section that due to the technical problems the experimentation plan was effected badly. With only two motors we could test our controller
for roll axis. We performed several tests to validate the functionality and applicability of our fuzzy controller. We are including some selected experiments
among the several we performed during thesis work.
The experimentation setup we built allows the quadrocopter to be stabilized without motors in few seconds, if it is disturbed along roll axis. Here we
can give the example of pendulum. If pendulum is disturbed from its point of
stability, it stabilized back to this point after some oscillations. But there is a
difference between our system and pendulum. The point of stability for pendulum is fixed, where pendulum attains minimum potential energy. But this is not
the case with our system. When we disturb the quadrocopter along roll axis,
the eight threads used to limit the movements around other axes change their
adjusments that results in a slight change in the angle of stability for the tied
quadrocopter.
We performed the first experiment to analyze, how much time it takes the
quadrocopter to get stabilized without motors. The results of this experiment
is shown in Fig. 5.2.
In Fig. 5.2, it is shown that the quadrocopter is destabilized by an external
force at around 11th second of the experiment. The quadrocopter became stabilized after around 8 seconds. Here we can see the difference between the angle
of stability before the occurence of external disturbence and after it. This slight
shift in the angle of stability for the quadrocopter is due to the re-adjustment
of the threads tied to quadrocopter, as stated earlier.
After performing experiment without motors we performed an experiment
with motors to analyze how the newly designed controller works to stabilize
the quadrocopter in our constrained experimentation setup. The results of this
experiment are shown in Fig. 5.3.
In Fig. 5.3 it is shown that when the experiment was started the roll angle
of the quadrocopter was around -4 degrees, means that the quadrocopter was
tilted -4 degrees towards motor 2. At around 4th second of the experiment the
motors were started with the power of 35 percent. The controller is started at
around 7th second. The activity of the motors can be seen in the second graph
5.2. RESULTS
41
of Fig. 5.3, where the red line represents the power plus controller signal to
motor 2 and blue line represents the power plus controller signal to motor 4.
At around 13th second we disturbed the quadrocopter along roll axis to 32
degrees.After that controller stabilized the quadrocopter in less than 4 seconds
that is the half of the time it took in last experiment.
The red line in the first graph of Fig. 5.3 represents the set point for the
roll angle. The controller should stabilize the quadrocopter at the set point.
But it can be seen in Fig. 5.3 that roll angle never reached to the set point.
On the other hand, we see in the second graph of Fig. 5.3 that the controller
continously tried to overcome the error by increasing the speed of motor 2 and
by decreasing the speed of motor 4, but still the roll angle remained unchanged.
This is due to the limitations associated with our experimentation setup. With
two motors we cannot perform experiments with high motor speeds, because
the torque produced by two motors destabilize the whole setup. And at lower
motor speeds we need high controller gains to stabilize the quadrocopter at
42
set point. And when we use higher controller gains, it results in uncontrolled
oscillations.
Figure 5.3: Disturbence test with 35 percent power and controller gain 1
5.2. RESULTS
43
Figure 5.4: Disturbence test with 30 percent power and multiple controller gain
44
Figure 5.5: Disturbence test with 60 percent power and controller gain 1
used threads to limit the movements around other axes other than the roll axis,
but this is not the real solution. These threads also interfare with the movement
along roll axis.
After performing several experiments with different power settings and controller gains, we found that operating motors at 35 percent power with controller gain of 1 results in best performance for our tightly constrained experimental setup. To find these settings, we performed several experiments. We
started from low power settings to high, with different values for gain. The
Fig. 5.6 show the results for 15 percent power and controller gain equals to 1.
As this was one the earliest experiment, we could not classify it as good or bad.
Then we tried higher gains at lower power settings. Fig. 5.7 is an example
of it. It represents the results for the experiment performed at 15 percent power
and gain value equals to 2.
Then we performed the experiment with 15 percent power with 2.5 controller gain. The results for this experiment are shown in Fig. 5.8. By comparing the results of the experiments performed at 15 percent power with different
5.2. RESULTS
45
Figure 5.6: Disturbence test with 15 percent power and controller gain 1
controller gain values, we found that higher gains at lower power settings cause
higher and more oscillations.
Then we increased power to 25 percent and test our controller with gain
equals to 1. The results for this experiment is shown in Fig. 5.9.
Then we performed experiment with same power settings but with different
controller gain values. Experiment shown in Fig. 5.10 was performed with 25
percent power with controller gain value equals to 2.
Then we performed another experiment with same power setting of 25 percent with controller gain value equals to 2.5. The results for this experiment
are shown in Fig. 5.11. We noticed the same trend with 25 percent power as
we noticed for 15 percent. But we found that the over all performance of the
system with 25 percent is better than performance with 15 percent power.
In the search of better power and gain settings for our system, we increased
the power to 35 percent. And we found that the power of 35 percent with
controller gain values equals to 1 result in best performance for our system.
The results of experiment with these power and gain settings are shown in
Fig. 5.3.
46
Figure 5.7: Disturbence test with 15 percent power and controller gain 2
47
Figure 5.8: Disturbence test with 15 percent power and controller gain 2.5
48
Figure 5.9: Disturbence test with 25 percent power and controller gain 1
Figure 5.10: Disturbence test with 25 percent power and controller gain 2
49
50
Figure 5.11: Disturbence test with 25 percent power and controller gain 2.5
Figure 5.12: Disturbence test with 35 percent power and controller gain 2
51
52
Figure 5.13: Disturbence test with 35 percent power and controller gain 2.5
Chapter 6
GPS integration
As stated earlier, the initial goal of the thesis work was to develop the controller
for autonomous flying of quadrocopter. To achieve this objective, a ublox indoor GPS was bought. But unfortunately the indoor GPS does not catch satellite signals inside the lab. We tested the module in the university corridors and
found it works fine there. That is the reason the objective of the thesis was
changed from 6DOFs controller design to 3DOFs design. However, the GPS
module has been to configured to work as per NMEA protocol, and a C function is written and tested to translate the GPGGA message of NMEA protocol
that gives the sufficient information reqired for autonomous flying. Harware
53
54
modification has also been done on the quadrocopter to interface GPS module.
These things are to be integrated in future.
6.2.2
6.2.3
Wireless connections
Currently we are using wired connections between dSPACE computer and onboard micro-controller for communicating sensor readings and . These wired
connections has to be replaced with wireless connections to operate quadrocopter freely. We configured the XBee communication module for wireless connection and tested them by sending test data, but modules are not integrated in
the project to avoid complexities of already complexed on-board electronics.
6.2.4
References
[1] skycar official website, 2011. (Cited on page 4.)
[2] B.Camlica. Demonstration of a stabilized hovering platform for undergraduate laboratory. 2004. (Cited on page 17.)
[3] S.A.A. Shakoor S.R. Munasinghe D.M.W . Abeywardena, L.A.K. Amaratunga. A velocity feedback fuzzy logic controller for stable hovering
of a quad rotor uav. Fourth Intemational Conf erence on Industrial and
Information Systems, IClIS, 2009. (Cited on pages 27 and 28.)
[4] E.Altug. Vision based control of unmanned aerial vehicles with applications to an autonomous four rotor helicopter, Quadrotor. PhD thesis,
University of Pennsylvania, 2010. (Cited on pages 15, 16, and 27.)
[5] E.N.Johnson. Uav research at georgia tech school of aerospace engineering, 2011. (Cited on pages 15 and 27.)
[6] Scott D. Hanford. A small semi-autonomous rotary-wing unmanned air
vehicle (uav). Masters thesis, 2005. (Cited on page 16.)
[7] Peter Hermannstadter. Modeling and simulation of a quadrotor aircraft,
2008. (Cited on page 7.)
[8] Rajnarayan D. Waslander S. Dostal D. Jang J. Hoffmann, G. and C. Tomlin. The stanford testbed of autonomous rotorcraft for multi agent control
(starmac). Proceedings of the 23rd Digital Avionics Systems Conference,
2004. (Cited on page 22.)
[9] Rajnarayan D. Waslander S. Jang J. Hoffmann, G. and C Tomlin. Quadrotor helicopter flight dynamics and control theory and experiment. 2007.
(Cited on page 22.)
[10] J. S. Jang. Nonlinear control using discrete-time dynamic inversion under
input saturation theory and experiment on the Stanford dragon fly UAVS.
PhD thesis, Stanford University, 2003. (Cited on pages 15 and 27.)
55
56
REFERENCES
[11] I. Kroo and F. Prinz. The mesicopter: A meso-scale flight vehicle - niac
phase i final report. technical report. Technical report, Stanford University, 2001. (Cited on page 22.)
[12] I. Kroo and F. Prinz. The mesicopter: A meso-scale flight vehicle - niac
phase ii technical proposal. technical report. Technical report, Stanford
University, 2001. (Cited on page 22.)
[13] J.G. Leishman. Principles of helicopter aerodynamics. Cambridge
aerospace series. Cambridge University Press, 2002. (Cited on pages 2
and 4.)
[14] M. Huzmezan M. Chen. A Behavior-Based Control System for Mobile
Manipulation. PhD thesis, University of British Columbia, 2003. (Cited
on pages 15, 18, and 27.)
[15] E. B. Nice. Design of a four rotor hovering vehicle. Masters thesis, Cornell University, 2003. (Cited on page 19.)
[16] A. Dzul P. Castillo and R. Lozano. Real-time stabilization and tracking
of a four rotor mini-rotorcraft. IEEE transactions on control systems
technology, 2003. (Cited on page 21.)
[17] P. Hynes J. Roberts P.Pounds, R.Mahony. Design of a four-rotor aerial
robot. Australiasian Conference on Robotics and Automation Auckland,
99, 2002. (Cited on page 17.)
[18] R. Siegwart S. Bouabdallah, P. Murrieri. Design and control of an indoor
micro quadrotor. 2003. (Cited on page 19.)
[19] S. N. Deepa S. N. Sivanandam, S. Sumathi. Chapter 6 - Introduction to
fuzzy logic using MATLAB. Springer 2007. (Cited on page 30.)
[20] P. Uhleman S.Sassen. Quattrocopter a unique micro-aerial vehicle. European Aeronautic Defense and Space Company Corporate research centre,
2003. (Cited on page 16.)
[21] Hoffmann G. M. Jang J. S. Waslander, S. L. and C. J. Tomlin. Multi-agent
quadrotor testbed control design: Integral sliding mode vs. reinforcement
learning. In Proceedings 2005 IEEE/RSJ International Conference Intelligent Robots and Systems, 2004. (Cited on page 24.)