Vous êtes sur la page 1sur 24

Hillock Le 1

Introduction

Look! Its a bird, its a helicopter, its a drone! Drones are unmanned aerial

vehicles, or in other words, does not contain a human pilot aboard and are becoming

more relevant in modern society. Their usage ranges from taking breathtaking pictures,

transporting packages and military aerial reconnaissance. However, in some

circumstances, the drone would not be manually flown. It would leave a large margin of

error as human input varies from time to time after a while of transporting packages, and

some military scouting missions would need an autonomous drone as regular aerial

vehicles cost much more to operate than the drones do. The purpose of this experiment is

to make a drone be able to move about a specific path and land at the end with a small

range of error.

In order to do this, a program was developed to manipulate the servos, and a

series of flights were conducted. After each flight, the program was modified so the

distance between the drone and the target would reduce. The drone will fly two separate

paths: a ten-meter path from point A to point B, and the same one, but back to point A.

Similarly, with the A to B to A flight of 20 meters. The goal of each flight was to be

under one meter of the objective way point after the landing.
Hillock Le 2

Review of Literature

Drones are everywhere in the world. They can be used for military purposes (such

as bomb runs), transporting cargo from supermarkets, and transporting human beings

from point A to point B. However, if you were to do this manually, all the time that

would cost too much money and be impractical with human error. What is a fix for that?

Designing a drone to make it autonomous. The purpose of the project is to get a drone

flying without any direct human input. To be able to do this, there needs to be an

understanding of how drones fly, and how it can be done to begin with.

Figure 1: Basic Diagram of a Quadcopter

Figure 1 shows a basic idea of how a quadcopter functions and spins. It is a visual

representation of what was discussed previously.


Hillock Le 3

Figure 2: Drone on a 3D Plane

Figure 2 shows a diagram of a basic drone design on a 3 Dimensional Plane.

Of course, drones can fly, or at least get themselves in the air. In this case, the

drone being modified and tested is a quadcopter, or in other words, it has four equal

propellers. Each of the propellers generate thrust forces (T), which causes it to be able to

lift itself up. To generate thrust, the propellers rotate various speeds (). For directional

movement, the propellers can be manipulated to different rotational speeds. To move

forward, the front propellers (1 and 2) will slow its rotation for the quadcopter to lean

forward and propel itself forwards. To move backwards, the back propellers (4 and 3)

will slow its rotation for the quadcopter to lean backwards and propel itself backwards.

This kind of forward and backwards movement corresponds to the x direction on a 3d

plane, and is known as pitch. To move left, the left propellers (1 and 4) will slow its

rotation, and it will maneuver to the left. The same concept goes for the right. The right

propellers (2 and 3) will decrease its rotation speed and will maneuver to the right. The

left and right movement corresponds to the z direction on a 3d plane, and is known as
Hillock Le 4

roll. To increase or decrease the height, the propellers will correspondingly increase or

decrease its rotational speed. This kind of movement corresponds with the y direction

on a 3d plane, and is known as throttle. To add on to all of that, the trimming feature

allows for permanent, until changed again, changes to the drones flight. Meaning that if

it drifted to the right in respect to the drones front, adding left trim would prevent that

and vice versa. It would also work the same way with forward and backward trim.

With that in mind, programming the drone is the next step. To program the drone,

the researches plan on using two Arduino boards. One for the horizontal, or x and z,

movement and rotations, and one for longitudinal, or y, movement. To do that the

researchers used servos. The servos are attached to the remote.

Servos are motors that turn because of electric motors inside that turn the outside

arm. To be able to use them, they had to be mounted to the controller, attached to the joy

sticks, and programmed.


Hillock Le 5

Figure 3. Controller with Mounted Servos

In order to mount the servos to the controller, they were simply mounted

perpendicular to the axis of movement of the joystick (as shown in Figure 3). There were

special metal rods mounted to the sticks and the servos after. The left servo controls the

drones rotation, and the right servo controls the drones pitch (forwards and backwards

movement).

In order to actually use the servos there has to be Arduino board controlling them.

The code Writes a value to the servo, controlling the shaft accordingly. On a standard

