Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

QUADCOPTER PROJECT

Abstract

The goal of this project was to design the quadcopter flying robot control from
Radio frequency and Wi-Fi technology. The purpose of this system was to
save time and reduce the extra cost unless necessary instead of using the
actual vehicle in the filming, surveillance research and rescue missions by
military and law enforcement agencies, etc. Moreover, this project was
intended to know about the calibration and balancing the quadcopter flying
robot control from the microprocessor. Quadcopter is able to control from a
computer in Surveillance WI-Fi communication port forwarding feature via the
internet.

Contents

Abstract
Table Contents
Acknowledgements
1. Introduction............................................................................................................................ 2
2. Arduino Nano ........................................................................................................................ 4
3. Brushless DC Motors (1300kv) .......................................................................................... 5
4. Electronic Speed Controller (ESC) .................................................................................... 7
5. ESC Features ....................................................................................................................... 7
6. ESC Calibrating .................................................................................................................... 8
7. Motor test result .................................................................................................................. 10
8. Frame/ measurement (x525 Quad frame) ...................................................................... 11
9. Accelerometer and Gyroscope ......................................................................................... 12
10. Gyro or M.E.M.S............................................................................................................. 12
11. Magnetometer................................................................................................................. 13
12. Theory of Roll/ Pitch & Yaw .......................................................................................... 14
13. Stabilization System ...................................................................................................... 15
14. Propellers ........................................................................................................................ 17
15. Balancing the Propeller ................................................................................................. 18
16. Ultrasonic Distance Sensors (HC-SR04).................................................................... 19
17. Altitude Hold.................................................................................................................... 22
19. Wi-Fi and Radio Control System Tx/ Rx ..................................................................... 23
20. RC Transmitter ............................................................................................................... 26
21. Power System (Li-po battery) ....................................................................................... 26
22. Designed the hardware and Software Choice ........................................................... 28
23. PID Theory ...................................................................................................................... 29
24. Reducing the vibration ................................................................................................... 30
25. Testing Experience Results and Calculations ........................................................... 31
26. Costs ................................................................................................................................ 34
27. Project Management Planning ..................................................................................... 34
28. Conclusions .................................................................................................................... 35
29. ENCE PROJECT SPECIFICATION FORM ............................................................... 36
30. Suggestions for further work ........................................................................................ 37
31. References and Bibliography ....................................................................................... 37
32. Appendices ..................................................................................................................... 39

1|P a g e
QUADCOPTER PROJECT

Acknowledgements

Firstly, I would like to thank to my family who inspired and fully supported me
for financial and advance the education of engineering.

I also want to thank to my Real-time lecturer Martin Giles from second year
who gave me the motivation and the knowledge of microprocessor. My final
year individual project depends on the knowledge of what Martin Giles has
taught us during the second year. I had enough education to do this
quadcopter project thus I decided to do it.

Thanks to all the staff members and lecturer of University of Westminster and
Computer System Engineering Department that made to get us the
graduation year for their effort.

Thanks to Mohammed Al-Janabi, who approved the project and my


supervisor Andrzej Tarczynski who helped this project come to successful.

1. Introduction

A quadcopter is a kind of like a helicopter also known as quadrotors or


multicopter it is used four motors to provide lift and the move around by
changing the speed which the motor rotate. Arduino ATmega328p is the main
microprocessor which takes the signal from remote control and level system
using gyroscope and accelerometer. The main processor board will be sitting
in the center of the quadcopter and move left, right and accelerate. Motor
speed controlling system call Electronic Speed Controller ESC which controls
the speed of the motor. These have a large power input from the power
supply.

2|P a g e
QUADCOPTER PROJECT

Nowadays people use the quadcopter for video filming, research platform,
Military and law enforcement, etc. Instead of using the actual helicopter. It
is a lot of saving money, no fuel cost, reduce the carbon dioxide into the
atmosphere (air pollution) and speed and efficiency. People use it for sky shot
video filming or very high location shot and crowded people in the event
instead of using filming crane. Quadcopter are used for surveillance research
and rescue missions by military and law enforcement agencies. The largest
use of quadcopters in the USA has been in the field of aerial imagery as
taking record video or photo of nature.

This project aims for young people who is learning the computer, electronic
science, to understand about the microprocessor, using different between
WIFI wireless signal and Radio signal and who try to build low cost
quadcopter. This project has been combined with the economic components
and efficient quadcopter. It is based on the theory but more practical than
theory. Most of the flying devices are based on the theory, then actual
balance, calibrate and level depending on the hardware.
There are many types of quadcopters

Bicopter Tricopter Quadcopter + Quadcopter X


My project uses the quadcopter X and it has been modified the additional
feature of the ground altitude hold, auto landing feature, WIFI controlling
system and WIFI camera module etc.

3|P a g e
QUADCOPTER PROJECT

2. Arduino Nano

The Arduino Nano is a breadboard based on the ATmega328 microprocessor


which uses (7-12) operating voltages. It has 14 digital input and output pins
included 6 PWM outputs. 3.3 volt supply generated by the on-board regulator
which can currently provide 50 mA. ATmega328 microprocessor has 32 KB
memory with 2 KB boot loader. It is also has 2 KB of SRAM and 1 KB of
EEPROM, 16 MHz clock speed. Pins 3,5, 6,9,10 and 11 provide the 8 bit
PWM outputs. Originally C programming language can be used to program
the Arduino Nano board. WI-Fi controlling system and radio receiver RX
directly connect to the Arduino. The main feature is autopilot in this project,
this function contains ground level altitude hold, auto take-off and auto
landing. So all the sensor are communication with Arduino microprocessor.
Arduino is keeping listening the direction, acceleration and distance of ground
level if it is anything position change without user's control, then Arduino will
re-calculate to get the balance or back to normal position. The Arduino is the
main brain of the project.

