Sei sulla pagina 1di 10

GPS Guided Autonomous Rover

ELEN3017

Josh Berman 320856


Group: 16

Partners: Terry Bugai, Kent Salmon, Mayur Chiba

Date: 24 May 2013

School of Electrical & Information Engineering,


University of the Witwatersrand,
Private Bag 3,
2050,
Johannesburg,
South Africa
Abstract
This document provides the development and implementation of a GPS (Global Positioning System) guided rover.
The rover is to compete in a race on a pre-defined track consisting of vertices made up of GPS coordinates. The
design is comprised of a perspex base, battery pack, servo motors, Ublox GPS module and an ATMega328 Arduino
microcontroller. The microcontroller receives the input from the GPS module in string format through serial
communication. This data is then sent through our path finding algorithm and the direction is calculated. The rover
runs through the course with minor mishaps. Improvement recommendations include alternate algorithms and
additional sensors.

1. INTRODUCTION The battery pack must be the sole power supply


for the rover. The rover must hence be able to
Critical to this project, a Ublox GPS unit is mounted on provide enough torque to carry the batter pack.
the highest point on the rovers surface. Location data is
converted to a usable form and a path is then calculated The Ublox GPS module must be used to control
using our path finding Algorithm. The rover determines the direction of the rover.
its location and direction in order to estimate how many
degrees to rotate. It then rotates accordingly, drives The Perspex provided must be used in the
forward and re-calibrates. This process continues until the construction of the rover
rover has reached its destination.
No power tools are to be used throughout the
Section 2 defines the constraints versus requirements of construction of the rover.
this autonomous rover. The physical circuit
implementation is discussed in section 3 and the 2.2. Success Criteria
construction and implementation in section 4. The
stability of the physical structure of the rover is discussed Navigate through a track consisting of vertices
in section 5, the algorithm is discussed in section 6 with made of GPS coordinates in the quickest
all results in section 7. The concluding statements with possible time without veering off course.
recommendations appear in section 8.
2.3. Component Constraints

For the purposes of this autonomous rover, a standardised


2. CONSTRAINTS AND REQUIREMENTS issuing of components to be used as power supplies and
tracking modules forms the basic constraints of the
2.1. General Assumption and Constraints subsequent system. It is around these components in table
1, that the subsequent design must meet all the
The continuous servo motors given must be used requirements.
to drive and steer the rover.

1
Table 1: Issued components and relevant ratings Table 2: Tested load characteristics of rover under normal
conditions.
Components Relevant
Ratings Component Voltage(V) Load Load
Current(A) Power
2 Continuous Rotation Servo 6V (W)
Motors Arduino 5.0 80m 0.4
1 Battery pack 6V 2.8Ah GPS 3.3 40m 0.13
50 300mm Perspex sheet N/A Servos 6.0 190m 1.14
2 Rubber/plastic wheels (not 9cm diameter Rover in motion 6.0 360m 2.16
issued) (under no load)
1 Track ball (not issued) N/A Rover in motion 6.0 420m 2.52
(under load)