servo, this will set the angle of the shaft (in degrees), moving the shaft to that orientation

(Arduino - ServoWrite). With that, the Arduino code was able to set the joysticks at a

certain length and control the flight of the drone.


Hillock Le 6

Problem Statement

Problem Statement:

To be able to make a drone fly without direct human input. Meaning creating a

program to have a drone fly on a specific path.

Hypothesis:

The drone will be able to fly in two separate fixed paths: a ten-meter path from

point a to point b, and a 20 math from point a to be and back to a.

Data Measured:

The radial distance from the end point will be collected in meters in order to try to

decrease that distance.


Hillock Le 7

Experimental Design

Materials:

Arduino Board Uno (1) Drone (1)


Arduino Wires (16) Drone Controller (1)
Bread Board (1) Parallax Arduino Servos (2)
Threaded Rod (4) Metal Bushing (2)

Procedures:

Modifying the Controller

1. Hot glue the servos to the edges of the remote

2. Connect the wires to the digital potentiometer

Autotomizing the Drone

1. Program, using C, the Arduino Uno board to control the servos which will
indirectly control the remote, see Appendix B and C for examples

2. Upload code from computer to drone from arduino software by pressing the right
arrow button at the above the coding region and clicking it, making sure the board is
connected to the computer

Testing:

1. Set up drone in an open area with almost no people around, for safety

2. Turn on the drone


a. making sure to set the drone on a flat surface before takeoff.

3. Turn on the remote


a. making sure hands are away from the drone propellers, to keep from pain/injury

4. Put drone on the initial waypoint, waypoint a

5. Run the code and fly the drone by pressing the reset button on the arduino board

6. Record Distances from the last point to the drone


Hillock Le 8

Figures:

Figure 4. The Drone

Figure 4 shows the drone that will be controlled externally using the Arduino

software. No direct modification were made to the drone.

Figure 5. The Controller

Figure 5 shows the controller used and the modifications to it.


Hillock Le 9

Data and Observations

Table 1
Flight AB

Trial Distance from B (m) Trial Distance from B (m)


1 10.00 12 1.14
2 10.00 13 0.46
3 9.46 14 3.50
4 4.40 15 2.70
5 4.90 16 2.35
6 3.30 17 1.14
7 6.20 18 1.52
8 4.20 19 0.53
9 0.24 20 1.00
10 0.55 21 0.66
11 1.03

Table 1 is a list of the distances for Flight AB, after the drone had finished its

flight. Distance is measured from the drone to the waypoint B and is measured in

meters. The highlighted trials are distances within the ten percent threshold. The values

with an even 10.00 means that the drone flew more than 10 meters away from the last

waypoint or was on a potentially dangerous path that could harm the drone.

Table 2
Flight AB Observations

Trial A-B Observations


1 Not trimmed correctly, flew largely to the right
2 Not trimmed correctly, flew back not enough push w/ program
3 not enough push w/ program
4 not long enough duration
Hillock Le 10

Trial A-B Observations


5 over shot and to the left, did not take into account acceleration
6 over shot and to the left
7 over trimmed to the left (added more right tar)(batteries began to run out)
8 moved to the left, added right tar
9 waited a little longer before flight
10 (decreased initial wait)
11 changed nothing from last (broke streak)
12 (decreased throttle time)
13 (added slight turn protocol)(turn didnt work?)
14 nothing good
15 (fixed turn)
16 (added more turn)(too far right turn)moved backward before flight
17 (added anti-turn)
18 (added more forward deration)
19 (decreased throttle time)
20 changed nothing from last
21 changed nothing from last (counted as completed)

Table 2 is a list of the observations from Flight AB. Each and every one of these

observations are made after each flight, and for most of the flights, adjustments are made

to the code. It should be noted that in the last three trials, no adjustments were made to

the code, as the flights were within one meter of the waypoint.
Hillock Le 11

Table 3
Flight ABA

Trial Distance from A Trial Distance from A Trial Distance from A