My own source code of C program plus multiwii flight control code combined
together and uploaded into Arduino nano to control the whole quadcopter
system. My own source code is created for an altitude hold feature, auto
landing system and WIFI control system. Multiwii flight control code was used
for main PID control.

Fig.2.1. Arduino Nano

4|P a g e
QUADCOPTER PROJECT

3. Brushless DC Motors (1300kv)

This is the main part of the quadcopter project. Firstly, find out what type of
motor will be required and how many amperes or how many kv of motor will
be needed. There are two types of motors, brushed motor and brushless
motor. Brushed motor runs on direct current (DC). The speed of the motor
depends largely on the voltage supplied. Brushless motor runs on alternating
current (AC). The speed of the motor depends largely on the rate at which the
alternating current is switched.

Approximately, the overall weight of the quadcopter will be needed to check


and type of the frames and sizes. Frames (x525) width 600mm were used in
this project. So between 15~25A 1300kv, 210 watts, 21A maximum current
Brushless Motors (Fig.3.1) require for this x525 frame. A brushless motor
mounts its permanent magnets, usually four or more around the perimeter of
the rotor in a cross pattern. The rotor is the sole bearer of the magnets, it
requires no power, no connections, and no brushes. In place of these, the
motor employs control circuitry (ESC). Brushless motors are synchronous
motors, which means their rotors and stators turn at the same frequency.

Coin A Magnet

Coin B

Coin C

Fig.3.1 The brushless motor RCX07-013

A brushless Motor will generally have three sets of wiring, there are red wire,
black wire and yellow wire. All the wires are connected to Electronic Speed

5|P a g e
QUADCOPTER PROJECT

Control (ESC). The Red wire goes to Vcc+ of ESC, Black go to GND of ESC
and Yellow is the middle coin of the motor which connect to the middle wire of
ESC. Red and black wire depending on the direction of the motor turning
direction see (Table.3.1). This brushless RCX07-013 model is support
maximum 19A current, 275W maximum power, Rotation speed 1300kv
(RPM/v) and 930g maximum pull per motor. The equation of the requires
RPM below.

Provide the maximum supply voltage = 80% (0.8)

RPM = 3.5V x Series Cell Count x Motor KV x 0.8

3.5V x 3 x 1300KV x 0.9 = 10920 RPM

The 4 brushless motors were used in this quadcopter so approximately the


3720g maximum weight can lift it. It depends on the one we use propellers,
motors and ESC performance. This RCX07-013 brushless motor compatible
with 9x5 or 10x5 propeller. Electronic Speed Controller will be required for the
motor test and more information about ESC below.

Motor ESC Turning Direction


Red Red + Clockwise
Yellow Middle
Black Black-

Black Red + Anticlockwise


Yellow Middle
Red Black-

Table.3.1 Direction motor spinning

6|P a g e
QUADCOPTER PROJECT

4. Electronic Speed Controller (ESC)

In electronic if we need the throttle control, we will need an Electronic Speed


Control (ESC). These devices are controlled by the speed of a brushless
motor. An ESC will generally have three sets of wiring Red and black to go to
battery. On the other side 3 wires for Brushless motors. Small servo (white,
red and black) wires are connected to controller board or a PWM pin on the
Arduino. ESC will be received the PWM pulse signal from the microprocessor
via that wire.

Signal
+5v
+12V + ESC
GND
20A Brushless
motor
-
GND

Fig4.1 Electronic Speed Controller

5. ESC Features

5.1 Motor cut off


This feature auto cuts the power to the motor before the battery is completely
exhausted, so that you still can have the power of radio channel to get safe
landing. The nowadays motor cutoff feature is programmed into the speed
controller and can also detect the number of cells when power source is initial
plug in to ESC.

5.2 Brake
This brake feature just stops turning the motor when the throttle is zero from
Radio control or Wi-Fi control.

7|P a g e
QUADCOPTER PROJECT

5.3 Speed controller on/ off


Brushless speed controller do not normally come with an on/ off switch so to
enable an ESC the battery was needed to plug in. Before enable the ESC to
ensure the throttle it set to zero or idle position. Just simply unplug to disable
the ESC.

5.4 PWM (Pulse Width Modulation)


The control of motor speed is gotten by exchanging the power to the motor on
and off in different proportions e.g. Maximum throttle is for all time on, half
throttle is on half time, of half time and so on. Switching rates around 3000 Hz
are about ideal. Anyplace between 1000 Hz and 5000 Hz is worthy.

6. ESC Calibrating

One of the most important parts is the calibration of Electronic Speed


Controller ESC. Calibration in terms of ESC means to set the maximum and
minimum speed of the brushless motor. The motor speed was pulsed from
Arduino microprocessor so which mean maximum and minimum speed of
motor set from Arduino. A PWM pulse signal is a simple square wave (fig.
6.1) high and low voltage (5v and 0v). It could be calibrated with radio
controller (TX transmitter and receiver RX) or calibrated with Arduino in the
other way. The basic servo program will be needed to load into an Arduino
and connect the wire to any PWM output to Electronic speed controller ESC
signal input. The black wire is connected to the ground pin on the Arduino.
ESC does immediately detect motor position, so sometimes they may not
start at the same time. However, after motors start they should all rotate at
the same speed.