3. DESIGN APPROACH Load currents are tested using a DC power supply and
reading off the current drawn. These test results show that
3.1. General Design Approach
the rover requires at least a 6V supply at <1Amp.
When comparing the constraints and requirements of the
3.3. Servo Motors
design the following two options for the drive mechanism
of the rover are presented. One way is to use a single Two FS5109R standard continuous rotation servos are
continuous rotation servo to produce the driving force used to drive and steer the rover. A PWM signal
acting on the rear axle of the rover and to use a 0-180 generated by the microprocessor controls the angle of
semi rotational servo to direct the front wheel which rotation. Since our servos are continuous rotation, the
controls the direction. Another way is to use two angle is used to determine the wheel direction once off,
continuous rotation servos to drive each wheel i.e. forwards or backwards. The servos continue to rotate
independently. This would allow us to turn on our axis by until a new command is given as they do not contain a
rotating the wheels in opposite directions. The latter limiting potentiometer. In order to turn the rover, the
option became the chosen one as the rover needs to make servos must be set to rotate the wheels in opposite
immediate turns when advancing passed coordinates. directions. The duty cycle of the PWM determines the
direction of the rotation of the servos and the frequency
The choice of the microprocessor used is dependent on a
determines the speed of rotation. Our frequency is set in
number of factors. The microprocessor must contain
order to get maximum speed of rotation while still
enough memory to house our entire code. The processing
providing enough torque to carry the battery pay load.
speed must be enough to calculate in real time before the
This frequency is set to be 333.3 Hz rated at the
rover crosses the next point. The micro must contain
maximum our plastic gears can handle. The normal
enough input/output pins so that the GPS and servo
operational frequency is between 50-60 Hz [4]. The
motors can be connected.
rovers speed is noticeably faster.
The Arduino ATMega328 fits all this criteria and is
Table 3: Servo Motor Ratings from datasheet
readily available at most electronic suppliers. The
sketch is coded in c providing an easier platform than
Components Ratings Ratings
PICs requiring assembly or mipps.

ASSEMBLY AND PHYSICAL FEATURES Power 4.8V 6V


Speed 0.16sec/60 0.16sec/60
3.2. Power supply Torque 6.5kg/cm 9.5kg/cm
Weight 52g N/A
The Battery pack provided has an output voltage Size 40.8*20.1*38.0mm N/A
measured to be 6.3V when fully charged. This is the sole Application robot N/A
supply for the rover and must provide enough current to
power the servo motors, GPS unit and Arduino
microprocessor. The optimum voltage for maximum
torque of the servos is 7.2V [1], but as little as a 4V 3.4. The Wheels
supply can be used. The GPS module requires 3.3V [2]
and is regulated through the Arduino. The microprocessor The diameter of the wheels is a crucial factor to the speed
requires a 5V supply but anything up to 8V can be used as of the rover. As the servos are now rotating at a fixed
the PCB board contains its own 5Vdc regulator [3]. These speed, Assuming enough torque is provided through
values are measured experimentally using a controlled entire operation, we can assume the larger the wheels the
variable power supply and displayed in table 2 as greater the speed. This is limited to availability of
minimum values for acceptable levels of performance. attachable wheels and as mentioned the servo torque.

2
Different sets of wheels are tried and tested until the load the Arduino in order to receive the desired data. Once this
on the servos is minimised and the speed of the rover is data is received we can use string manipulation to extract
maximised. A final wheel of diameter 9cm is chosen. The the latitude and longitude. Checks need to be performed
wheels are taken from an old Mecano/Lego set and are in order to make sure data is being received else the
fixed in place using rods. Glue is used to secure these information is insufficient.
rods. A table of varying size wheels and their respective
speed is shown below. The GPS module takes roughly 30 seconds to begin
receiving information and therefore initial loops need to
Table 4: Wheel diameter and resultant speed/time be put in place to prevent the rover from moving forward
before this information is received. The Latitude and
diameter Perimeter Rotations Time to longitude are displayed with five decimal places in order
per meter cover a meter to depict an accuracy of 1.1 meters [6]. The accuracy
(sec/meter) during final tests was less than this and caused minor path
4cm 12.5cm 8 7.68 variations for this rover. With a larger antenna and the
6cm 18.85cm 5.3 5.08 storage of latitude and longitude in integer format as
9cm 28.27cm 3.53 3.39 opposed to floats, we can reduce this error significantly.
There was not enough time to incorporate this fix in the
Speed is the Inverse of the time taken to cover a meter. code and hence the error was relatively high. The GPS
output can be found in Appendix B.
3.5. The Chassis

A 6mm thick sheet of Perspex measure to be 300x500mm 4. CONSTRUCTION