(m) (m) (m)
1 5.71 12 10.00 23 1.19
2 10.00 13 10.00 24 2.87
3 1.70 14 2.39 25 10.00
4 10.00 15 1.17 26 10.00
5 10.00 16 1.23 27 5.17
6 10.00 17 10.00 28 3.58
7 10.00 18 4.55 29 3.36
8 4.42 19 4.59 30 0.61
9 3.44 20 2.80 31 0.95
10 10.00 21 2.96 32 0.56
11 0.10 22 0.70

Table 3 is a list of the distances for Flight ABA after the drone had finished its

flight. Distance is measured from the drone to the waypoint A and is measured in

meters. The highlighted portions are distances within the ten percent threshold. The

values with an even 10.00 means that the drone flew more than 10 meters away from

the last waypoint, did not make it to the second way point or was on a potentially

dangerous path that could harm the drone.


Hillock Le 12

Table 4
Flight ABA Observations

Trial A-B-A Observations


1 Set program - over shot - over turned- over accelerated coming back
2 decreased return throttle and turn time - overshot - hit wall
3 decreased return throttle and turn time
4 Turn did not work as it did previously - added more turn
5 Turn did not turn enough
6 Turn did not turn enough
7 over turn (360 degrees)
8 did not rotate enough, good enough to measure
9 needed more forward and more turn (increased turn time)
10 did not make it to b, tar was off
11 barely made it to b
12 tar was messed up
13 tar was messed up
14 no significant observations
15 did not turn enough
16 really good, needs to fly a little farther

17 redone - hit wall-


18 landed on matts, over flew
19 too much coming back
20 over flew b, fell short to a
21 short to a
22 pretty good
23 flew short
24 flew very short - added more thrust after
25 too much throttle coming back - hit wall and became null
26 not enough turn
27 over flew the return flight
28 Moved slightly before measuring
29 no significant observations
30 slightly slow coming back - no significant observations
Hillock Le 13

Trial A-B-A Observations


31 bounced on landing
32 no significant observations - finished

Table 4 is a list of the observations from Flight ABA. Each and every one of these

observations are made after each flight, and for most of the flights, adjustments are made

to the code. It should be noted that in the last three trials, no adjustments were made to

the code, as the flights were within two meter of the waypoint. As an added note, the

program was executed slightly different in the last three, it was initialized then started

flight. This worked because there was a built in delay before the program made the drone

move.
Hillock Le 14

Data Analysis and Interpretation

There was no applicable statistical test available for the type of data this

experiment produced. That is because there was not a before and after. There was a

different program ran every time in order to decrease the distance. Based on that, there

was a descriptive analysis of what the data means.

In order to make sure that the data recorded was reliable and had the least

variability possible the trials were conducted in a similar manner throughout each of the

different flights. The flights were recorded and the distances in which they landed at the

end of the flight were written down, corresponding to which flight that was currently

being conducted. In total, 53 flights were carried out. Once a flight finished, the next one

was conducted, excluding ones done near the end of the day; in those cases, the flights

were resumed the next day. As each set went by, one would expect to see a somewhat

constant downward trend.

Figure 6. Dot Plot of Flight AB


Hillock Le 15

Figure 6 shows the recorded distances from B in Flight AB. There is an overall

downward trend of the data. Which seems to be heading down almost exponentially.

Figure 7. Dot Plot of Flight ABA Without Invalid Flights

Figure 7 shows the recorded distances from A in Flight ABA. There does not

seem to be any clear pattern with this data, however, there are three sets of decreasing

distances, as shown by the black lines. Probable causes may be due to larger program

changes causing dramatic drone responses or battery life and changing battery level after

change.

As a whole as time went on, the distances got smaller. That shows the programs

were getting more and more accurate. Which means that it will be able to be gotten

smaller and reliably smaller so that it can be used practically under commercial and

industrial circumstances for transporting cargo to and from places.


Hillock Le 16

Conclusion

The objective of the project was to develop a system that can give a drone a set of

flying instructions to fly a fixed path to reach a certain waypoint within 1 meter, three

times in a row. Overall, the drone was able to fly its fixed path and managed to get

through the waypoints of AB and ABA. AB being from a point to another point, and

ABA being a point, to another point, back to the original point. The distance between the