8|P a g e
QUADCOPTER PROJECT

Fig.6.1 square duty cycle output of PWM

6.1. ESC Calibration figure with Arduino

Quadcopter will be controlled from Arduino which is plugin to computer USB


port and upload the program. When the Arduino is ready in the serial monitor,
apply the power to ESC then the motor will beep twice, which mean the ESC
detect the maximum value of the frequency, then delay 5 seconds and set the
minimum value of the frequency to ESC. The motor will beep three times.
Sample c program below.

#define MAX_SIGNAL 2400


#define MIN_SIGNAL 1850
#define MOTOR_PIN 9
void setup() {
motor.attach(MOTOR_PIN);
motor.writeMicroseconds(MAX_SIGNAL);
delay(5);
motor.writeMicroseconds(MIN_SIGNAL);
}

Maximum signal applies to ESC which is 2400 microseconds value as soon


as the program started and wait for 5 second then minimum signal apply
1850 microseconds value. So now ESC will be detected minimum and
maximum of throttle. Therefore, motor will run between value of 2400 and
1850 microseconds. Individual ESC will be needed to calibrate those steps.

9|P a g e
QUADCOPTER PROJECT

6.2. ESC Calibration figure with 9x Radio Controller/ Tx

Quadcopter will be controlled from 9x Radio Controller/ Tx and ESC signal


wire will be connected to the channel 3 on the RX radio receiver. Before ESC
power is applied throttle stick will need to set maximum place then apply the
power to the ESC, motor will beeps twice then wait for 5 seconds and set the
minimum throttle. The motor will beeps three times and detect the minimum
and maximum of throttle. ESC calibration needs to calibrate because
electronic speed controller ESC needs to know the value of a maximum full
throttle of the controller and minimum zero throttle of the controller. Therefore,
DC brushless motor will run between maximum full throttle and minimum zero
throttle.

This is result of motor performance below after ESC and motor calibration.

7. Motor test result


Propeller : 8x4.5
Battery : 2200mAh 20C 3S Li-po
RPM : 11,100 RPM
Pull : 390g
Prop Speed : 35MPH

MOTOR TECHNICAL DATA


NO LOAD ON LOAD
Model Weight Voltage Current Speed Current Speed Pull Power Battery/Prop
V A RPM A RPM g W
5.4 9446 390 59.9 Lipo3C/8x4.5
11.1 9.9 7997 610 109.9 Lipo3C/9x6
1300KV
11 7183 710 122.1 Lipo3C/10x4.7
brushles 58g 0.7 10920
8.3 7740 630 122.8 Lipo4C/8x4.5
s motor
14.8 13.6 6960 820 201.3 Lipo4C/9x6
14.6 6814 920 216.1 Lipo4C/10x4.7

10 | P a g e
QUADCOPTER PROJECT

Table 7.1 Motor Technical Data

8. Frame/ measurement (x525 Quad frame)

The x525 quad frame is designed wheelbase as 600mm because will


consider the torsibility of fiber frame which mean the capacity of recovering
from being twisted. The x525 quadcopter frame is high quality glass fiber
frame and great performance, build from extremely rigid glass fiber. So if we
need to install something on the frame which is easy to make a hole.

Frame choosing is the most important of the quadcopter. The weight is so


important. It needs to be extremely lightweight, strong and balance weight. If
the frame is light and strong we save more battery life, efficiency and carry
more weight for the camera, gps device or any other electronic device etc
All the electronic components and sensors will be sitting on the frame
therefore the frame needs to be strong and balance. This x525 quad frame is
600mm wide and 147g. Therefore, it is compatible with minimum 1000 KV of
brushless motor and minimum 8x4 propeller size.

Fig.8.1 x525 Fiber Glass Quadcopter frames

11 | P a g e
QUADCOPTER PROJECT

9. Accelerometer and Gyroscope

The accelerometer measures the orientation reference to the surface of the


earth. But accelerometer is so sensitive and unstable. If the propeller and
motor vibration are very bad accelerometer can be messed up the orientation
measurement. With the accelerometer alone cannot be balanced to
quadcopter because the accelerometer cannot be measured the rotational
movement. Stable quadcopter needs to measure the orientation and
rotational movement measurement. Therefore rotational movement can only
be measured by gyroscopes, however gyroscope drifts a lot. For example, if
the quadcopter start rotating the gyro sensor will output the angular velocity
when the rotation stop it does not necessarily go back to 0 degrees. Which
means quadcopter will continue move slowly drift. Thus, quadcopter used
both accelerometer and gyroscope readings to balance when the gyro sensor
rotation start quadcopter will start drift then accelerometer will clear out the
drift so it will be able to measure differences between movement, rotation and
vibration.

10. Gyro or M.E.M.S

When we think the gyro we usually think about a big heavy spinning object
like bicycle wheel as long as they keep spinning one in axis fast enough they
do not want to fall over. This is the same example can be also apply other
moving structure not just spinning object. For example, fly insect is flipping
wing keep up and down with the same speed so this insect can correct their
body balance.

Also the single electronic gyro uses the same basic principle. There is a micro
coin vibrator back and forward with the piezoelectric current when the gyro
changes the angle the micro coin will keep vibrating up and down in the same
direction. This thing pushes pressure on the piezoelectric components which