is issued and must contribute to the structure of the rover.
The Perspex is light in comparison to a metal structure The rover is pieced together using assorted screws and a
but heavy when considering the added weight of the glue gun. The Servos are attached in opposite directions
battery pack. Perspex is used as it can be easily cut using to the underside of the Perspex base plate. The wheels are
a saw or bored using a hand drill. Cut out pieces can be then attached independently to each servo using the
attached using a glue gun. Aesthetic additions such as a screws and the servo arms that are supplied with the
wind deflector are added for our own amusement. The servos. The track ball is fixed using the holes in the front
Chassis is a single sheet of Perspex with side sections of the chassis that were drilled previously. The battery
removed for the wheels to fit. Holes are drilled for the pack is strategically placed and secured in the center of
Arduino to be secured and the front track ball to be the chassis for optimum weight distribution. The GPS unit
mounted. The base plate dimensions can be found in is placed on top of the battery pack and the TX and RX
Appendix A, Figure 1. pins are connected to pin 3 and 5 of the Arduino
respectively. The Vcc and GND are connected directly to
3.6. GPS Module the 3.3V output of the Arduino and the GND pin of the
Arduino respectively. The Arduino is secured in front of
The Global Positioning System comprises of multiple the battery pack and the supply voltage is connected
Satellite networks orbiting the earth. These satellites directly, via a power diode, into the power connector. The
transmit data or timestamps depending on their position servo signal inputs are connected to PWM pins 6 and 10
in space. The data is received by a GPS receiver where of the Arduino and their respective ground and supply are
there is an unobstructed line of sight. This is accessible to connected to the battery supply rail. The rear spoiler is
anyone from military personnel to civilians. The most added for aesthetic reasons, and a rear leg is then secured.
common GPS receivers are located in land mapping The construction of the rover is complete and the Arduino
devices used in cars and cell phones [5]. sketch containing the path finding algorithm can be
uploaded.
The data set or information from GPS receiver is called
NMEA, which stands for National Marine Electronics 5. DESIGN INSTABILITY
Association. These data strings based on ASCII are
communicated at a rate of 38400 bits per second [6] The performance of the rover is heavily susceptible to
which is equivalent to the baud rate of 38400 characters wind resistance and uneven surfaces. The small trackball
per-second. The data is transmitted in sentence codes and in the front can get lodged in a crack in the surface of the
is decoded into string format which we then manipulate to track thus altering the direction of movement. More
find our required information. The GPS data is normally calculations need to be done in order to get the rover back
received and transmitted in a standard NMEA-0183 on track as it is no longer moving along its desired path.
format. This GPS continuously outputs NMEA sentence
codes such as RMC and VTG. In this case, the only The Battery pack is large and heavy and puts a great deal
concerned is the ($GPRMC) sentence, which represents of strain on the servos. The battery is located slightly
the Global Positioning Recommended Minimum Specific forward on the chassis. Ideally one would like to have a
GPS/Transit Data. 50:50 weight distribution but as a result of the vibration
caused by the uneven surface, the weight is constantly
A serial communication port is set up in the software of shifted and the rover can topple backwards. A support bar

3
protruding from the rear of the rover prevents the rover 7. RESULTS
from toppling backwards if the weight is shifted
drastically. 7.1. Test day