drone and the particular waypoints somewhat gradually decreased, until there were three

consistent trials of the distances being 1 meter or less. For Flight AB, it took 21 trials,

with an average of successful flights of 2.59 meters, before the right code and flying

procedure was acquired, and for Flight ABA, it took 32 trials with an average of

successful flights of 2.64 meters.

The hypothesis of actually being able to get a drone controller to be automated

and fly a within a fixed path was accepted. Although the hypothesis was accepted, there

were some errors done while testing it. First off, there was trimming problems. That

would cause the drone to drift in the air. This could only be fixed from using the trim

feature of the controller. The buttons were pressed for the specific trim that needed and

keep pressing for a guess and check idea. The next problem was the battery level. The

battery level was a huge problem in the experiment. While adjusting code (decreasing or

increasing the time interval for a certain section in the code to run for, and/or increasing

or decreasing how fast the drone moves), adjustments for the noted decreasing battery

level would be made. After the battery level was so low the drone could not keep itself in

the air, the battery was changed. After the change in battery charge, and no change in
Hillock Le 17

code, there would be dramatically different results. That happened because the energy

concentration is much lower in a nearly depleted battery than a fully charged one, causing

a lower amount of energy to be able to be used for flight. A next error world be a guess

and check idea of testing. The changes in code were done in a guess and check method.

There would be a flight that was short and change the timing of movement by a large

amount and that would be too much or too little. A final error was the timing of the drone

in the air and the starting of the program. At the beginning, there was a large delay, coded

in on purpose, thinking at the time it was a good idea. The further into the experiment the

researchers got, the less the delay, due to starting the program closer to the flight start up

and actually coded decrease in general. However, the drone always started moving after it

got into a decent hover.

These results show that it is possible to program a drone to fly a fixed path in a

closed environment. Real world applications would not be much different. There would

be sensors needed to detect wind and programming to combat the wind, however

fundamentally it is the same. Even the closed environment situation is useful.

With this, this information can be used to ship items from point A to B inside a

warehouse or a school by attaching the package underneath the drone and starting the

program. This is good for outdoor use also because GPS is not available everywhere, so

drones could have a fixed path planned out for that. With this in mind, the drones could

also be used in military scouting missions where if a drone was not used, then there

would be a high risk of casualty. People can benefit from this because they can set the

drone on the program to do something and people can do whatever else.


Hillock Le 18

Acknowledgment

We would like to thank Mr. Mark Supal at MMSTC. He helped us think of our

unique idea, and got us our research drone. He provided us with plentiful information for

the experiment we needed.


Hillock Le 19

Appendix A: Program Flowchart

Figure 8. Flow chart

As shown in Figure 8, the program itself is short and simple. It starts, then

activates the classes made to program it easier. Then it runs the classes in the order

specified in the code. When there is no more it will end the program.
Hillock Le 20

Appendix B : AB Flight Program


#include <Servo.h>

Servo myservo1; //creates the pin variable


Servo myservo2; //creates the pin variable

void wait(double wait){; //creates a wait function


delay((int)(wait*1000)); //waits 'wait' seconds
}

void base(double temp){


myservo1.write(90); //sets left servo to 90 degrees for no turning
myservo2.write(90); //sets left servo to 90 degrees for no moving
wait(temp); //waits for 'temp' seconds
}
void base(){
myservo1.write(90); //sets left servo to 90 degrees for no turning
myservo2.write(90); //sets left servo to 90 degrees for no moving
}
void fnd(int deg,double temp){
myservo2.write(90-deg); //sets left servo to 90-'deg' degrees so it will move forward
//for positive degrees and backward for negative degrees
wait(temp); //waits for 'temp' seconds
}
void turn(int deg,double temp){
myservo1.write(90-deg); //sets left servo to 90-'deg' degrees so it will left right
//for positive degrees and turn left for negative degrees
wait(temp); //waits for 'temp' seconds
}

void setup() {
myservo1.attach(11); //sets a pin write so the program can control the board
myservo2.attach(8); //sets a pin write so the program can control the board

base(.6); //waits .6 seconds after program starts


fnd(35,0); //sets flight forward, waits zero seconds
turn(18,.5); //turn slightly right, wait half a second
turn(-18,.5); //turn slightly left, wait half a second
turn(0,2.706); //have no turn value, wait 2.706 seconds
base(.3); //set base for .3 seconds
}