12 | P a g e
QUADCOPTER PROJECT

sensor electronic signal goes to the microprocessor or computer so they can


correct for the unwanted motion. These types of device call Micro Electro
Mechanical Systems (M.E.M.S). Gyro is used for mobile phone, game device
and the other RC helicopter etc.

Fig.10.1 Gyroscope or M.E.M.S

11. Magnetometer

The accelerometer can sense only roll and pitch rotation, which cannot sense
the yaw rotation. However, gyroscope can sense the yaw rotation, but it
cannot point the direction of the magnetic field and direction. In this case
quadcopter used the magnetometer to measure the yaw rotation.
Magnetometer measures the direction of the magnetic field which way is
North, South, East and West. Therefore quadcopter can follow the waypoint
of pilot seat. This is an additional feature for the quadcopter. Especially, if the
quadcopter used the GPS device, magnetometer must be installed, the pole
locations are used as a reference together with the Yaw angular velocity from
the gyroscope to calculate a stable of Yaw angle.

13 | P a g e
QUADCOPTER PROJECT

12. Theory of Roll/ Pitch & Yaw

Roll is tilting left and right, which is controlled from increasing speed of left
and right motors.
Pitch is moving the nose up and down which has controlled the same way as
a roll, but it uses different motors increasing speed of front and back motors.
Yaw is turning clockwise and anticlockwise controlled by turning speed of
regular rotation motor.

Fig.6.1 Roll, Pitch and Yaw explanation

Fig.12.1 Roll/ Pitch and yaw movement

Gyro sends the degree of rotation data to the microprocessor so how does
the quadcopter reacting. Quadcopter has 4 controllable degrees of Roll,
Pitch, Yaw (x, y, z axis) and Altitude. Roll is Ailerons, pitch is Elevator, yaw is
Rudder and acceleration is called throttling in term of flight.

Fig.12.2 Main parts of the flight

14 | P a g e
QUADCOPTER PROJECT

13. Stabilization System

The idea is simple, if the quad is falling to the right then speed up the right
motor and slow the left one with the same amount and vice versa. Also, if the
quad is falling down from the nose, then speed up the front motor and slow
down the rear motor. Each degree can be controllable by the speed of thrusts
of each motor. If all four rotors apply equal thrust the quadcopter will stay in
the same direction. Gyro sensors are calculated to get the correct position for
those three x, y, z degrees. To maintain the balance of the body the
quadcopter must be continuously taking measurements from the gyro
sensors. Those measurements of the speed of the motor are made the
quadcopters body level.

There is the Roll and pitch theory calculation below. Always motor is running
between minimum 1100 and maximum 2000. For example, if the nose of the
quadcopter wants to lift M1 and M2 motors need to speed up and the M3 and
M4 motors will decrease the same speed. So M = M + RX (Elevator)/ 2 for
example current motor M value is motor 1200. Current RX (Elevator) value is
same as motor value, but when transmitter raises up from TX the value will
be increased e.g.: 1250 then we need the actual value therefore divided by 2.
The current motor speed is 1225 so 25 raise up the speed.

M = (1200 + 1250)/ 2 = 1225


M = motor

Pitch Control
M1 = M1 + Receiver (Elevator) /2
M2 = M2 + Receiver (Elevator) /2
M3 = M3 - Receiver (Elevator) /2
M4 = M4 - Receiver (Elevator) /2

15 | P a g e
QUADCOPTER PROJECT

Roll Control
M1 = M1 + Receiver (Aileron)/2
M4 = M2 + Receiver (Aileron) /2
M2 = M3 - Receiver (Aileron) /2
M3 = M4 - Receiver (Aileron) /2

Gain amount
M1 = M1 + PitchAmount * PitchGain
M4 = M4 - PitchAmount * PitchGain
M2 = M2 + RollAmount * RollGain
M3 = M3 - RollAmount * RollGain

This is the basic rule that should be found in all quadcopter programs. The
main difference between the different firmware approaches is how to
calculate PitchAmount and RollAmount. This can simply be read from a Gyro
sensor and multiply it by a constant factor to adjust the range, or we can use
PID approach or even Kalman filter and combine Gyro with Acc sensors to
get the exact degree.
The Gain factor is used to determine the sensitivity. Other checks such as
trimming are common in quadcopter code.

16 | P a g e
QUADCOPTER PROJECT

14. Propellers

Fig.14.1 Propeller 8x4.5

Choosing the right propellers is made to stabilize of the quadcopter. It


depends on the quadcopter frame and motor. If it is too long or too big than
motor compatible which is not efficiency and making the vibrations. However
propeller is compatible for motors, but which is not compatible for quadcopter
frame it will drain more battery energy and may be too heavy to lift. For
example 8x4.5 propeller means 8 is the length of propeller and 4.5 mean
pitch. If the propeller length is longer than necessary that is making you slow
moving on roll/ pitch or yaw and more battery usage. Too short propeller is
hard to take-off. Too much pitch of propeller means less springing of the
motor, too much pulling performance, difficult to control, hard to landing and
battery drain faster.

Therefore, short and small pitch of minimum requirement propellers is more


stable, easy to land and takeoff, faster moving of roll/pitch or yaw, less battery
usage and easy to control. x525 frame and 1300kv brushless motors
compatible between 8x4.5 ~ 10x5 propellers. 8x4.5 clockwise and 8x4.5
anticlockwise propellers are used in this project. Pitch or thrust and RPM are
directly proportional. If increase the RPM rotation speed pitch or trust will also
increase.

