Documente Academic
Documente Profesional
Documente Cultură
The Quadcopter
Group 13
Rahul Bura
Mohamed Chande
Vinayak Goge
Hue Vo
Supervisor: Professor Peter X. Liu
April 7, 2010
Abstract
Group 13 consisting of Rahul Bura, Mohamed Chande, Vinayak Goge
SYSC 4907 Engineering Project: Internet Mobile Robot: The Quadcopter. The
Internet Mobile Robot April 7th, 2010
(helicopter with four propellers) that can take flight and be controlled using a
location. This opens up different possibilities with the design being applied in
Military Applications.
interaction. Any command received from the WI-Fi chip is processed by the
controllers and inertial measurement units that are used to stabilize the
Quadcopter.
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
Acknowledgements
We would like to formally thank Professor Peter X. Liu for supervising
and for his guidance throughout the Internet Mobile Robot project as well as
We would also like to thank the Technical Support Staff, Danny Lemay,
Jerry Buburuz and Daren Russ, for their support throughout the project.
Table of Contents
Abstract.......................................................................................................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.1Project Contributions................................................................11
2.4.2Report Contributions................................................................12
3.0 Robot Design......................................................................................13
3.1 Structure........................................................................................13
3.1.1Number of Motors....................................................................13
3.1.2Frame.......................................................................................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.1Propeller and Motor Combination Configuration......................25
4.3.2Electronic Speed Controller (ESC)............................................26
4.3.3Six Degrees of Freedom (DOF).................................................27
4.4 Communications............................................................................28
4.5 Battery...........................................................................................28
4.5.1Flight 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.1Noise Reduction.......................................................................33
5.1.2Second Order Complementary Filter........................................34
5.2 Feedback Control...........................................................................35
5.2.1Six Degrees of Freedom (DOF).................................................36
5.2.2System Control Theory.............................................................37
5.2.3Proportional, Integral, Derivative Controller.............................40
5.2.4Feedback Control Mechanism: Inertial Measurement Units......42
5.2.5Feedback Control Loop.............................................................43
5.2.6Flight Tuning Using Ziegler-Nichols Rules................................45
5.3 Flight Configuration and Simulation...............................................46
5.3.1Flight Configuration Methods and Tools...................................46
5.3.2Pre-Flight Tests........................................................................49
5.3.3Flight Control and Results........................................................50
6.0 Wireless Communication (Server)......................................................54
6.1 Communication System Overview..................................................54
6.2 Wireless Standards.........................................................................55
6.2.1ZigBee......................................................................................56
6.2.2Wi-Fi.........................................................................................57
6.3 WiShield Configurations.................................................................58
6.3.1Network Type...........................................................................58
6.3.2TCP vs UDP...............................................................................59
6.4 WiShield Functionality....................................................................64
6.5 Serial Peripheral Interface..............................................................66
6.6 Challenges and Solutions...............................................................69
6.6.1Debugging................................................................................69
6.6.2Pin 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.1Operating System....................................................................81
8.1.2XAMPP......................................................................................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
Error: Reference source not found
List of Figures
Figure 1: Rotating pairs of rotors [3]................................................................1
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 18: Feedback loop including system, controller and sensor configuration [21]
.......................................................................................................................43
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 38: Pin 5 of SM (with WiShield) connected to digital pin 32 of PM using a wire
[39]................................................................................................................87
List of Tables
Table 1: Report Contributions........................................................................12
10Introduction
With the recent developments in wireless communications
based applications are now able to expand into new areas. One of
web browser.
1.1Background
The Unmanned Aerial Vehicle built is also
Internet Mobile Robot falls under. This more recent generation consists
that use electric control systems and sensors to stabilize the aircraft().
as mechanical linkages are not required for control of the rotor blades.
time and cost (). Also, the use of four rotors allows each individual
resulting in less kinetic energy being stored during flight. This reduces
the damage caused should the rotors hit any objects. For small scale
1.2Motivation
Multiple implementations of the Quadcopter currently exist.
Wi-Fi implementation.
1.3Problem Statement
A Quadcopter needs to be constructed and a Wi-Fi
this project concerned itself with. The first goal was to get a
the system. This system then needs to achieve stability and stable
parts from hobby shops. Major parts to look at would be the robot’s
and 4.0 regarding the selection of components and the design and
implementation process.
with the robot remotely via a router. The WiShield from Async Labs
was purchased for this purpose. Commands that the Wi-Fi module
came with the module was also necessary and can be seen as an
controllability as the WiShield is one of the first modules of its kind and
(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
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
IMR.
perfect but it’s a good foundation for future designs. It outlines the
basic controls currently but this can be improved upon in the future to
8.0.
code so that the IMR can function seamlessly. The current solution was
constitute research needed for the IMR project. These documents may
well.
will outline the research and calculations done to come to the final
chosen and the rationale behind each selection. It will also briefly
controls. The section will delve deeper into topics such as noise-
handling, filters and filtering as well as feedback loops and the control
how commands are communicated to the IMR. It will look at how the
Wi-Fi module has been utilised and how the functions were
how the user can communicate with the IMR via the GUI created. It
Quadcopter.
posture can cause back pains and wrist pains and staring at a screen
recommended to take regular breaks to not over strain the eyes and to
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
them to spin, one should ensure that there is no one and nothing in the
space with plenty of room in case one should lose control of the
Ensure that everyone that must come in contact with the components
know the risks and the proper method of handling the components.
burns.
2.2Engineering Professionalism
Engineering is a profession. It is the process of methodically and
and analysis was done before the design phase of the project, followed
procedures and are coming to the end of the development cycle for the
proposed project.
Throughout the project, our group made sure our decisions were
made decisions for the benefit of the progress of the project without
Each member took ownership of their duties and ensured that their
2.3Project Management
Our team started our development by doing some research on
ideas, we proceeded with our Quadcopter idea and did some further
the idea and laid a path for the direction we wanted the project to
head in.
an expertise in that topic and allow for a specific area of work while
working independently.
decided that only the core components be done for this year, which
2.4Individual Contributions
2.4.1Project Contributions
The area of expertise and designated work was assigned as stated
below. The project could be divided into four high level components:
Goge – Client)
The work was assigned as such in order to allow for any additional
Much of the Research and Analysis was done by all members of the
team with Rahul Bura leading the structural and component selection.
regardless whose component was being integrated at the time. For formal
Department of Systems and Computer Engineering |Carleton 2
University
Internet Mobile Robot April 7th,
2010
1.1.1Report 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
20Robot Design
Robot design is one of the key components of the project. The
IMR consists of the structure and logic elements. The structure designs
component parts and feasibility of the design. The logic elements were
2.1Structure
The structure is one half of the IMR. The structure houses the
2.1.1Number of Motors
Technically, any number of motors can be mounted to achieve
flight. However, with every new motor mounted, the weight of the
the correlation between the weight of the IMR , its ability to carry that
the table.
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
4 Motors 8 Motors
Design Design
Pay
(Quadcopte (Octocopter
Load(oz)
r) )
0 19.9 11.7 Fl
ig
8 12.6 9.2 h
16 9.2 7.5 t
Ti
24 7.3 6.3
m
32 - 5.3 e
(
M
Table 2: 40 - 4.6 in
Flight Times s)
for 2
Different Designs
achieve flight for about 20 minutes and the Octocopter can achieve
flight for about 12 minutes. This demonstrates the effect of the weight
contrast to the 40oz that the Octocopter can carry due to the
about 4.6 minutes which is not ideal. We also expect that the
2.1.2Frame
The frame of the Quadcopter was next in the design of the
easy to work with. It has about one-third the density and stiffness of
steel making it significantly lighter (). Balsa wood is one of the lightest
varieties of wood available and strong for its weight, pound for pound.
It’s fairly malleable without compromising its strength (). Carbon fibre
The design of the frame itself was based on other models. It was
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
2.2Communications
How we communicated with the robot was a key consideration.
design.
transmission ranges of 1m, 10m and 100m. For our project purposes,
the ideal minimum range was considered to be 100m. With this range,
to network delays.
DC electric power and there are various types that include the Brushed
current direction between the rotor and the external circuit, and a
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
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
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
2.4Flight Control
To control the Quadcopter, two alternatives were considered.
various high level programming languages are now in use as well. Such
microcontroller.
are numerous manufacturers. Ultimately the cost, form factor and ease
2.5Power
The Quadcopter needed a sustainable and portable power source
Nickel Metal Hydride (NiMH), and Lithium Polymer (LiPo) cells are
Nickel Cadmium or NiCd batteries are less common now but they
are cheap. These batteries have cons as well however. NiCd batteries
mean that for future discharge cycles, they will not discharge to their
full potential. NiCd batteries also have a low energy density – the
advantages over the NiCd batteries. NiMH cells offer higher energy
The latest cells are the Lithium Polymer (LiPo) cells. LiPo cells
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
cause the cells to be potential major fire hazards given the amount of
The Lithium Polymer battery was chosen in the end due to the
used for the arms of the robot. Carbon Fibre Rods are light and proved
pound with the other alternatives. Carbon fibre also has high tensile
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
3.2Microcontroller
The Arduino Mega was chosen because of its
that provide a 10bit resolution each, and 4 Serial UARTs. The Arduino
from 7V to 12V, 128KB of Flash Memory for storing code, 8KB of SRAM,
widely adopted and hence there is more support for it. There are
single click.The IDE also comes with a C/C++ library that can be used
akin to C/C++ and hence it is something that we are familiar with ().
This results in reduced noise, longer lifetime and more power. These
pick the right motor model, the propeller was chosen first. The light
matching motor for optimal thrust was sought and research yielded
Table 3 below.
analysis was done, what it came down to was availability. The only
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
IMR, they will contribute a total weight of 8.2oz. The Amp rating is
13.5A.
closer the motors are to the centre, the more stable the IMR is.
are further apart. This increases the signal noise fed into the IMU due
perfect distance of the motors from the centre for the right balance
Section 1.1, there are 2 motors that spin clock-wise and two that spin
the speed of the motor rotation. Unlike a brushed motor, power cannot
causing it to rotate.
The Tower Pro w18A Mag8 Digital Brushless Motor ESC was
for the purpose of selecting the battery. The the total weight
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
provide the 6 DOF for the Inertial Measurement Unit. The first is a
board enables the 5 axis of sensing (Roll, Pitch, X,Y,Z) in less than 1
gyro. This senses the angular velocity on the X and Z axes. This board
thus provides Yaw information and it complements the first board that
provides Roll and Pitch. These two chips can be mounted onto the
3.4Communications
The WiShield 1.0 was the chosen Wi-fi module from Async Labs.
that can be directly mounted on the Arduino Mega. This shield provides
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
3.5Battery
The Lithium Polymer (LiPo) cells were chosen since they clearly
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 doesn’t weigh too much. A 11.1V battery was chosen and this is a
Department of Systems and Computer Engineering |Carleton 2
University
Internet Mobile Robot April 7th,
2010
good volatage rating recalling that the ESCs has a input voltage range
certain battery can provide and how much time the battery will provide
for flight given the pay load. The various components and the
with its basic component parts. This weight will be considered the IMR
with the Table 2 in Section 3.1.1. The graph generated can be seen in
Figure 9.
Component Weight(oz)
Base/Frame 4.2
Microcontroller 1.5
ESCs 2.8
Battery 5.2
The results above show that with no payload (i.e. 24oz), 19.9
predict the flight time for heavier payloads but it might not necessarily
be realised in reality.
and electrical in nature. Basic mechanical work was done with regards
rods and drilling was done. Two acrylic pieces were added as a final
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
is a core factor that determines whether the Quadcopter can take flight
when it is in the air as well as the constraints on the system that will
4.1Filtering Noise
A 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
Filter was used to remove the noise from the accelerometers and
mechanical.
4.1.1Noise 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
mechanical vibrations and wind) which may add noise to the system
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
common frequencies. For this reason, the Signal to Noise Ratio (SNR),
the power ratio between the signal and noise, has more value in noise
indoors with relatively low draft. Mechanical and electrical noise from
Complementary Filter.
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
First Order Complementary Filter and without wasting too much more
Filter removes the noise from the sensors quite well and leaves a
Figure 13).
4.2Feedback Control
As with most control systems, the time it takes for the system to
timely manner. There are many factors that may affect the response
can only ensure that we allow enough time for the message to be
has six independent ways it can move (or six DOF). The movement
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
space.
Controllers, are useful for systems where the system inputs are directly
related to the system outputs and the desired system state, usually by
Figure 15: Types of Control Systems: (a) Open Loop (b) Feed-Forward (c)
Closed Loop()
Loop Feedback System is the most suitable for a Quadcopter that must
system to grow relatively quickly. This is useful when the output of the
the actual output so that the system can reach the desired output.()
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
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
value and oscillate about the steady state value before it reaches
steady state. The more underdamped the system, the higher the
reach steady state without overshooting the desired value but over a
Figure 16: How the damping constant affects the time it takes to reach
steady state()
terms (controllers) that are used to control the gain and thus the
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 sums the recent errors and provides a better steady state
uses the rate at which the error has been changing and therefore can
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
KI/s + KDs = KDs2 + KPs+ KI. Using the S-domain 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
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
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
time, it is expected that the error in the feedback loop approach zero:
Quadcopter, the system would need to constrain all six DOF in order to
certain plane. That plane would then be the position of rest. The
the other direction. From the output of the accelerometer, one can
about an axis. Once the spin is axis is skewed, the output will tell us
Using the one device without the other is simply not sufficient.
determine how fast it will reach that steady state while accelerometers
required to reach steady state due to the inputs. Both the gyroscopes
sensors for the feedback loop are the three accelerometers and three
gyroscopes. Our feedback control loop design for the Quadcopter can
From Figure 19, one can follow the feedback loop to determine
that the output of the system is as desired (the system output being
outputs will then be fed through the filter and the measured command
error will be again calculated. The filter was added after the sensor
can remove the noise from the sensors before using the signal in any
into different subsystems. The PID values for the Roll control may be
PID controllers, there are also different PID controllers for the auto-
analytical approach to determining the values for the PID controller can
educated estimation for the PID which can later be fine tuned further.
()
Type of KP KI KD
Controller
P 0.5KC 0 0
R
PI 0.45K 1.2/P 0
CR CR
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 KD = 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
Using the frequency at which the system oscillates, one can find the
critical period. Then according to Table 1, one can choose the desired
this PID should exhibit close to optimal response for the system, with
and read before and throughout operation. There are two methods of
setting these variables: Using the Serial Monitor or with the aid of
board and the user computer via USB. This communication medium is
Figure 20: Motor Command outputs (S) during simulation of flight with
Serial Monitor
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
same manner, one can simulate flight (without propellers attached for
Figure 21: Sensor Data output (Q) during simulation of flight with Serial
Monitor
Aeroquad before flight. This software can also be used to set various
parameters that control the flight of the Quadcopter such as the PIDs,
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
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.
double checked with the Serial Monitor before flight to ensure the
4.3.2Pre-Flight Tests
Before the Quadcopter takes flight, there is a list of tests that
ensure that the Quadcopter does not fall out of the sky and or crash
2. Tilt the Quadcopter to the left. The left motor should speed up.
3. Tilt the Quadcopter to the right. The right motor should speed
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
5. Tilt the Quadcopter up (the front motor should be higher than the
rear motor). The rear motor command should increase. The front
period of the development cycle. This section will discuss the results
There were many issues that surfaced when the project moved
from the simulation phase to the flight testing phase with all the
Because of the propellers and the need for mobility, the flight
flight. It was expected that with all the hardware components working
simultaneously that some extra fine tuning would be required for the
made for the motors since the motors may not be able to use the same
voltage level to reach the same speed. All of the above considerations
also done to eliminate the idea, as much as possible, that the structure
was not rigid enough. Thereafter, work was done on the assumption
that most of the variables that can still affect the flight of the
position. It can also be seen that this levelling PID combination causes
significantly decreased.
KP Observations
3.7 • Underdamped
5 • 3-4 oscillations before it stabilizes
4.7 • Close to critically Damped
5 • 1-2 small oscillations
5.7 • Overdamped
5 • Difficult to tip off axis. Resistant to
change
6.7 • Overdamped
5 • Very difficult to tip off axis. Highly
resistant to change
Table 6: Values of KP and corresponding qualitative observations for
Ziegler-Nichols Rule
sustained oscillatory state must be found. The Roll and Pitch PIDs were
programmed to have a KP of 4.75 which has, thus far, the most optimal
levelling KP of 6 and KI = 0 and KD = 0 (for both the pitch and roll), one
Therefore, with Ziegler-Nichols Rules, the PID gains that will have the
the Ziegler-Nichols Rules does state that fine tuning may be required
as the gain values are only estimates for the optimal gain values.
As the project progressed, the issue with the drift was narrowed
accelerometers would take that to be the zero point and adjust the
angle (if no pitch and no roll were initially applied). Further testing
The internet is used widely around the world and thus one of the
include ZigBee and WiFi for wireless personal area networks (WPANs),
The ideal design implements the TCP protocol in the uplink and
UDP protocol in the downlink as shown in Figure 24. TCP is used in the
uplink for control commands and UDP is used in downlink for feedback.
be looked at, such as the choice of the WiFi chip to work with the
the solutions chosen for the project. Furthermore, the operations of the
1.2Wireless Standards
For our project purposes, an RF transceiver module was needed
been detailed in the following sub sections. The solution for the project
1.2.1ZigBee
ZigBee is a wireless mesh networking standard that is based on
ZigBee is simpler and less expensive. Due to its low cost, the
battery life, and secure networking. The low power-usage allows longer
life with smaller batteries, and the mesh networking provides high
area network (WLAN), simply because the standards used for WLANs
WPANs. This Gateway collects data from XBee chips and sends it to
the project and thus this option was deemed too expensive for our
purposes.
1.2.2Wi-Fi
Wi-Fi is a specification based on IEEE 802.11 standard. Devices
configured to run Wi-Fi can connect to the Internet if they are within
Arduino platform. This shield was built specifically for the Arduino
its low cost, specifications and its ability to directly connect to a WLAN,
this option was deemed the best solution for our project purposes.
1.3WiShield Configurations
As discussed in the section 6.2.2, the Wishield has different
our project.
1.3.1Network Type
The WiShield has in-built implementations of wireless area
Access Points:
configuration.
Ad-hoc:
network was used. This configuration worked very well in the course of
1.3.2TCP vs UDP
The WiShield has two alternatives in terms of transport protocols
in the WiShield are those of UDP and TCP. The following subsections,
TCP:
(SYN) message. The WiShield then replies to this SYN message with an
established and that data transfer can begin. As part of the three-way
losing data.
before sending the next packet. Hence the packets arrive in order at
account for lost packets, a timeout is set and if this time expires then
real-time applications.
UDP:
packet. The server must then extract the IP address and port of the
client from the received packet. Equipped with this information, the
server can reply to the appropriate client with the proper information.
()
rather than huge delays in the network packets as in the case of TCP.
one application at a time, either UDP or TCP; this is consistent with the
1.4WiShield Functionality
address, network type as well as the security type are configured first.
Once the parameters have been configured and verified, the Wishield
selected.
from the Client Application to its socket buffer. If the data is received,
it stores this data in the socket buffer. The data was then parsed to
Furthermore, the socket buffer was emptied to allow for new data to be
stored. The connection state was also changed to wait state to indicate
that the WiShield is waiting for a new command from the client
application.
master device initiates the data frame and the slave device is the
master)
slave)
generated by the master and is an input to all slaves; this case only
one slave. MOSI carries data from master to slave. MISO carries data
from slave back to master. A slave device is selected when the master
asserts the SS signal to select the microcontroller as the slave and the
communication proceeds.
transceiver module.
occurs in which:
•master sends a bit on the MOSI line; slave reads it from the
same line
•slave sends a bit on the MISO line; master reads it from the
same line
word size, such as eight bits, one in the master and one in the slave;
they are connected in a ring. Data is usually shifted out with the most
significant bit first, while shifting a new least significant bit into the
same register. After that register has been shifted out, the master and
registers are loaded with new data and the process repeats.
With this serial communication process, if the SPI pins are in use,
then they cannot be used for any other purpose. As such, a challenge
(PWM) pins required for motor functionality. This challenge, along with
1.1.1Debugging
the product. The WiShield only comes with a simple compiler that
and then verified in the client application which runs on a remote PC.
1.1.2Pin Conflict
The biggest challenge faced in the implementation of the WiFi
interface the Arduino board with the WiShield, otherwise known as SPI
pins were also used as Pulse Width Modulation (PWM) Pins for motor
proper operation, these pins are used for only one purpose, either SPI
There may be different ways of solving this problem, but the best
section 9.0.
software. With these signals, there was no need to use PWM pins to
control the motors. Instead, any digital pin other than the SPI pins
used for SPI communication purposes only. This solution is the best
feasible.
with the remote client application. The PM was then connected to the
need not be avoided, as the WiShield did not use the SPI interface to
and the demonstration was recorded and shown on the poster fair. The
objectives.
system the user is referred to as the client since the user is one that
2.1Client Design
Earlier in the winter term, a client script was written in Arduino
Shield.
communication between the client and the server script. UDP protocol
was chosen since live video feedback was one of the user interface
through the year, live video feedback was excluded. Therefore, this
protocol. The client and server script which were implemented using
User, who is also the client, utilizes the user interface to select
formed into an IP packet and then sent over the internet to the server
which is running the XAMPP services. The server executes the PHP
in turn the Wi-Shield calls the C subroutine which turns the motors
a reply back to the server, in turn sends the reply back to the client
Wi-Shield and a user, and how the client system actually interacts with
Wi-Shield.
phase the web browser, which embodies the user interface, was not
along with the PHP and HTML code. The locally running XAMPP services
execute the PHP code in the packet and forward the embedded
services encase the reply with appropriate PHP and HTML code and
the connection is setup, it asks the user to input a move, where the
user would like the quad-copter to move to. If the input provided by
the user is valid and within predefined commands then the input is
client waits until it receives a reply from the Wi-Shield and then asks
2.2Client Process
Figure 35 describes process which was developed and followed
through the web user interface. The selected command is then sent to
the client process through “from User” stream. The client process
sends the command to the server via “to Server” socket. The server
with XAMPP services receives the command and processes it. After
Client process reads the reply and sends it to the user interface via “to
User” stream. Once the user interface receives the reply, it displays
30User Interface
User interface was developed using HTML coding with embedded
PHP scripting. HTML was used to develop the basic structure of the
user interface, such as the titles, buttons and etc. PHP was used to
As seen in the following figure, using PHP the layout of the user
partitions.
which shows where the live video feedback would be visible, if in the
box below the image lists all the previous commands sent, if the user
wants to track the movement of the quad-copter since the initial start.
Below the display box are the basic controls of the quad-copter such as
3.1Software Requirements
All software used to develop the user interface and the client
3.1.1Operating System
the project since it is fairly new and stable. However, in future newer
capability ().
3.1.2XAMPP
XAMPP is a tool which allows website
• PHP Service
• PHP extensions
• MYSQL Database
• Perl
interface ().
since the programmer can preview and debug the code during
code with HTML code. Moreover, a server which hosts a website with
execute the PHP code. However, most of the web host services offer
free PHP support on their servers, thus making use of PHP to develop
• PHP Service
• PHP extensions
response from the Wi-Shield to the client even though all the code
which could be used to fix the code. This obstacle was overcome by
through the system, which it is installed on. With the help of Wireshark,
where the source and destination IP are the same. This pointed out the
error in the Wi-Shield header file, which asked for the wrong IP address
as an input. It should have asked for the client IP address rather than
Interface code and client code developed earlier in the term. Proper
button was clicked. For example, the client code that sends the Left
Therefore, PHP code must call the client code, written in C language,
when the page loads. This behaviour occurs due to the fact that PHP is
hosts the website. In order to get around this problem, PHP form
method can be employed. After clicking on a button, the PHP code fills
out a “form” with the C code embedded within the PHP code and sends
it to the server; which executes the PHP code and forwards the
button was clicked, the PHP code for that button with the embedded C
code will be sent to the server as a form entry. Afterwards, the server
would execute the PHP code and send turn Right command to Wi-
Shield().
20Software Integration
This section discusses the software integration of the Wi-Fi
Microcontroller (PM) was used solely to run motors and control the
motion of the Quadcopter. The SM was used with the WiShield for Wi-Fi
were sent from the SM to the PM, which then consequently ran the
motors appropriately.
sent from the client application. With this process, every control
command from the client process requires usage of two pins, one on
mounted onto the SM. The WiShield process then turns the voltage on
38. Turning digital pin 5 to +5V forces pin 32 on the PM to change its
voltage to +5V.
The WiShield process then waits for 10ms to change the voltage
on pin 5 back to 0V. This again forces digital pin 32 back to 0V. The
motor control process was programmed to poll pin 32 once every 2ms;
to inspect any change in the voltage of the pin. Since the voltage on
the pin is programmed to remain at +5V for 10ms and the motor
for the motor control process to read this command and respond
accordingly. For all the control commands, dedicated pins were used
WiShield
the overall weight of the Quadcopter. The overall weight of the copter
becomes 1Kg. This does not present a problem as the motors chosen
communicated as expected.
30Production Expenses
3.1Material Costs
Unit
ITEM # Total NOTE
Price
Tower Pro 2410-09 6 US $6.39 Brushless Motors
Tower Pro Brushless
6 US $9.99 Brushless Speed Controller
Speed Controller
TowerPro Alloy Stick Mount for the motors that
4 US $2.00
Mount for Motors also act as heat sinks
Carbon Fibre Tubing 4 US $2.62 750x6mm
US $187.90 Propeller saver that
Prop Saver with 3mm
1 US $3.99 prevents propeller from
Bands
breaking free
Rhino 2150mAh Lipoly
2 US $9.69 Rechargeable Battery Pack
Pack
Turnigy 2-3 Cell Lipoly
1 US $5.95 Battery Charger
Balance/Charger
CAD
AsyncLabs WiFI Shield 1 $59.78 WiFi Module
$309.23
Low cost Ultrasonic
3 $26.33 Ultrasonic Sensor
Range Finder
Counter Rotating Pair
EPP1045 Propellors 3 $6.95 CAD $33.50
Propellers
Gyro Breakout Board -
US
IDG500 Dual 500 1 Gyroscope Board
$39.95
degree/sec US $133.90
IMU 5 Degrees of US Gyroscope Chip to control
1
Freedom $74.95 stability of UAV
US Interface for Gyroscope to
AeroQuad Shield v1.5 1
$24.95 microcontroller
US $
Stackable Headers 2
7.90 CAD $62.95 Necessary male and female
US $ headers to mount the
Right Angle Headers 1
1.95 Gyroscope and
Straight Male Header (9 US $ microcontroller
4
Pin) 3.00
US $
Female Header (5 Pin) 2
1.50
Female Header (9 Pin) 2 US $1.90
Used in order concurrently
Arduino Microcontroller
1 $49.99 develop wireless
Basic Kit
communication code
CAD $66.84
6 Foot USB cable 1 $2.99 Used with the basic kit
Mini Breadborad 1 $4.29 For custom circuit design
Used for preliminary testing
18A DC Power Supply 1 $139.99
of UAV
CAD
Stronger than Rhino
3-cell 2200mAh Battery $203.38
1 $39.99 2150mAh. Used for final
Pack
testing and presentation
CAD
Total
$999.70
Table 8: List of Materials and Respective Cost
The total prices in the above table include shipping cost and
applicable taxes.
internet. New parts were required since it is a first year that this
project has been worked on. Moreover, higher performance parts were
necessary due to the aerial nature of the project. The cost of the
to the problems.
Mobile Robot, a new design of the robot was needed. The Quadcopter
after the component parts were acquired from various sources using
can be developed.
Quadcopter. As such, this is one of the few Quadcopters that use Wi-Fi
feedback.
code was also exigent. Debugging and careful inspection of the code
was done to ensure that there was no mistake in the coding. Numerous
As such, all the problems that motivated this project have been
4.2Recommendations
The Project has been a great success but as it is a pioneering
able to prevent crashes. Also feasible in the next phase is the addition
of video feedback. The WiShield can perhaps stream the video feed
wirelessly back to the router. This addition will greatly increase the
References
[1] Leishman, J.G., Principles of Helicopter Aerodynamics. New York :
Cambridge University Press, 2000.
[4] Hoffman, G.M., et al., "The Stanford Testbed of Autonomous Rotorcraft for
Multi Agent Controls(STARMAC)." Proceedings of the 23rd Digital Avionics
System Conference. November, 2004.
[5] Pounds, P., Mahony, R. and Corke, P., "Modelling and Control of a Quad-
Rotor Robot." Proceedings of the Australasian Conference on Robotics and
Automation. December, 2006.
[6] Hoffman, G., et al., "Quadcopter Helicopter Flight Dynamics and Control:
Theory and Experiment." Conference of the American Institute of Aeronautics
and Astronautics. 2007, 20-23 August.
[8] What is Balsa Wood? WiseGeek. [Online] [Cited: September 23, 2009.]
http://www.wisegeek.com/what-is-balsa-wood.htm.
[9] Carbon Fiber - Wikipedia. Wikipedia. [Online] [Cited: September 23, 2009.]
http://en.wikipedia.org/wiki/Carbon_fiber#cite_note-1.
[15] 2nd Order Comp Filter. Quaduino. [Online] [Cited: March 28, 2010.]
http://www.rcgroups.com/forums/showpost.php?
p=12082524&postcount=1286.
[17] Ogata, Katsuhiko., Modern Control Engineering Fifth Edition. Upper Sadle
River : Prentice Hall, 2010.
[19] 2nd Order Damping Ratios. Wikipedia. [Online] [Cited: March 28, 2010.]
http://en.wikipedia.org/wiki/File:2nd_Order_Damping_Ratios.svg.
[31] Understanding the SPI bus with NI LabVIEW. Developer Zone. [Online]
[Cited: 03 27, 2010.] http://zone.ni.com/devzone/cda/tut/p/id/9119.
[34] Apache Friends - XAMPP for Linux. Apache Friends. [Online] [Cited: 3 02,
2010.] http://www.apachefriends.org/en/xampp-linux.html.