void loop() {//nothing for loop


}
Hillock Le 21

Appendix C: ABA Flight Program


#include <Servo.h>

Servo myservo1; //creates the pin variable


Servo myservo2; //creates the pin variable

void wait(double wait){; //creates a wait function


delay((int)(wait*1000)); //waits 'wait' seconds
}

void base(double temp){


myservo1.write(90); //sets left servo to 90 degrees for no turning
myservo2.write(90); //sets left servo to 90 degrees for no moving
wait(temp); //waits for 'temp' seconds
}
void base(){
myservo1.write(90); //sets left servo to 90 degrees for no turning
myservo2.write(90); //sets left servo to 90 degrees for no moving
}
void fnd(int deg,double temp){
myservo2.write(90-deg); //sets left servo to 90-'deg' degrees so it will move forward
//for positive degrees and backward for negative degrees
wait(temp); //waits for 'temp' seconds
}
void turn(int deg,double temp){
myservo1.write(90-deg); //sets left servo to 90-'deg' degrees so it will left right
//for positive degrees and turn left for negative degrees
wait(temp); //waits for 'temp' seconds
}

void setup() {
myservo1.attach(11); //sets a pin write so the program can control the board
myservo2.attach(8); //sets a pin write so the program can control the board

base(.6);//wait at none movement values


fnd(34,0);//set forward to 34 degrees
turn(-20,.5);//left turn for half second
turn(16,.5);//right turn for half second
turn(0,2.75);//no turn value for 2.75 seconds
base(.3);//no value for .3 seconds
turn(35,1.52);//turn around in 1.52 seconds
turn(0,0.2);//not turn value
fnd(28,0);//set forward value to 28 degrees
turn(16,.5);//turn right for a half second
turn(-20,.5);//turn left for a half second
turn(0,2.45);// no turn value for 2.45 seconds
Hillock Le 22

base();//end flight
}

void loop() {//nothing goes here, nothing needed to be looped


}
Hillock Le 23

Appendix D: Professional Contact


Senior Research Professional Consultant Contact Form

Names: Jacob Hillock and Brian Le

Research Topic: Flying a Drone with Pre-set Flying Controls

Professional Contact Information

Name: Mark Supal

Title: IDS Teacher

Organization: MMSTC IDS Teacher

Phone (area code and extension): (586) 825-2400 extension 20124

Email: marsup@wcskids.net

Dialogue Information

1. Contact Goal:
Help us think of the experiment, set it up, and code it.
Hillock Le 24

Works Cited

"Arduino - ServoWrite." Arduino - ServoWrite. Arduino, n.d. Web. 07 Nov. 2016.

<https://www.Arduino.cc/en/Reference/ServoWrite>

By Single, It's Meant That the Chip Contains a Single Potentiometer. Some Digital Pot

ICS Contain 2 Potentiometers; These Are Called Dual Potentiometers. This

Means You Could. "How to Build a Digital Potentiometer Circuit Using a

MCP4131." How to Build a Digital Potentiometer Circuit with a MCP4131. N.p.,

n.d. Web. 13 Oct. 2016.

<http://www.learningaboutelectronics.com/Articles/MCP4131-digital-

potentiometer-circuit.php>.

Debczak, Michele. "This New Drone Is Designed to Transport Humans." Mental_Floss.

N.p., 8 Jan. 2016. Web. 3 Oct. 2016. <http://mentalfloss.com/article/73430/new-

drone-designed-transport-humans>.

Santoro, Corrado. "How Does a Quadrotor Fly?" N.p., 10 Feb. 2014. Web. 20 Sept. 2016.

<http://www.slideshare.net/corradosantoro/quadcopter-31045379>.

Simple Servo Control Tutorial." Arduino Playground. Arduino, n.d. Web. 20 Sept.

2016. <http://playground.Arduino.cc/Learning/SingleServoExample>.

Vous aimerez peut-être aussi