17 | P a g e
QUADCOPTER PROJECT

Fig.14.2.Thrust (g) vs RPM

Two propellers rotate in the opposite directions to the other two motors to
avoid the body twisting. The propeller is rotating in each centering which
having opposite tilting, all of the propeller will provide lifting thrust without
twist in the same direction. This makes it possible for the quadcopter to
stable. The larger diameter of propeller can generate more thrust, it also
requires more power. The larger diameter of propeller can lift more weight but
less RPM so no stable. When using the heights RPM motors needs the
smaller or middle size propeller. Smaller propeller with highest RPM motor
makes extra stable of quadcopter but it has only limited thrust to lift the
weight.

15. Balancing the Propeller

This is the most important part of the quadcopter project. Balancing is the
essential of stabilization. If propellers are not balanced find out the heavier
side using with balancer. There are two ways of balancing the propeller, using
the wire which means put some small wire, tape on the lighter side to balance
the propeller. Or using the sandpaper to rub on the heavy part of the

18 | P a g e
QUADCOPTER PROJECT

propeller. Balancing is so important so make sure all the propellers are


properly balanced. When the propeller balance is done install on the motors
with right turning direction. There are clockwise and anticlockwise directions
the same direction with the brushless motor's direction. Motor 1 and motor 3
will be clockwise, therefore motor 2 and motor 4 will be anticlockwise
direction.

Brushless Motor Propeller's direction


Motor 1 Clockwise
Motor 2 Anticlockwise
Motor 3 Clockwise
Motor 4 Anticlockwise

Fig.15.1 Propeller balancer

16. Ultrasonic Distance Sensors (HC-SR04)

The reason why I am using Ultrasonic Distance Sensors in this project is it


provides the stable long range of reading. Ultrasonic Sensor will not be
spread out even long distance detecting because it transmits the low
frequency of ultrasonic sound from Trig sensor and hear the frequency from
the other side of the sensor. Even human being can hear the frequency of

19 | P a g e
QUADCOPTER PROJECT

ultrasonic sound while the sensor is testing. Advantages of the Ultrasonic


Distance Sensor are that can detect to long ranges of reading, low power
usage, small target detection and high reading stability and Less affected by
target materials and surfaces.

Wall

Fig.16.1 HC-SR04 (Ultrasonic Sensor)

16.1. How does it work on the Quadcopter?


There are 5 sensors in this project. 4 sensors are sitting on the 4 directions of
the quadcopter at Left direction, Right direction, Front direction and back
direction of the quad and one sensor is under the quad to measure the
distance from the floor as the low-level altitude hold. I set the 200 cm for low-
level altitude hold from the floor. The other 4 sensors will detect around the
object near from the quad. If the object is less than 100 cm then the
quadcopter will move away from the object in order to get to minimum 100 cm
away. This feature will help you when you lose control the quad will never hit
to the wall and also the custom distance from ground level can be set for the
low-level altitude hold. The sensors will read the value of the distance and
send to Arduino pin as soon as Arduino decide to move the direction of the
quadcopter.

20 | P a g e
QUADCOPTER PROJECT

100cm 100cm

Adjustable distance
from user

Fig.16.1.1 Low-level altitude holding

16.2. How to measure the distance?


Wired up on the breadboard between Ultrasonic Sensor and Arduino to
measure the distance before I install on the quad. Both circuit Ultrasonic
Sensor and Arduino need to be provided the DC 5 volt. See the table for pin
connection.

Arduino Ultrasonic
Pin 7 Echo
Pin 8 Trig
GND GND
5V Vcc

Arduino connected to computer USB port to load the program. After upload
the program Arduino will start to run automatically then pressed the Serial
Monitor under the Tools to read the value of the distance from the sensor. So
now decide the distance from the object what maximum distance will require
in the project and set the value in the program. The theory to find the distance
in centimeters below

Distance (cm) = duration / 58.2

21 | P a g e
QUADCOPTER PROJECT

The Echo Pin cycle is used to determine the distance of the nearest object by
bouncing ultrasonic sound waves off of it. If you change the value of
maximumRange that adjust the maximum range of the distance. For
example, if you use a value of 100 mean is 100cm after the distance
calculation. See the Sensor test Program

17. Altitude Hold

This is the automatic balancing system. There are 5 ultrasonic distance


sensors in this quadcopter project. One is altitude hold from ground level
which mean sensor face down to the ground and measure the distance from
the ground. If the user switch to the auto altitude hold is on, the Arduino will
memorize the current value of distance from ground level (height) and current
value of throttle speed level. Then quadcopter will auto fly in the air with the
same height without user control even user control from the transmitter the
quad will not be affected until turn the altitude switch off.

The same feature with the other 4 side ultrasonic sensors are measured to
the object neat to the quadcopter. When the user is switched on to side
altitude hold the quad will memorize the distance of the object from every side
and auto stabilizing. Those features help a lot when we are flying in the
narrow area without hitting any objects. Anytime a user can switch off the
altitude hold switch for the manual control.

18. Auto Take-off and Auto Landing

Autopilot feature is more safe and stable. This feature does auto takeoff and
auto landing. The auto takeoff function is communication between ground
sensor and motor's speed. If the user enables to auto takeoff, all the sensor
will get their value distance from the objects. Then throttle will raise up by

22 | P a g e
QUADCOPTER PROJECT

