Internet Mobile RobotThe QuadcopterGroup 13 Rahul Bura Mohamed
Chande Vinayak Goge Hue Vo
Supervisor: Professor Peter X. Liu
A report submitted in partial fulfillment of the requirements of
SYSC-4907 Engineering Project
Department of Systems and Computer Engineering Faculty of
Engineering Carleton University
April 7, 2010
Internet Mobile Robot
April 7th, 2010
AbstractGroup 13 consisting of Rahul Bura, Mohamed Chande,
Vinayak Goge and Hue Vo have developed a start-up project as a
partial fulfillment for SYSC 4907 Engineering Project: Internet
Mobile Robot: The Quadcopter. The objective of the project was to
design and implement a Quadcopter (helicopter with four propellers)
that can take flight and be controlled using a remote client
application over the internet. Currently, different Quadcopter
designs have been implemented. However, most of them have used
handheld Radio Control implementations. With the design implemented
in this project, different applications can be developed to control
the Quadcopter over the internet from a remote location. This opens
up different possibilities with the design being applied in
different areas ranging from Surveillance to Virtual Gaming
Technologies to Military Applications. Different designs were
explored and from these designs, it was determined that we would
need a microcontroller to run control algorithms, a Wi-Fi chip to
facilitate wireless communication and a webpage to for user
interaction. Any command received from the WI-Fi chip is processed
by the microcontroller and executed by all the components including
motors, speed controllers and inertial measurement units that are
used to stabilize the Quadcopter. The communication system
implemented a server/client architecture with the Wi-Fi chip
behaving as a server that acts to reply to requests from a remote
client webpage. For the data transfer mechanism, TCP protocol was
used over the Internet to send traffic from the client to the
server and bidirectionally. The webpage, implementedDepartment of
Systems and Computer Engineering |Carleton University i
Internet Mobile Robot
April 7th, 2010
as a simple Graphical User Interface (GUI), is a good
replacement for the RC handheld devices and allows for easy
portability from one client to another.
Department of Systems and Computer Engineering |Carleton
University
ii
Internet Mobile Robot
April 7th, 2010
AcknowledgementsWe would like to formally thank Professor Peter
X. Liu for supervising and for his guidance throughout the Internet
Mobile Robot project as well as giving us the opportunity to
explore and experiment with our creativity. We would also like to
thank the Technical Support Staff, Danny Lemay, Jerry Buburuz and
Daren Russ, for their support throughout the project. Their prompt
actions, experience and knowledge allowed us to surpass various
milestones throughout the duration of the project.
Department of Systems and Computer Engineering |Carleton
University
iii
Internet Mobile Robot
April 7th, 2010
Table of
ContentsAbstract......................................................................................................................................
i Acknowledgements
.................................................................................................................
iii List of Figures
...........................................................................................................................
vi List of Tables
..........................................................................................................................
viii 1.0 Introduction
......................................................................................................................
1 1.1 Background
..................................................................................................................
1 1.2 Motivation
...................................................................................................................
3 1.3 Problem
Statement......................................................................................................
3 1.4 Proposed Solution and Accomplishments
...................................................................
3 1.5 Overview of the Remainder of the Report
..................................................................
6 2.0 The Engineering Project
....................................................................................................
8 2.1 Health and
Safety.........................................................................................................
8 2.2 Engineering Professionalism
........................................................................................
9 2.3 Project Management
.................................................................................................
10 2.4 Individual Contributions
............................................................................................
11 2.4.1 Project Contributions
.........................................................................................
11 2.4.2 Report Contributions
.........................................................................................
12 3.0 Robot Design
...................................................................................................................
13 3.1 Structure
....................................................................................................................
13 3.1.1 Number of Motors
.............................................................................................
13 3.1.2 Frame
.................................................................................................................
15 3.2 Communications
........................................................................................................
15 3.3 Flight and Stability
.....................................................................................................
16 3.4 Flight Control
.............................................................................................................
18 3.5 Power
.........................................................................................................................
20 4.0 Hardware Components and Construction
......................................................................
22 4.1 Frame and Structure
..................................................................................................
22 4.2 Microcontroller
..........................................................................................................
24 4.3 Flight and Stability
.....................................................................................................
25 4.3.1 Propeller and Motor Combination
Configuration.............................................. 25
4.3.2 Electronic Speed Controller (ESC)
......................................................................
26 4.3.3 Six Degrees of Freedom (DOF)
...........................................................................
27 4.4 Communications
........................................................................................................
28 4.5 Battery
.......................................................................................................................
28 4.5.1 Flight Time and Battery Power Dependancy
..................................................... 29 4.6 Design
Implementation and Final Structure
.............................................................. 30
5.0 Stability and Manoeuvre
.................................................................................................
33 5.1 Filtering Noise
............................................................................................................
33 5.1.1 Noise Reduction
.................................................................................................
33 Department of Systems and Computer Engineering |Carleton
University iv
Internet Mobile Robot
April 7th, 2010
5.1.2 Second Order Complementary Filter
.................................................................
34 5.2 Feedback Control
.......................................................................................................
35 5.2.1 Six Degrees of Freedom (DOF)
...........................................................................
36 5.2.2 System Control Theory
.......................................................................................
37 5.2.3 Proportional, Integral, Derivative Controller
..................................................... 40 5.2.4
Feedback Control Mechanism: Inertial Measurement Units
............................. 42 5.2.5 Feedback Control Loop
......................................................................................
43 5.2.6 Flight Tuning Using Ziegler-Nichols Rules
.......................................................... 45 5.3
Flight Configuration and Simulation
..........................................................................
46 5.3.1 Flight Configuration Methods and
Tools............................................................
46 5.3.2 Pre-Flight
Tests...................................................................................................
49 5.3.3 Flight Control and Results
..................................................................................
50 6.0 Wireless Communication (Server)
..................................................................................
54 6.1 Communication System Overview
.............................................................................
54 6.2 Wireless Standards
....................................................................................................
55 6.2.1 ZigBee
.................................................................................................................
56 6.2.2 Wi-Fi
...................................................................................................................
57 6.3 WiShield Configurations
............................................................................................
58 6.3.1 Network Type
.....................................................................................................
58 6.3.2 TCP vs UDP
.........................................................................................................
59 6.4 WiShield Functionality
...............................................................................................
64 6.5 Serial Peripheral Interface
.........................................................................................
66 6.6 Challenges and Solutions
...........................................................................................
69 6.6.1 Debugging
..........................................................................................................
69 6.6.2 Pin Conflict
.........................................................................................................
71 7.0 Wireless Communication (Client)
...................................................................................
73 7.1 Client Design
..............................................................................................................
73 7.2 Client
Process.............................................................................................................
77 8.0 User Interface
.................................................................................................................
79 8.1 Software Requirements
.............................................................................................
80 8.1.1 Operating System
...............................................................................................
81 8.1.2
XAMPP................................................................................................................
81 8.2 Challenges and Solutions
...........................................................................................
83 9.0 Software Integration
.......................................................................................................
85 10.0 Production Expenses
.......................................................................................................
88 10.1 Material Costs
............................................................................................................
88 11.0 Conclusion and Recommendations
................................................................................
90 11.1
Conclusion..................................................................................................................
90 11.2 Recommendations
.....................................................................................................
92 References
..............................................................................................................................
93 Department of Systems and Computer Engineering |Carleton
University v
Internet Mobile Robot
April 7th, 2010
List of FiguresFigure 1: Rotating pairs of rotors
[3]................................................................................................
1 Figure 2: First Generation Design of De Bothezat Quadrotor [3]
.................................................... 2 Figure 3:
Wound Rotor [10]
...........................................................................................................
16 Figure 4: Brushless Motor Design [11]
...........................................................................................
17 Figure 5: Typical Microcontroller
...................................................................................................
19 Figure 6: Sketch of Proposed Structure
.........................................................................................
23 Figure 7: Initial Frame
....................................................................................................................
23 Figure 8 : Aeroquad Shield
.............................................................................................................
28 Figure 9: Graph of Flight Time versus Battery
Life.........................................................................
30 Figure 10: Wiring Diagram for IMR
................................................................................................
31 Figure 11: Final Design
...................................................................................................................
32 Figure 12: Second Order Complementary Filter
[15].....................................................................
34 Figure 13: Second Order Complementary Filter
[15].....................................................................
35 Figure 14: Possible independent movements in 3D space
[16]..................................................... 37 Figure
15: Types of Control Systems: (a) Open Loop (b) Feed-Forward (c)
Closed Loop [18] ....... 38 Figure 16: How the damping constant
affects the time it takes to reach steady state [19] ......... 40
Figure 17: PID Controller loop [20]
................................................................................................
42 Figure 18: Feedback loop including system, controller and sensor
configuration [21]................. 43 Figure 19: Feedback Control
Loop with control components
....................................................... 44 Figure
20: Motor Command outputs (S) during simulation of flight with
Serial Monitor ............. 46 Figure 21: Sensor Data output (Q)
during simulation of flight with Serial Monitor
...................... 47 Figure 22: AeroQuad Configurator GUI with
updatable flight parameters ................................... 48
Figure 23: Various sensor outputs with AeroQuad Configurator GUI
........................................... 49 Figure 24: Original
Communication System Design
.......................................................................
55
Department of Systems and Computer Engineering |Carleton
University
vi
Internet Mobile Robot
April 7th, 2010
Figure 25: TCP three-way handshake
............................................................................................
60 Figure 26: Re-designed Communication System
...........................................................................
63 Figure 27: WiShield Functionality
..................................................................................................
64 Figure 28: Handling TCP connection
..............................................................................................
65 Figure 29: SPI bus, single-master single-slave
...............................................................................
67 Figure 30: WiShield Schematic [27]
...............................................................................................
68 Figure 31: Simple Compiler provided for WiShield
........................................................................
71 Figure 32: Ideal Layout of Client System in relation with
WiShield ............................................... 74 Figure
33: Actual Implementation of Client System in relation with
Wi-Shield ............................ 75 Figure 34: Client Design
.................................................................................................................
76 Figure 35: Client Process
................................................................................................................
78 Figure 36: User Interface
...............................................................................................................
79 Figure 37: Components of the User Interface
...............................................................................
80 Figure 38: Pin 5 of SM (with WiShield) connected to digital pin
32 of PM using a wire [39] ........ 87
Department of Systems and Computer Engineering |Carleton
University
vii
Internet Mobile Robot
April 7th, 2010
List of TablesTable 1: Report
Contributions........................................................................................................
12 Table 2: Flight Times for 2 Different Designs
.................................................................................
14 Table 3: Matching Motors for EPP1045 Propeller
.........................................................................
25 Table 4: Total Weight Calculation
..................................................................................................
29 Table 5: PID gain using Ziegler-Nichols Tuning Rule [17]
............................................................... 45
Table 6: Values of KP and corresponding qualitative observations
for Ziegler-Nichols Rule ......... 52 Table 7: Relevant differences
between TCP and UDP
...................................................................
62 Table 8: List of Materials and Respective Cost
..............................................................................
89
Department of Systems and Computer Engineering |Carleton
University
viii
Internet Mobile Robot
April 7th, 2010
1.0 IntroductionWith the recent developments in wireless
communications technology and its increased accessibility and
affordability, network-based applications are now able to expand
into new areas. One of these areas is the domain of Internet
Robots. Internet robots have numerous applications and they can be
programmed to perform multiple functions. The Internet Mobile Robot
(IMR) constructed is an Unmanned Aerial Vehicle (UAV) that will be
controlled wirelessly via a web browser.
1.1
BackgroundThe Unmanned Aerial Vehicle built is also known as
a Quadcopter or Quadrotor owing to the fact that it has four
motors and propellers that stabilize and manoeuvre the robot.
Flight control is achieved by varying the speed of each rotor to
change the thrust and torque about the center of rotation. The
rotors are spinning in pairs ofFigure 1: Rotating pairs of rotors
[3]
angular velocity - two rotate clockwise and two rotate
counter-clockwise. This is illustrated in Figure 1. Quadcopters
have been around for a while and its development can be generally
classified into 2 generations. The first generation of designs were
done to transport cargo and passengers. However, early prototypes
suffered from poor performance [1] and latter prototypes required
too much pilot workload, due to poor stability [2].
Department of Systems and Computer Engineering |Carleton
University
1
Internet Mobile Robot
April 7th, 2010
Figure 2: First Generation Design of De Bothezat Quadrotor
[3]
The second generation of Quadcopter designs is what the Internet
Mobile Robot falls under. This more recent generation consists of
designs that are commonly designed to be unmanned aerial vehicles
that use electric control systems and sensors to stabilize the
aircraft [4]. There are various advantages of the current
generation of Quadrotors over comparable scale helicopters.
Quadrotors have a simpler mechanism that controls the rotor blades
as opposed to a helicopters as mechanical linkages are not required
for control of the rotor blades. This simplifies the design of the
vehicle, and reduces maintenance time and cost [5]. Also, the use
of four rotors allows each individual rotor to have a smaller
diameter than the equivalent helicopter rotor resulting in less
kinetic energy being stored during flight. This reduces the damage
caused should the rotors hit any objects. For small scale vehicles,
this makes it safer to interact with in close proximity. Finally,
by enclosing the rotors within a frame, the rotors can be protected
during collisions, permitting flights indoors and in obstacle-dense
environments, with low risk of damaging the vehicle, its operators,
or its surroundings [6].
Department of Systems and Computer Engineering |Carleton
University
2
Internet Mobile Robot
April 7th, 2010
1.2
MotivationMultiple implementations of the Quadcopter currently
exist. However, most of
them are Radio Control (RC) implementations. Having a Wi-Fi
implementation would open up the communications to other
possibilities. Adopting this implementation would mean that we
would be abolishing the use of the traditional RC remote
controller. In lieu of this, a control mechanism needs to be
created in the form of an encrypted web browser with a
user-friendly Graphical User Interface (GUI). Also, there are
various methods to stabilize the RC Quadcopter using accelerometers
and gyroscopes. Having chosen to adopt a Wi-Fi implementation,
these methods need to be studied and adapted to the Wi-Fi
implementation.
1.3
Problem StatementA Quadcopter needs to be constructed and a
Wi-Fi implementation needs to be
done to wirelessly manoeuvre and stabilize it via the internet,
through a web browser.
1.4
Proposed Solution and AccomplishmentsAs can be seen from Section
1.3, there were four main areas that this project
concerned itself with. The first goal was to get a Quadcopter,
comprising of the structure and control logic, constructed. Having
done so, a Wi-Fi implementation has to be deployed to control the
system. This system then needs to achieve stability and stable
manoeuvrability. A user control interface also needs to be
developed to control the system in the form of a secure web
page.
Department of Systems and Computer Engineering |Carleton
University
3
Internet Mobile Robot
April 7th, 2010
The Quadcopter can be constructed using various component parts
from hobby shops. Major parts to look at would be the robots frame
as well as the robots flight and control mechanism. A major
accomplishment was determining the various required parts and where
we could procure them. Having done much preliminary research, a big
contribution to the project, the components were purchased from
various online stores. The construction of the structure itself was
an important accomplishment as it was a necessary component for
testing this year. It will be just as important a component for
future groups working on this project as it will be foundation on
which further applications can be developed. The initial design was
constantly modified to meet changing needs. More can be read in
Sections 3.0 and 4.0 regarding the selection of components and the
design and implementation process. The Wi-Fi implementation can be
achieved by using a Wi-Fi module that can communicate remotely with
the router. An accomplishment was to find the right Wi-Fi module to
communicate with the robot remotely via a router. The WiShield from
Async Labs was purchased for this purpose. Commands that the Wi-Fi
module receives are communicated to the microcontroller making the
robot correspond respectively. This was achieved by learning the
various communication protocols (TCP and UDP) and selecting the
appropriate protocol. A good understanding of the extensive
documentation that came with the module was also necessary and can
be seen as an accomplishment since we are now able to write code
(client / server) for this module knowing which functions we would
utilize. It is an even greater accomplishment that we were able to
achieve Wi-Fi controllability as the WiShield is one of the first
modules ofDepartment of Systems and Computer Engineering |Carleton
University 4
Internet Mobile Robot
April 7th, 2010
its kind and there was neither support nor a debugging mechanism
available. Section 6.0 covers this in detail. Extensive research
was done to determine the means to achieve stability of the IMR.
Results showed that stability can be achieved using an Inertial
Measurement Unit (IMU) and a Proportional-Integral-Derivative (PID)
controller. The IMU is the hardware component and the PID
controller is the software component that complements the IMU. Two
chips work in tandem to provide a Six Degree Of Freedom (6DOF) IMU.
The IMU generates raw accelerometer and gyroscope data that are fed
to a filter as inputs so that the speed of the motors can be varied
accordingly to stabilize the Quadcopter. The Quadcopter is able to
stabilize fairly well using this implementation although more
testing and debugging needs to be done for this implementation to
work flawlessly. Due to time constraints, we were unable to get the
Quadcopter completely stable. We were however able to identify why
the Quadcopter is unable to completely stabalize itself and this is
a key contribution to the project this year so that future teams
are saved from looking for causes. Section 5.0 can be referred for
further details regarding stability. The PID Controller was just
one component of the code required for the proper control of the
IMR and hence another major contribution this year was to have a
good understanding of the various component functions required for
the proper operation of the IMR. A web browser- based GUI was
developed using a suite of scripting languages. One accomplishment
was to determine which languages needed to be used to build
this
Department of Systems and Computer Engineering |Carleton
University
5
Internet Mobile Robot
April 7th, 2010
interface. After much research XAMPP package was selected due to
its ability to facilitate various interfacing as well as the
potential for further development in the future. After having
chosen this package, another major accomplishment was the design of
the interface. This design is not perfect but its a good foundation
for future designs. It outlines the basic controls currently but
this can be improved upon in the future to provide visual feedback,
a battery monitor, telemetry etc. according to future development
of the IMR. Further details can be read in Section 8.0. Another
major accomplishment was the integration of all the code so that
the IMR can function seamlessly. The current solution was
implemented successfully however it is not the most elegant
solution. Section 9.0 has more information with regards to
this.
1.5
Overview of the Remainder of the ReportThe remainder of the
report consists of documents that constitute research
needed for the IMR project. These documents may be in the form
of code, calculations, charts or graphs that illustrate or aid in
the understanding of a concept or point. Graphs, figure and tables
will be referred to in the pertinent paragraphs, by their
corresponding numbers. The List of Figures and List of Tables on
pages vi and viii respectively can be referred to as well. Section
3.0 will expound on the process of designing the IMR. It will
outline the research and calculations done to come to the final
design of the IMR as well as the component parts. Section 4.0 is
complementary to Section 3.0 and it will outline theDepartment of
Systems and Computer Engineering |Carleton University 6
Internet Mobile Robot
April 7th, 2010
components chosen and the rationale behind each selection. It
will also briefly touch on the construction process of the IMR.
Section 5.0 will go into further detail on stability and system
controls. The section will delve deeper into topics such as
noise-handling, filters and filtering as well as feedback loops and
the control mechanism that was used to control the IMR. Section
6.0, Section 7.0 and Section 8.0 constitute materials on the
communications component of the project. Section 6.0 looks into how
commands are communicated to the IMR. It will look at how the Wi-Fi
module has been utilised and how the functions were implemented to
communicate wirelessly with the IMR. Section 7.0 describes the
client process and Section 8.0 comprises of material on how the
user can communicate with the IMR via the GUI created. It also
looks at how the GUI was implemented. Section 9.0 explains the
software integration process and Section 10.0 provides information
on the materials purchased. Section 11.0 concludes the report by
looking at what weve achieved this year. It is going to briefly
outline the accomplishments and detail various recommendations for
future project groups working on the Quadcopter.
Department of Systems and Computer Engineering |Carleton
University
7
Internet Mobile Robot
April 7th, 2010
2.0 The Engineering Project2.1 Health and SafetyDue to the
nature of the project, there are many health and safety concerns
that one should be aware of before working on such a project. These
concerns range from health concerns possibly causing bodily harm to
oneself as well as others. Many measures were taken to ensure the
health and safety of all members as well as other throughout the
span of the project. As with most engineering projects, a lot of
time is spent in front of a computer whether it be for research and
analysis or for the implementation aspect. Many health concerns can
arise if one spends an extended period of time in front of the
computer. Sitting with poor posture can cause back pains and wrist
pains and staring at a screen for too long may cause ones eyes to
strain. As such, it is recommended to take regular breaks to not
over strain the eyes and to not cause future back or posture
problems. Specific to this project, there are large propellers
slicing through the air and a mass flying from point to point.
Anytime there are large moving parts that can cause minor to severe
bodily harm, one should take safety precautions. Although the
propellers are plastic, the speed at which it is rotating is
enough to penetrate the skin. Before commencing with any tests or
attaching the propellers and allowing them to spin, one should
ensure that there is no one and nothing in the vicinity of the
propellers. Also, it is recommended to test in an open space with
plenty of room in case one should lose control of the Quadcopter.
For testing purposes, the Quadcopter should be
powered using the Power Supply until consistent wireless
connection andDepartment of Systems and Computer Engineering
|Carleton University 8
Internet Mobile Robot
April 7th, 2010
communication to the Arduino can be established. This way, there
is always a method of turning off the Quadcopter should it start to
fly in an unexpected manner. Once the wireless connection can be
proven to be reliable, one can use the battery to test the
Quadcopter. When working with electrical devices, there can always
be a risk of shock or even electrocution. It is extremely important
to take precautions when handling electrical components and power
supplies. Ensure that everyone that must come in contact with the
components know the risks and the proper method of handling the
components. Any soldering done should be done with proper equipment
and technique. There are guidelines at each soldering station in
the labs. One should read and understand how to properly handle the
equipment before attempting to solder as this can lead to severe
burns.
2.2
Engineering ProfessionalismEngineering is a profession. It is
the process of methodically and logically coming
up with a solution for a given problem. As part of the
requirements for graduation, our team has formally respected all
phases of a development cycle. For it to be considered engineering
there must have been some research and analysis of a problem. A
solution was then supplied in the form of a Proposal. Further
research and analysis was done before the design phase of the
project, followed by an interim/progress report (and presentation).
Then there was a period of implementation and testing. The team has
followed the procedures and are coming to the end of the
development cycle for the proposed project.Department of Systems
and Computer Engineering |Carleton University 9
Internet Mobile Robot
April 7th, 2010
Throughout the project, our group made sure our decisions were
made responsibly and took precautions to ensure no one in the
immediate society would be harmed during the testing and
development of the project. Should any doubts arise about the
potential safety of anyone, measures were taken to relieve that
doubt. Internally, as a team, each group member has handled
themselves professionally. In the case of a disagreement, the team
would get together and discuss civilly to find a compromise. We
have made decisions for the benefit of the progress of the project
without attempting anything that may be considered immoral or
unethical. Each member took ownership of their duties and ensured
that their work was completed as well as it could be.
2.3
Project ManagementOur team started our development by doing some
research on our topic of
interest. After some brainstorming sessions for possible ideas,
we proceeded with our Quadcopter idea and did some further research
and analysis on the topic including possible structure design and
components. The brainstorming session really brought together the
idea and laid a path for the direction we wanted the project to
head in. As the project progressed, different components were
selected and designated to a primary that will be responsible for
that component from then forward. These topics were chosen to be
relatively independent of each other to allow each member to
develop an expertise in that topic and allow for a specific area of
work while working independently.
Department of Systems and Computer Engineering |Carleton
University
10
Internet Mobile Robot
April 7th, 2010
Team meetings were made regularly to discuss the progress and
any problems encountered. Should a problem arise, the team would
help in finding a solution or suggest any possible alternatives.
Any major changes in the direction of the project would then be
discussed and agreed upon. Deadlines for both the department as
well as internal team deadlines were emphasized and any upcoming
events would be brought up to ensure all team members were aware of
their responsibilities for that deadline. Internal team deadlines
were made to ensure progress was made in a timely manner. Changes
to the project were also made in order to meet deadlines as
required. It was decided that only the core components be done for
this year, which removed many additional features we previously
wanted to implement. We also created an online group with Google
Groups to allow every member to add and access any documents
another member may be using. This helped with organizing documents
and reports as well as allowed us to share any useful information
with the group in a well managed, designated area. It quickly
became a good source for referencing any previous discussions and
documents.
2.42.4.1
Individual ContributionsProject Contributions The area of
expertise and designated work was assigned as stated below. The
project
could be divided into four high level components: 1. Structural
Analysis and Design (Rahul Bura) 2. Stability and Manoeuvre (Hue
Vo) 3. Wireless Communication (Mohamed Chande Server, Vinayak Goge
Client) 4. User Interface and Webpage Design (Vinayak Goge)
Department of Systems and Computer Engineering |Carleton University
11
Internet Mobile Robot
April 7th, 2010
The work was assigned as such in order to allow for any
additional required independent work to be done outside of team
meeting times. Much of the work in the development cycle, from
Research and Analysis to Implementation to Component Testing, were
done as a team where suggestions and any further knowledge of the
topic by other teammates could help progress the project more
efficiently. Much of the Research and Analysis was done by all
members of the team with Rahul Bura leading the structural and
component selection. During integration of the project, all members
were equally involved, regardless whose component was being
integrated at the time. For formal presentations, all members
contributed in different components throughout the presentation
preparation period. 2.4.2 Report Contributions As with the Project
Contributions, as previously stated, this report was written by the
person with the most expertise of the topic throughout the project,
as much as possible. The formal contributions are as follows:
Section 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 Author Rahul
Bura Hue Vo Rahul Bura Rahul Bura Hue Vo Mohamed Chande Vinayak
Goge Vinayak Goge Mohamed Chande, Hue Vo Rahul Bura, Vinayak Goge
Rahul Bura, Mohamed Chande, Vinayak Goge, Hue Vo Editing and Proof
Reading Mohamed Chande Vinayak Goge Hue Vo Mohamed Chande Rahul
Bura Vinayak Goge Mohamed Chande Hue Vo Rahul Bura Mohamed Chande
Rahul Bura, Mohamed Chande, Vinayak Goge, Hue Vo
Table 1: Report Contributions
Department of Systems and Computer Engineering |Carleton
University
12
Internet Mobile Robot
April 7th, 2010
3.0 Robot DesignRobot design is one of the key components of the
project. The IMR consists of the structure and logic elements. The
structure designs were considered based on manoeuvrability,
aerodynamics, and cost of component parts and feasibility of the
design. The logic elements were chosen on the design decisions made
to address the problem statement. The design process took into
consideration key components that include structure of the robot,
communications, the stability mechanism, the controls mechanisms
and power.
3.1
StructureThe structure is one half of the IMR. The structure
houses the microcontroller
and also has the flight mechanism integrated. Designing the
structure design required various design considerations including
the number of motors and frame design.3.1.1 Number of Motors
Technically, any number of motors can be mounted to achieve
flight. However, with every new motor mounted, the weight of the
robot increases. Weight is obviously a concern and we want the IMR
to be as light as possible. There are two types of weightweight of
the IMR with the basic components mounted components and weight of
extra mounted parts, also known as payload. It is important to note
the correlation between the weight of the IMR , its ability to
carry that weight and the number of motors. Table 2 tabulates these
factors to help with the design decision. 2 designs were considered
- the Quadcopter (4 motors) and the Octcopter (8 motors) as is
reflected in the table.
Department of Systems and Computer Engineering |Carleton
University
13
Internet Mobile Robot
April 7th, 2010
The metric used to determine the design is flight time and a
2100mAh battery was used as a constant power source to determine
the flight times for all the payloads of each of the two designs.
It is assumed that each design is able to carry its own structural
weight and hence they are ignored so only the payload is
tabulated.
4 Motors Design Pay Load(oz) (Quadcopter)
8 Motors Design (Octocopter)
0 8 16 24 32 40
19.9 12.6 9.2 7.3 -
11.7 Flight Time (Mins) 9.2 7.5 6.3 5.3 4.6
Table 2: Flight Times for 2 Different Designs
As can be observed, with no payload, the Quadcopter can achieve
flight for about 20 minutes and the Octocopter can achieve flight
for about 12 minutes. This demonstrates the effect of the weight of
Octocopters frame. It has a decreased time of flight compared to
the Quadcopter without a payload. The maximum payload that the
Quadcopter can carry is 24oz for a period of 7.3 minutes. This is
in contrast to the 40oz that the Octocopter can carry due to the
increased number of motors. However, it can only sustain flight for
about 4.6 minutes which is not ideal. We also expect that the
maximum payload we will have would be less then 16oz. Hence looking
at the payload of 16oz, the Quadcopter offers a better performance
and we settled on the four-motor design for our IMR.Department of
Systems and Computer Engineering |Carleton University 14
Internet Mobile Robot
April 7th, 2010
3.1.2
Frame
The frame of the Quadcopter was next in the design of the
structure. Numerous materials were researched with the criteria
that the material be durable and light. Some of the alternatives
considered were aluminum, balsa wood and carbon fibre reinforced
plastic. Aluminum is a soft, durable, lightweight and malleable
metal that is easy to work with. It has about one-third the density
and stiffness of steel making it significantly lighter [7]. Balsa
wood is one of the lightest varieties of wood available and strong
for its weight, pound for pound. Its fairly malleable without
compromising its strength [8]. Carbon fibre reinforced plastics are
composite plastics that have been reinforced with carbon fibre to
provide a high strength-to-weight ratio. The density of carbon
fiber is also considerably lower than the density of steel, making
it ideal for applications requiring low weight [9]. The design of
the frame itself was based on other models. It was decided that
well have a cross-shaped frame with a motor mounted on each of the
four arms. The intersection in the middle would have the logic and
power units mounted on it. The illustration in Figure 6 shows the
preliminary proposed structure.
3.2
CommunicationsHow we communicated with the robot was a key
consideration. Various
alternatives we looked at including ZigBee, Wi-Fi and Bluetooth.
After careful analysis of the specifications and capabilities of
each technology, we decided on implementing WiFi for our robot
design.
Department of Systems and Computer Engineering |Carleton
University
15
Internet Mobile Robot
April 7th, 2010
Bluetooth technology however was ruled out earlier in the course
of development of the project mainly because of the cost to
transmission range trade-offs. Bluetooth modules can provide
transmission ranges of 1m, 10m and 100m. For our project purposes,
the ideal minimum range was considered to be 100m. With this range,
Bluetooth technology is very expensive. Furthermore, compared to
Wi-Fi and ZigBee, Bluetooth networking is slower and this feature
is undesirable in real-time applications and applications that are
sensitive to network delays. ZigBee, Wi-Fi standards and their
corresponding Radio Frequency (RF) modules provide specifications
that meet the requirements of the project. As to how Wi-Fi was
selected over ZigBee, a detailed explanation is provided in Section
6.2.
3.3
Flight and StabilityFor flight, four pairs of propellers and
motors are required. There are numerous
motors available that are powered by DC or AC sources. We were
particularly interested in DC motors since we wanted to power
components using battery cells. DC motors run on DC electric power
and there are various types that include the Brushed DC motors and
Brushless DC Motors. Brushed motors refer to the classic DC motor
that has a wound rotor with a split ring commutator which
periodically reverses the current direction between the rotor and
the external circuit, and a magnet stator. [10] An electrical power
source is connected to the rotor through the commutator and its
brushes providing current flowDepartment of Systems and Computer
Engineering |Carleton UniversityFigure 3: Wound Rotor [10]
16
Internet Mobile Robot
April 7th, 2010
and subsequent electromagnetism.
With the commutator switching currents
periodically as the rotor turns, the magnetic poles of the rotor
are prevented from ever being fully aligned with the magnetic poles
of the stator field causing the rotor to spin indefinitely.
Essentially, stationary metal contacts that brush against moving
metallic contacts are used to transfer electrical energy to coils
on the rotor. However, the brushed implementation has a number of
limitations. Main ones include a limit to the maximum speed of the
machine and the need for replacing the brushes. The alternative is
the brushless motor. The brushless motors implementation differs
from that of the brushed motors. A brushless motor consists of
stationary coils and a rotating magnet. The need for brushes to
provide currentFigure 4: Brushless Motor Design [11]
to the moving rotor is eliminated and instead an
external electronic controller is used to power up the
stationary coils, which are grouped in phases, causing the magnet
to rotate. [11] Section 4.3.2 contains further discussion on the
electronic controller. Figure 4 shows the brushless motor design.
The star-shaped component with the blue coils is the rotor and the
disk in the top right corner has the permanent magnet in the shape
of a ring and it rotates around the rotor, about the centre. This
design differentiation provides several advantages over the brushed
motors.
Department of Systems and Computer Engineering |Carleton
University
17
Internet Mobile Robot
April 7th, 2010
Research showed that an ultimate combination of motor and
propeller is needed to be used for optimal thrust power. The
appropriate combination was chosen as can be seen in Section 4.2. A
6 degree of Freedom (DOF) Inertial Measurement Unit (IMU) was
required for stability and manoeuvring the Quadcopter. An IMU is an
electronic device that measure and reports velocity, orientation
and gravitational forces using accelerometers and gyroscopes in
tandem. Accelerometers measure acceleration relative to freefall
and gyroscopes measure or maintain orientation, based on the
principles of conservation of angular momentum [12]. Since the
Quadcopter is going to be flying in a threedimensional space, an
IMU that considered the 6 degrees of freedom was essential. The 6
degrees of freedom refers to the fact that the rigid body is able
to move about the X, Y and Z axes independent of each of the 3 axes
and of the rotation about any of the 3 axes. This would enable the
Quadcopter to move forward, backward, up, down as well as left and
right in three-dimensional space.
3.4
Flight ControlTo control the Quadcopter, two alternatives were
considered. We could have
used a Field-Programmable Gate Array (FPGA) board or a
microcontroller. A FPGA is an integrated circuit that contains
programmable logic components known as Logic Blocks and a hierarchy
or reconfigurable interconnects that allows the blocks to be
connected. These configurations can be programmed using Hardware
Description Language (HDL). However, an FPGA would have been harder
for us to work with as we were not as familiar with it as we are
with our other alternative the microcontroller.Department of
Systems and Computer Engineering |Carleton University 18
Internet Mobile Robot
April 7th, 2010
Microcontrollers are computer systems on a chip.
Microcontrollers have a microprocessor and peripheral functions
like a relatively simple clock, timers, I/O ports and memory
implemented on one chip. Figure 5 illustrates this.
Microcontrollers are designed for smaller or more dedicated
applications and hence they may have lower clock rate frequencies
enabling lower power consumptions. This would be perfect for
battery-powered applications such as our Quadcopter.
Microcontrollers were originally programmed in assembly language
(low level language communication at machine level) but various
high level programming languages are now in use as well. Such
languages can be specially written to be microcontroller-specific
or be versions of general purpose languages such as the C
programming language. Compilers and environments may be tools that
are provided by the microcontroller vendors to program or debug the
microcontroller.
Figure 5: Typical Microcontroller
Various microcontroller options were considered as well as there
are numerous manufacturers. Ultimately the cost, form factor and
ease of programming are the criteria that would determine the
choice.Department of Systems and Computer Engineering |Carleton
University 19
Internet Mobile Robot
April 7th, 2010
3.5
PowerThe Quadcopter needed a sustainable and portable power
source to power the
control unit and the motors. Different types of rechargeable
batteries were researched and a number of chemical compositions
were taken into consideration. Nickel Cadmium (NiCd), Nickel Metal
Hydride (NiMH), and Lithium Polymer (LiPo) cells are currently the
most commonly used, but each needs to be charged, discharged, and
stored differently. On top of that, each model may require a
different cell count or battery configuration as well. Nickel
Cadmium or NiCd batteries are less common now but they are cheap.
These batteries have cons as well however. NiCd batteries need to
be fully discharged after each use as failure to do so would mean
that for future discharge cycles, they will not discharge to their
full potential. NiCd batteries also have a low energy density the
capacity per weight. Nickel Metal Hydride (NiMH) batteries have
numerous advantages over the NiCd batteries. NiMH cells offer
higher energy density and dont have the same performance issues
attributed to improper discharge practices as NiCd batteries do.
The latest cells are the Lithium Polymer (LiPo) cells. LiPo cells
offer higher better discharge performance as they provide better
consistency compared to NiCd and NiMH cells. LiPo cells also offer
a significantly higher capacity for their weight; a cell may have
twice the capacity for half the weight of a similarly performing
NiMH cell. Hence, LiPo cells can achieve higher voltage and energy
density. LiPo cells need to be monitored when being charged
however. This is the major deterrent when it comes to adopting
Department of Systems and Computer Engineering |Carleton
University
20
Internet Mobile Robot
April 7th, 2010
this technology. Overcharging can cause the cells to be
potential major fire hazards given the amount of energy packed into
such a small space. The Lithium Polymer battery was chosen in the
end due to the advantages mentioned above.
Department of Systems and Computer Engineering |Carleton
University
21
Internet Mobile Robot
April 7th, 2010
4.0 Hardware Components and ConstructionHardware components were
chosen from the alternatives presented in Section 3.0. It was
important to bear in mind the weight of each component. There were
other decisions that needed to be made in the process of choosing
an individual component. These decisions were made to ensure
compatibility with other component parts. This will be discussed in
each of the sections.
4.1
Frame and StructureCarbon fibre reinforced plastic (Carbon Fibre
for short) rods were used for the
arms of the robot. Carbon Fibre Rods are light and proved to
have a higher strength-toweight ratio when compared pound-
for-pound with the other alternatives. Carbon fibre also has high
tensile strength, low thermal expansion. However, it is relatively
expensive when compared to the other alternatives but the small
price discrepancy was almost negligible looking at the advantages
Carbon Fibre provided, especially since it is significantly lighter
and durable compared to the alternatives mentioned in Section
3.1.2. The sketch in Figure 6 shows the proposed basic frame of the
IMR. Aluminum was chosen for the square base initially as can be
seen in Figure 7. The figure shows the initial structure with the
Carbon Fibre rods and aluminum square base. The total weight of the
fibre rods, the aluminum base and the miscellaneous screws and nuts
used to secure the components is 3.2oz.
Department of Systems and Computer Engineering |Carleton
University
22
Internet Mobile Robot
April 7th, 2010
Figure 6: Sketch of Proposed Structure
Figure 7: Initial Frame
Department of Systems and Computer Engineering |Carleton
University
23
Internet Mobile Robot
April 7th, 2010
4.2
MicrocontrollerThe Arduino Mega was chosen because of its
greater memory, processing power and number of ports. It has 54
digital input/output pins, 14 of which offer Pulse Width Modulation
(PWM) that is required to control the motors, 16 analog inputs that
provide a 10bit resolution each, and 4
Serial UARTs. The Arduino Mega is a microcontroller board based
on the ATmega1280 microprocessor. It has an operating voltage of
5V, input voltage range from 7V to 12V, 128KB of Flash Memory for
storing code, 8KB of SRAM, 4KB of EEPROM and a clock speed of
16MHz. It was a cheaper alternative to the other options
considered. The microcontroller is widely adopted and hence there
is more support for it. There are numerous shields that can be
mounted on to it for added functionality. Examples include the
Aeroquad Shield V1.7 and the WiShield 2.0 that will be discussed in
later sections. The Arduino Mega can be programmed with the Arduino
Software provided free by the developers. The Arduino Integrated
Development Environment (IDE) is written in Java and made for the
Processing programming language. It includes a code editor with
features such as syntax highlighting, brace matching, and automatic
indentation, and is also capable of compiling and uploading
programs to the board with a single click.The IDE also comes with a
C/C++ library that can be used to simplify I/O operations. Arduino
programs are written in a language akin to C/C++ and hence it is
something that we are familiar with [13]. The Arduino Mega
contributes a weight of 1.5oz to the IMR.Department of Systems and
Computer Engineering |Carleton University 24
Internet Mobile Robot
April 7th, 2010
4.34.3.1
Flight and StabilityPropeller and Motor Combination
Configuration
Brushless DC motors were ultimately chosen to provide thrust
power to the IMR. Brushless DC motors have a higher efficiency of
85% to 90% as opposed to the 75% to 80% efficiency of brushed
motors. This results in reduced noise, longer lifetime and more
power. These motors provide superior power-to-weight ratios and are
very light. To pick the right motor model, the propeller was chosen
first. The light EPP1045 propeller was chosen as they are widely
adopted in other implementations of the Quadcopter. With this
design decision, the matching motor for optimal thrust was sought
and research yielded Table 3 below.
Table 3: Matching Motors for EPP1045 Propeller
The table shows the comparison of the performance of the
propeller with various motors. The criteria in consideration are
cost, weight of the motor, maximum thrust achieved in pounds and
the amount of power drawn per pound at maximum
Department of Systems and Computer Engineering |Carleton
University
25
Internet Mobile Robot
April 7th, 2010
thrust. After the analysis was done, what it came down to was
availability. The only motor available was the Towerpro 2410-09
Open Base Brushless Motor. The statistics show that it is a cost
effective option and that it is really light at 2.05oz. It could
provide better thrust but it is one of the more power-efficient
motors. With a total of four such motors on the IMR, they will
contribute a total weight of 8.2oz. The Amp rating is 13.5A. The
positioning of the motor also contributed to the stability. The
closer the motors are to the centre, the more stable the IMR is.
However, this compromises the manoeuvrability of the IMR as the
Quadcopter responds better to change in directions when the motors
are further apart. This increases the signal noise fed into the IMU
due to increased vibration. Extensive testing was done to determine
the perfect distance of the motors from the centre for the right
balance between noise and manoeuvrability. The propeller/motor
configurations also differed. As mentioned in Section 1.1, there
are 2 motors that spin clock-wise and two that spin counter
clockwise. The right propeller had to be mounted on the
corresponding motor to achieve this. The motors were wired to
Electronic Speed Controllers (ESCs) in 2 configurations to ensure
the clock-wise and counter clock-wise rotations of the motors. ESCs
are discussed in Section 4.3.2.4.3.2 Electronic Speed Controller
(ESC)
Since a Brushless Motor was chosen, an Electric Speed Controller
was required. A brushless motor controller or brushless ESC
(Electronic Speed Control) is used to vary the speed of a brushless
motor. These function as an interface between the motor and
Department of Systems and Computer Engineering |Carleton
University
26
Internet Mobile Robot
April 7th, 2010
the battery. Controlled by the microcontroller, the brushless
ESC provides variable power to the motor allowing proportional
speed adjustments. The microcontroller sends PWM signals with
different duty cycles to vary the speed of the motor rotation.
Unlike a brushed motor, power cannot be directly applied to a
brushless motor. Instead, the speed control intelligently powers
each phase of a brushless motor in sequence, causing it to rotate.
The Tower Pro w18A Mag8 Digital Brushless Motor ESC was chosen.
This component has a weight of 0.705oz, an Amp rating of 18A and
operates ideally at a voltage of 6V 12V. These are considerations
that are important to note. The voltage information needs to be
noted for the purpose of selecting the battery. The the total
weight contributed by the 4 ESCs is 2.8oz. The Amp Rating of 18A
indicates the maximum current that the ESC is able to provide
continuously to a motor and it is better to have an ESC with a
higher continuous current rating to ensure that the ESC is able to
handle the power requirements of the motor. The Amp rating 18A is
good given the 13.5A rating of Tower Pro Brushless Motor 2410-09
chosen.4.3.3 Six Degrees of Freedom (DOF)
After much research, two chips from SparkFun were chosen to
provide the 6 DOF for the Inertial Measurement Unit. The first is a
5DOF IMU combo board that incorporates the IDG500 dual-axis
gyroscope and the ADXL335 accelerometer on one single chip. This
board enables the 5 axis of sensing (Roll, Pitch, X,Y,Z) in less
than 1 square inch and weighs less than 0.07oz. The second board is
the dual axis IXZ-500 gyro. This senses the angular velocity on the
X and Z axes. This board thus provides YawDepartment of Systems and
Computer Engineering |Carleton University 27
Internet Mobile Robot
April 7th, 2010
information and it complements the first board that provides
Roll and Pitch. These two chips can be mounted onto the Aeroquad
Shield. The Aeroquad Shield is a printed circuit boards (PCB) that
was made for the Arduino. It was created to mount the two chips as
well as to interface with the ESC connections. The total weight
contributed by this set-up is 0.75oz.Figure 8 : Aeroquad Shield
4.4
CommunicationsThe WiShield 1.0 was the chosen Wi-fi module from
Async Labs. This is perfect
for the Arduino-based projects and is a shield module that can
be directly mounted on the Arduino Mega. This shield provides
802.11b connectivity and is a direct drop-on plug-and-play
solution. It has a 16Mbit serial flash onboard to store web pages
and other data. This space can also be used for storing sensor type
data that can be downloaded in the future. It supports both
infrastructure and ad hoc wireless networks which can be useful in
the testing phase. Further research can be found in Section
6.0.
4.5
BatteryThe Lithium Polymer (LiPo) cells were chosen since they
clearly provided better
performance compared to the NiCd and NiMH battery types. It is
really light and has a good energy density. This is perfect for the
project as more power would be provided from a battery pack that
doesnt weigh too much. A 11.1V battery was chosen and this is a
good volatage rating recalling that the ESCs has a input voltage
range of 6-12V and the microcontroller has an input voltage of 7V
to 12V.Department of Systems and Computer Engineering |Carleton
University 28
Internet Mobile Robot
April 7th, 2010
4.5.1
Flight Time and Battery Power Dependancy
Given that the Quadcopter would have its own weight as well as
other payloads, we needed to do an analysis to see how much load a
certain battery can provide and how much time the battery will
provide for flight given the pay load. The various components and
the corresponding weight calculated in previous sections have been
tabulated in Table 4. The table indicates the weight of the
Quadcopter with its basic component parts. This weight will be
considered the IMR weight. Anything on top of this weight will be
considered payload. Measurements were taken using a 2100mAh battery
again to see how much payload this configuration can take and to
see if it is consistent with the Table 2 in Section 3.1.1. The
graph generated can be seen in Figure 9.
Component Base/Frame Microcontroller EE1045 Propellers and Prop
Savers 2410-09 Motors Motor Mounts ESCs Bindings and Miscellaneous
Parts Battery Total Weight
Weight(oz) 4.2 1.5 1.1 8.2 0.6 2.8 0.4 5.2 24.0
Table 4: Total Weight Calculation
Department of Systems and Computer Engineering |Carleton
University
29
Internet Mobile Robot
April 7th, 2010
Flying weight vs Battery Life25 20 Battery Life ( Mins) 15 10 5
0 0 10 20 30 40 50 60 70 Flying Weight in Ounces (oz) 12.6 10.5
2100mAh 7.5 7.3 6.4 5.5 4.6 19.9 17.1
9.2
Figure 9: Graph of Flight Time versus Battery Life
The results above show that with no payload (i.e. 24oz), 19.9
minutes of flight time can be achieved. The graph was extrapolated
to predict the flight time for heavier payloads but it might not
necessarily be realised in reality.
4.6
Design Implementation and Final StructureHaving considered the
numerous factors to choose component parts, the
eventual implementation of the design was both mechanical and
electrical in nature. Basic mechanical work was done with regards
to the construction of the structure. Minor cutting of the Carbon
Fibre rods and drilling was done. Two acrylic pieces were added as
a final design decision to provide two different levels. The bottom
level is used to store wiring and the battery and the upper level
is where the logic unit is situated. Minor electrical skills were
also required to solder the component parts and wire them. Figure
10 shows the top level wiring diagram andDepartment of Systems and
Computer Engineering |Carleton University 30
Internet Mobile Robot
April 7th, 2010
Figure 11 shows the final design.
Department of Systems and Computer Engineering |Carleton
University
31
Internet Mobile Robot
April 7th, 2010
Figure 10: Wiring Diagram for IMR
Department of Systems and Computer Engineering |Carleton
University
32
Internet Mobile Robot
April 7th, 2010
Figure 11: Final Design
Department of Systems and Computer Engineering |Carleton
University
33
Internet Mobile Robot
April 7th, 2010
5.0 Stability and ManoeuvreThere are obviously many factors that
affect the flight of the Quadcopter. The collaboration of
components as previously described is a core factor that determines
whether the Quadcopter can take flight or not; the sections to
follow describe ways to stabilize the Quadcopter when it is in the
air as well as the constraints on the system that will allow us to
steer the Quadcopter.
5.1
Filtering NoiseA clean analog signal is almost impossible to
get. It is always littered with noise
whether it is from the AC signal from the outlets that add 60Hz
noise or mechanical motors that cause vibrations. This noise
usually cannot be completely removed but needs to be minimized in
order to get the data that we need. A Second Order
Complementary Filter was used to remove the noise from the
accelerometers and gyroscopes caused by a variety of sources from
electrical to mechanical.5.1.1 Noise Reduction
To obtain the desired signal, it is theoretically possible to
use a filter and isolate the desired signal. Reality is, it is
harder than it sounds. There are many uncontrollable variables
ranging from predictable (such as 60 Hz AC noise) to unpredictable
(such as mechanical vibrations and wind) which may add noise to the
system and make it more difficult to isolate for the desired
signal. It is extremely difficult to eliminate all noise from any
given signal. The noise is mixed in with the desired signal and
simply applying a filter may not be able to remove the noise
without also potentially removing the signal. In fact, it is
impossible to remove just the noise without attenuating the signal
ifDepartment of Systems and Computer Engineering |Carleton
University 34
Internet Mobile Robot
April 7th, 2010
the frequencies overlap or if there are common frequencies. For
this reason, the Signal to Noise Ratio (SNR), the power ratio
between the signal and noise, has more value in noise reducing
processes and is more frequently used in practice. For the purposes
of this project, moderately controllable variables such as the
weather and wind are removed by testing in an open space that is
indoors with relatively low draft. Mechanical and electrical noise
from the equipment is monitored and removed as much as possible
without distorting the desired signal itself using a Second Order
Complementary Filter.
5.1.2
Second Order Complementary Filter
A complementary filter is a filter with a derivative feedback
through the filter. [14] The order of a filter determines how many
components that is required. The high level design for a second
order filter requires two integrals from the inputs to the output.
Therefore, a Second Order Complementary Filter is one with two
integrals, with the value of the output being fed back between the
first and second integral. A block diagram of the Second Order
Complementary filter can be seen in Figure 12.
Figure 12: Second Order Complementary Filter [15]
Department of Systems and Computer Engineering |Carleton
University
35
Internet Mobile Robot
April 7th, 2010
Theoretically and through experiments, it can be seen that the
Second Order Complementary Filter performs drastically better than
a First Order Complementary Filter and without wasting too much
more computation time. It can be seen that a Second Order
Complementary Filter removes the noise from the sensors quite well
and leaves a relatively clean signal as compared to the signal
received (refer to Figure 13).
Figure 13: Second Order Complementary Filter [15]
5.2
Feedback ControlAs with most control systems, the time it takes
for the system to reach Steady
State is of utmost importance and is part of the tradeoffs that
must be taken into consideration. A system must respond in a timely
manner. There are many factors that
Department of Systems and Computer Engineering |Carleton
University
36
Internet Mobile Robot
April 7th, 2010
may affect the response time but a couple of major factors
affecting Transient Response: Computing/executing speed of system,
Communication delay. Computing speed of system is dependent on the
speed of the microcontroller used, but as processing speed is
getting faster and faster, finding a microcontroller that is fast
enough has become less of a problem. Execution at the optimal speed
and with the optimal response is still very important. There are
methods used in control
engineering that optimize the speed at which the system reaches
steady state. Communication delay is inevitable with any system. We
can only ensure that we allow enough time for the message to be
received before re-sending a signal. considerations will be
discussed in Section 6.0 Wireless Communication.5.2.1 Six Degrees
of Freedom (DOF)
Further
The principle is that a rigid body in three dimensional (3D)
space has six independent ways it can move (or six DOF). The
movement can either be translational or rotational about the X, Y,
and Z axis or combinations thereof (Figure 14). In flight terms,
the axes are called Roll, Pitch, and Yaw. The Roll is tilt from
side to side. The pitch is the elevation of the front. The yaw is
the direction of movement relative to the desired projection, also
referred to as side slip. Constraints are needed for each DOF in
order to restrict or enable movement in 3D space.
Department of Systems and Computer Engineering |Carleton
University
37
Internet Mobile Robot
April 7th, 2010
Figure 14: Possible independent movements in 3D space [16]
5.2.2
System Control Theory
To control an object in 3D space that is free to move about, all
six DOF must be monitored for unplanned directional changes and
adjusted accordingly. Adjustments can either be done manually or
with an automated control system to ensure the object is of the
correct orientation and angle. Control Systems can be classified in
to three categories: Open Loop, Feed-Forward, and Feedback. [17]
Open Loop Controllers, also referred to as Non-Feedback
Controllers, are useful for systems where the system inputs are
directly related to the system outputs and the desired system
state, usually by a mathematical formula. Feed-forward Control
Systems are generally used when the effect of an input or command
to the system produces a predictable output. Feedback Systems (or
Closed-Loop Systems) are causal systems that are mostly used in
systems that require adjustments and possibly machine learning. The
output of causal systems depends on the previous output(s) of the
system. For
Feedback System, the output is determined by comparing the
previous output signal and the reference signal. [17]Department of
Systems and Computer Engineering |Carleton University 38
Internet Mobile Robot
April 7th, 2010
Figure 15: Types of Control Systems: (a) Open Loop (b)
Feed-Forward (c) Closed Loop [18]
As seen in Figure 15, different types of systems will react
differently to disturbances to the system. From the description of
the project and from the
descriptions of the types of systems, a Closed Loop Feedback
System is the most suitable for a Quadcopter that must adjust
according to the sensors that determine its orientation and
direction. There are two types of Feedback Systems: Positive
Feedback Systems and Negative Feedback Systems. [17] Positive
Feedback Systems are causal systems that amplify any small
disturbances to the system. A small perturbation can cause the
system to grow
relatively quickly. This is useful when the output of the system
needs to be magnified or
Department of Systems and Computer Engineering |Carleton
University
39
Internet Mobile Robot
April 7th, 2010
enhanced. [17] In the case of a Quadcopter, a Positive Feedback
Systems would ultimately magnify any noise present in the system
and destabilize the system. Negative Feedback Systems are also
causal systems, but instead of amplifying any small perturbations
they will make up for any discrepancy between the desired output
(according to the input) and the actual output so that the system
can reach the desired output. [17] The output of the system is the
signal that is fed back into the system. The difference between the
desired signal and the signal fed back is the command error and
will determine how the system should react. If the desired signal
and the feedback signal match, the command error is zero and the
system has reached the desired state. Along with how a system will
reach a stable state is how quickly a system can reach that steady
state. The time it takes to reach steady state is dependent on the
damping of the system. A system can be described to be underdamped,
critically damped, or overdamped. An underdamped system will
overshoot the steady state value and oscillate about the steady
state value before it reaches steady state. The more underdamped
the system, the higher the amplitude and number of the
oscillations. A critically damped system is a system that reaches
steady state as quickly as possible without overshooting the steady
state value. An overdamped system will reach steady state without
overshooting the desired value but over a longer span of time. The
dampness of a system is represented by the damping constant, . If 0
< < 1, the system is considered to be an underdamped system
which means the transient
Department of Systems and Computer Engineering |Carleton
University
40
Internet Mobile Robot
April 7th, 2010
response is oscillatory. If = 1, the system is described as
critically damped and if > 1 the system is overdamped, as seen
in Figure 16. [17]
Figure 16: How the damping constant affects the time it takes to
reach steady state [19]
Because of the nature of the system for a Quadcopter, manual
adjustments are very difficult as the response must be
instantaneous, yet human reaction is only so quick. Thus, to steer
the Quadcopter, we must resort to a mechanical-electrical
solution: Accelerometers and Gyroscopes. These mechanisms will
help direct and control the direction of motion of the Quadcopter
by outputting any possibly unwanted changes to the system.5.2.3
Proportional, Integral, Derivative Controller
A Proportional, Integral, Derivative (PID) Controller contain
three terms (controllers) that are used to control the gain and
thus the overall response time of the system: Proportional,
Integral and Derivative. PIDs calculate the difference between
the
Department of Systems and Computer Engineering |Carleton
University
41
Internet Mobile Robot
April 7th, 2010
output value and a set desired input value and use it to
calculate and control the gain of the system and maximize the
response time. The Proportional Controller determines the reaction
to the current error, the Integral Controller sums the recent
errors and provides a better steady state response, the Derivative
Controller enhances transient response but uses the rate at which
the error has been changing and therefore can be unpredictable and
cause a lot of jitters. Together, the three terms are used to
control the gain and response time of the system. The tradeoff for
speed is how much the system will oscillate. For a system like the
Quadcopter, too much oscillation is
undesirable so the gains will be set accordingly. The time
domain transfer function can be seen and derived fromFigure 17. The
S-Domain transfer function of a PID is: H(s) = KP + KI/s + KDs =
KDs2 + KPs+ KI. Using the Sdomain transfer function, one can
determine where the poles and zeros of the system are. The poles
are at the denominator factors and the zeros are at the numerator
factors for a fully factored transfer function. For a system to be
stable, all poles must be in the open left half plane (OLHP). If
there are any poles in the open right half plane (OLHP), the system
is considered unstable. Any poles on the imaginary axis is
considered marginally stable (or pure oscillatory). The closer
the poles are to the imaginary axis, the quicker the response, but
at the same time the system can become more oscillatory which is
undesirable for a Quadcopter. Over time, it is expected that the
error in the feedback loop approach zero: the steady state of the
system with the current input. [17]
Department of Systems and Computer Engineering |Carleton
University
42
Internet Mobile Robot
April 7th, 2010
Figure 17: PID Controller loop [20]
5.2.4
Feedback Control Mechanism: Inertial Measurement Units
Inertial Measurement Units (IMU) are widely used to manoeuvre
and control the direction of moving objects from airplanes to
satellites to rockets. It consists of a combination of
accelerometers and gyroscopes. As previously discussed, for a
system such as a Quadcopter, the system would need to constrain all
six DOF in order to fully navigate the Quadcopter predictably. The
three accelerometers can be used to
constrain the translational motion along the three independent
axes and the gyroscopes can be used to constrain the rotational
motion about each of the three independent axes. The accelerometer
measures the acceleration relative to the frame and acts as a
motion sensor to determine the direction and orientation of
movement. It would firstly need to be zeroed for a certain plane.
That plane would then be the position of rest. The output of an
accelerometer is simply a voltage level that is increased if the
accelerometer is tilted to one direction, or decreased if it is
tilted in the other direction. From the output of the
accelerometer, one can determine the angle at which the Quadcopter
is currently at. With three accelerometers placed perpendicular to
each other, one can determine the angle for each of the
axes.Department of Systems and Computer Engineering |Carleton
University 43
Internet Mobile Robot
April 7th, 2010
The gyroscope maintains the direction by detecting the change in
orientation. Gyroscopes maintain the orientation using the concepts
of conservation of momentum. The gyroscope continuously spins about
an axis. Once the spin is axis is skewed, the output will tell us
how the gyroscope is moved and what must be done in order to
balance it out again. As with the accelerometer, the gyroscope also
has to the zeroed to determine the rate of change at the desired
constant value (usually at rest). The gyroscope would then output a
certain voltage level when a change in orientation is detected and
this value can then be used to adjust the orientation accordingly.
Using the one device without the other is simply not sufficient.
Both devices must be used in tandem in order to control both the
orientation and direction of movement of the Quadcopter. PIDs will
determine how fast it will reach that steady
state while accelerometers and gyroscopes determine the
direction and magnitude of adjustment required to reach steady
state due to the inputs. Both the gyroscopes and accelerometers can
be found in compact forms in an integrated chip the size of a
quarter.5.2.5 Feedback Control Loop
Now that we have generally described all the desired components
that will help stabilize and manoeuvre the Quadcopter, we can put
the components together. A generic form for a feedback control loop
with the controller and sensors is:
Figure 18: Feedback loop including system, controller and sensor
configuration [21]
Department of Systems and Computer Engineering |Carleton
University
44
Internet Mobile Robot
April 7th, 2010
We can replace the generic controller with our controller of
choice: the PID controller. Similarly, the System is our Quadcopter
(consisting of the structure, motors, propellers, etc.) and our
output sensors for the feedback loop are the three accelerometers
and three gyroscopes. Our feedback control loop design for the
Quadcopter can be represented by the block diagram below.
Figure 19: Feedback Control Loop with control components
From Figure 19, one can follow the feedback loop to determine
the sequential output of each component. The difference between the
sensor outputs and the
reference signal is determined which is then used by the PID to
determine the optimal input to the Quadcoptor so that the output of
the system is as desired (the system output being the flight
orientation and direction). The accelerometer and gyroscope outputs
will then be fed through the filter and the measured command error
will be again calculated. The filter was added after the sensor
data and before calculation of the measured command error so that
it can remove the noise from the sensors before using the signal in
any component of the system. It should be understood that each
control component uses a different controller. The Quadcopter
system as a whole can be split into different subsystems. The PID
values for the Roll control may be different than that of the
Pitch, Yaw or Throttle. In addition to those PID controllers, there
are also different PID controllers for the autoDepartment of
Systems and Computer Engineering |Carleton University 45
Internet Mobile Robot
April 7th, 2010
levelling (or stabilization) of the Quadcopter to try to
optimize the response to a disturbance to the system.5.2.6 Flight
Tuning Using Ziegler-Nichols Rules
Many systems can be easily modelled mathematically and an
analytical approach to determining the values for the PID
controller can be used. For systems that are difficult to model
mathematically other approaches such as the Ziegler-Nichols Rule
can be used to obtain an educated estimation for the PID which can
later be fine tuned further. [17] Type of Controller KP P PI PID
0.5KCR KI 0 KD 0
0.45KCR 1.2/PCR 0 0.6 KCR 2/PCR 0.125PCR
Table 5: PID gain using Ziegler-Nichols Tuning Rule [17]
To use the Ziegler-Nichols Rule, one must find the critical
gain, KCR, and critical period, PCR, of the system. To find those
two values, one must set K D = 0 and KI = 0 for the PID Controller
transfer function: H(s) = KP + KI/s + KDs. Adjusting only KP, one
must find the value that causes the system to exhibit sustained
oscillations. The gain at which the system exhibits sustained
oscillations, is known as the critical gain. Using the frequency at
which the system oscillates, one can find the critical period.
Then
according to Table 1, one can choose the desired values for the
PID controller. According to the Ziegler-Nichols Rules, this PID
should exhibit close to optimal response for the system, with
perhaps minor fine tuning around these gain values.
Department of Systems and Computer Engineering |Carleton
University
46
Internet Mobile Robot
April 7th, 2010
5.35.3.1
Flight Configuration and SimulationFlight Configuration Methods
and Tools
There are many variables that must be configured in order to
control the Quadcopter in flight. These variables are stored in
EEPROM and read before and throughout operation. There are two
methods of setting these variables: Using the Serial Monitor or
with the aid of AeroQuad Configurator v1.2. The Serial Monitor is
built into the Arduino development environment. It allows for
serial communication between the Arduino board and the user
computer via USB. This communication medium is used to upload
programs as well as to debug via print statements and send and
request flight configuration parameters.
Figure 20: Motor Command outputs (S) during simulation of flight
with Serial Monitor
The commands to send and request flight parameters can be found
in SerialTelemetry.pde and SerialCommand.pde, respectively. The
commands need to be
Department of Systems and Computer Engineering |Carleton
University
47
Internet Mobile Robot
April 7th, 2010
entered in the command line of the serial monitor. To send or
request a command, enter the letter corresponding to the command,
select send and the values will appear in the Serial Monitor output
screen below it. Refer to Figure 20 for the outputs using the
command S which requests the motor commands and various other
flight parameters separated by a comma. In the same manner, one can
simulate flight (without propellers attached for safety reasons) by
tilting the Quadcopter and sending the Q command to receive
continuous sensor data to monitor the change as the Quadcopter is
being moved Figure 21.
Figure 21: Sensor Data output (Q) during simulation of flight
with Serial Monitor
Alternatively, AeroQuad Configurator is an open source software
developed by AeroQuad to test and adjust flight parameters of the
Aeroquad before flight. This software can also be used to set
various parameters that control the flight of the Quadcopter such
as the PIDs, filter time constant, transmitter/receiver
sensitivity,Department of Systems and Computer Engineering
|Carleton University 48
Internet Mobile Robot
April 7th, 2010
levelling limits, etc. Its Graphical User Interface (GUI) is
very straight forward and easy to understand and use (refer to
Figure 22). The values can be entered into the corresponding box
and updated by selecting the Update button at the bottom right
corner.
Figure 22: AeroQuad Configurator GUI with updatable flight
parameters
In a similar manner, values such as the PID outputs, motor
speeds, sensor values, etc. can be plotted and seen in graphical
form with the AeroQuad Configurator Figure 23. The continuous time
line graph helps one to visually see the oscillations occurring and
the sizes of the oscillations.
Department of Systems and Computer Engineering |Carleton
University
49
Internet Mobile Robot
April 7th, 2010
Figure 23: Various sensor outputs with AeroQuad Configurator
GUI
There is known to be a few bugs with this tool when it comes to
setting these parameters. Even if it says the parameters have been
updated, it may not necessarily be so. The values should always be
double checked with the Serial Monitor before flight to ensure the
values were indeed written to EEPROM.5.3.2 Pre-Flight Tests
Before the Quadcopter takes flight, there is a list of tests
that should be executed. This is for the safety of everyone
involved and everyone in the vicinity of the Quadcopter while it is
flying. It is to ensure that the Quadcopter does not fall out of
the sky and or crash into anyone. This could prevent damaging the
Quadcopter as well as prevent causing any bodily harm to oneself
and others. 1. Increase the throttle to a point where all motors
are spinning.
Department of Systems and Computer Engineering |Carleton
University
50
Internet Mobile Robot
April 7th, 2010
2. Tilt the Quadcopter to the left. The left motor should speed
up. The right motor command should slow down. 3. Tilt the
Quadcopter to the right. The right motor should speed up. The left
motor should slow down. 4. Tilt the Quadcopter forward so that the
front motor is lower than the back motor. The front motor should
speed up. The rear motor should slow down. 5. Tilt the Quadcopter
up (the front motor should be higher than the rear motor). The rear
motor command should increase. The front motor command should
decrease. 6. Rotate the Quadcopter clockwise. The front and rear
motor commands should increase. 7. Rotate the Quadcopter
counter-clockwise. The left and right motor commands should
increase in value. The above Pre-Flight Tests were referenced from
http://AeroQuad.info and modified for the Quadcopter. [22] There
are also communication related tests that will be described further
in Section 6.0 Wireless Communication.5.3.3 Flight Control and
Results
As with many projects that rely on a variety of variables and
have a large amount of components that need communicate with each
other, this project encountered many issues during the integration
period of the development cycle. This section will discuss the
results and problems encountered for the flight components as well
as the approach
Department of Systems and Computer Engineering |Carleton
University
51
Internet Mobile Robot
April 7th, 2010
to solve them. Further discussion on integration