The wheels need to be perfectly aligned as a slight degree Assumptions are made for the testing of the rover: the
of inaccuracy can cause a large change in direction when course is assumed to be smooth, the GPS module would
travelling over large distances. This takes copious trials constantly provide accurate information and that the
and error. Additionally the servos can be tweaked by power supply would be constant. This is an ideal case.
altering their variable resistors; this can slow down a During testing however these factors come into play and
servo independently allowing the rover to tend towards a cause variations in the results. The rover completed the
certain direction. This is used for correction of alignment course but overshot one or two vertices on occasion. The
and compensation of independent speed inaccuracy. speed and direction was hindered by the uneven surface
which caused the rover to veer off the path towards the
end. After much initial tests prior to the demonstration,
the battery output voltage was lower than its initial value
6. PATH FINDING ALGORITHM and the rover had to be connected directly to a PC in
order to provide enough current for all the components.
The path finding algorithm is initially drafted in sudo The rover did manage to complete the entire path at a
code to get a better understanding of the objective relatively fast pace with all the constraints adhered to.
required. The code is then simulated in Matlab which
provides a visual representation of the calculated angles
and their respective paths. These simulated results can be
seen in Appendix C. Once the algorithm is tried and 8. IMPROVEMENTS
tested on Matlab, it is then coded in c and used on the
Arduino to output the required results. The rovers improvements can be made in the form of
additional sensors such as sonar or a gyroscope. The
The algorithm begins with finding the direction required sonar sensor can measure the distance to an object in its
for the rover to move. This can only be done with two sets path and hence trigger an object avoidance algorithm. An
of reference coordinates. Thus the rover must move example of this algorithm is shown in Appendix D. The
forward initially to retrieve these two sets of coordinates. gyroscope can be used to measure the angle of rotation.
The coordinates are passed to a function that calculates This would be preferable as the current design requires
the angle of movement and the rover is rotated the rover to move forward and retrieve new coordinates
accordingly. The rover must continuously loop through and hence calculate its angle.
this set of instructions until the desired point is reached.
The rover then checks for the next vertices and re- The rover build quality was of high standard but the
evaluates its position. uneven surface can cause undesired results. The rover can
be built with a wider base and thicker tires to absorb
bumps in the track.

An antenna can be added to improve the GPS signal and


therefore reduce the time taken to retrieve coordinates;
this would noticeably speed up the rovers algorithm. To
add theses improvements the connection diagram in
Appendix E can be used for reference.

9. CONCLUSION

A GPS guided autonomous rover was designed, constructed and tested. The system followed a strict set of constraints
with regards to the structure of the Rover as well as the implementation. The employed system autonomously navigates
its way through a path set out in GPS coordinates powered by a single 6.3V battery pack. The accuracy of the GPS
module was questioned and the desired outcome was hindered. The algorithm that was initially drafted in Matlab did
not function as well as expected when converted to c, but the overall construction and implementation produced the
required result. This project is a prime example of an intelligent autonomous vehicle.

4
REFERENCES

[1] Servo Voltage, FS5109R Data-sheet.


[2] GPS Operating Voltage, http://www.openimpulse.com/blog/products-page/product-category/ublox-neo-6m-gps-
module/ ,June 2013
[3] Arduino Operating Voltage , http://arduino.cc/en/Main/arduinoBoardUno, June 2013
[4] Servo Frequency, http://pcbheaven.com/wikipages/How_RC_Servos_Works/ , June 2013.
[5] GPS information, http://en.wikipedia.org/wiki/Global_Positioning_System , May 2013.
[6] Implementation of GPS for Location Tracking , 2011 IEEE Control and System Graduate Research Colloquium,
Shah Alam, Malaysia

Appendix A

Figure 1: Perspex Chassis Dimensions

Figures 2: Side View of Rover Figures 3: Top View of Rover

5
Figures 4: Rear View of Rover

Appendix B

Figure 1: GPS Output Stream Using Serial Communication

Appendix C

Figure 1: Flow Diagram of the Path Finding Algorithm


6
Sudo code:

General order
Initialisation
Find goal
drive forward
determine "direction"
goalFind = 0
Running
turn & drive
if goalFind = 1
find goal + 1
goalFind =0
end
acquire position
check angle
check if success
if success
goal = goal + 1
goalFind = 1
end

Issue that may arise in order of probability:


###
Check angle after movement, else every turn/drive adds an error
###
Crossing goal latitude/longitude
if condition: latP > latS
if latP >= latG
latG = max(latC,latB)
end
if condition: latP < latS
if latP <= latG
longG = min(latC,latB)
end
similarly for longitude.
###
Crossing wall
Check proximity to wall AC