program gently until quadcopter is floating up in the air. In this case, the user
can set the value for the height limit. For example, if the user sets the value of
100cm the quad will stay in the 100cm height after auto takeoff and wait for
the user control.

The auto landing system is aimed for a professional landing without hitting to
the ground. The controller can more concentrate on the other stabilization
with auto landing system. Also more battery efficiency of using the auto pilot
system when the quad landing.

19. WI-Fi and Radio Control System TX/ Rx

The most popular system is called the WI-Fi wireless communication. WI-Fi
wireless communications and radio communications are slightly different
features. WI-Fi network communication uses radio frequency. Communication
across a wireless network is two-way radio frequency communication. A
computer or mobile phone or tablets wireless adapter translates the data into
a radio signal and transmits it to the router. Then the router receives the data
and decodes it. WI-Fi system able to connect internet through wireless or
Ethernet cable connection. The same process also works with the router
receives the information from the internet, translating it into a radio signal and
sending to computer or mobile or tablets wireless adapters.

WI-Fi and Radio signal are the same frequency. This quadcopter project
using the 2.4 GHz WI-Fi and Radio Signal. User can able to control from both
transmitters. Nano wireless router sit in the center of the quadcopter which is
connected to Arduino network shield via RJ-45 network cable. Nano Router
will generate 2.4 GHz wireless signal and all the same feature as normal
router. It's able to configure the SSID and password from PC.

23 | P a g e
QUADCOPTER PROJECT

Fig.19.1 Communication Arduino Ethernet shield to nano router

The basic quadcopter webserver will upload on the nano Arduino


microprocessor to control the quadcopter which is C programming source
code. When the PC or mobile phone or table connect to the nano routers
SSID, those devices can able access the web server to control the
quadcopter. Local IP address and default gateway address are able to
change to any favorite according to the IP address rules. Server port will
always be 80 because the controller will use the internet explore on the
computer so that TCP port is 80. Controller required to type that address in
the internet explore to access the web server to control the quadcopter. Then
ready to control when a quadcopter control html page is loaded display on
screen.

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(80); //server port

24 | P a g e
QUADCOPTER PROJECT

client.println("<TITLE>Q U A D C O P T E R</TITLE>");
client.println("</HEAD>");
client.println("<BODY>");
client.println("<H1>-- WIFI Q U A D C O P T E R --</H1>");
client.println("<hr />");
client.println("<br />");
client.println("<br />");
// movement
client.println("<a href=\"/?start\"\"> Start </a>");
client.println("<br />");
client.println("<a href=\"/?up\"\"> UP </a>");
client.println("<br />");
client.println("<a href=\"/?landing\"\"> Landing </a>");
client.println("<br />");
client.println("<a href=\"/?stop\"\"> STOP </a>");
client.println("<br />");
client.println("</BODY>");
client.println("</HTML>");
//stopping client
client.stop();

Advantages of the Wi-Fi wireless feature is able to control through internet


then control the device using computer to different location. Port forwarding
configuration needs to configure in the base router which is directly
connected to internet WAN (Wide Area Network). Also able to extend the Wi-
Fi signal using access point AP or extender if necessary for long distance
range.

Radio transmitter is one way signal, easy to use and only one controller
transmitter device can connect. Controller using the radio signal are not able
to access the internet access so that only limited distance.

25 | P a g e
QUADCOPTER PROJECT

20. RC Transmitter

Fig.20. Frequencies throughout within the flight controller board

21. Power System (Li-po battery)

As for the power source of the quadcopter, the reason behind to choose the
li-po battery because it is light. NiMh is cheaper than li-po but a lot heavier. Li-
po is more performance and long lasted ampere life. Equation below to
calculate the flight time. Battery capacity is depends on the overall ampere
draw of the quadcopter (eg: how much power usage of the motors and how
much overall weight of the quadcopter). For example

Battery Capacity = (Flight Time * Average Amp Draw) / 60 sec

26 | P a g e
QUADCOPTER PROJECT

Fig.21.1. Li-po 2.2mA battery/ Power system

Advantages
This is Heavy Duty Series 60C Li-poly packs deliver full capacity. It is high
performance for x525 size quadcopter. Heavy duty 12AWG leads deliver the
power through the pre-installed XT60 plug for maximum efficiencies and
minimum resistance. Heavy Duty li-poly cells are hand selected at the factory
and matched by internal resistance to give the most consistent and best
performing battery. Li-po provides the minimum 2200mAh capacity and 11.1
voltage 3 Cells. 60C of constant discharge and light weight 198g.

Disadvantages
Li-po batteries are so dangerous if careless. The only important thing is over
charged or electric shocked when it is happen li-po will get fire easily. Li-po
will need the low battery alarm because if it is used until less than 6 voltage or
over discharged battery will completely damage. It will not be allow to charge
again.
The battery 11.1 volts directly connected to ESC then ESC provided 5 volt to
flight controller microprocessor board. This is the theory of a flight time theory
it is depends on the capacity of the li-po batteries and balancing of the device.
I choose a 11.1 volt 20C 2200mAh li-po battery. The average amp draw of my
quadcopter should be 18 amps maximum for full throttle. This will give me a
flight time of 7 to 10 minutes.

Flight Time = (Battery Capacity / Average Amp Draw) * 60 second

27 | P a g e
QUADCOPTER PROJECT

22. Designed the hardware and Software Choice

There is the completed schematic flight control circuit board in the


Appendices A. This project used all the economy components and free
universal Multiwii flight C programming language. The Multiwii program is
easy to configure for universal multirota so that stress free to focus on PID
setting and any other modification of quadcopter.

Flight control circuit board was simply designed the minimum weight of nano
arduino and micro 10dof GY-87 gyro sensor solder on universal PCB. One
important thing was PCB needed to break the connection between pins of
arduino see in Appendices A. All the components needs to measure the
weight individually to calculate the total of quadcopter weight.

Device Weight (g) Quantity Total Weight(g)

1 x525 quad frame 147 1 147


2 Arduino nano 41 1 41
3 Arduino Ethernet Shield 59 1 59
4 Nano Router 231 1 231
5 Brushless DC motor 58 4 232
6 Electronic Speed Controller 30 4 120
7 Li-po batteries 185 1 185
8 Propellers 13 4 52
9 Ultrasonic Sensors 9 1 9
10 General tools and wires 10 1 10
11 Radio receiver RX 18 1 18
12 10dof GY-87 gyro 6 1 6
Total 1378
Table.22.3 Total weight of all components after combine

According to the table.22.3 is showing the total weight of the all components
1378g. The target weight was 2000g and maximum weight of the 4 brushless

28 | P a g e
QUADCOPTER PROJECT

motors thrust is 4212g which is a lot more saving weight. So performance of


quadcopter is well speed and efficiency.

23. PID Theory


This PID theory is the main part of the project to get high performance and
stabilize quadcopter. PID stand for Proportional, Integral and Derivative.
These terms represent the 3 different loops work together to stabilize the
quadcopter. The Proportional (P) loop focuses on correcting for present
errors, the Integral (I) loops focuses on correcting for the past errors and
Derivative (D) loops focuses on future errors.

Proportional
Proportional is the first loop and it focuses on correcting the present errors in
the stabilization system. For example: quadcopter is running well and
hovering in the air. If there any outside force cause as wind or user change
the angle from transmitter the quadcopter will tilt to one direction. The gyro
will sense this degree change and it will measure how many degree was
changed and tell to microprocessor the output pulse for motor in opposite
direction of tilt.

Proportional (P) loop intend to return the quadcopter back to initial position
but in reality quadcopter is overshoot to opposite direction of tilt. The
quadcopter will keep changing back and forth between two directions. This
problem will happen when Proportional (P) working alone. Integral (I) loop
can fix this problem. See Appendices C for PID flowchart.

Integral
Integral is the second loop and it focuses on correcting the past errors in the
stabilization system. Integral (I) will measure changing of angle as
Proportional (P) but it will also measure how long the tilt lasted for. So Integral
(I) loop is the kind of delay between beginning of measurements and

29 | P a g e
QUADCOPTER PROJECT

quadcopter return back to initial position.The overshoot error will occur after
Proportional (P) measurement, Integral will correct the overshoot error and
help stabilize the quadcopter.

Derivative
Derivative (D) focuses on predicting future errors of quadcopter stabilization.
This measurement is the same type of measurements as the Integral (I)
measurement. Derivative (D) is calculated the when is the next overshoot will
occur so that (D) loop make ready to fix the next overshoot error. See
Appendices B for PID flowchart.

24. Reducing the vibration

Mostly vibration come from the propeller and propeller head. Even if the
propeller was balanced there is minor vibration left when the motor spinning
with high speed. Those vibration needs to reduce to get stable quadcopter.

There is two type of reducing the vibration of propeller, changing the new
propeller head or using rubber band prop instead of using prop head see
(fig.24.1). Rubber band prop is more safety for propeller damage when the
quadcopter crash and less vibration effect. If less vibration of quadcopter is
less drifting and more stabilize.

Fig.24.1 Rubber band prop head.

30 | P a g e
QUADCOPTER PROJECT

25. Testing Experience Results and Calculations

25.1. Useful Equations


RPM = 3.5V x Series Cell Count x Motor KV x 0.8
Thrust (g) = 4.8e-6 * rpm ^ 2.0662

Testing Wi-Fi Control (PASSED)


Building Wi-Fi control GUI (FAILED)
Wi-Fi control GUI was not completed.
Gyro sensor Testing (PASSED)
Ultra Sonic Sensor Test (PASSED)
Sensor tested minimum 20mm to maximum 4500mm

Fig.25.1 Multiwii config for reading the gyro

25.2. ESC Calibration (PASSED)


Firstly, individual ESC was calibrated maximum value of throttle 2400
microseconds and minimum value of throttle 1850 microseconds with
arduino. Arduino was uploaded the C program complete code of manual
calibration (Software CD). After calibration motor was run smoothly no error
occurs.

31 | P a g e
QUADCOPTER PROJECT

Arduino ESC Li-po


PWM pin 9 ESC signal pin
+5V +VCC
GND GND
Red Red
Black Black

Table: Pin layout table

25.3. Thrust Test (PASSED)


Propeller was installed on motor and tested the lifting thrust performance of
maximum throttle. Trust tested with different propeller sizes there are different
thrust result for 8x4.5 propeller, 1300kv motor and 11.1V 3 cells battery.
RPM = 3.5 x Series Cell Count x Motor KV x 0.8
= 3.5 x 3 x 1300 x 0.8 = 10920 RPM

Thrust (g) = 4.8e-6 * rpm ^ 2.0662


= 4.8e-6 * 10920 ^ 2.0662 = 1053g for one motor

4 motors thrust = 1053 x 4 = 4212g

26.4. Problems and Solving