Figure 2: Map coordinates illistration

7
Figure 3: Visual Matlab Map Simulation

MATLAB code:

clc;
%close all;
%clear all;

latIn = [28.02766, 28.02783, 28.02778, 28.02778, 28.02785, 28.02763];


longIn = [26.19165, 26.19164, 26.19159, 26.19149, 26.19139, 26.19150];
latOut = [28.02767, 28.02794, 28.02792, 28.02787, 28.02792 ,28.02798, 28.02765];
longOut = [26.19173, 26.19166, 26.19155, 26.19155, 26.19155, 26.19131,
26.19141];
latP= 28.02767;
longP = 26.19169;
longVert = [26.19165, 26.19173, 26.19164, 26.19166, 26.19155, 26.19155,
26.19159, 26.19149, 26.19155, 26.19139, 26.19131, 26.19141, 26.19150];
latVert = [28.02766, 28.02767, 28.02783, 28.02794, 28.02792, 28.02787, 28.02778,
28.02778, 28.02792, 28.02785, 28.02798, 28.02765, 28.02763];

longPath = longP;
latPath = latP;
longA = longVert(1,1);
latA = latVert(1,1);
longB = longVert(1,2);
latB = latVert(1,2);
longC = longVert(1,3);
8
latC = latVert(1,3);
longD = longVert(1,4);
latD = latVert(1,4);

longABC = [longA, longB, longC , longA];


latABC = [latA , latB , latC , latA ];
longPC = [longP, longC];
latPC = [latP , latC ];

if (longA - longD)^2 + (latA - latD)^2 < (longB - longD)^2 + (latB - latD)^2


longB = longA;
latB = latA;
end

longG = abs(longB - longC)/2 + min(longB,longC);


latG = abs(latB - latC)/2 + min(latB,latC);
longPath = [longPath, longG];
latPath = [latPath, latG];
plot(longIn, latIn, longOut, latOut, longABC, latABC, longPC, latPC, longPath,
latPath);

vertN = 5;
vertM = size(longVert) + 1;
evalResponse = input('prompt');
while vertN < vertM(1,2)
longA = longC;
latA = latC;
longC = longD;
latC = latD;
longD = longVert(1,vertN);
latD = latVert(1,vertN);
vertN = vertN + 1;
longP = longG;
latP = latG;

longABC = [longA, longB, longC , longA];


latABC = [latA , latB , latC , latA ];
longPC = [longP, longC];
latPC = [latP , latC ];
longPD = [longP, longD];
latPD = [latP , latD ];

if (longA - longD)^2 + (latA - latD)^2 < (longB - longD)^2 + (latB - latD)^2


longB = longA;
latB = latA;
end

longG = abs(longB - longC)/2 + min(longB,longC);


latG = abs(latB - latC)/2 + min(latB,latC);
longPath = [longPath, longG];
latPath = [latPath, latG];

plot(longIn, latIn, longOut, latOut, longABC, latABC, longPC, latPC,


longPath, latPath);
evalResponse = input('prompt');
end

longP = longG;
latP = latG;
longA = longC;
latA = latC;
longC = longD;
latC = latD;
9
longABC = [longA, longB, longC , longA];
latABC = [latA , latB , latC , latA ];
longPC = [longP, longC];
latPC = [latP , latC ];
longPD = [longP, longD];
latPD = [latP , latD ];

longG = abs(longA - longC)/2 + min(longA,longC);


latG = abs(latA - latC)/2 + min(latA,latC);
longPath = [longPath, longG];
latPath = [latPath, latG];

plot(longIn, latIn, longOut, latOut, longABC, latABC, longPC, latPC, longPath,


latPath);
evalResponse = input('prompt');
plot(longIn, latIn, longOut, latOut, longPath, latPath);

Appendix D

Figure 1: Depiction of Object Avoidance Algorithm

Appendix E

Figure 1: Connection Diagram of rover components

10

Potrebbero piacerti anche