1st test (FAILED)


Too much vibration cause
PID setting was not right (too much wobble)
Drifting to front right

2nd test (FAILED)


Fixed the vibration cause by balancing to individual propellers
Fixed the drifting front right adjusting to sub-trimming from transmitter

32 | P a g e
QUADCOPTER PROJECT

Quadcopter was slowed response because I gain was too high in PID
setting
Quadcopter was not stable which was jumped up and down because
too big propeller and high pitch which is 10x5

3rd test (FAILED)


Fixed the PID setting retuned from beginning
Changed to smaller propeller 8x4.5
Problem occurred from ultrasonic sensor which was read the right
distance from object but the signal output calculation was wrong
between ultrasonic sensor and main arduino nano.

4th test (PASSED)


Fixed the ultrasonic sensor output signal calculation
Balanced
See Appendices C for final setting of PID setting

Main Multiwii C program test (PASSED)


The Multiwii complete C program and Multiwii config in the Software
CD

33 | P a g e
QUADCOPTER PROJECT

26. Costs

The project was managed to the economy cost depends on the university
project allowance. Most of the device was bought from amazon and eBay.
The cost will be changed depend on the type of project and currency
different.

Device Price () Quantity Sub-total ()

1 Arduino Nano ATmega 328 6.00 1 6.00


2 Arduino Ethernet Shield 6.00 1 6.00
3 Nano Router 11.50 1 11.50
4 Brushless DC motor 1300kv 9.18 4 36.72
5 Electronic Speed Controller 6.00 4 24.00
6 Li-poly batteries 5.46 1 5.46
7 Propellers 8x4.5R/ 8x4.5 7.27 1 7.27
8 x525 Quad frame 14.99 1 14.99
9 Ultrasonic Distance Sensors 2.50 1 2.50
10 General tools and wires 5.00 1 5.00
11 10dof GY-87 gyro sensor 10.00 1 10.00

Total 129.44
Table.26.1. Maximum Component costs

27. Project Management Planning

Project planning is the main part of the whole project before the project
starting. Everything need to be managed and organised to complete the
project on time. Project management is directly link to the overall project cost
and time. Anything get the wrong order of any component or damaging during
the test that will be delayed and waste the time.

34 | P a g e
QUADCOPTER PROJECT

Testing Oct Nov Dec Jan Feb Mar Apr May


Point

Motors & x x x
ESC

Wireless Ctrl x x x

Stabilization x x x x

Sensor x x x x x x

Programming x x x x x x x x

Propeller x x

Reports x x x x

PID setting x x

Table.27.1 Project Management Planning

28. Conclusions
The outcome of this project was greater than what expected because the
quadcopter was managed the extra stabilized the balanced. It also got
chance to modify the altitude hold and magnitude hold by using barometer
and magnetometer. In the objective of quadcopters theory, there is still a
minor drifting issue when the quadcopter hover although there should not be
drifting issue if PID setting and right propellers were used in designed project.
It is needed to fix the frame after been crashed.

There is need to upgrade 4000mAh the li-po battery ampere to get more flight
time. Wi-Fi controller GUI was not completed. Currently, html webserver was
able to control instead of complete Wi-Fi control program. It might successful
the program and modify to Xbee Technology instead of using the nano router
when I got more time and extra budget.

35 | P a g e
QUADCOPTER PROJECT

29. ENCE PROJECT SPECIFICATION FORM


Project Title: Quadcopter Project

Student Name: Phyo Paing


Year: 2013/14

Supervisor(s):

AIMS and DESCRIPTION

PRIMARY GOALS
1.

SECONDARY GOAL
1.

RESOURCES NEEDED

HEALTH and SAFETY ASSESSMENT and ARRANGEMENTS


Low Risk, No special requirements or precautions?

36 | P a g e
QUADCOPTER PROJECT

Supervisor(s) Signature: ____________________ Students Signature:


___________________
Date: ____________________ Date: ____________________

30. Suggestions for further work

Ultimate planned to modify on this quadcopter to get more speed, efficiency


and more stabilize. This quadcopter is able to install the surveillance Wi-Fi
video camera and GPS system. I choose the Xbee wireless communication
for future work. Xbee is extremely light weight of Wi-Fi system and more easy
to communication with Arduino.

For future development, I consider to developing a fully automatic control


system which system is able to fly a quadcopter without user control.
Controller can set the waypoint of quadcopter in GPS location tracking
system. Ultrasonic range finder sensor will sense 360 degree directions of
around quadcopter for collision detection, those features will working together
with autopilot system.

31. References and Bibliography

http://robots.dacloughb.com/project-2/esc-calibration-programming/

Yeo, S. Phoenix Model Products.


Available: http://www.phoenixmp.com/articles/Brushless%20Motors.pdf.
Accessed: 25th March 2014

37 | P a g e
QUADCOPTER PROJECT

38 | P a g e
QUADCOPTER PROJECT

32. Appendices

Appendices A

Fig.32.1 Connection of components

Fig.32.2. Complete Schematic of main flight control circuit

39 | P a g e
QUADCOPTER PROJECT

Fig.32.3 Flight Control Board

40 | P a g e
QUADCOPTER PROJECT

Fig.32.4 Arduino and 10dof GY-87 gyro

41 | P a g e
QUADCOPTER PROJECT

Appendices B

Fig.32.5 Flowchart of PID control

Appendices C

Fig.32.6 Final PID setting tuned

42 | P a g e

You might also like