final draft EEL 4915

Document Sample
final draft EEL 4915 Powered By Docstoc
					     Tailgate Buddy

           Group 11




Greg Koeppen, John Fuoco, John Maskasky, Ken Kauffman

     5/1/2009
Introduction                      2
  Executive Summary               2
  Project Motivation              2
  Applications                    4

Definition                        5
  Goals                           5
  Specifications                  5
  Requirements                     7
    Motors and Drivetrain          7
    Tracking System                7
    Chassis                        8
    Obstacle Avoidance             8
    Power Supply                  11
    Electronic Speed Controller   11
    RC Tx/Rx                      12
    Software                      12
    GPS                           12
    Water Gun                     13
    Master Microcontroller        13

Research                          16
  Tracking System                 16
  Obstacle Avoidance              18
  GPS                             22
  Motor/Drivetrain                24
  Power Supply                    28
  Radio Control                   29
  Master Microcontroller          30
  Software                        31
  Electronic Speed Controller     32
  Chassis                         35
  Water Gun                       37

Design                            39
  Design Summary                  39
  Block Diagrams                  41

                                   ii
 Subsystems                       42
   Tracking System Design         44
   Obstacle Avoidance Overview    47
   GPS                            57
   Master Microcontroller         70
   Software                       72
   Motor/Drivetrain               73
   Power Supply                   74
   Electronic Speed Controller    75
   RC Tx/Rx                       75
   Chassis                        75
   Water Gun                      77

Prototype                         79
 Procurement                      79
 Building Methods                 79
 Subsystems                       80
   Motors and Drivetrain          80
   Power Supply                   81
   Electronic Speed Controller    82
   RC Tx/Rx                       83
   Water Gun                      83
 Final Build                      84

Testing                           86
 Parts                            86
 Subsystems                       86
   Chassis                        87
   Tracking System                87
   GPS                            93
   Motors and Drivetrain          93
   Power Supply                   95
   Electronic Speed Controller    96
   Obstacle Avoidance             96
   RC Tx/Rx                      106
   Complete Drive System         106
   Water Gun                     107
 Entire System                   109
   Testing Environments          109

Users Manual                     116


                                  iii
  Basics                   116
  RC Mode                  116
  Autonomous Mode          117
  Debugging                117

Administrative Details     119
  Budget                   119
  Timeline                 121
  Team Bios                122

Appendices                 123
  System Wiring Diagrams   123
  Copyright permissions    123
  Data-Sheets              123
  Source Code              123




                            iv
List of Figures
Figure 1 Obstacle Avoidance Detection Cone .................................................... 10
Figure 2 Detection Patterns ................................................................................ 20
Figure 3 Receiver Detection Patterns ................................................................. 21
Figure 4 WD-G-ZX4120 GPS Module ................................................................ 23
Figure 5 Microchip PIC16F819 Microcontroller................................................... 24
Figure 6 Photo of Traxxas TQ3 AM Radio .......................................................... 29
Figure 7 Diverse Electronics Services MC7 motor controller .............................. 34
Figure 8 Broken Tie Rods ................................................................................... 36
Figure 9 Approximate Location of Subsystems .................................................. 40
Figure 10 Inputs – Outputs Block Diagram ......................................................... 41
Figure 11 Microcontroller Block Diagram ............................................................ 42
Figure 12 Software Block Diagram ..................................................................... 42
Figure 13 Pulsed Circuit ..................................................................................... 45
Figure 14 Detection Cone ................................................................................... 46
Figure 15 Obstacle Avoidance Detection Cone .................................................. 48
Figure 16 Ultrasonic Sensor Connection ............................................................ 52
Figure 17 RS232 Connection ............................................................................. 53
Figure 18 Obstacle Avoidance Blind Spots ........................................................ 54
Figure 19 Ultrasonic Sensor ............................................................................... 56
Figure 20 PIC16F819 Pin Diagram..................................................................... 59
Figure 21 ZX4120 GPS Module.......................................................................... 63
Figure 22 Secure Digital (SD) Memory Card ...................................................... 64
Figure 23 Antenna Socket (LEFT), GPS Antenna (RIGHT) ................................ 64
Figure 24 PCB for GPS Unit ............................................................................... 65
Figure 25 First Half of GPS Unit Circuit Diagram................................................ 67
Figure 26 Second Half of GPS Unit Circuit Diagram .......................................... 68
Figure 27 Completed GPS Unit .......................................................................... 69
Figure 28 Master Microcontroller Schematic ...................................................... 71
Figure 29 Example of How to Launch GPS Parser Utility ................................... 72
Figure 30 - 12 Volt 9.5 Ah Rechargeable Battery ............................................... 74
Figure 31 HS-805BB Power Servo ..................................................................... 76

                                                                                                               v
Figure 32 Basic Washer Pump System .............................................................. 77
Figure 33 Basic Layout of Components .............................................................. 85
Figure 34 Photodiode Angular Sensitivity ........................................................... 92
Figure 35 IR LED Angular Sensitivity ................................................................. 93
Figure 36 Obstacle Avoidance Testing Areas..................................................... 98
Figure 37 Side Sensors Viewing Angles ........................................................... 101
Figure 38 Forward Facing Sensor .................................................................... 103



List of Tables
Table 1 Specifications .......................................................................................... 6
Table 2 Subsystem Legend ................................................................................ 40
Table 3 GPS Hardware List ................................................................................ 58
Table 4 Sample GGA Data ................................................................................. 61
Table 5 Sample GSA Data ................................................................................. 61
Table 6 Sample RMC Data ................................................................................. 62
Table 7 Sample GSV Data ................................................................................. 62
Table 8 Tracking System Distance Test ............................................................. 88
Table 9 Test for Turning Response .................................................................... 89
Table 10 Expected Budget Cost ....................................................................... 120
Table 11 Actual Cost ........................................................................................ 120




                                                                                                                vi
Introduction

Executive Summary
This document contains information on the Tailgate Buddy. The Tailgate Buddy
is an automated robot designed to track and follow the operator, or be controlled
directly by the operator. The Tailgate Buddy also is designed to carry a payload
of approximately 100 pounds. This will allow the operator to bring cargo along
with him or herself without having to carry it, leaving his or her hands free. The
motivation of the project is to make transporting cargo for long periods of time
easier. Tailgate Buddy will allow for easier tailgating at UCF, making the lives
easier of those who own the vehicle.

The technical approach to the tailgate buddy is very modular. The entire project
is broken into several modules/subsystems and sub-modules, which contain both
software and hardware. Most of these subsystems are connected together by a
single master microcontroller. The subsystems which are connected by the
master microcontroller are the ultrasonic sensors, the infrared sensors, the water
gun, the motor, drivetrain, and electronic speed controller, and the RC control.
The GPS module contains a separate microcontroller specifically to parse data to
a Secure Digital (SD) card. This data is saved in a manner that makes it easy for
a graphical operator program to take the data and interface with a mapping
program to visually show the operator where he or she was that day. This
mapping program is also able to save the routes that get generated for
comparison purposes. It can also display the total distance traveled and the total
time of operation for that route.

An algorithm was developed to track the direction and distance to a target that
has an IR transponder. It does the direction finding with an infrared detector and
the distance with an ultrasonic sensor. The algorithm takes the information from
these two sensor systems and uses the information to tell the drive systems what
it needs to do to follow the operator as he or she walks around.


Project Motivation
One way for the engineering design process to start is to find a current problem
for which there is no solution or where the current solution could be improved.
From this various ideas were thrown around to determine different ways to solve
this problem. The first thing that happens in this process is a problem needs to
be identified to be solved. In our case, the problem to be solved is not simple.

                                                                                2
When tailgating at the UCF campus for football games the best area to be in
Memory Mall, while the closest parking lot open for students is in front of the
Visual Arts building. Carrying coolers, tents, and chairs across this distance is
not a fun thing to do. This walk takes about 10 minutes without carrying anything.
So when carrying all of the aforementioned tailgating supplies it slows the trip
down even more. After some brainstorming in the group, we eventually agreed
upon a solution that was believed is the best for our problem. The solution we
agreed was best can be described as an electronic mule. This is a robotic vehicle
capable of hauling approximately 100 to 150 pounds of gear. It follows the
operator around keeping within a certain distance of that individual. When the
transponder and robot are turned on with the robot being in autonomous mode,
the operator is able to walk and have the vehicle follow within a 10 foot radius of
them, in an ideal case. It also has features like obstacle avoidance to avoid
running into other objects, a 50 watt stereo system, and a 12 volt power outlet.
The vehicle is able to avoid obstacles that were in the way and find a route
around them all while continuing to follow the operator. The GPS tracking saves
data points to an SD card, and these data points are later used in a mapping
program. When the operator gets home he or she is able to be upload this saved
data into a mapping program that shows precisely where the robot has been that
day. The primary use for the vehicle is to carry gear from your car to a tailgating
site area some lengthy distance away. Then at the conclusion of tailgating, carry
all that gear back to your car.

The vehicle needed to be able to move at speeds that people walk at and
possibly fast enough for a slow jog. The vehicle also needed to have obstacle
avoidance to avoid objects and be able to plot a course around said obstacle to
continue following the operator. The vehicle needed to be able to traverse a
semi off-road terrain. Being able to climb over small obstacles, grassy conditions
all while maintaining stability with the load that is being carried. It should be able
to travel for about three miles on a single charge or about 3 to 4 hours of
operation to ensure that the operator will not have to then carry the vehicle along
with the payload back to the operator‟s vehicle.

As an added bonus to having a robot carry your cooler and other tailgating gear
around another feature that was implemented is a radio controlled function in the
vehicle in addition to its following mode. Since the entire operation of the robot is
being controlled via a microcontroller it was relatively easy to implement a radio
controlled feature. This is a nice feature to have if for example, you are sitting in
a chair and your friend fifty feet away would like something out of the cooler so
instead of getting up and giving it to him you just grab the radio controller and
drive the vehicle over to him. Then once he is finished you drive the robot back
over to yourself and enjoy an ice cold beverage for a job well done.




                                                                                    3
Applications
Although the vehicle is called “The Tailgate Buddy,” is made for the purpose of
having fun and is more of a novelty creation, it can also be used for many more
applications than just tailgating. The basic design of the vehicle is a robotic
wagon that follows the operator around while carrying a load. With a few simple
modifications the vehicle can be used for a variety of things. Simply changing a
few key design details, like overall size, motor and battery performance, wheel
size and type, the vehicle‟s load capacity can change and be used for other
applications. It could be used for gardening and landscaping. Instead of pushing
a wheel barrow the operator could load the vehicle with tools, dirt, mulch, plants,
etc and instead of pushing these heavy loads long distances, they could walk to
the desired location and the vehicle would move the heavy load. This same
principal could be applied to construction. Most jobsites require a large amount
of tools and supplies. Usually this means workers must constantly move heavy
loads. Having a robotic hauler could prove to not only be easier for the workers
but also may prove to be safer for them as well. After construction finishes or a
major event is over there can be a daunting task of site cleanup. This vehicle
could make cleanup move a lot faster and require less workers. If scaled down a
little a vehicle like this may be used for work around the house. It could help with
everything from cleaning to household repairs. It may even prove beneficial for
traveling. It could be used in airports to carry heavy luggage from locations. The
list of uses is only limited by the imagination and the needs of potential users.

In some applications it may be helpful to have more than one vehicle following a
user at a time. If IR emitters are placed on the backs of vehicles they could be
placed inline like a train and be made to all follow the user. This could be helpful
in cases where vehicles that follow tracks or sensors in the ground could not be
used because the route that they must travel would change too often to keep
placing a tracking line in or on the ground. This would give freedom of movement
and versatility to situations that require a train-like vehicle but the path traveled is
rarely the same as it was for a previous trip. The primary tracked user may not
even need to be a person. It could be another vehicle that could either be driven
by a user or be a more advanced robot. This would leave the following vehicles
to be less advanced and cheaper vehicles and only the lead vehicle to be a more
advanced and expensive model. Another application could be underground
where GPS routed vehicles could not be used or in a place where GPS would not
be accurate enough to get to precise positions. This may be helpful in mining or
tunneling applications. Instead of taking time to lay down a track the vehicles
could immediately start hauling. The vehicle could be scaled up or down to meet
the demands of the user. They could be small vehicles the size of small RC cars
or as large as tanker ships. As long as all components of the vehicle are scaled
appropriately the vehicles should still operate properly. The design of the tracking

                                                                                      4
system is the key behind the project. The rest of the design is to suit the
application of tailgating. Take that all away and the vehicle can be reconfigured
to suit other needs. In this way the design of the robot is very modular and is
suited for many different fields of use.


Definition
The Tailgate Buddy is made up of several different subsystems and various
components. The main subsystems are the chassis, motors and drivetrain,
obstacle avoidance system, power supply, electronic speed controller, master
microcontroller, RC system and the water gun. All of these systems have their
own purpose and specifications that will be discussed further in this section.


Goals
The main goals for the robot to accomplish relate to its job of hauling a cooler for
the operator with little interaction from the operator besides unloading from their
vehicle. The first and foremost goal for the robot was for it to be able to reliably
follow the operator as he or she walks from one place to another. This means
the tracking system needed to accurate enough to follow at a certain distance
from the operator, keep up in speed with the operator and be able to follow the
operator as he or she turns and walks in differing directions. If this did not work
well the vehicle would not be able to achieve its primary purpose and ultimately
have been regarded by the group as a failure. The goal of the project was to
make the vehicle as simple and cost efficient as possible, while still meeting all of
the design goals; speed, payload capacity, weight, range, etc.


Specifications
The group decided upon the overall specification for the vehicle before going on
and detailing any other design goals or starting to research. Some of the original
specifications had to be modified from what information was found out during the
research but for the most part the specifications the group decided upon have not
changed drastically since the beginning of the project.            Some of the
specifications are based around the robot being relatively easy to transport the
around for an average person. While, other specifications are based upon what
was believed to be the maximum amount of travel or use a person would get out
of the robot while tailgating or using the device for a decent amount of time. All
of these specifications are well above what an average operator would use the
vehicle for during tailgating.


                                                                                   5
There are other specifications that have been agreed upon that were not quite
that easy to put into a quantified table. For the GPS mapping software, it needed
to be as user friendly as possible while still retaining as many features as
possible. The Group has defined user friendly in a few ways. First, the user
interface must be visually appealing to the eye and are buttons laid out in a way
that makes sense to the average person. The consulted the help of non-
engineering people to see what they thought of the layout when there was a
preliminary version running. It needed to be very easy to upload data from the
robot to the mapping software. The plan was to use a SD card to transfer the
data. The program has some powerful features like being able to save routes
traveled for comparison as well as being able to give total distance traveled and
total time taken. For obstacle avoidance the robot needed to be able to route
itself around objects that are in the way and still follow the operator. It should not
run into any object that may be in the way or come into the way while it is
operating.

                                   Specifications
                                            Able to fit into a standard
                         Size                       4 door car
                        Speed                   Maximum 8mph
                   Payload Capacity                100 Pounds
                        Range                         5 Miles
                  Average Following
                      Distance                      5 to 7 Feet
                   Max Distance to
                      Operator                Greater than 12 Feet
                    Vehicle Cost               500 to 700 Dollars
                                              Minimum 6 Times a
                  GPS Logging Rate                  Minute
                  Weight of Vehicle               50 to 70 lbs
                  Water Resistance          Unaffected by Light Rain
                  Water Gun Range             Minimum of 5 feet
                                            Should be able to Avoid
                 Obstacle Avoidance                Obstacles
                      Terrain               Fields and Parking Lots
                            Table 1 Specifications




                                                                                    6
Requirements
In this section the various subsystems will be introduced and they will have their
primary purpose explained. Each subsystem has its own requirements that it
needs to meet to be considered.


     Motors and Drivetrain
The drive system of the vehicle is very important as it needed to be built to move
the required load and perform the driving task well. The vehicle is slow moving,
at a max speed of just above a walking pace, so the drivetrain was not required
to be able to move the load fast. However it is required to run for extended
periods of time and power the vehicle up gentle slopes and through grassy
terrain. It also had to be rugged enough to stand up to the tasks of carrying
heavy coolers and other tailgating necessities.

The drivetrain is quite simple. Its basic components are motors, gears and a
drive axle with wheels. The motors had to have the required torque and power to
propel the vehicle at full load and up gentle slopes without too much strain. The
gears transfer torque from the motor to the drive axle. They also provide the
needed gear reduction to transfer the low torque, high speed rotation of the
motor to high torque and low speed drive axle rotation. The wheels needed to be
large enough to be able to make it over small obstacles like sticks and to be able
to make it over transition points like when going from grass to a concrete
sidewalk that may be slightly raised. However they couldn‟t be too large as to be
too hard for the motor to turn or lower the efficiency of the entire drive system.


     Tracking System
The tracking system might just be the most important system in the robot. It
takes the job of tracking the operator as he or she walks around. It feeds this
information to the microcontroller about where the robot needs to drive to follow
the operator. It needed to be able to follow the operator to a maximum distance
of equal to or greater than twelve feet. The system needed to use a technology
to track the operator; either radio frequency, or optically, or even using infrared
radiation. The technology that is used is not important. What is important is that
it is reliable and will work in many different environments and in different weather
conditions that degrade the tracking ability.

The information that is transmitted consisted is a generic 38kHz PWM signal that
the vehicle detects and determines the direction the user is at. Using code in the

                                                                                  7
maser microcontroller, it takes this information and directs the vehicle where it
needs to drive. The system is broken up into two main subsystems; the
transponder and the detector. The transponder is a small device that emits a
beacon that the detector receives and locates. With these two systems working
together the tracking system is able to reliably track the operator and pass the
information on to the microcontroller to steer the vehicle.


     Chassis
There are several main purposes of the chassis with the design. First is that it
carries a payload. The main goal of the project was to be able to carry a heavy
payload around without any effort from the operator. It needed to be able to hold
the payload easily and not lose it while maneuvering around in the projected
environment of use. The next thing that the chassis needed to do was to be able
to carry all the complicated electronics and keep them protected from weather
conditions that the vehicle might be exposed to. Finally the chassis needed to
be rugged enough to maneuver through the outdoor environment and do so
safely and securely.


     Obstacle Avoidance
The obstacle avoidance system is using ultrasonic to project a pulse of sound out
in front of the sensors. If the pulse of sound is reflected back then the system
can identify that there is an object in that path. By transmitting the sound in
pulses and measuring the time delay between the time the sound was broadcast
and the sound was received its possible to determine the distance the object is
at.

There are several different obstacle avoidance system designs that are
commonly used any of these could be used to model this system after. A simple
obstacle avoidance system is one in which the Tailgate Buddy is able to see that
there is an obstacle in the direct drive path, however could not be able to
maneuver around the object but instead would wait for the object to move from
the path before continuing. It does this by incorporating one sensor in the front of
the vehicle that can view a wide angle with only a minimum blind spot. This
simple system acts as an electronic bumper for the Tailgate Buddy essentially
just preventing it from running into an object. The second system is more
complex giving the Tailgate Buddy the ability to not only see the obstacle in the
path but also to see at a forty-five degree angle from both sides and the front to
see if there is an object approaching it. Using this information it can make a
judgment as whether to maneuver around the obstacle, continue straight, or stop
and wait for the obstacle to be removed from the path. Using this system with

                                                                                  8
front sensor continues to watch for objects and act as a preemptive electronic
bumper that prevents the vehicle from ramming into an object. The two side
sensors watch from the sides for objects and if they see an object they will cause
the Tailgate Buddy to turn with a limited turning radius to attempt to avoid the
obstacle. The drawback is the vehicle may lose sight of its original path and can
still hit the obstacle since it won‟t have a measure of distance to the obstacle or
speed at which the obstacle is approaching. The third type of obstacle
avoidance is more complex, using a system of three or more sensors covering
different angles in the forward and side directions giving the vehicle not only
positions of obstacles but also distances of the obstacles allowing it to virtually
build a two dimensional map of the obstacle layout directly in the drive path of the
vehicle. This information allows the Tailgate Buddy to make an informed
decision on its travel route to avoid nearby obstacles and make decisions on
travel route that will also affect its future travel path.

The reason for using ultrasonic sound for the obstacle avoidance detection
sensors is because using ultrasonic gives us the ability to easily measure the
distance from the sensors to objects in range. Infrared would be difficult to
measure the distance of the obstacles although it would be easy to determine if
an obstacle exists. Using radar to detect obstacles brings challenges of
detection of obstacle into the scenario. Radar also brings along a higher price
tag. This higher price tag and the extra processing power required to process
the data would make radar an impractical way to detect obstacles. Ultrasonic
require a low amount of processing power, low amount of battery power and an
easy way to identify the target and the targets distance from the sensor.
Ultrasonic‟s also have the benefit of heavy use in the robotics world currently and
so there is much available online about their use.

The Obstacle avoidance system for the Tailgate Buddy utilizes ultrasonic
detectors. The ultrasonic detectors give back distance measurements for each
of the obstacles they detect. One sensor pointed directly to the front and two
sensors, one on each side, each covering a forty-five degree angle. The sensor
field is setup in such a way as attempt to prevent blind spots between sensors
while not overlapping the fields but allowing the angles to be such that when
there is an obstacle that it can pass through the blind spot quickly and from one
sensor to the next as the vehicle is moving forward. Each sensor feeds back a
distance for the obstacle which allows the vehicle to see from the side sensor
how far the obstacle is away and whether it needs to steer to avoid the obstacle
or if it has the necessary clearance. The sensor pointing straight ahead is also
transmitting back distance of any obstacles in front of it. This allows the vehicle
to start slowing down gradually to stop for the obstacle instead of having to make
a sudden stop. The front sensor not only acts to stop the vehicle from ramming
an object directly in front of it but this sensor also acts as the speed sensor for
limiting the speed of the vehicle while trying to follow its target.

                                                                                  9
                 Figure 1 Obstacle Avoidance Detection Cone

As the target moves forward the Tailgate Buddy utilizes the obstacle avoidance
system, mainly the front facing sensor, to determine the distance the target is
away from the vehicle. While trying to maintain a set distance the vehicle‟s
obstacle avoidance system is able to speed up and slow down the motors to
match the speed of the target and maintain the following distance desired. The
goal with the obstacle avoidance system was to have the Tailgate Buddy start
slowing gradually when a target comes into range as opposed to stopping
suddenly to avoid a target. With this goal in mind it was easy to expand the
obstacle avoidance system to use the distance measurement it has to the target
that it is following to determine the speed at which it needs to travel to keep a
safe following distance from its target while preventing it from losing the target.

The ultrasonic detector mounted in the front of the unit works together with the
infrared tracking system. This sensor has a limited viewing range only allowing it
to see straight ahead. The infrared tracking system keeps the target in direct line
of sight of the vehicle. While the target is in direct line of sight of the Tailgate
Buddy, the obstacle avoidance system is able to calculate the distance the target
                                                                                 10
is from it and keep the it at a safe distance behind the target. This system is also
able to stop the vehicle in the instance that a passerby steps between the
Tailgate Buddy and the target that it is following. While a sudden stop isn‟t the
preferred stopping force, preventing the vehicle from ramming into an innocent
passerby who unknowingly steps in front of the Tailgate Buddy is preferable.


     Power Supply
The Tailgate Buddy‟s power supply is a critical component of the system. Its
main components are the battery bank that is part of the vehicle and the battery
pack for the tracking device that the user carries. The batteries needed to be able
to supply enough power to operate the Tailgate Buddy effectively and for a full
day of tailgating duty. The battery bank for the vehicle needs to operate the
control system as well as provide power to the drive motor and steering system.
It needs to be able to provide enough current to drive the vehicle while carrying
the maximum payload over grassy, rough terrain. Although the vehicle will likely
sit in a standby mode for the majority of its operation it stills need to have enough
storage capacity to do this for an extended period of time. If this battery dies, the
vehicle becomes completely useless as it will be stuck wherever it is, until the
battery can be recharged.

The battery pack for the user‟s device needed to be much smaller in comparison
to the battery bank the vehicle operates on. This was needed because the user
has to carry this device and if the battery is too large it may become too
cumbersome to carry comfortably. However even when the vehicle is sitting idle
it needs to be putting out a signal constantly always ready to alert the vehicle of
movement. If this battery should fail, the vehicle will have to be driven manually
in the radio control mode. The next crucial component of the power supply is a
battery charger. The batteries are rechargeable and needed a way to be
recharged back to full power before the next day‟s use. It needed to be able to
recharge the vehicle‟s battery bank in a reasonable amount of time for the
vehicle to be useful. If it required too much time to recharge, it would prevent the
user from being able to use it for another day of tailgating at another event.
Ideally it needed to charge overnight and be ready for the next day‟s use.


     Electronic Speed Controller
In order to keep pace with the user the Tailgate Buddy required a device to
control the speeds of the motors and to regulate power sent to them which
control the vehicle‟s speed. This is what is known as a motor controller or
sometimes referred to as an electronic speed controller. It accepts commands
from the microcontroller and determines how fast the motors should be moving.

                                                                                  11
Under normal conditions it powers the vehicle forward at a walking pace.
However it also must be able to supply enough power to enable the vehicle to
catch up to the user in cases where the vehicle was stopped by an obstacle and
has fallen behind. It needs to be able to supply enough current to move the
maximum payload of 100 lbs designated by the vehicle specifications for this
application.


     RC Tx/Rx
The vehicle also has a manual drive mode. This mode enables the user to be
able to drive the vehicle by radio control (RC). This is helpful when the user
wishes to send the vehicle to a position but doesn‟t need to walk to that location.
One case where this could be handy is to deliver beverages from the cooler to a
friend. Instead of having to walk over and bring them a drink, the vehicle can be
driven over and the beverage can be retrieved by the recipient. The manual drive
function of the vehicle requires the use of a transmitter and receiver. It needed to
be made to be relatively easy for any user to be able to drive the vehicle around
without a high risk of loss of control which could potentially injure the user, other
people, animals, or damage property. Ideally any user who has experienced
driving a toy RC car should be able to operate the vehicle‟s manual drive mode
without difficulty. The user can operate a normal RC transmitter which transmits
signal to the receiver, and the receiver outputs to the vehicles control system
which drives the vehicle.


     Software
This is installed upon the operator‟s computer and its primary purpose is to take
that data that is saved from the GPS logger and input this data onto a visual
map. The interface needed to be laid out in a way that all buttons are in areas
that they make sense to be in and they work the way people expect them to.
This entailed that the interface needed to be user friendly, easy to look at and
easy to operate for the user. It takes stored data from a SD memory stick.


     GPS
The GPS unit is stored in a compartment in the chassis of the Tailgate Buddy,
with a removable door which allows access to the Secure Digital (SD) memory
card. The GPS unit functions completely separately from the rest of the
components in the Tailgate Buddy. That is, there are to be no electrical
connections to any other electrical component of the entire vehicle, with the
exception of the accessory battery to power the device. The purpose of the GPS

                                                                                  12
unit is to track where the Tailgate Buddy has traveled during the course of its
use. The GPS unit tracks GPS satellites and records the coordinates of the
vehicle once every second to the SD card. The data written to the SD card is
removable for analysis with a personal computer (PC) at a later time. The GPS
unit needs to be small and light enough to fit somewhere inside the chassis of the
Tailgate Buddy. The unit, including the area where the user is to access SD card,
needs to be water-resistant to guard against light rain or other water during
normal use. The unit is not water proof incase the Tailgate Buddy is submerged
because the Tailgate Buddy‟s intended use is not aquatic.

The main components of the GPS module are the microcontroller, the GPS
receiver, and the SD card socket. These main components are assembled on a
circuit board so they can interface with each other. Another necessary
component of the GPS module is the antenna. This allows much better reception
for the GPS receiver.


     Water Gun
One of the features on the vehicle is a water gun. When tailgating, it is often at a
busy and crowded location. There are usually people walking everywhere and
this may pose a slight problem when using a robotic vehicle that is tracking the
user. When the vehicle encounters an obstacle that blocks its “sight” of the
tracking device and is stuck in front of it, the vehicle activates a water. The idea
is simple, if the vehicle is following the user; it should always want to be following
the same path as the user is taking. For an obstacle to suddenly appear in front
of the vehicle, it is likely because someone or several people have walked
between the user and the vehicle blocking the vehicles line of sight. In the case
of someone standing in front of the vehicle for an extended period of time,
unknowingly or perhaps because they are examining the robot closer, it is
possible for the vehicle to become lost if the user continues to walk away without
knowledge of it being stopped. To combat this problem, when the vehicle is
blocked by an obstacle, and has no “sight” of the tracking device, the water gun
is activated. Since it is likely to be a person standing in front of the vehicle, the
water spray can get their attention, and likely convince them to move out of the
way. Once they are out of the way the vehicle can continue on its path to the
user.


     Master Microcontroller
The master microcontroller needed to be small in size for easy mounting and
protecting. It needed to have the capability to control all of the subsystems on
the Tailgate Buddy. This meant the master microcontroller needed to have a fast

                                                                                   13
processor and the available ports to plug into, plus have the memory space
necessary to store all of the program files. It needed to be expandable in case its
capacity was surpassed and needed to have an additional slave microcontroller,
expansion ports or more memory.

The processor speed needed to be fast enough to manage all of the subsystems
of the Tailgate Buddy. The processor has to monitor all of the sensors of the
obstacle avoidance system and determine if there is an obstacle present. It must
also watch the front ultrasonic sensor and determine the speed the vehicle must
travel to keep up with its target. The processor must also manage the tracking
system and determine which direction the Tailgate Buddy must turn to keep
tracking its target.

The microcontroller needed be expandable in case it needed additional memory,
ports, or slave microcontrollers to it in order to get the Tailgate Buddy correctly
and efficiently. Expandability in the master microcontroller was necessary
because not all problems could be foreseen in the initial design. If the processor
speed of the master microcontroller was not fast enough it may have needed an
additional slave microcontroller to manage one or more systems to free up
processor cycles on the master microcontroller and allow it to focus only on
managing the information rather than deriving the information and managing the
information. The advantage to adding a slave microcontroller is that the slave
microcontroller can actively monitor a subsystem and rather than return what the
results of its findings were it can sift through the data and return the necessary
instructions to adjust speed or direction. This saves processor cycles on the
master microcontroller and allows it to focus on other tasks. The ability to
expand memory or ports on the master microcontroller is necessary because it
may have needed extra storage space on the master microcontroller for
programs or data. The ability to add extra ports on the master microcontroller is
important because of the sensors it has to monitor and the devices it has to
control. With three ultrasonic sensors for the obstacle avoidance system, three
infrared sensors for the tracking system, and two servo motors for the drive
system needed at least eight ports minimum on the master microcontroller. This
was the reason the Digilent Cerebot II microcontroller was used in the vehicle.
This microcontroller has eight add-on ports with RS232 serial port add-on boards
that can be used with the sensors and an add-on board that can directly drive a
servo motor. This ability in the microcontroller helps to simplify the building of the
Tailgate Buddy because the group didn‟t have to build hardware circuits to
interface between the master microcontroller and the drive components of the
Tailgate Buddy. This got rid of a lot of unnecessary extra design and testing that
would have needed to be done to get the system working correctly.

To communicate with the ultrasonic sensors, the group is using the pulse width
output signal from the sensors. To implement this it was necessary to calculate

                                                                                   14
the processor speed of the board and build a delay function so that we could
calculate how long each pulse was high. The length of time the pulse was high
gives us the distance the obstacle is away from the vehicle. The obstacle
avoidance system and the tracking system required their own microcontrollers to
perform calculations on the inputs and give the main microcontroller results as to
what needs to be done. This eliminated performance delays that otherwise
would‟ve been a problem in our design.




                                                                               15
Research
A project of this magnitude with all the features defined in the Requirements
section requires many components. It was important to pick out the best
components for our chosen application of tailgating. To make the best decisions
extensive research was done on each subsystem. Each system and part had to
not only work well and be a quality part, but also work together with all the other
parts and systems. This was extremely important when interfacing parts like a
microcontroller with the electronic speed controller. This section describes the
research process and specific reasons why each part was chosen.


Tracking System
There were several main goals for the tracking system that were decided upon.
The first of these goals was for the system to be able to follow a single operator
with many other people and objects around. The second goal was for the system
to have a range of at least twelve feet. The last main goal was for the system to
be able to be cheaply implemented. The system needs to be able to work in a
wide variety of environments and still perform its job effectively. It needed to be
able to work in cloudy conditions, bright sunny days, and even light rain. All of
this required a system that either takes in little interference from these
environmental factors or is able to cope with them and still perform according to
the specifications. With all of these goals the tracking system is one of the most
complicated systems on the entire robot.

To be able to track the operator in various environments with many other
obstacles around requires the tracking system to be able to, in a sense, target
the operator specifically. After some research on a lot of the common tracking
systems commonly used on robots most of the common ones were thrown out
because they did not fit the specifications. The first one to be thrown out was an
optical based tracking system where the robot is set to follow an object of at least
a certain size that is moving. So if a person were walking the robot would follow
behind and track the walking person. While this sounds good it does not fit for
the application because there is no target discrimination, i.e. if the robot is
following person X and person Y comes in and walks between person X and the
robot the robot could potentially follow person Y now. So this would not quite suit
the application and environment that the robot will be used in; an area where
there are many other people around that could be distracting to the robots
tracking system. There are some more advanced optical based systems that
could be used to track a person first it could follow the shape of a person or it
could follow a specific color.


                                                                                 16
The first method of optical tracking involves scanning the image from the optical
sensor and scanning for a silhouette of a person. This would require a very
efficient algorithm to be designed to scan through the image for the outline of a
person. For optical tracking a group or group member would have to be at least
somewhat familiar with image processing and image processing algorithms. This
design also has a downfall in that it will follow any silhouette that comes into its
path. This could have potentially led to problems because the environment of
use is surrounded with many people. This made an optical design impractical for
use on this project. The second method commonly used for optical tracking is to
track an object based upon its color. This seemed like a good idea but the only
way to get it to work properly would be to choose a color of shirt that only the
operator would be wearing.           This is counterproductive to the tailgating
atmosphere where for almost every game there are notices to wear a certain
color. So becoming the odd person out but being forced to wear a different color
of clothing is not quite an ideal situation. Also, if another person happened to be
wearing the same color shirt the robot could possibly change course and follow
them instead of the operator.

The second technology that was researched was a radio frequency based
transmitter and receiver. This would have required the operator to have with
them a radio transmitter that is linked in frequency to the robot. The robot would
need to have at least three omni-directional antennas to be able to tell precisely
where the person is located. With only two antennas via triangulation algorithms
there are two independent solutions of where the operator could be located.
Adding a third antenna into the mix gets rid of this extraneous solution and
pinpoints the location of the operator to a single point. This system meets the
first goal of being able to pick out the operator in an environment, and the second
goal of a minimum of a twelve foot range. The problem with a RF based system
is that it is expensive and hard to get working properly; it would be a project in its
self. While researching this topic the group was unable to find any robots built by
people and not companies that used radio frequency to locate the operator and
follow him or her. After starting to punch some numbers of what it would cost to
get the radio frequency triangulation system to a testing phase was realized that
this doubled was original budget. We eventually decided along with the input of
Dr. Richie to scrap the radio frequency method of tracking that the operator and
decided to pursue other means for a tracking system.

This leads to the last area of research in the tracking systems area an IR
tracking. The initial thought was that this would not work because in the
environment there would be many other people around to sidetrack the robot with
their own IR generated from their body. A little later on it was realized that
human bodies only emit IR in a rather narrow band of frequencies so as long as
this band of frequencies is not used the Infrared detection should function
properly. While looking at different IR LEDs and IR detectors the goal was to try

                                                                                   17
to optimize the functionality and cost of the system. This led us to decide on
using a commonly available frequency of 940nm. The way the system will be set
up is that the operator will wear an IR LED on themselves that points to the robot
and the robot will pick up this point source and follow it.

While looking at different robotic websites there were some examples of IR
tracking systems that were used to guide a robot around. Some systems had a
single IR detector while others had as many as five detectors. The most common
design and used only two detectors that were set up on the front of the vehicle
and had a slight overlapping cone in the middle of the front of the vehicle. This
design was picked by the group as the best way to get the robot to complete its
design criteria. It is the simplest to design and build. It is also the easiest design
to feed control data to the master microcontroller for further control of the robot.
This will in turn tell what the drive system needs to do in order to follow the
operator.


Obstacle Avoidance
The Tailgate Buddy uses ultrasonic sensors for the obstacle avoidance system.
Ultrasonic sensors have advantages in comparison to other forms of obstacle
detection for the purposes of this robot. The ultrasonic sensors were chosen to
use the basic circuits to return whether or not an obstacle is detected and what
distance the obstacle is at in comparison to the position of the Tailgate Buddy.
The obstacle avoidance system consists of three ultrasonic obstacle sensors,
which are controlled by the master microcontroller. The three sensors are setup
with a semicircular detection pattern giving them a full one hundred and eighty
degree view from the front of the vehicle. This viewing angle allows it to see not
only the objects it runs the chance of ramming into, but also any obstacles it may
run into if it has to make a turn.

The master microcontroller is a Digilent Cerebot II board. This board has
ATMega64 AVR processor, 128 Kbytes SRAM, 64Kbyte program flash memory,
2Kbyte EEPROM. This board is small and uses relatively low power. The
Digilent Cerebot microcontroller has flexible power input allowing it to be
connected to either wall power for programming or battery packs for use inside
the vehicle. This board has a RS232 peripheral board plug which allowed the
group to easily interface with the sensors. The ultrasonic obstacle detection
sensors interface using an RS232 serial connection. The software decodes the
serial communication from the ultrasonic obstacle detection sensors and
decodes it to be used with the algorithms for obstacle avoidance and speed
monitoring.

--This information Given by Digilent Website.

                                                                                   18
The ultrasonic sensors operate at 42KHz frequency. The ultrasonic sensor
requires an input voltage between 2.5 to 5.5 volts with only 2mA supply current.
They have a 20Hz-reading rate and have a RS232 serial interface operating at
9600bps. The ultrasonic sensors also offer an analog output of 10mV per inch or
a PVM output of 147uS per inch. The modules are very small allowing them to
be directly mounted to the front of the vehicle. The ultrasonic sensors transmit
the distance data over the serial port via ASCII characters. It transmits an ASCII
capital „R‟ followed by three ASCII numbers representing the distance of the
obstacle from the sensor in inches up to a maximum of 255 inches or 21.25 feet.
The ultrasonic sensor automatically performs a calibration cycle every time it is
powered up. It is necessary to keep objects at least seven inches away from the
sensor for good sensitivity. Best sensitivity is obtained of the object is kept up to
fourteen inches away during the ultrasonic calibration cycle. The ultrasonic
sensors are sensitive to temperature, humidity, or applied voltage changes
during their operation. If the temperature increases drastically during the
ultrasonic operation it could cause the sensor to have false up close readings. If
the temperature decreases drastically the ultrasonic sensor is more likely to
decreased close range sensitivity. This means that the sensor isn‟t able to
accurately detect obstacles that the vehicle may encounter during its operation.
Since the vehicle may be taken outside and either run or allowed to sit for hours
then be forced to return after sunset. The sun setting can cause changes in
humidity and temperature that could affect the Tailgate Buddy‟s ability to
navigate around objects. A couple solutions to this problem existed. One
solution was to force a sensor recalibration every time the Tailgate Buddy is
turned on. Another solution was to place a recalibrate button right on the
Tailgate Buddy making it easy to recalibrate the sensors. The third solution to the
problem was to detect for obstacles after its been in an idle state for a long
period of time and if no obstacles are present call to automatically recalibrate the
sensors.

-- This information taken from maxbotics.com & sparkfun.com

The ultrasonic sensors are offered with five different beam width sizes. Beam
width size EZ0 has a long but wide beam of detection, beam width EZ1 has a
shorter but relatively narrower beam of detection, beam width EZ2 is the same
length of EZ1 but is even narrower, beam width EZ3 is about one half foot
narrower beam than EZ2, and beam width EZ4 is relatively smaller than EZ3.
The beam widths are represented in Figure 2 Detection Patterns. Each block on
the picture represents one foot. The sensors field of view is not actually in a
cone shape but more so in the shape of an eye drop as represented in the figure
below. Using the dimensions of each block in the picture below it can be seen



                                                                                  19
how the different rod sizes and beam widths will affect the ability to see objects
side to side and distance past the front of the vehicle.




                       Figure 2 Detection Patterns
                 [Permission to reprint from www.sparkfun.com]

The sensors have to cover a semicircular pattern in order to protect the area in
the front of the vehicle from collisions. The two sensors on the sides have to
have more of a shorter wider array in order to detect objects near the vehicle that
may be hit. A one-quarter inch diameter dowel set on EZ0 should be able to
detect objects that are in immediate danger of being hit. The sensor facing
forward should be set with a one-inch diameter dowel set on EZ0 to allow the
sensor to see only the target. The two side sensors are positioned to protect
both the corners of the vehicle allowing it to turn to miss a target. The sensor on

                                                                                20
the front of the vehicle is primarily to detect the target and determine the speed
the robot should be traveling. This sensor will also help to prevent the vehicle
from running directly into an object.




                  Figure 3 Receiver Detection Patterns
The vehicle length became an issue with this system, as the two sides are not
protected by the forward-looking obstacle avoidance system. To take care of the
body of the vehicle and to ensure it doesn‟t turn into an obstacle the obstacle
avoidance system has to calculate the distance of the target by where the target
is in comparison with the vehicle. Using this information the obstacle avoidance
system has to calculate the distance the vehicle will be required to travel in order
to clear the target before it can be allowed to make a turn in that direction. This
system helps to reduce the amount of hardware the need and reduce the overall
unit price of the Tailgate Buddy.

Overall the system hardware consists of three ultrasonic sensors. One ultrasonic
sensor looks forward and two look at forty-five degree angles off to the sides in
the forward direction. This system also required use of the main microcontroller
board to interpret the serial communications from the ultrasonic sensors and

                                                                                 21
determine what maneuvers it may need to make in order to avoid a collision. It
also has to determine the overall speed and acceleration of the Tailgate Buddy.


GPS
The foremost component looked at for the GPS unit was the GPS receiver
module. There were three possible candidates for this component in the GPS
unit, and each shall now be discussed.

The first GPS receiver module considered for the project was the CW20 from
NavSync. This device measures 21 mm x 16.4 mm x 2.4 mm. The module has
an operating temperature from -30°C to 65°C. The maximum power drawn by the
CW20 is 69 mW. The module outputs standard NMEA 0183 protocol data. The
input voltage required is 4.5 V to 6.5 V. The reacquisition time for the module is
less than three seconds. The CW20 module costs $197.81.

The second GPS receiver module considered for the project was the EM-411
from GlobalSat. This device measures 30 mm x 30 mm x 10.5 mm. The module
has an operating temperature from -40°C to 85°C. The maximum power drawn
by the EM-411 is 60 mW. The module outputs standard NMEA 0183 protocol
data. The input voltage required is 4.5 V to 6.5 V. The reacquisition time for the
module is 0.1 seconds. The EM-411 module costs $66.06. The EM-411 is
superior to the CW20 foremost because it is nearly $130 cheaper, and can
reacquire satellites 30% faster. The only disadvantage of using the EM-411 is
that it is approximately 8 mm thicker than the CW 20, which could make
mounting the entire GPS unit in the vehicle in a small place more difficult, as the
circuit would have less clearance.

The third GPS receiver module considered for the project was the WD-G-ZX4120
from Crownhill. This device measures 25.9 mm x 25.9 mm x 2.7 mm. The
module has an operating temperature from -40°C to 80°C. The maximum power
drawn by the WD-G-ZX4120 is 99 mW. The module outputs standard NMEA
0183 protocol data. The input voltage required is 3.3 V. The reacquisition time for
the module is 0.1 seconds. The WD-G-ZX4120 module costs $44.90. The WD-G-
ZX4120 is superior to the EM-411 because it is nearly $20 cheaper, and still
maintains most of the advantages over the first GPS receiver module considered,
the CW20. The only disadvantage to the WD-G-ZX4120 from the EM-411 is that
the WD-G-ZX4120 uses 99 mW of power, versus the EM-411‟s 69 mW of power.
However, this is not a significant disadvantage. The WD-G-ZX4120 will be the
unit used in the Tailgate Buddy‟s GPS unit. The WD-G-ZX4120 is pictured below.




                                                                                22
                  Figure 4 WD-G-ZX4120 GPS Module
The next most important component in the Tailgate Buddy‟s GPS unit is the
microcontroller used to parse the data received from the GPS receiver module,
which will also output to the SD card.

The first microcontroller considered was the Microchip PIC16F877. This
microcontroller contains 14 KB of programmable flash memory. This model PIC
also contains 368 bytes of EEPROM. The PIC16F877 runs at a speed of 5 MIPS.
The operating temperature of the device is -40°C to 85°C. The PIC requires an
input voltage of 2 V to 5.5 V. The PIC16F877 contains 40 pins. The cost of the
unit is $7.11.

The second microcontroller considered for the Tailgate Buddy‟s GPS unit was
the PIC16F690. This microcontroller contains 7 KB of programmable flash
memory. This model PIC also contains 256 bytes of EEPROM. The PIC16F690
runs at a speed of 5 MIPS. The operating temperature of the device is -40°C to
125°C. The PIC requires an input voltage of 2 V to 5.5 V. The PIC16F690
contains 20 pins. The cost of the unit is $1.95. The only numerical advantages of
the PIC16F690 over the PIC16F877 are operating temperature and price. The
PIC16F690 can withstand temperatures 40°C warmer than the PIC16F877,
although the Tailgate Buddy is not designed to operate in temperatures this high,
anyway. Even though the PIC16F690 is a “step down” from the PIC16F877, the
690 model should be sufficient for this project‟s purposes.

The third microcontroller considered was the Microchip PIC16F819. This
microcontroller contains 3.5 KB of programmable flash memory. This model PIC
also contains 256 bytes of EEPROM. The PIC16F819 runs at a speed of 5 MIPS.
The operating temperature of the device is -40°C to 125°C. The PIC requires an
input voltage of 2 V to 5.5 V. The PIC16F877 contains 18 pins. The cost of the
unit is $2.52. This model PIC is nearly the same as the PIC16F690. One major
difference is that the PIC16F819 contains half of the programmable flash

                                                                              23
memory of the PIC16F690. The other major difference between the two models
of microcontrollers is that the PIC16F819 (shown in Figure 5 Microchip
PIC16F819 Microcontroller) contains two fewer pins than the PIC16F690. The
PIC16F819 costs $1 more than the PIC16F690, but this is not significant. Even
though the PIC16F819 contains half the memory of the PIC16F819, this should
be suitable for the purposes of the GPS unit in the Tailgate Buddy.




            Figure 5 Microchip PIC16F819 Microcontroller

Motor/Drivetrain
The motors are the muscle of the vehicle. There are many choices and things to
consider when selecting a motor. The first thing to consider is what will power the
motor. Today there are two common power types that could be used in the
Tailgate Buddy; combustion or electric. Either could feasibly be implemented but
both have strengths and weaknesses to consider.

A combustion engine would likely run on gas, mixed gas, propane, or possibly
nitro-methanol. One thing to consider is if the motor will be a two-cycle or four
cycle engine. This is usually a determining factor for fuel type. A two-cycle
usually runs on gas mixed with some oil for lubrication. So gasoline mixed with
motor oil or even something as wild as a nitro-methanol blend is usually used. A
four-cycle could run on gasoline, diesel, propane, etc. They typically have a
separate oiling system that is separated from the combustion chamber so they
usually have cleaner emissions than oil burning two-cycles. Whatever the fuel
type, combustion engines, for size to power ratio, are usually quite good.
Although they require fuel to run on and must be refueled periodically, this would
cut down on batteries and minimize recharging time as the batteries would only
have to power the electronics. The drivetrain would have to have been fitted with
a centrifugal clutch to allow the motor to continue to idle and run when the

                                                                                24
vehicle is stationary. When the engine is revved up to a certain speed, the clutch
engages and the vehicle would move forward. The disadvantage here is there is
that it is a wearable part that would need to be replaced from time to time
depending on distance traveled and the weight of the load that is carried.

Having a gas engine has a certain “cool factor.” Tailgating is all about having fun
and gas engines have an exciting aspect. They can be loud, powerful, and
amusing to see. Having a vehicle following you around carrying a cooler full of
drinks and other tailgating items, while displaying the raw power of a gas engine,
makes other tailgaters turn and take notice. This could add to the excitement of
tailgating and make for more fun. Another advantage to a combustion engine
would be extended run-time. The fuel tank could be large enough to supply a full
day of tailgating without the need for refueling. However, to accomplish this, the
engine may have to be shut down to save fuel when the robot is to be in a
stationary place for an extended period of time. Then when the user wants to
move to a new location, the engine would have to be restarted. This would
require the user to either pull start it, or an electric starter to be fitted to the
drivetrain. A pull starter can be rather annoying to use if the motor is having
trouble starting because it is flooded or cold. An electric starter is very easy to
use, but requires extra weight and usually a lot of battery power to crank an
engine.

There are also a few more complications with a combustion engine. Although the
centrifugal clutch automatically allows the vehicle to idle and still propel itself
forward when the engine revs up, and coast when the throttle is pulled back, it
doesn‟t help the vehicle stop. So a braking system would have to be added. This
creates a few issues on its own. A braking system would either have to be
adapted to the vehicle or built from scratch. This could have been costly and time
consuming. Time is something to be valued when trying to build a vehicle like this
in only one semester. This project was supposed to deal mostly with electrical
and computer engineering. In this case creating a braking system is a job better
left to mechanical engineers. Another problem was that braking sensitivity is a
difficult thing to program into the microcontroller. Not only do you have to
program in throttle sensitivity to tell the vehicle how hard to accelerate, you also
have to tell it how hard to brake. This is difficult as there are many factors that will
affect this; most importantly is the weight of the load to be carried, temperature of
the brakes, the slope of the terrain, and the conditions of the terrain itself. It is
harder to accelerate on rough terrain, up slopes, and with a heavy load. It is
harder to brake on down slopes and with heavy loads. So this posed potential
problems as one would not want the vehicle to be running into the user or other
obstacles, nor would it be desired to be applying the brakes all the time, burning
more fuel by loss of efficiency and wearing the brakes prematurely.




                                                                                     25
There is another major problem with a combustion engine. What to do when the
robot needs to reverse to move around an obstacle? It would need a reverse
gear. This complicates things as the drivetrain becomes even more complex and
expensive to build. This would be another part that would have taken too much
time given the goals of this project. Creating a drivetrain with a reverse gear is
another thing better left to mechanical engineers. The last key problem is that a
combustion motor would likely be restricted to outdoor use only, because of
carbon monoxide emissions. Propane would be a cleaner fuel with low carbon
monoxide emissions that can be ran in large indoor building if there is adequate
ventilation. A plus here would be that you could use the same bottle of propane
to power a grill when the vehicle is not in use. However it still limits where it can
be used and many tailgaters prefer charcoal anyway.

On the other end of the spectrum, an electric motor was another option. There
are different types of electric motors, but an easy way to categorize them would
be to split them between AC and DC. In this case a DC motor would be need as
the vehicle would be powered straight off battery power. DC motors can be
broken down into two categories, motors with brushes, and brushless motors.
Motors that use brushes to transfer current are typically cheaper and would allow
for the vehicle‟s cost to be lower. Because of this, a more powerful motor can be
selected also. Brushless motors are nice because you do not have to worry
about the brushes wearing down and having to be replaced. However they are
more expensive and in many cases are less powerful than a comparable motor
that uses brushes when comparing what can be purchased for the same price.
Electric motors are nice because they can be used indoors as they do not
produce any carbon monoxide or other harmful gasses. Most have the ability to
reverse direction by reversing polarity of the power source. They are easy to
control speed and can incorporate a built in braking function that in many cases
can be used as regenerative power to recharge the batteries a little. In this
application there is no need for a clutch or wearable brakes so there is less
maintenance. Not having all those parts saved quite a bit of money; not only for
initial building and designing, but also for cost to maintain the vehicle in the
future.

Many endeavors require purpose built items to accomplish an end result or task.
It is possible to design and build an entirely custom motor and drive assembly.
To do this, electric motors could have been mounted to the chassis and
sprockets or gears would have been fitted to them and the axles. If sprockets
were used, chains or a belt drive could have effectively transferred the power
from the motors to the wheels. Belt drives are very forgiving with alignment of the
sprockets, however chains are usually better as they don‟t stretch as much or
have a tendency to slip. The downside here was that with all of this there was an
increased chance of failure points. Usually every new design has to be tested
and modified many times over before being considered to be acceptable. If this

                                                                                  26
approach was used, the time taken to complete this process could have eaten
into build time for other systems. If the drivetrain fails, a tracking system is of no
use to an end user. For this application a premade vehicle or kit vehicle was the
best option, even if it was only to gather main parts from.

There are a few places that motors and drive components could have been
scavenged from, or an entire drivetrain could have been designed and built from
parts. One option was an electric wheelchair. These are quite powerful and run
for very long periods of time. They are more than capable of carrying the load
selected for this vehicle and can run for miles. They would have easily been able
to accomplish a full days worth of tailgating activity and walking around. However
they are quite expensive and were a little overkill for this application. Electric
scooters were another option for scavenging. Many can push a full grown adult
around for hours at a time before needing the battery to be recharged. They are
cheaper but are usually only one wheel drive. The Tailgate Buddy was to have
two drive wheels on an axle for better traction. So either the drive wheel of the
scooter would have to have been replaced with an axle with two wheels, or two
scooter drive systems would have to have been used. This adds work and cost to
the build. A third option was to buy from a robotic parts dealing website that sells
complete drive assemblies and even complete chassis kits that include
everything one would need to build a running vehicle. These kits range in price
from a few hundred to a few thousand dollars. They were designs that have been
proven to be very reliable but the cost of the kits would have put a huge dent in
the budget for this project. This application calls for a fairly large vehicle and
most of the robotic vehicle kits are pretty small. Also the larger they get, the more
expensive they are.

A fourth option was to modify the drivetrain of a children‟s electric car. Power
Wheels is a common brand of these, and make many 12 volt cars that have
enough power to carry the intended load. The small batteries that they come with
provide a few hours for kids to drive them around, but if outfitted with a larger
battery like a deep cycle marine battery they could be able to run for more than
enough time for tailgating and have more than enough power to stand up to the
terrain it is required to drive on. Many of these electric cars have two drive
wheels in the rear. Each of these drive wheels has a motor and a gearbox
connected to it. Although not connected by a shared axle, both wheels are
powered and together should give enough traction for grassy and sloped
surfaces. The wheels are made of plastic but are quite durable. They also are an
appropriate size for this application. They are large enough to easily cross over
small transition points and obstacles yet were designed to not exceed the power
limitations of the motors and gearboxes. This seemed like a viable option
because rather than just parts scavenging the entire vehicle can be modified and
used to carry tailgating supplies. Also it was quicker than trying to build an entire
drive system from parts. They are relatively cheap also, at only around $200 for a

                                                                                   27
basic 12 volt vehicle that can run 5 mph without modification. Adding a second
set of batteries in parallel or changing to different batteries all together, could
have extend run time to more than a user could ever need from it for a single day
of tailgating. It was decided that one of these vehicles was the best choice for
this application.


Power Supply
The batteries are the main components of the power supply. Both the vehicle and
the tracking device needed batteries. The tracking device had a few options for
batteries. Since they needed to be small enough to fit in a small device but also
have enough power to last for a full day, small rechargeable battery packs, or
replaceable AAA batteries could have been used. The vehicles batteries are
where it got a little more complex. Since a children‟s electric car was to be used,
it came with a 12 volt battery. However even though these batteries are quite
powerful, depending on distance traveled in a given day of tailgating by the user,
one of these batteries may have not been of enough capacity for a full days use.
Since different users may habitually walk different distances, limiting the vehicle
to just one of these smaller batteries may have not been quite enough.

Using lithium-ion (Li-ion) batteries had an advantage of being small in size while
still having a large storage capacity and power output. However they are much
more expensive than typical lead acid, nickel-metal hydride (Ni-MH), or nickel
cadmium (NiCd) batteries. Also they aren‟t very safe. They need to be recharged
at specific rates, and do not respond well to quick instances of minor short
circuits that sometimes occur from accidental misuse or poor design. Misuse
could easily result in fires and sometimes even small explosions. Although the
NiCd and Ni-MH batteries do not store as much energy as a lithium-ion battery
for a given size and weight, they still are still of a lower weight than lead acid
however they are still much more expensive. The children‟s electric cars use
sealed lead acid batteries. Although they do not have the storage capacity of
other three types of batteries, they are cheaper, safer and more resilient than the
other types.

The microcontrollers, the electronic speed controller, and the rest of the
electronics will require batteries as well. They could have ran off the same
battery system as the motors but with the motors turning on and off quite often
and with a gradual decline in available voltage that comes with the motors
draining the batteries as the day goes by, the sensitive electronics may have not
been able to have a steady input voltage. The best solution for this seems to be
to give the electronics a separate smaller power supply. A small rechargeable 6
volt battery pack can provide plenty of power to run the electronics for days. The
other advantage here was that as the vehicles motor battery supply wears down

                                                                                28
the vehicle won‟t run out of control because of low power to the electronics
controlling the vehicle.


Radio Control
The manual control feature of the vehicle requires the use of a transmitter (Tx)
and a receiver (Rx). The Tx and Rx have multiple channels for operation. The
minimum required is two. One channel is for forward and reverse operation, and
a second is for steering. Two channel radios are very common. Four channel
radios are also very common for RC model airplanes and helicopters. A less
common style is the three channel radio like the Traxxas TQ3 shown in Figure 6
Photo of Traxxas TQ3 AM Radio. The third channel is usually just a simple on-
off switch but sometimes it is a proportional slide switch. These are usually used
on nitro RC cars and trucks that have a reverse gear. The switch is used to put
the vehicle‟s gearbox into reverse. However any of these styles can be used for a
number of things. In the case of the Tailgate Buddy, it would be a fun feature to
use the third channel of a 3 channel radio to manually fire off the water gun to get
people out of the way or just have fun spraying people. A popular company in the
RC hobby is Traxxas. They make a three channel radio called the TQ3. It has a
toggle switch located on the grip where the user‟s thumb is normally positioned. It
can be seen in the photograph below as the red lever on the grip.




               Figure 6 Photo of Traxxas TQ3 AM Radio

                                                                                 29
A three channel radio is a nice piece of equipment for this application. Usually
using one adds a bit of cost and extra time to the project. However the TQ3 is
one of the more inexpensive models out there at $30 for the radio and receiver,
and didn‟t have a significant impact on the budget. If the group had wanted to
save more money, there was one particular style of two channel radios that
would have been very easy to implement into the vehicle and would have also
saved a significant amount of money. This is because the receiver is so simple, it
has no proportional control. There are two outputs on the receiver. Each will only
put out a full positive or negative 9 volts when used or 0 volts when at rest. There
is no in between output, they are either outputting or they are off. This could have
been helpful when wiring the vehicle for manual control. Instead of the vehicle
having a range of speeds that it can travel, it could have operated on either low
or high speed like the Power Wheels jeep does in factory form. There really was
no need for a variable speed unless the vehicle is following a target for
autonomous mode. When manually driving the vehicle to another location, going
at a speed of about 5 mph the whole time would have been perfectly acceptable.
The real advantage though was cost. This style radio and receiver could have
been pulled from a toy RC car and modified for this application for about $20.
However this design called for the use of simple toggle switches and 12 volt
automotive relays, power sent to the motors can be switched on and off. The
main disadvantage with using a two-channel radio system like this was that there
is no manual firing option for the water gun. Also since a variable electronic
speed controller was needed anyway for the autonomous mode, the added cost
of the switches and relays to the $20 RC system wouldn‟t save any money as
they would only benefit the RC mode. In the end the group went for the $30 TQ3
and interfaced it with the electronic speed controller that is also used for
autonomous mode.


Master Microcontroller
The master microcontroller is a Digilent Cerebot II. This board was used due to
its small size, processor and storage capacity, and its expandability. The board
has available add-ons that contain serial connectors, an infrared detector, and a
SD card reader which made the system easier to build, allowing the
programming of the Tailgate Buddy via software. The Digilent Cerebot II does
not require a special programmer as this board can be programmed from a PC
using either an optional parallel communications cable or an optional USB
communications cable. Digilent provides their programming software free from
their                                 website                                  at
http://digilent.us/Software/Adept.cfm?Nav1=Software&Nav2=Adept.               The
programming language used to program the Digilent Cerebot boards is C. By
doing this the Digilent Cerebot board was easier to program. This board allows
itself to be programmed in C, giving it several advantages over other boards.

                                                                                 30
One advantage was that it uses a common programming language and the only
software that will be required to program the board is free software available on
Digilent‟s website. While the software is free, it was necessary to buy a
programming cable for the board. Since all of the Tailgate Buddy‟s functionality
was to be performed through this one board, the programming of the board was
more complicated as it manages system resources efficiently so that each
primary system on the Tailgate Buddy receives the amount of clock cycles it
needs in order to perform its task in an efficient and complete manner.

The Tailgate Buddy required multiple add-ons for the different systems. The
obstacle avoidance system required a PIC16F690 chip programmed to accept
the PWM signal from the ultrasonic sensors and return the distance measured by
each sensor back to the main microcontroller. The tracking system required a
Atmega168 programmed to accept in the PWM signal from the infrared sensors
and output back to the main microcontroller which direction the vehicle would
should turn to keep up with its target. The drive system required several servo
motors and a motor controller to control the throttle and the steering of the
vehicle. These systems plugged directly into the main microcontroller and
utilized the onboard servo plugs. To control the main servo plugs I am utilizing
bit banging and individually toggling the signal lines to each of the servos.

The master microcontroller manages all of the subsystems for the Tailgate
Buddy. It makes decisions on what the vehicle should do depending on the
information given back by each of the subsystems. It‟s necessary for the master
microcontroller to manage the subsystems because each of the subsystems
requires a different priority. For instance, if the obstacle avoidance system
detects an obstacle it has to take priority until the Tailgate Buddy has moved past
the obstacle and is again in the clear, then the tracking system can again have
control of the track of the vehicle. While it‟s important that the tracking system
can maintain visual contact on its target, it‟s more important that the robot not run
down any pedestrians or run into any obstacles in the process. This is why it‟s
important for the master microcontroller to determine the priority of each
subsystem and run commands accordingly.


Software
This section describes all external software related to the Tailgate Buddy. There
is a console application written in C programming language to parse GPS data.
The GPS unit in the Tailgate Buddy records GPS data throughout the course of
the vehicle's use. The GPS unit stores the raw GPS data to an SD memory card.
The memory card is removable, and interfaces with the user's PC. Once the
user's PC is able to read the SD memory card, the user activates the C program
that parses the GPS data in a manner that is then indirectly uploaded to Google

                                                                                  31
Maps. The website http://www.gpsvisualizer.com allows the user to upload a
comma-delimited file. This website will allow the user to select a mapping service
(either Google Maps or Google Earth) he or she would like to use to view the
Tailgate Buddy's GPS data from its most recent use. The user is also allowed to
select multiple output files, such as JPEG, PNG, and SVG files, an elevation
profile, a GPX file, or a plain text spreadsheet. This website can also read from a
variety of input files, but the only concern for the Tailgate Buddy‟s GPS
capabilities is the comma-delineated file, as created by the C program.


Electronic Speed Controller
There were many choices available when selecting an electronic speed controller
for the vehicle. The main points to consider were how much current the speed
control can output, whether to use one for each motor or use only one that can
control two or more motors, and finally what kind of added features it had. This
robot is a rather heavy vehicle. It was designed to carry a payload of 100 lbs, and
the vehicle weight was estimated at about 30-40 lbs dry weight. The fully loaded
vehicle required quite a bit of current to move this kind of weight when operating
on a 12 volt system. To facilitate this need, a powerful speed controller was
needed. For this project, the motors did no need to be controlled independently
to steer the vehicle. There are many speed controls that are designed to control
two motors: they can slow the speed of one motor while increasing the speed of
the other to turn the vehicle, however this was not needed for this project.
Features were important in the selection process also. Many features were
obvious requirements. For example this vehicle required a reverse function and
many controllers only have forward operation available so those would not have
worked for this application. However, some controllers had other features may
not be required but they could have made certain tasks easier. Some had add-
ons, like built in connections for RC controlling that make the function nearly
plug-and-play. Other features are luxury items. For example, many that were
considered had a regenerative braking function that recharges the batteries a
little when reverse is selected on the controller when the vehicle is moving
forward it enters a braking mode. This uses the motors as brakes, slows the
vehicle to a stop while restoring power and then allows the vehicle to reverse
direction.

Many retailers and websites specialize in robotics and were key places to look at
when shopping for a speed controller. One such place is The Robot MarketPlace
[www.robotmarketplace.com]. They have many different brands and models of
controllers and accessories to choose from. The first four manufacturers on their
list are IFI Robotics, Vantec, 4QD, and RoboWars. They make a variety of very
powerful controllers however they are all setup to only have RC inputs and
cannot easily function off outputs of a microcontroller. The manufacturer Robot-

                                                                                32
Power has a model out called the “Sidewinder.” It is a very powerful controller
that can put out 80 amps of continuous power for each motor. It also can put out
150 amps at peak power for 5 seconds for each motor. It only weighs 13 oz,
measures 108mm x 82mm x 28mm so it is quite compact. It has full reverse,
throttle mixing between motors for steering, and regenerative braking. It can
accept a serial input for control but was designed primarily for RC use. Also it is
set up to have an input of 14V to 48V supply voltage. That will only be useful if
the vehicle is configured to have the two 12 volt batteries wired in series. Finally
at $399.00, it is quite expensive considering the required work it would have
taken to get it to interface with a microcontroller.

RoboteQ is a company that makes several speed controllers that at first
appeared to be useable for this application. Almost all of them have been
designed to be used by either RC control or by a microcontroller. A few even
have the option of using wireless modems for two-way remote control. Two of the
more basic models are the ax1500 and the ax3500. Both are 2-channel motor
controllers. Their operating voltage range is from 12V to 40V DC. They have 2
channel RC inputs as well as an RS232 serial interface which operates at 9600
baud, and finally an analog interface that has two inputs that operate at 0-5V with
8-bit resolution. Both models have automatic current limit reduction. This kicks in
when heat sink temperature rises above 175° F. They both have a 5V, 100mA
supply output for powering radio equipment like an RC receiver. That is useful
because a separate small battery pack would not have been required to power
the receiver as the controller can feed it regulated power of 6 volts off the 12 volt
batteries it is using.

The ax3500 is the higher end model that has a couple extra features, like eight
pulsed outputs for driving RC servos and optical encoder inputs. It has 0.25”
Faston male style terminals for connecting power wires, while the ax1500 uses a
terminal strip with a screw down connect that accepts an AWG 12 max sized
wire. In relation to the needs of this application, the main difference between the
two is the current output. The ax1500 is rated for a 20 amp continuous current
output to each motor and can output 30 amps if a larger heatsink is added to the
device. The ax3500 is rated for a 40 amp continuous output to each motor and
can output 60 amps if a larger heatsink is used. Both are very compact and
lightweight. The ax1500 is 4.2” x 4.2” x 1.5” and only weighs 3 oz. The ax3500 is
understandably a little larger and heavier at 106 4.2” x 6.75” x 1.2” and 7.5 oz,
but it is still very small. This vehicle is large enough to house either controller
either under the hood or under the original seating area and still had enough
room to allow for adequate ventilation. Either controller could have been a
promising device to use, however since cost is a determining factor when
selecting one, it is important to consider what is really needed for this application.
The ax1500 is rated for a lower current output and costs $275.00, while the
ax3500 can put out double the current but boasts a hefty price tag of $395.00.

                                                                                   33
This vehicle at maximum weight should never continuously pull more than 20
amps of current for each motor. There may be times when the vehicle is asked to
start up a slope, and the maximum current output may surge beyond even the 30
amp mark, but it is only be for a brief period, and the controller is rated to handle
those cases.

In the end, cost was the determining factor. A project of this magnitude carries a
hefty price tag so saving money anywhere possible was a goal. Finally towards
the end of the design phase, the group stumbled on to a small company named
Diverse Electronics Services who are dedicated to manufacturing affordable
motor controllers for robotic and machine use. The company manufactures a few
different styles of heavy duty motor controllers and even their lightest duty
controller, the MC7, more than met the needs of this robot. It is a speed controller
with reverse function. It does not have the capability for independent motor
control but this project did not require both drive motors to be operated
independently to help control steering so it did not prove to be a problem. This
controller is capable of 35 amps continuous output and an input voltage of 11 to
36 volts. It measures about 3.75” by 4.5” by 1.5” in size. The final deciding factor
was that the controller was priced at only $95. The board has an option of an
add-on module called the RCIC-1 which allows the board to be interfaced directly
into an RC receiver. The add-on board was only another $30 and was money
well spent as it simply plugged right into the RC portion of the project. At a total
of $125, the cost of the MC7 and RCIC-1 combination was still less than half the
cost of the ax 1500.




   Figure 7 Diverse Electronics Services MC7 motor controller


                                                                                  34
Chassis
The chassis in the robot needed to be able to perform across a wide variety of
specifications. First, it needed to be able to fit into the back of an SUV or van
and, this already ruled out many platforms that were available to be used for the
robot. It needed to be able to carry 100lbs of weight. The chassis must carry the
payload over a wide variety of terrain including hills, grass, roads, and sidewalks.
This meant it must have at least a few inches of ground clearance and good,
stable tires with adequate grip. The vehicle also needed to be rugged enough to
withstand a little water and the outdoors.

Due to the size and payload, a chassis was needed that could stand up to the
needs of the Tailgate Buddy. Most hobby shops and robot stores on the Internet
do not sell any chassis nearly as big and strong as what was needed for the
payload and rugged use. So then, the search switched from normal stores that
sell robot parts to ones that sell machines to the public. The group spent a lot of
time deciding between buying a wagon from Lowe‟s, or buying a Power Wheels
vehicle from Wal-Mart, and retrofitting it to work for the project. Both chassis
would have met the specifications easily. Size-wise, they would have been able
to hold the cooler and weight. The wagon from Lowe‟s is rated to hold between
500 and 600 lbs. The Power Wheel‟s vehicle is rated to hold a maximum of
130lbs, so they both satisfied the weight requirements that are necessary to
support the cooler. As far as size goes, they will both fit into the back of an SUV,
van or pick-up. So the physical size requirement was accomplished with either
choice. The wagon has at a minimum of 5 inches of ground clearance and is
designed to be used outdoors so its platform would have been stable and able to
withstand any wet conditions that might occur during the operation of the vehicle.
The Power Wheels vehicle was an off-road model so it also had the ground
clearance and stability for the application. However, it needed to be protected
against water since the electronics are not fully shielded. So there had to be
some preventative measures taken to ensure that no water would get on any
critical components, i.e., batteries, motors, wiring etc. A positive aspect with the
Power Wheels chassis is that it came with batteries, motors and everything it
needed to drive around. All that was needed was to interface it with the control
systems and to devise a steering system. The wagon would have needed a lot
of work to add on an electric motor, drivetrain, batteries, and a powered steering
system.

The easiest way to power the vehicle is to get one that is already powered, and
modify it from there. The main downfall with a lot of vehicles currently out there
is that they are built for kids to ride in and not for hauling things around. This
creates two problems: first is that the chassis needed to be modified to
accommodate carrying the payload would be used (a cooler); the second

                                                                                 35
problem was how to steer it. These vehicles use a steering wheel for control of
the vehicle direction. This system is difficult to convert to a powered system that
can be controlled electronically on a minimal budget.

To convert this steering into a powered version required a lot of mechanical
design. One of the first ideas was to just remove the steering from the front
wheels and allow them to freely turn and then use the two separate motors to
power the rear wheels. It would have been relativity simple to turn the vehicle
using just differential power to the rear wheels. There were many motor
controllers that were considered which already had this feature built in and would
accomplish it with minimal effort. The problem in using this is that just removing
the wheels from the steering causes them to not perform correctly. It can be
likened to a car that has the tie rods broken. The wheels either both point
outwards or inwards. This happens because the point of rotation for the wheel is
inside the vehicle away from the center of mass of the wheel. This causes the
wheels to point in a set direction against the direction of travel. This would make
moving the vehicle very difficult as the wheels would act as brakes to the vehicle.
So, on a vehicle with a central steering system the group would need to change it
so that the wheels would be free spinning and also have the point of rotation
above the wheel itself( i.e. above the center of mass of the wheel). See Figure 8
Broken Tie Rods for an example of what happens when the steering rods are
broken and the wheel‟s center for rotation is not above the center of mass of the
wheel.




                         Figure 8 Broken Tie Rods



                                                                                36
Instead, it was decided that a large servo or linear actuator could be fitted to the
existing steering linkage and steer the vehicle when powered.

The chassis also needed to have adequate room to mount all the subsystems
that were being used in the robot. The location for attaching these devices
needed to be protected from the terrain and also from the weather conditions.
So having a vehicle that is just a flat platform with wheels attached is not
desirable from the standpoint of mounting the equipment to the chassis. The
Power Wheels chassis that was decided upon to be used has spaces that are
protected from the terrain and from most weather conditions that the vehicle
might encounter. The electric motors are already in the chassis, as are the
batteries. This saved a lot of mechanical work to get these devices mounted
correctly and safely. There are areas that the rest of the electronics can be
mounted in the chassis. In the battery compartment there is space to place most
all of the electronics. This helped out immensly to simplify the mechanical
designing that would have been needed to properly install the electronics and to
make sure they were unaffected by the enviroment the vehicle is in.


Water Gun
There were a few choices for what to use for a water gun, and also for how to
power it. One option was a pneumatic style water gun. In this configuration,
pressurized air, in a chamber, pushes water through a nozzle and sprays it out in
a stream. This is a common configuration for squirt guns and other sprays like
aerosol sprays and spray paint cans. It has the ability to spray a large quantity of
water at great distances. However it would have required an air tank to be
pressurized using either a small on board compressor or to manually pressurize
it by hand in advance. This could have posed a problem if there wasn‟t enough
air stored in the tank or if using an onboard compressor. It would have had to be
big enough to keep up with demand. Another option was to use a small electric
pump and spray nozzle. In this configuration the electric pump forces water
through the spray nozzle. This also can spray water at great distances but is
limited only by the size and power of the pump and size of the nozzle. There was
no need to soak anyone from head to toe, but there needed to be enough water
spray to get people to take notice and possibly get out of the path of the vehicle.
Using a pump, reservoir, and nozzle from an automotive windshield washing
system was a perfect choice for this application. The parts were cheap, easy to
modify, and readily available. The pumps are also built to run on 12 volts, so with
the use of a servo moving a toggle switch that is controlled by the microcontroller
or the receiver from the manual control system, power can be sent directly from
the powerful 12 volt batteries, used for driving the motors, to the washer pump.
The pump is small but powerful. Most cars have two separate sprayers, each
with two spray streams. If only one sprayer was used, the distance of the two

                                                                                 37
remaining streams could have been greater. The output of one is more than
adequate for this application however two were used to get a greater coverage
area.

Along with a water gun there was also a possibility of using a small horn to help
get people out of the way. This could have easily be implemented into the design
if it was to be activated whenever the water gun was to be fired. Since the water
gun is of a 12 volt design, and automotive car horns are also 12 volts, running
them off the same power system was possible if the power system can output
enough current to operate both simultaneously without losing performance from
the water gun. The downside to using a horn is in cases of many obstacles or
people, the sound could become a nuisance. Because of this and lack of time, it
was decided among the group that a horn would not be used for this project.




                                                                              38
Design
The research process helped determine specific parts to use for the application.
With that information, the design process was started. Each subsystem had to be
designed to work with all the other systems. This section explains in detail the
designing of each subsystem as well as the completed vehicle‟s design.


Design Summary
The Tailgate Buddy‟s motors, 12 volt battery, and chassis came from a Fisher
Price Power Wheels toy vehicle. The reason for this was because the vehicle
included a battery, a drivetrain, a chassis, independent motors, and an adequate
steering system which were all already integrated. Some of the superfluous
components of the Power Wheels vehicle were removed, such as the seats, to
make room for the payload. The Tailgate Buddy has two main separate
microcontrollers as well as many slave microcontroller. One main microcontroller
is to control the functions of the GPS module. The GPS module tracks GPS
satellites and records GPS data to a Secure Digital (SD) card for later analysis.
There is a user interface that allows the user to upload their data to and see the
route displayed.     This ties into existing online mapping software on Open
StreetMap. The second main microcontroller (the “master microcontroller”) is
responsible for handling any other input and output, such as from the sensors.
Input to the RC remote control comes directly from the user to the servos and
motor controller to manually move the Tailgate Buddy and skips the master
microcontroller. There are two kinds of sensors used. Ultrasonic sensors are
used to detect obstacles so the Tailgate Buddy can avoid them using obstacle
avoidance algorithms. The microcontroller utilizes obstacle avoidance algorithms
to continue following the user without colliding with the foreign object. Infrared
(IR) receivers are used to track the IR transponder carried by the user. There
are also two water nozzles mounted on the tops of the vehicle fenders to shoot
water when the sensors detect an object between the transponder the user is
carrying and the vehicle.




                                                                               39
    A
                                              E
    B



    A       C                             D
    B
                                              E
    A




                       Front of Vehicle




Figure 9 Approximate Location of Subsystems

            Table Of Locations Of
                Subsystems
        A          Ultrasonic sensor
        B            IR Detectors
        C           Microcontroller

        D         GPS and Batteries

        E           Electric Motors

            Table 2 Subsystem Legend




                                                  40
Block Diagrams
The three block diagrams, shown below, visually depict the basic layout of the
main systems and subsystems of the project. All the inputs to the system and all
the outputs that the entire system requires to function correctly are identified
there. There are a small number of inputs and outputs the system as a whole.
This is seemingly deceptive making it appear as though the inputs and outputs
are easy to quantify and most of them are. Having all one input and all one
output is very easy to quantify and pretty simple to accomplish. It is the IR
transponder on the input side that was the hardest to get working properly, and
on the output side it is the driving around that required a lot of work to get it to
function properly.




              Figure 10 Inputs – Outputs Block Diagram
The block diagram entitled Microcontroller shows a basic overview of all the
major and minor subsystems that are in the project. It also shows what group
member was responsible for the design and testing of a certain subsystem. That
is not to say that because one person was not in charge of a system that they


                                                                                 41
didn‟t help the other member out. This encouraged team members to work
together to solve the problems that were encountered. The more people that are
brainstorming on a problem, the better the potential solution can turn out to be.
The software block diagram shows a rough idea of what software needed to be
written for. This software needed to perform the goals that had been specified
previously. The most important piece of the software block is driving. If this piece
of software did not work correctly then no other features of the robot would work.
It is by far the most important piece of software that was written for the project.




               Figure 11 Microcontroller Block Diagram




                   Figure 12 Software Block Diagram

Subsystems
Most of all of the subsystems were designed separately with a lot of
communication going on between the members of the group to ensure capability
with the subsystems. Each group member had a few subsystems that they were

                                                                                 42
in charge of designing and testing. Whoever was in charge of a particular
subsystem was responsible for communicating to the other group member‟s
important information about their system and how it interacts with another‟s
systems. For example, if someone was in charge of the motor controller they
would need to tell the person in charge of the microcontroller what
communication protocol this system needs and how it needs to be turned on and
used properly. Most components used the subsystem design method because
the project was varied enough to give each member enough to work on
separately so everyone could be in charge of a different aspect of the project.
This also let each member be accountable for some part of the project and made
sure that the work load was evenly spread across the group members. There
were also some areas where every group member was involved in the design.
The microcontroller is one of those areas because it is vital to all the subsystems
that were designed to interface with the microcontroller correctly. So every group
member was responsible for the microcontroller to help reduce the chance of
subsystems needing to be redesigned because of compatibility issues with the
microcontroller.

The Tailgate Buddy has an array of subsystems to manage all of its functionality.
The subsystems it contains are a GPS system to track where the vehicle has
been. The Tailgate Buddy has a drivetrain consisting of all the drive components
to move it, and an RC controller for manual operation of the vehicle. The
Tailgate Buddy will also has a water gun for a warning system for pedestrians, an
obstacle avoidance system to prevent the Tailgate Buddy from running into any
obstacles, and a tracking system for use while trying to follow its target. Not all of
the subsystems are operational at the same time. The manual drive operation
makes use of the RC controller circuits allowing the driver full operation of the
Tailgate Buddy. The automatic operation makes use of the tracking system for
following its target, the obstacle avoidance system for adjusting speed and
distance from its target and to make sure the vehicle doesn‟t run into any
obstacles. The GPS operates all the time tracking where the vehicle has been.

The master microcontroller manages all of the subsystems, determining what
systems should be running and what each system should be doing. The master
microcontroller monitors the status of the different systems and determines if the
vehicle should be in manual operation mode or if it should be running in full
automatic operation mode. If the robot is running in manual mode it powers
down the automatic systems rather than just ignoring the inputs given to it by the
automatic systems, allowing the remote control of the system. Once the Tailgate
Buddy is put back into automatic mode it cuts power applied to the RC
subsystems.

Since the Tailgate Buddy has one master microcontroller to manage all of the
subsystems, the software to manage the subsystems consists of many different

                                                                                   43
pieces. The master microcontroller has main function with the purpose of calling
all of the sub functions at appropriate times. The main function has the job of
managing the sub systems. If the subsystem is not in operation the main
function simply will not call the sub routine to manage that subsystem. If the
subsystem is in operation the main function has the job of dividing the time
among the subsystems appropriately.          Dividing the time appropriately is
important since the obstacle avoidance system and the tracking system are
needed to keep the vehicle moving in the correct direction and at the right speed
while not allowing it to run into any obstacles. While systems like the GPS
subsystem can‟t be ignored as they are recording important information they are
not vital to the Tailgate Buddy fulfilling its role successfully and thus it is
important to ensure the Tailgate Buddy is going to make a successful trip, keep
following its target at a safe distance and avoid any obstacles that may block its
path by allowing the vital systems priority on the microcontroller. While this
shouldn‟t present a problem it may mean that systems such as the GPS tracking
may not always be able to record all the GPS tracking points that would like for a
clean route to be recorded however should be enough to make an accurate
outline of where the Tailgate Buddy has been and what path it took to get there.


     Tracking System Design
The tracking system needed to meet its design goals or the robot would not
function, so along with the drive system the tracking is the most important system
on the robot. The tracking system needed to be able to follow one person at
ranges of at least 12 feet. It needed to be able to discriminate between the
operator and other people who might be around the robot. The tracking system
is split into two different subsystems, the transponder and the receiver. The
transponder is a small device that the operator wears on themselves which emits
IR pulses that are tracked by the detector. The detector receives these pulses
from the transmitter and translates them into directions for the drive commands
and then moves the vehicle around accordingly. The tracking system does not
work if there is not a clear line of sight between the operator and the vehicle. So
when an obstacle comes into the line of sight the vehicle has to decide on what
to do next; i.e. if the robot should attempt to drive around the new obstacle or if it
should stop and wait for the operator to come and save it from the stopped
condition.

The transponder is a little device that is battery powered and is able to be affixed
to the operator. It contains a battery, the IR LED (TSAL7600 from Vishay
Semiconductors), and a switching device to turn it on and off. The circuitry inside
is simple a little circuit that minimizes battery use and pulses the LED at a 100 Hz
pulse width modulated by a 38 kHz signal. See Figure 13 Pulsed Circuit for a
general circuit for the generation of the pulses. The best course of action was to

                                                                                   44
use a 555 timer chip for the pulse generation which worked well and made
changing the frequency as simple as changing the value of a resistor. The
values of R6, R7, R8, R9, C1, and C2 were determined depending on what
frequency worked best in testing of the transponder. The output of the 555
timers turn on an NPN transistor that drives the IR LED‟s with more current than
the timer can supply on its own. It was decided that 38 kHz was the best
frequency because the detectors that were selected have a band pass filter build
in centered at this frequency. The goal was to power the transponder on a three
volt watch battery for its small size and weight. The size for the package is about
as big as a two decks of cards stacked on top of each other.




                          Figure 13 Pulsed Circuit

                                                                                45
The receiver is able to detect the pulses from the transponder and determine
where the operator is in relation to the vehicle. The receiver then tells the drive
systems what they need to do in order to follow the operator around. It then tells
the direction the vehicle needs to travel to the master microcontroller. The
master microcontroller takes in these commands in its software determines if the
vehicle should turn or continue to drive straight in to follow the operator and not
run things or people over. The vehicle has at two photo detectors that are
optimized for the 940nm frequency. Since the Tailgate Buddy only uses two
detectors they were positioned on the front of the vehicle at angles that allow
overlapping in the center, directly in front of the vehicle. Each detector is
positioned at a corner on the front of the vehicle. Since each detector has only a
cone of where it can detect from when set up in this manner it simplifies the
system circuitry. If the operator is in the area that is overlapped by both
detectors the vehicle drives straight ahead. If the operator is outside of the
middle cone the vehicle turns towards the side that sees the operator, this angle
of turning depends upon the speed that the vehicle is traveling. See Figure 14
Detection Cone below for a graphical representation. The receiver module on
the vehicle that is used is from Sharp. The chosen model has a center band of
940nm±40nm and a bandpass filter at 38 KHz. So they match up with the IR
LED very well since they are both matched for the same wavelength. In Figure
14 Detection Cone you can see that the IR detectors have an angle of detection
of 60 degrees. The plan was to set up the detectors so that they overlap by
about 30 degrees in the center of the vehicle.




                         Figure 14 Detection Cone

                                                                                46
This zone of overlap is the area where the vehicle is following behind the
operator. This means that the vehicle continues to drive straight as long as the
operator stays within this zone. If the operator goes outside of this area central
zone of overlap the vehicle needs to take one of three different actions. The first
two actions are turning either right or left to continue to follow the operator as he
or she is walking around. If the operator is in the zone on the left of the picture
the vehicle needs to turn right to follow and continue to follow until the operator is
in the central zone of overlap. The same is true if the operator is in the cone of
detection for only the right cone a pictured, i.e. the vehicle turns left until the
operator is back in the central zone of overlap. The last option is that the
operator is not in any of these three zones. This would mean that the person is
either too far off to the side of the vehicle to be seen or too close to the front of
the vehicle. If the person is too close to the front of the vehicle the obstacle
avoidance detects the person and takes appropriate action to not collide with the
obstacle. If the operator goes off to the right or left of the vehicle, the vehicle was
programmed to slow down and increase the radius of the turn until the operator
has been detected again. If this slowing down and scanning method does not
work the vehicle stops completely and wait for the operator to come back in the
detection area and then the vehicle will start to drive again.

The last way for the vehicle to lose the person is if the person is approaching the
vehicle, close enough for the obstacle avoidance to stop the vehicle or steer
around it. Then the person is standing on the side of the vehicle where there is
no detection for the operator. The vehicle will remain stopped and will not scan
for the operator if the operator approaches the vehicle.


     Obstacle Avoidance Overview
The obstacle avoidance system needed to be quick when determining if an
obstacle exists and the position of the obstacle. The obstacle avoidance system
must also be quick when determining what action must be taken to avoid the
obstacle. It consists of three ultrasonic sensors, each one covering a different
section of the front of the Tailgate Buddy. It is important to have the entire front
including the front corners of the Tailgate Buddy covered to prevent the vehicle
from running into an object straight on or turning into an object. Since the vehicle
is very heavy it could do some real damage if it were to hit an object, making the
obstacle avoidance system important to prevent an accident from happening.




                                                                                    47
             Figure 15 Obstacle Avoidance Detection Cone
The front sensor of the obstacle avoidance system has the job of determining the
speed of the vehicle. The vehicle will keep the person it‟s following directly in
front of it. Since its target will remain directly in front of it, the front sensor of the
obstacle avoidance system will see the target consistently. Since the front
sensor will see the target consistently and will be receiving distance
measurements from the Tailgate Buddy‟s target consistently, the front sensor can
be used to determine speed and following distance from the vehicle‟s target. The
Tailgate Buddy tries to leave a safe following distance from the target. A safe
following distance is the distance it will take the vehicle stop without running into
its target. This distance is affected by the fact that the vehicle does not always
have sight of its target. If the target roams outside of the front sensor the
Tailgate Buddy will have to maintain, increase, or decrease its speed in order to
maintain control and regain sight of its target without running into its target or any
surrounding obstacles.

The side sensors have partial view of the front and front corners of the Tailgate
Buddy. The readings the obstacle avoidance system receive from these two side
                                                                                       48
sensors determine if the Tailgate Buddy has to make a turn to avoid an obstacle
or if the Tailgate Buddy has to avoid making a turn in a certain distance to ensure
that the it doesn‟t turn directly into an obstacle or sideswipe an obstacle. The
algorithm for the obstacle avoidance system also has to determine if the target
has turned a corner that it cannot turn because of an obstacle. The algorithm for
the obstacle avoidance system has to realize this is the case and maintain speed
allowing the Tailgate Buddy to turn the corner when it is safe. If the target has
disappeared from sight because they have walked too fast for the Tailgate Buddy
and has disappeared from the obstacle avoidance system the algorithm has to
tell the vehicle to speed up in order to reacquire its target. As the target gets
closer to the vehicle the algorithm for the obstacle avoidance system has to slow
the vehicle to match speed with its target. By matching speed the vehicle can
keep up with its target without running into the target or losing the target by
moving too slowly. If the Tailgate Buddy has to turn to avoid an obstacle the
tracking system may lose its target. Since the vehicle losing the target would
cause it to have to come to a stop and wait to reacquire a target, the obstacle
avoidance system makes an effort to point it back at the target before returning
control of the robot back to the tracking system.

The obstacle avoidance system has the responsibility of protecting the Tailgate
Buddy from damage and protecting obstacles around it from taking damage. The
system uses ultrasonic waves to detect obstacles before the robot reaches the
obstacle. By providing early detection of the obstacles, the obstacle avoidance
system can navigate the vehicle around the obstacles avoiding collisions. The
system has another important responsibility as well. It has to maintain proper
speed while following its master. While the target walks forward, the obstacle
avoidance system has the task of keeping up with the target by matching the
speed. This task is completed by use of the front facing sensor. Since the front
sensor returns the distance of the operator as an obstacle and the only obstacle
directly in front of the Tailgate Buddy is the user. The front sensor only returns
the distance of the target. This distance is used to determine the speed the
Tailgate Buddy has to travel in order to keep up with the target. If another
obstacle appears in view of the front sensor the vehicle, it will slow and stop to
avoid hitting the obstacle. The vehicle utilizes the same algorithm for matching
speed of its target, as it stops for this obstacle to prevent a collision. This
phenomenon made it practical to use the forward facing sensor of the obstacle
avoidance system for matching the speed of the Tailgate Buddy‟s target.

The obstacle avoidance system consists of 3 ultrasonic sensors. Each sensor
has a view of 7 feet forward and 4 feet to each side. They all connect to the
microcontroller via the independent serial connections. The microcontroller
manages the information coming in from the sensors and determines what
actions the obstacle avoidance system must take in order avoid a collision and
maintain correct speed. Each ultrasonic sensor has an area of the front of the

                                                                                49
Tailgate Buddy it is monitoring. Two ultrasonic sensors are watching each side
of the vehicle ensuring that it doesn‟t turn towards an obstacle. Depending on
the location of the obstacle in view of one of the two side sensors, the Tailgate
Buddy may need to maneuver to avoid hitting an obstacle. The front sensor is
responsible matching the vehicle‟s speed with its target. The front sensor also
slows or stops it to avoid hitting any new obstacles that appear directly in front of
it. Each sensor has a viewing angle of forty-five degrees.

The software receives the data from each sensor and determines from the input
whether there is an obstacle in danger. If there is an obstacle in the way, the
software directs the Tailgate Buddy around the obstacle. If the obstacle is
directly in front of the vehicle the front sensor picks this up and transmits this
data to the software. The software slows the vehicle to a stop or applies the
braking function of the motor controller to prevent it from running directly into the
obstacle. The sensors have to be read more often than every second in order to
get an accurate estimation of the location of the surrounding obstacles. If the
obstacle is to one side the vehicle may have to maneuver to clear the obstacle or
avoid turning until the vehicle passes by the obstacle and the obstacle is no
longer a threat. If the obstacle is in the front of the vehicle, the front sensor has
to detect the obstacle in enough time to slow it to a stop, as it takes some time to
stop when fully loaded. Because of the stopping distance, the forward facing
sensor has to be read more often by the software than the other sensors to
detect the obstacles sooner and give the Tailgate Buddy the extra time it needs
to stop.

The obstacle avoidance system determines the speed the Tailgate Buddy needs
to travel to keep up with its target while maintaining a following distance that will
allow it to stop short of its target without running into its target. The obstacle
avoidance system will determine the speed based on the following distance. As
the following distance increases the Tailgate Buddy increases speed to keep up,
however as the following distance decreases the Tailgate Buddy has to decrease
speed in order to keep from running into the target. The sensors return the
following distance up to seven feet in inches. Since the following distance is
reported so accurately the obstacle avoidance system uses this to determine the
speed it needs to travel and if the following distance decreases quickly the
Tailgate Buddy will decelerate quickly to ensure that it does not run into the
target that is slowing down. The side sensors use distance to determine if the
obstacle is too close, ensuring the Tailgate Buddy doesn‟t turn until the obstacle
is clear. If the distance on a side sensor is approaching the Tailgate Buddy
rapidly, the obstacle is coming towards the vehicle, meaning that it must make
the necessary maneuver, meaning it must turn to avoid the obstacle. Sensing
the obstacle in this way is possible because of the angle the side sensors see the
obstacles at. The side sensors don‟t make the distinction whether the obstacle is
in front or back of its viewing range, they only determine that they can see the

                                                                                  50
obstacle. This is why the obstacle avoidance system must determine the
position of the obstacle by how fast the obstacle is approaching the Tailgate
Buddy.


        Description
The obstacle avoidance system uses ultrasonic sensors for detecting obstacles
that the Tailgate Buddy could run into. This detection includes obstacles directly
in front of the Tailgate Buddy and obstacles that it could turn into. While
obstacles that the vehicle could turn into are not as big of a threat they are still a
concern for the safety of the obstacle and the vehicle. To do this it was
necessary to make use of some advanced ultrasonic sensors. These sensors
have the ability to detect obstacle distances allowing the obstacle avoidance
system to determine if an obstacle is of immediate danger to the Tailgate Buddy.

The ultrasonic sensors require a voltage in the range of 2.5 to 5.5 volts DC. It is
necessary to feed the ultrasonic sensors a steady voltage, changes in voltages
cause the sensitivity to spike or drop. These changes could cause false readings
in the outputs greatly affecting the ultrasonic sensors accuracy. Each sensor has
a coverage area of about seven feet long and four feet wide. The length wasn‟t
an issue, as the sensor return accurate distance measurements of objects.
Using the distance measurements, it can determine if an object is in immediate
danger or if that can continue without taking action to avoid the obstacle. The
ultrasonic sensor communicate via RS232 serial port, it return and ASCII
character „R‟ followed by the three ASCII numerical digits representing the
distance the object is from the sensor. The obstacle avoidance sensors needed
to be able to accurately detect obstacles that are a four feet distance away so it
can avoid turning in to such obstacles. The ultrasonic sensors also needed to be
able to detect obstacles that are within one foot of the vehicle so that it can make
an emergency stop or quick maneuver turn to avoid hitting the obstacle. Regular
quick last minute turns can indicate that something is wrong, as the vehicle
should be making small adjustments to its path to avoid stationary obstacles
rather than last minute maneuvers.

The microcontroller needed to have the ability to read RS232 serial. It needed to
have the hardware included to read RS232 serial included. The microcontroller
also needed to have the ability to pole all three-obstacle avoidance sensors
every second and run the obstacle avoidance algorithm to determine obstacle
threat. It had to have the ability to gather data from the front facing ultrasonic
sensor every quarter second, run a speed calculation and adjust for changes in
the targets speed. If this could not be accomplished it would run the risk of
running into the target. The Cerebot microcontroller is rated to take a voltage
range of 3.6 to 9 volts DC, it does accept voltages outside that range as they

                                                                                   51
may damage the microcontroller. To power the microcontroller and the ultrasonic
sensors it needed a stable voltage of 4 to 5 volts DC power. The power supply
must be stable and have a voltage protection circuit to cut off if the battery supply
voltage drops below 3.8 volts to protect the microcontroller and the ultrasonic
sensors on board. For the serial port connection the TX pin on the ultra sonic
sensor connects to pin two on the nine pin RS232 serial connector. The ground
pin on the ultrasonic sensor will connect to the ground pin on the nine pin RS232
serial connector. This is illustrated in the picture below.




                Figure 16 Ultrasonic Sensor Connection
            [Permission to reprint figure given by www.Sparkfun.com]

                                                                                  52
                       Figure 17 RS232 Connection
            [Permission to reprint figure given by www.sparkfun.com]

The three ultrasonic sensors are setup in a fashion that provides a full view in
front of the Tailgate Buddy. The sensor in front has the responsibility of
measuring distance to the target and controlling speed. The front ultrasonic
sensor also prevents the vehicle from running into an object head on. The front
sensor has a range of seven feet in front allowing it to see the target roaming
ahead, if an obstacle comes between the vehicle and the target, it will cause the
vehicle to come to a stop and wait for the obstacle to move or the target to come
back into view. The two side sensors have an angle view of the front and the
sides of the Tailgate Buddy to watch for obstacles approaching that the Tailgate
Buddy may hit either straight on or turn into. If the vehicle is about to run into an
obstacle, it will have to make a turn to avoid the obstacle. If the obstacle is at
such a distance so that the vehicle won‟t run into it but will stand a chance of
hitting the obstacle if it turns the obstacle avoidance system has to prevent it
from turning until the obstacle is sufficiently past it. The Tailgate Buddy does not
require any rear ultrasonic sensors for obstacle avoidance since the Tailgate
Buddy will not be operating automatically in reverse; therefore it does not use
any rear sensors to determine if it is safe to turn. To determine if the Tailgate
Buddy is safe to turn it uses a calculation based on the speed and length of the
vehicle. The vehicle‟s blind spots and danger zone while making a turn are
indicated in the figure below.




                                                                                  53
              Figure 18 Obstacle Avoidance Blind Spots

        Software
The software for the Tailgate Buddy was designed to check each of the sensors
every half-second and the front sensor once every quarter second. The side
sensors are not a critical as they are only looking to see if it‟s safe to turn the
vehicle and checking to see if it will have to make a maneuver in order to avoid
an obstacle approaching from the side. The front sensor has to be monitored
every quarter second because it is critical in adjusting the speed to ensure that it
doesn‟t run into its target. This sensor is even more critical since the Tailgate
Buddy won‟t be able to stop instantly but will require some distance to stop.

The software for the obstacle avoidance system has no user interface. The
software monitors the sensors and performs calculations on the results returned
by the sensor. While the front facing sensor is the most important, the two side
sensors are performing important observations the software needs to know. The
software was designed to prevent the Tailgate Buddy from turning directly into an
object by simply taking the results from the last reading from the side sensor and
determining if there is an obstacle in range and if the Tailgate Buddy will hit that
obstacle if it turns. If the obstacle is far enough away the software allows the turn
to take place. The software then watches the side sensors and front sensor to
                                                                                  54
determine if the obstacle is now in immediate danger. If the target is in view and
the obstacle is safe control is returned to the targeting system. If the obstacle is
still a problem the obstacle avoidance system has to continue moving around the
obstacle until the obstacle is clear then it returns control to the targeting system.


        Hardware
The hardware for the obstacle avoidance system consists of three ultrasonic
sensors and a Digilent Cerebot microcontroller. This system also requires a
power supply admitting a stable 5 volts DC. The entire system has to be
mounted inside water resistant cases since the Tailgate Buddy is an outdoor
vehicle. The ultrasonic sensors were tricky since the case they are put in could
have affected their ability to detect obstacles. They were incased in PVC pipe
and foam because the foam does not block or distort the ultrasonic signals being
transmitted by the sensors. The microcontroller had to be mounted inside a
waterproof plastic case to prevent it from getting wet. The plastic case housing
the microcontroller had to have multiple holes allowing the serial and power
cables through. Each hole had to be sealed against the outside environment
preventing water penetration. This is important since the sensitive electronics on
the microcontroller will be damaged by moisture.

The ultrasonic sensors had to be placed inside weatherproof cases as well.
Since the case may affect the sensitivity of the ultrasonic sensor, it was
necessary to adjust for this in software. If the Tailgate Buddy has a false reading
being given continuously by the ultrasonic sensors it can be programmed in
software to ignore the ghost image and continue. Another way to get around this
problem was to use a different material over the sensor that doesn‟t block
ultrasonic waves. The power supply also has to be put into a plastic waterproof
case preventing water penetration. If water gets into the power supply it could
cause the power supply to short out or cause a spike in power which could blow
out the master microcontroller and slave microcontrollers and blow out the
ultrasonic sensors.




                                                                                  55
                       Figure 19 Ultrasonic Sensor
            [Permission to reprint figure given by www.sparkfun.com]


        Obstacle Avoidance Microcontroller
The obstacle avoidance microcontroller has the responsibility of monitoring the
ultra sonic sensors to determine if an obstacle is present. If there is an obstacle
present the microcontroller has to make a decision as to whether the Tailgate
Buddy should turn to avoid the obstacle, avoid turning into the obstacle, stop or
slow to avoid running into the obstacle, or ignore the obstacle as it is not in the
path. The microcontroller has obstacle avoidance as a priority algorithm in the
design. The algorithm first checks the front sensor judging distance between the
Tailgate Buddy and the target. After this the algorithm checks the two side
sensors, one than the other looking for obstacles. If there is an obstacle it will
determine if the obstacle is too close to the Tailgate Buddy and there is a danger
of hitting the obstacle if immediate action is not taken or if the Tailgate Buddy is
not in immediate danger. There will only need to be one main microcontroller,
the master microcontroller. It has the processing power available to determine
distance, speed and tracking without fumbling. The master microcontroller also
has the available ports to read all the sensor data and determine what needs to
be done with it.

The ultra sonic detectors were connected to the microcontroller via serial port.
By addressing a serial port to the microcontroller it gives direct access to the
ultrasonic detectors. The detector transmits the data to the serial port via ASCII
characters. It transmits a capital „R‟ followed by three ASCII numeric characters
representing the distance the obstacle is from the detector in inches. This
routine is a function on the main microcontroller. This is possible because the
checking the ports, retrieving the data, and running the algorithms, determines
speed and distance of obstacles. The software has to take into account the

                                                                                 56
obstacle positions and determine if the Tailgate Buddy is safe to travel in the
chosen direction. The software checks the two side sensors and determines if
the obstacle is close enough to the Tailgate Buddy to cause it harm. If the
obstacle is too close the vehicle the algorithm will cause it to turn to avoid the
obstacle. Next the algorithm checks the front sensor to detect the distance the
target is from the Tailgate Buddy. The function uses this distance to determine
the speed of the vehicle. If the target is increasing in distance from the Tailgate
Buddy then the algorithm will increase the speed. If the target is decreasing in
distance from the Tailgate Buddy then it will decrease in speed to match the
targets speed.


     GPS
This section covers the GPS functions and hardware (collectively referred to as
the “GPS unit” or “unit”) for the Tailgate Buddy. For a complete list of the Tailgate
Buddy‟s GPS hardware, refer to Table 3 GPS Hardware List shown below.

The purpose of the GPS unit is to track where the Tailgate Buddy has traveled
throughout the course of its use. The GPS unit tracks GPS data of the vehicle‟s
movements, and write updated GPS coordinates to an SD memory card once
every second. The entirety of the GPS hardware is concealed in the chassis of
the Tailgate Buddy by a cover which allows access to an SD memory card for its
removal and interfaces with the user‟s PC (personal computer). The unit
interfaces with the rest of the device via a microcontroller.

Some relevant technical specifications for the PIC16F819 Microcontroller will
now be discussed. For complete technical specifications, please refer to
Appendix B. The PIC16F819 microcontroller dissipates power at 1W. The
microcontroller contains 256 bytes of EEPROM, and 3.5 KB of flash memory.
The RC oscillator of the microcontroller has eight selectable frequencies: 31.25
kHz, 125 kHz, 250 kHz, 500 kHz, 1 MHz, 2 MHz, 4 MHz, and 8 MHz. For the
purpose of the GPS unit, the microcontroller runs at 8 MHz. Even though this is
the fastest mode for the microcontroller, this frequency still allows plenty of time
for the ZX4120 GPS module to perform its tasks and for data to be written to the
SD card in a timely manner. The PIC16F819 microcontroller contains eighteen
pins, with fifteen of those pins for input and output, one for ground, one for input
voltage, and one that will not be used (pin 9). The input and output pins are
divided into two groups: PORTA and PORTB. PORTA contains RA0/AN0 (pin
17), RA1/AN1 (pin 18), RA2/AN2/VREF- (pin 1), RA3/AN3/VREF+ (pin 2),
RA4/AN4/T0CKI (pin 3), RA5/MCLR/VPP RA5/                /VPP (pin 4),
RA6/OSC2/CLKO (pin 15), and RA7/OSC1/CLKI (pin 16). PORTB contains


                                                                                  57
    Component Name                      Specific Component                        Quantity

Microcontroller               Microchip PIC16F819                            1

GPS Receiver                  WD-G-ZX4120 GPS Module                         1

SD Card to Board Socket       Yamaichi FPS009-2405-0 SD Card Socket          1
                              (Push/Push)

Antenna                       2.4 GHz Wireless Transceiver Accessories       1
                              Antenna 5 MMCX

Antenna to Board Connector    Generic MMCX Antenna to Board                  1
                              Connector

Voltage Regulator             LE33CZ Voltage Regulator                       1

Resistors                     4.7 kΩ (1), 100 kΩ (4), 470 Ω (2), 1 kΩ (3),   18
                              2.2 kΩ (2), 330 Ω (1), 10 kΩ (4), 68 kΩ (1)

Capacitors                    2.2 µF (1), 100 nF (ceramic) (3), 10 nF        5
                              (ceramic) (1)
Transistors                   2N3906B                                        4

Diode                         1N4001                                         1

LEDs                          Bi-Color Red/Green                             3

Circuit Board                                                                1



                          Table 3 GPS Hardware List
RB0/INT (pin 6), RB1/SDI/SDA (pin 7), RB2/SDO/CCP1 (pin 8), RB3/CCP1/PGM
(pin 9), RB4/SCK/SCL (pin 10), RB5/         (pin 11), RB6/T1OSO/T1CKI/PCG (pin
12), and RB7/T1OSI/PGD (pin 13). For a pin-out diagram illustrating the above
pins, please refer to Figure 20 PIC16F819 Pin Diagram below. Pins RA0 to RA4
is a bi-directional port (can be configured as input or as output). Pins RB0 to RB7
also form a bi-directional port, which behaves in the same manner as RA0 to
RA4, only there are eight bits instead of five. VDD is the positive power supply,
and must take a load of 2 V to 6 V. VSS is the negative power supply or ground (0
V). Pins OSC1/CLKI and OSC2/CLKO are for connecting an external clock if the
microcontroller needed one. Pin MCLR is used to clear the memory locations in
the EEPROM. Normally, MCLR is connected to VDD. Pin INT is an interrupt,
which can be used to make the program stop and restart. Pin T0CK1 is another

                                                                                      58
clock input, but operates an internal timer. For more detailed functions of each
pin, please refer to the full technical specifications in Appendix B. The
PIC16F819 Microcontroller is programmed using PIC assembly language. To do
this, a PIC programmer was necessary to interface with a PC. The PIC compiler
that is used to compile the GPS unit‟s assembly code is a Linux application
called gpasm, which is part of the gputils package. This software is licensed
under the GPL. The PICKit2 PIC programming software will be used with the
PICKit2 hardware to transfer the compiled hex file to the Microchip PIC16F819
microcontroller. For the source code used for this project, please refer to
Appendix A.




                   Figure 20 PIC16F819 Pin Diagram
                 [Permission to reprint approved by Microchip]

Some relevant technical specifications for the WD-G-ZX4120 GPS Module will
now be discussed. The module can track up to seven GPS satellites using
sixteen channels. The ZX4120 GPS Module interfaces using a standard RS232
(TTL level) link operating at 9600 baud, and outputs using the NMEA0183
protocol. The device measures 25.9 mm by 25.9 mm by 2.7 mm, weighs 3.4 g,
and consumes 89 mW of power in continuous mode, and 99 mW in continuous
mode using LNA. For complete technical specifications, please refer to Appendix
C. The ZX4120 GPS Module contains nineteen pins, with eleven of those pins for
input and output (as shown in Figure 21 ZX4120 GPS Module below). Pins 1
through 10 are used for standard operation. Pins 11 through 16 (DSUMUX,
DSUEN, DSUBRE, DSURX, and DSUACT are for a dedicated debug unit, and
are not connected to any other device. Pins 17 through 19 are for the antenna
connection. Pins 17 and 19 are RF ground, and pin 18 is the connection for the

                                                                             59
antenna. The function of GPIO [0] (pin 10) is to tell if the antenna is shorted or
open circuit; GPIO [0] will be set to high if it is detected that the antenna is open
or shorted. The function of GPIO [4] (pin 1) is to tell when the first satellite is
detected; when the ZX4120 GPS module detects the first satellite, GPIO [4] will
change from high to low. The RESET pin (pin 6) is used to reset the device. NC
(MODE) (Pin 2) is not used, pin 8 is ground, and pin 9 is input voltage VDD (3.0 V
to 3.6 V). VBAT (pin 7) is used to attach an external battery for backup power.
WAKEUP (pin 5) is used to keep the ZX4120 GPS Module in standby mode for
low power consumption when it is idle, and to bring the device out of standby
mode. NMEA TX (pin 3) is used for NMEA serial data output. NMEA RX (pin 4) is
used for NMEA serial data input. NMEA is a standard developed by an
organization called the National Marine Electronics Association originally created
for communicating between marine electronics and computers and other marine
equipment. For a more detailed description of each pin‟s function, please refer to
Appendix C. The data that is stored to the SD memory card not as ASCII
characters, but as pure zeroes and ones. The SD card is intended to interface
with the user‟s PC. There is a console-based application to parse the GPS data
into a text file from the user‟s PC. The text file contains ASCII values. This text
file is able to be uploaded to an online mapping service such as
http://www.openstreetmap.org.

The GPS data is written to the SD memory card once every second. The data is
written as raw NMEA data sentences. Excluding carriage returns, the data
transfer rate should never exceed 512 bytes per second. The GGA, GSA, RMC,
and GSV sentences are stored on the SD card. The GGA is the global
positioning system fix data. GGA provides three-dimensional location and
accuracy data. The GGA data includes the time, fix, latitude, longitude, altitude,
and horizontal dilution of precision (HDOP). Dilution of precision is a measure of
how the satellite geometry affects the accuracy of the fix. In the fix quality field of
the GGA data, 0 means the fix is invalid, 1 indicates a GPS fix (SPS), 2 indicates
a DGPS fix, 3 indicates a PPS fix, 4 indicates real-time kinematic, 5 indicates
float RTK, 6 indicates the data are estimated, 7 indicates the data was input
manually, and 8 indicates simulation mode. Dilution of precision is a unitless
number. A small dilution of precision is desirable, with 1.0 being the desired ideal
value. The GGA data will take up 78 bytes on the SD memory card. For greater
detail of GGA data, please refer to Table 4 Sample GGA Data below.

GSA provides details about the fix. The GSA data includes the GPS satellite
numbers the GPS module is using, detailed geometric dilution of precision
(GDOP) data, and fix information. The fix information field in the GSA NMEA
sentence can take one of three values: 1 indicates that there is no fix, 2 indicates
a two-dimensional fix, and 3 indicates a three-dimensional fix. For greater detail
about GSA data, please refer to Table 5 Sample GSA Data below.



                                                                                    60
                Sample GGA NMEA Sentence:
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
      GGA               Global Positioning System Fix Data
     123519                  Fix taken at 12:35:19 UTC
   4807.038,N                Latitude 48 deg 07.038‟ N
  01131.000,E               Longitude 11 deg 31.000‟ E
        1                            Fix quality
        8               Number of Satellites Being Tracked
       0.9                 Horizontal Dilution of Precision
    545.4,M               Altitude Above Mean Sea Level
                                     (in meters)
     46.9,M            Height of geoid above WGS84 ellipsoid
                                        (in meters)
   (empty field)               Time since last DGPS update
                                       (in seconds)
   (empty field)                  DGPS station ID number
      *47                             Checksum data
                              (always begins with an asterisk)

                   Table 4 Sample GGA Data
      [Data Taken From http://gpsinformation.org/dale/nmea.htm]

 Sample NMEA GSA Sentence:
 $GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39
 GSA                          Satellite Status
 A                            Auto-Selection of 2D or 3D Fix
                              (A = Auto, M = Manual)
 3                            Fix Status
 04,05,09,12,24, blank fields Pseudorandom Noise of Satellites
                              Used in Fix
 2.5                          Dilution of Precision (DOP)
 1.3                          Horizontal Dilution of Precision (HDOP)
 2.1                          Vertical Dilution of Precision (VDOP)
 *39                          Checksum Data
                              (Always Begins with an Asterisk)
                   Table 5 Sample GSA Data
      [Data Taken From http://gpsinformation.org/dale/nmea.htm]


                                                                        61
The RMC data includes PVT data (position, velocity, and time). For greater detail
on RMC, please refer to Table 6 Sample RMC Data below. The GSV data
includes data about the satellites the GPS module might be able to find based on
almanac data and its viewing mask data, and the SNR (signal to noise ratio)
which can be thought of as signal strength. A high SNR is favorable. For greater
detail of GSV data, please refer to Table 7 Sample GSV Data below.

 Sample NMEA RMC Sentence:
 $GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A
 RMC                Recommended Minimum Sentence C
 123519             Fix Taken at 12:35:19 UTC
 A                  Status (A = Active, V = Void)
 4807.038,N         Latitude 48 Degrees
                    07.038 Minutes North
 01131.000,E        Longitude 11 Degrees
                    31.000 Minutes East
 022.4              Speed Over the Ground
                    (in knots)
 084.4              Track Angle in Degrees
 230394             Date (March 23, 1994)
 003.1,W            Magnetic Variation
 *6A                Checksum Data (Always Begins with an Asterisk)
                        Table 6 Sample RMC Data
           [Data taken from http:://gpsinformation.org/dale/nmea.htm]

   Sample NMEA GSV Sentence
   $GPGSV,2,1,08,01,40,083,46,02,17,308,41,12,07,344,39,14,22,228,45*75
   GSV         Satellites in View
   2           Number of Sentences in View
   1           Sentence 1 or 2
   08          Number of Satellites in View
   01          Satellite PRN (Pseudorandom Noise) Number
   40          Elevation
               (in Degrees)
   083         Azimuth
               (in Degrees)
   42          SNR
               (Up to 4 Satellites per Sentence)
   *75         Checksum Data
               (Always Begins in an Asterisk)
                        Table 7 Sample GSV Data
           [Data taken from http:://gpsinformation.org/dale/nmea.htm]

                                                                              62
                        Figure 21 ZX4120 GPS Module
             [Permission to reprint approved by www.crownhill.co.uk]

The YAMAICHI FPS009-2405-0 Secure Digital (SD) Card Socket is used to
interface with the SD memory card used to store the recorded GPS data. The SD
socket operates in SPI (serial peripheral interface) mode, which is commonly
used to interface with microcontrollers in full duplex, such as the Microchip
PIC16F819 microcontroller described above. The SD standard has nine pins.
DAT3/CS (pin 1) is used for chip select and slave select. CMD/DI (pin 2) is used
for MOSI (master out/slave in). VSS1 (pin 3) is ground. VDD (pin 4) is input
voltage (either 2.7 V or 3.6 V). CLOCK (pin 5) is the SCK (serial clock). V SS2 (pin
6) is another ground pin. DAT0/D0 (pin 7) is used for MISO (master in/slave out).
DAT1/IRQ (pin 8) is IRQ (interrupt request). DAT2/NC (pin 9) is not used in SPI
mode. For a pin-out diagram of a Secure Digital (SD) card, please refer to Figure
22 Secure Digital (SD) Memory Card below.




                                                                                 63
                Figure 22 Secure Digital (SD) Memory Card
The MMCX socket for the antenna is PCB-ready, and is pictured with the
antenna in Figure 23 Antenna Socket (LEFT), GPS Antenna (RIGHT) below.
The antenna used is 47.0 mm by 45.4 mm by 14.4 mm, and weights 60 g. The
operating temperatures for the antenna are -30 degrees Celsius to 80 degrees
Celsius. The operating humidity for the antenna is 40% to 95%. The voltage
regulator chosen is the model number LE33CZ. The LE33CZ voltage regulator is
a 100 mA regulator with a low drop voltage (0.2 V) and low quiescent current (0.5
mA). These properties allow for low noise. A 2.2 µF capacitor was required for
stabilizing power to the device. For the purpose of the GPS unit of the Tailgate
Buddy, the 3.3 V TO-92 version was used. This version of the LE33CZ contains
three pins: VIN, VOUT, and GND. There is also a SPST push to make button to
toggle the GPS receiver from standby mode to active mode, or it can be held
down for ten seconds to reset the unit.




     Figure 23 Antenna Socket (LEFT), GPS Antenna (RIGHT)
The LEDs and external button for the GPS unit will now be discussed. The status
LED shows the current GPS fix status. The LED turns on when the PIC
microcontroller synchronizes with the data sequence. The status LED is red
when the GPS module has no position. The status LED is orange when it has a
2D fix. The status LED is green when it has a 3D fix. The next LED is the SD
card LED. This LED lights up green when the SD card is receiving power. The

                                                                              64
SD card LED flashes orange when there is being data transferred. The button on
the outside of the GPS unit is the wake up/standby switch. Pushing the button
once starts the device. Pushing the button again will stop the device. If the button
is held down for a total of ten seconds, the write position in the SD card is reset
to the beginning of the card.

For a complete diagram of the PCB, please refer Figure 24 PCB for GPS Unit
below. The circuit will now be described in its entirety. For a complete circuit
diagram of the GPS unit of the Tailgate Buddy, please refer to Figure 25 First
Half of GPS Unit Circuit Diagram and Figure 26 Second Half of GPS Unit
Circuit Diagram below. The completed circuit is pictured in Figure 27
Completed GPS Unit. The GPS circuit and source code are the design of
Andrew M. Bishop, and can be found at http://www.gedanken.demon.co.uk/gps-
sd-logger. The PIC16F819 Microcontroller is connected in the circuit as follows.
All connections are in series, unless otherwise noted. Pin 1 is connected to a 1 k
resistor (R5). The other end of R5 is connected to the base of Q1, a BC327 PNP
bi-polar junction transistor (BJT). The emitter of Q1 connects to V CC. The
collector of Q1 has several connections, and will be mentioned later in the
description of the circuit. Pin 2 of the microcontroller connects to a 470R resistor
(R3).




                        Figure 24 PCB for GPS Unit
             [Reprinted with permission from Andrew M. Bishop from
               http://www.gedanken.demon.co.uk/gps-sd-logger/]


                                                                                 65
The other end of R3 is connected to the green side of a bi-color LED (D2). D2 is
then connected to ground. Pin 3 of the microcontroller is connected to another
470R resister (R4). R4 is then connected to the red side of D2. Pin 4 of the
microcontroller is connected to a 4k7 resistor (R1). The output of R1 is connected
just after the receiving end of a 1N4001 diode (D1), and this connection joins pin
1 (VDD) the 5x SIL socket (CONN1). Pin 5 of the microcontroller is connected
directly to ground, and also connected directly to a 100 nF ceramic capacitor
(C2). C2 is then connected to the non-receiving end of D1, pin 2 of the MMCX
antenna connector (J1), which then connects to pin 14 of the microcontroller and
pin 2 of CONN1. C2 is also connected to the SPST push button (S1), which is
connected in parallel with a 10 nF ceramic capacitor (C3). The other end of S1 is
connected to a 100k resistor (R2). The other end of R2 is connected to ground.
The other end of J1 is connected to VCC. Pin 6 of the microcontroller is connected
to the junction between C3, S1, and R2. Pin 7 of the microcontroller is connected
to pin 7 of the SD card socket (CONN2). Pin 8 of the microcontroller is connected
to pin 2 of the SD card socket, and to a 10k resistor (R9). The other end of R9 is
connected to the base of a BC327 PNP BJT (Q2). The collector of Q2 is
connected to a 330R resistor (R8). The other end of R8 is connected to the red
end of a bi-color LED (D3). D3 then connects to ground. The emitter of Q2 will be
mentioned later. Pin 9 of the microcontroller is not used in this circuit.




                                                                               66
          Figure 25 First Half of GPS Unit Circuit Diagram
            [Reprinted with permission from Andrew M. Bishop from
              http://www.gedanken.demon.co.uk/gps-sd-logger/]

Pin 10 of the microcontroller is connected to pin 5 of the SD card socket. Pin 11
of the microcontroller is connected to pin 1 of the SD card socket. Pin 12 of the
microcontroller is connected to pin 5 of CONN1. Pin 13 of the microcontroller is
connected to pin 4 of CONN1. Pin 15 of the microcontroller is connected to a 10k
resistor (R15). The other end of R15 then connects to pin 6 of the 10x SIL socket
(CONN3), and to another 10k resistor (R16). R16 is then connected to ground.
Pin 16 of the microcontroller connects to pin 3 of CONN3, and to a 10k resistor

                                                                              67
(R14). R14 then connects to the base of a BC327 PNP BJT (Q4). The collector of
Q4 then connects to a 1k resistor (R13). R13 then connects to the red side of a
bi-color LED (D4). D4 then connects to ground. The emitter of Q4 connects to the
collector of another BC327 PNP BJT (Q3), pin 9 of CONN3, a 2k2 resistor (R12),
and a 100k resistor (R11). The other end of R12 is connected to the green side
of D4. The other end of R11 connects to ground. R11 is also connected in
parallel to a 100 nF ceramic capacitor (C5). The connections for the base and
emitter of Q3 will be mentioned later. Pin 17 of the microcontroller connects to
pin 4 of CONN3. Pin 18 of the microcontroller connects to a 1k resistor (R10).




        Figure 26 Second Half of GPS Unit Circuit Diagram
            [Reprinted with permission from Andrew M. Bishop from
              http://www.gedanken.demon.co.uk/gps-sd-logger/]


                                                                             68
 R10 is then connected to the base of Q3. The emitter of Q3 connects to V CC,
and to a 68k resistor (R17). The other end of R17 connects to pin 7 of CONN3,
and to a 100k resistor (R18). The other end of R18 connects to ground. Pin 3 of
CONN2 is connected to pin 6 of CONN2, which are both connected to ground.
Pin 4 of CONN2 is connected to the collector of Q1, to the emitter of Q2, to a 2k2
resistor (R7), and a 100k resistor (R6). The other end of R6 is connected to
ground. There is a 100 nF ceramic capacitor (C4) connected in parallel with R6.
The other end of R7 is connected to the green side of D3. Pin 3 of CONN1 is
connected to ground. Pins 1, 2, 5, and 10 of CONN3 are not used in this circuit.
Pin 8 of CONN3 is connected to ground. VIN on the LE33CZ Voltage Regulator is
connected to a 3.6 V battery (B1). B1 then connects to ground. GND on the
voltage regulator also connects to ground. VOUT on the voltage regulator
connects to a 2.2 uF capacitor (C1), and VCC. The other end of C1 is then
connected to ground.




                     Figure 27 Completed GPS Unit


                                                                               69
     Master Microcontroller
The Digilent Cerebot board is designed to work well with Digilents full line of
peripheral modules. These modules connect to the Digilent Cerebot board using
Digilents 6-pin connectors. These add-on boards are specifically designed to
work well with custom applications involving switches, buttons, LEDs, and other
circuits. The Digilent Cerebot board uses an ATMega64 AVR processor with
4KB of internal SRAM and 128KB external SRAM. The microcontroller also has
64KB of program flash memory that can be used for storing the program code
necessary to power the Tailgate Buddy and a 2KB EEPROM that was used for
the purpose of storing a basic boot up algorithm allowing all the components of
the robot to come alive using the proper startup process each component will
need. The microcontroller has the ability to directly drive up to eight servo
motors and three H-bridge modules. This board is preferable for the mobile app
on the Tailgate Buddy because of its low power consumption, small size, and
processing power.

The Tailgate Buddy required multiple add-ons for the different systems. The
obstacle avoidance system required a PIC16F690 chip programmed to accept
the PWM signal from the ultrasonic sensors and return the distance measured by
each sensor back to the main microcontroller. The tracking system required a
Atmega168 programmed to accept in the PWM signal from the infrared sensors
and output back to the main microcontroller which direction the vehicle would
should turn to keep up with its target. The drive system required several servo
motors and a motor controller to control the throttle and the steering of the
vehicle. These systems plugged directly into the main microcontroller and
utilized the onboard servo plugs. To control the main servo plugs I am utilizing
bit banging and individually toggling the signal lines to each of the servos.

The master microcontroller has a failsafe system to prevent the Tailgate Buddy
from running away or ramming obstacles. The fail safe system consists of a
watchdog timer and a rating associated with each process. If the process
freezes up and gets caught by the watchdog timer the process will be terminated.
Based on the rating associated with that process the vehicle may be shut down
and require manual restart. If the process is a minor process not essential to the
operation of the vehicle, the process will be terminated and restarted to allow the
Tailgate Buddy to continue to follow uninterrupted. If the process is a critical
process, like the obstacle avoidance system, tracking system or the speed
control system the Tailgate Buddy will be shut down and allowed to roll to a stop
to prevent it from causing damage or injury to any surrounding pedestrians or
obstacles. The master microcontroller will then attempt to restart the application.

                                                                                70
If the application restarts and operates properly returning the correct output,
assuming the Tailgate Buddy‟s tracking system still has its target in view the
Tailgate Buddy will resume its course and catch up to its target. The master
microcontroller then records this error in a buffer file which is saved in the
onboard flash memory. The recorded file makes for easier debugging later and
allow the Tailgate Buddy to report any errors it has encountered during its run.

The figure below shows the schematics for the Digilent Cerebot microcontroller,
the master microcontroller in the Tailgate Buddy. The schematic shows all the
power connection options and many of the ports available on the microcontroller.
The schematics show the details for how the SRAM is connected to the board
the reset button and the LED‟s available for output on the board. The schematics
also show the available servo motor connectors and the PMOD connectors used
for connecting the Digilent Add-on boards.




             Figure 28 Master Microcontroller Schematic
                 [Permission to reprint from www.digilent.com]


                                                                             71
     Software
A simple console application was programmed for extracting the GPS data from
the Secure Digital (SD) card. The data from the GPS receiver is stored on the SD
card not as ASCII values, but as pure high and low bits, which means that the
data are not immediately readable or recognizable to any operating system. The
application will extract the data and parse it in a manner that will be readable by
Google Maps, or a similar online map service. This program allows the user to
select a drive or directory on his or her PC (personal computer) that contains
relevant GPS data. The parsed data is stored in a text file which does contain
ASCII values.

The main function of the application takes two arguments, as illustrated in Figure
29 Example of How to Launch GPS Parser Utility below. The first argument
the application takes is the location of the input data. The second argument the
application takes is the location and file name of where the user would like to
store the output data. After the user presses the enter key, if the user input is
correct, the program begins parsing the data according to the user specifications.

The previously mentioned program creates a comma-delineated text file. This
text file is then able to be uploaded to a website with the address
http://www.gpsvisualizer.com. This website allows the user to choose which
service (Google Maps or Google Earth) on which the user would like to view the
coordinates from the most recent use of the Tailgate Buddy. This website also
allows the user to save the coordinates as a map in a JPEG, PNG, or SVG file,
an elevation profile, or even as plain text.




           Figure 29 Example of How to Launch GPS Parser Utility


                                                                                72
     Motor/Drivetrain
In choosing to use a Power Wheels vehicle, the overall design of the drivetrain
was greatly simplified mechanically, as the original configuration can be used as-
is. There was no need to modify anything mechanical. The motors already have
a gearbox set up for a low gear ratio. This gave the ability to use the small but
efficient motors the vehicle came with. Another nice quality with using the motors
and gearboxes in their original configuration was the resiliency of the design. It is
a proven design that has been engineered and revised by its makers to make it a
lasting quality part. They can stand up to the abuse that children inevitably put
them through. A few members of this project grew up with some of the original
Power Wheels‟ Jeeps. From previous experiences, the vehicles have proven to
be water resistant, built with parts with good heat dissipating qualities, and
overall extremely rugged. They were driven through tall grass while going up
slopes even though they were designed to only be driven on hard surfaces.
They were subjected to carrying more weight than the original 130 lbs they are
rated for. One even stood up to being over powered by using a 12 volt marine
battery and then subjected to popping wheelies while being driven by an average
adult male. Never once did a vehicle strip a gear or burn up a motor while being
subjected through years of torture. All of these vehicles were given away and
used by younger children, and no doubt put through more abuse.

Although the motors and gearboxes were used as-is in the mechanical aspect,
the wiring needed to be heavily modified for the purpose of this project. The
vehicle was set up for having both a low and high speed when operating in the
forward direction, and a low speed reverse function. The low speed is
approximately 2.5 mph and the high speed is approximately 5 mph. This is nice
for a child‟s play toy as 2.5 mph is a nice walking pace and 5 mph provides for a
little bit more fun. Although the 2.5 mph speed would work for a normal walking
speed for the vehicle to follow the user, this was not an ideal setup for a few
reasons. The first reason being, that not every user will walk the same speed.
Also as the batteries drain, the speed will gradually slow down. Finally if an
obstacle is encountered and causes the vehicle to fall behind the user, it should
be able to pick up a little more speed to catch up with the user when it is no
longer obstructed. Ideally the user should never have to wait around for the
vehicle to catch up.

To combat those problems the vehicle needed to be able to have a variable
speed setup. Only having a choice between 2.5 mph and 5 mph could work but
the operation would not be as smooth as a variable speed setup with at least four
to an almost infinite number of selectable speeds. Almost all of the original wiring
configuration was done away with. It was replaced with an electronic variable


                                                                                  73
speed control, which is controlled by the microcontroller when in autonomous
mode, or by the RC receiver when in manual mode.


     Power Supply
The power supply is composed of three separate battery systems and their
chargers. The largest battery bank is made up of a 12 volt 9.5 Ah lead-acid
rechargeable batteries. It is battery that came with the Power Wheels electric
vehicle. An example of one is pictured below. The “Pb” symbol on the battery in
Figure 30 - 12 Volt 9.5 Ah Rechargeable Battery indicates that the battery is a
lead based battery.




           Figure 30 - 12 Volt 9.5 Ah Rechargeable Battery
Since the microcontroller was to be run off a separate battery system, it did not
need to be as large or as high of a capacity of a battery system as the batteries
for the motors require. However it still needed to be rechargeable as replacing
batteries over and over will get expensive and should be reduced as much as
possible. Because of this, a smaller 6 volt lead-acid battery was selected. It has a
capacity of 4.5 Ah which was more than what was required.

                                                                                 74
     Electronic Speed Controller
The speed controller is a crucial part of the vehicle‟s overall control and
movement. It has multiple types of inputs and outputs. The most obvious input is
the supply voltage. It receives a 12 volt input voltage which it uses to power itself
and it outputs a variable voltage and variable current, up to that 12 volt supply, to
the motors. It also uses a pulse width modulated input that is used for both RC
inputs and for receiving commands from the microcontroller.


     RC Tx/Rx
Since the three channel radio system was used, the normal driving functions,
forward, reverse and steering are handled in manual drive mode in much the
same way as in autonomous mode. The receiver outputs a pulse-width
modulated signal on each channel which are connected to the servos and motor
controller. The pulse width signal is used to determine which direction to move
and how fast to power the motors or how far to turn the wheels when steering.
For the water gun function, the toggle switch on the controller operates the third
channel of the radio. When the switch is toggled, it signals the water gun‟s servo
which toggles a switch and sends DC power directly to the water pump. Since
the microcontroller and RC receiver both have to control the same servos and
motor controller, but at different times, this created a problem and the need for a
solution. The solution was quite simple and uses an array of diodes and relays in
combination with the three channel transmitter and receiver. Relays were be
used to cut signal off from the outputs of the microcontroller or receiver


     Chassis
For simplification a chassis that is already complete and meets most of the major
goals for a chassis was purchased. The chassis that was selected needed to be
able to hold the required payload of 100 pounds. It needed to be able to
conqueror the terrain specification that the vehicle was intended for. Some
modifications needed to be made to the vehicle for it to carry the payload
securely and hold the electronics.

The first modification that needed to be done to the vehicle was to cut a portion
of it out to make room for the payload carries. This meant removing the seats
and making a suitable platform for a cooler to be placed. The second
modification that needed to be done was to mount the two IR Detectors on the
front of the vehicle as shown in Figure 14 Detection Cone. The detectors
needed to be mounted on each side of the front of the vehicle. They also needed

                                                                                  75
to be aimed fifteen degrees off center towards the outside of the vehicle for the
proper operation of the tracking system. This was a critical dimension to be kept
so the mounting of these two detectors needed to be very robust and needed to
have as little likelihood of breaking or changing direction as possible. The
obstacle avoidance hardware also needed to have a secure mounting on the
front of the vehicle.

The biggest modification that needed to be made to the vehicle was to convert
the steering system to a powered version capable of being controlled via a
microcontroller. The first idea on how to do this was to remove the steering
wheel and replace it with a linear actuator. The actuator would be attached to
the chassis with the ability to rotate about an axis. However since the cost of
linear actuators that could be operated by RC or a microcontroller was in the
$300 range, it was decided that a very large and powerful servo was a better
option. The servo that was selected was the 5:1 HS-805BB Power Servo (shown
below) with metal gears from ServoCity.com. It has 1,715 oz-in of torque at 6
volts and proved to be more than enough power to easily steer the vehicle.




                   Figure 31 HS-805BB Power Servo


                                                                              76
The other components, microcontroller, GPS module and antenna were mounted
inside the compartment where the main battery was originally located. The 12
volt and the 6 volt batteries are both located in the under seat area for more room
in the front compartment. They were mounted inside of waterproof boxes to
ensure that they will not get wet in the event of any rain.


     Water Gun
The automotive washer pump system appeared to be the ideal setup for this
application. All the parts for this design came from a 1999 Dodge Dakota pickup
truck. The reservoir and pump are fitted together in a compact unit. These parts
were chosen because of the compact design and also because they were
salvaged parts off a team-member‟s wrecked vehicle. Using parts already in
possession of the team helped keep overall costs down. The pump and reservoir
are located on the floor of the chassis. Installing them under the plastic hood of
the Power Wheels Jeep would be a nice location; however there is not a lot of
space under there and most of the electronics were mounted there. There is
space on the floor of vehicle though. Since there is no real driver or passenger,
legroom is not a concern. Also having the reservoir there still allows for easy
refilling.




                                 Reservoir


    Battery                                                    Nozzle

                                                      Hose
                   Switch        Pump


                 Figure 32 Basic Washer Pump System

The nozzles were fitted to the plastic front fenders of the Jeep in much the same
way as they would on a car with the exceptions of the outlet facing forward
instead of facing a windshield, and mounted at the front of the vehicle instead of
towards the rear of the hood near the windshield. This setup put the nozzles in a
prime position for hitting people with the streams of water where they are likely to
easily take notice, which is from just below the abdomen down to the knees. The
hose which connects the nozzles to the pump and reservoir is routed underneath
the fenders and down through the base of the under-hood bin and through the
toe of the floorboard where it will be attached to the pump outlet. To do this holes

                                                                                 77
are drilled in the under-hood bin and through the floorboard. This was merely to
hide the hose, keeping the water gun as stealth as possible until it is fired off.
The original length of the hose was longer than needed since it used to belong to
a much larger vehicle. It was shortened so there wasn‟t a long coil of
unnecessary hose to fit into the vehicle. This was easily accomplished as the
hose connectors are a slip fit design. The hose can be pulled off either the pump
or nozzle ends and cut with scissors before reinstalling it back on the connector.

If a horn was used in conjunction with the water gun, it would have to be made so
it can also be silenced. A simple two pole switch in line with its power wire can
easily interrupt it and render it inoperable. The switch could have been mounted
on a panel along with other necessary switches. When the switch is off only the
water gun will operate. The same idea could also have been applied to the water
gun. In cases where the water gun is not desired, like being used indoors, a
switch can interrupt its power as well. If neither feature is desired, both can be
switched off; however the user may have to go back and let the vehicle find the
tracking device again before it can move on. Although switches are a very simple
solution, they add to the options that the user has available to them. However
with the limited time given for this project, the horn was an option that wasn‟t
really necessary and was left out for this prototype.




                                                                               78
Prototype
Since this project is a rather large venture that is composed of many smaller
projects, proper planning for the building of each system was very important. This
section is dedicated to the initial building of the vehicle and all of its subsystems.
A plan for how each subsystem was built is detailed below.


Procurement
All parts that were used on the project were purchased by the group. Most of the
parts were bought from online retailers since they have lower costs for almost
everything. For any parts that were needed that were not worth buying online,
resistors, capacitors, etc. the group visited Skycraft Parts & Surplus. Most of the
parts were on order by the start of the spring semester. This was done to ensure
that any parts that have a long lead time were able to be acquired with plenty of
time to build and test.


Building Methods
There were several different methods for building the project that were used. To
make any system easier to build, a system that was ready for integration upon
arrival was purchased. The microcontrollers are a good example of this. To
make the project simpler, a robot control board was purchased. This meant that
we did not have to use precious time designing a PCB for the master
microcontroller. The rest of the boards were all built using proto boards. The
GPS, Tracking System, tracking power supply, ultrasonic power supply, and the
ultrasonic microcontroller, were all built on prototype boards. The original goal
was to get PCB‟s made for each of these systems but the designs were not
finalized to make this idea cost effective.

For part placement there were a few items that were required; soldering iron,
magnification glasses for small parts, tweezers, solder wick, solder, solder flux,
alcohol for cleaning the board, etc. Two of the group members had a decent
amount of experience soldering electronic parts so we were able to solder all of
the components by hand in the senior design lab. After the parts had been
soldered to the boards they were visually inspected for any defects by someone
other than the person who did the soldering. If everything looked good the board
was cleaned with alcohol and tested for functionality. If it did not pass the
functionality test then the board was troubleshoot until it either worked or the
problem had been determined and a fix decided upon. This process of testing
and fixing continued until the board worked as expected.

                                                                                   79
Because of the skill and knowledge required build some of the components
required to build the Tailgate Buddy, a lot of the parts were ordered as an entire
subsystem and then assembled. If the required parts took extensive time to build
and test, the Tailgate Buddy could have run over time limits causing the project
not to be completed on time. By purchasing parts as whole units that could be
soldiered together and programmed through software, the Tailgate Buddy took
less time to build and has a higher reliability factor.


Subsystems
Each subsystem had to be built independently. This allowed for testing and
verifying that each system worked properly before the Tailgate Buddy is put
together. This is necessary to ensure that every system was functioning
properly. If a subsystem was not functioning properly, the system had to be
debugged to find the error and correct the problem. If the Tailgate Buddy was
assembled before all the systems are functioning properly it would be hard to
analyze if the problem was being caused by interference with another subsystem
or communication with the master microcontroller or if the problem was being
caused by the subsystem itself. For this reason a prototype of each subsystem
was built and tested to comply with the specifications for its operation. Each
subsystem was simulated first to ensure all the algorithms and code functioned
properly. Then the subsystem was built and ran under a controlled environment
to ensure that each part in the subsystem was able to communicate with the
microcontroller and that each part in the subsystem functioned properly.
Individual prototypes ensured that when the entire Tailgate Buddy is built that no
major problems would arise from upon the final build of the vehicle.


     Motors and Drivetrain
Since the main vehicle platform was purchased from Power Wheels, the majority
of the parts for the drivetrain came with the chassis. The motors and gear boxes
were already installed into the vehicle. However other smaller parts needed to be
acquired and added to the drivetrain. Most of these parts were for wiring the main
power circuits for the motors. These circuits are high current and were built using
12 AWG wire. Along with purchasing various colors of 12 AWG wire, various
connectors and terminals, heat shrink, fuses, wire loom, relays and switches
were needed. Most of these parts were purchased from Watek Inc.
[www.waytekwire.com]. They have just about every type of connector, color of
wire and type of switch anyone could ever need. Their selection is great and their
prices are very good considering there is usually a minimum order for each
product. For all the parts being assembled in the Tailgate Buddy, multiple


                                                                                80
switches, relays, and various other components were required making it possible
to order these items in bulk and get a reduced price.

Prototyping the drivetrain was fairly easy in comparison to the rest of the build.
Since the motors and gear boxes were already mounted, the wiring was main
focus for this area of the build. The majority of the vehicle‟s original wiring
configuration, as it comes from Power Wheels, was removed and reconfigured
for this application. The wiring between the speed controller and the motors used
the 12 AWG wire as it is the high current circuit. The controller side used the
screw down connectors that are on the controller‟s board. The motor side of the
wiring was made with quick disconnect spade style terminals. The original wiring
from the motor was cut and fitted with one end of the quick disconnect and the
new wiring will be fitted with the matching counterpart terminal. This made
reconfiguring the system easier as it had to be done a few times before it was
right. All of the relays and switches have a standard ¼” male spade terminal at
every connection. Sticking with this standard connection, ¼” female terminals
were used to make all the connections for those various components. All of the
wiring needed to be neatly laid out to avoid confusion. Wire was used to group
wires together to keep the layout cleaner. However since the wiring was
reconfigured a few times, the wire loom needed to be easily removable so wires
could be changed out and rerouted if necessary. Split corrugated plastic wire
loom was used instead of the mesh tube kind, since the split design allows for
the loom to be removed without disconnecting all the wires that pass through it.
This allowed for only the wires that need to be removed to be disconnected. Also
more wires can be added in without disconnecting all the wires that pass through
it.


     Power Supply
The main battery for the drive system is the 12 volt lead acid battery that came
with the Power Wheels vehicle. The batteries for the user‟s transponder are
rechargeable AA batteries but since they are a standard battery, they can be
replaced with alkaline batteries bought from local stores whenever they are
needed. The microcontroller, steering servo, GPS and other sensors are
powered by a separate rechargeable 6 volt lead-acid battery that was purchased
from batteries.com.

The main 12 volt battery for the drivetrain was mounted in the rear of the vehicle
near the motors. Originally the battery was mounted under the hood. It was
moved to transfer some weight off the front of the vehicle to lighten the load on
the steering servo. A new battery hold down strap had to be made as the original
was no longer able to be used in the new location. New wiring had to go from the
battery to the speed controller. The batter for the microcontroller and sensors has

                                                                                81
a quick disconnect that allows for the battery to be taken out and recharged.
Another connector matching the one on the charger had to be installed into the
vehicle so it can be easily connected and disconnected.


     Electronic Speed Controller
The MC7 electronic speed controller was bought from Diverse Electronics
Services. They seemed to have the most affordable motor controllers. Although
the price of the controller may seem high at first, for the features and specs that it
carries, it is actually a very good value for this application. The controller had to
be mounted somewhere between the drivetrain batteries. The goal here was to
keep the wires as short as possible to limit resistance and maximize efficiency.
There was room for it under where the seats once were and the payload area will
sit. This placed it close to the motors. There also needed to be adequate
ventilation for it to cool itself properly so a couple of vent holes were cut.
However these vent holes could not be in any location that could allow moisture
to get to the controller. The vehicles main payload is a large cooler. Since coolers
normally carry ice and water, it was crucial that any water spilled does not make
it down through a vent. So the vents were located towards the bottom of the
chassis. To aid in cooling, a small 12 volt computer case could have been added
to keep air flowing through the vents if needed. There were a couple of these
fans already in possession of the team. One particular model is a 4.5” brushless
DC 0.25 A fan. It proved to be able to flow more than enough air to help keep the
speed controller cool. The fan could be turned on when the controller receives its
supply power from the main batteries when the vehicle and controller are turned
on. Luckily the fans were not needed and the motor controller produced very little
heat. There also needed to be a new platform made for the payload to separate it
from the electronics to keep water from seeping down directly onto them. So a
plywood platform was cut to fit and then sealed and painted to look pleasing.

The motor controller connects to the microcontroller and the RC receiver using
servo connectors. The original plan is to only connect one connector to either the
receiver or microcontroller at a time and switch back and forth by disconnecting
one and swapping for the other system‟s connector to switch between modes. It
may was possible to make y-adapter that would allow both outputs to be plugged
in at once, however to use this, it had to be designed so that only one system
could use it at a time to ensure power wasn‟t backfed into the other component
and turning it on. This would cause both systems to fight for control over the
servos and motor controller. Having both on at once would likely confuse the
entire system and possibly damage it. This was done with a simple toggle switch
that when flipped one way only powers the microcontroller and when flipped the
other way powers only the RC receiver in combination with diodes and relays.


                                                                                   82
This ensured that only one system could be activated and using one output at a
time.


     RC Tx/Rx
All of the radio equipment was purchased from eBay and Servo City. Servo City
[servocity.com] specializes in the RC hobbies and robotics, and they also have
the widest selection of products out of any other dealer. Local hobby shops were
another option. There are quite a few that are local and they have many RC parts
that were helpful for this project. However their prices were usually a little higher
than ordering online, even after shipping and handling costs so they were used
as little as possible. The RC equipment had to be mounted under the hood with
all the other electronics but also had to be able to connect to the speed controller
which was mounted in the rear of the vehicle so a three foot servo extension was
needed. The receiver also had to be mounted in an area where the antenna can
easily make it to the outside of the vehicle. Placing the receiver under the hood,
near one side of the vehicle allowed for the antenna to be placed far to one side
of the vehicle but also far away from the motors which cause interference. The
antenna is a wire antenna and needs a plastic mast to support it upright. This
plastic mast is installed by drilling a small hole into the plastic of the chassis and
feeing the antenna up through it and out. The third channel of the radio that is to
control the manual firing of the water gun used a servo that was also mounted
near the speed controller so another three foot extension was needed. This servo
manually toggles a switch that feeds power directly to the water gun. To do this,
both the servo and switch needed to be rigidly mounted to a plastic plate and a
metal rod connects the servo horn to the end of the switch. When the servo
moves it flips the switch in either direction turning it on and off. It is in the off
position when the servo is in starting position; only toggling on when the user
toggles the switch on the transmitter. It is possible to buy solid state devices that
do this electronically but they were $30 for the cheapest models and still require
a relay. A servo only costs $10 and a switch is less than $2. So the mechanical
approach may not have been the easiest but it does work and cost the least
amount. Channel one of the RC system controls the forward and reverse
movement of the vehicle. It is the part that connects directly to the speed
controller through the servo connector. Channel two is what controls the steering
of the vehicle. This channel outputs to the steering servo that turns the front
wheels.


     Water Gun
The majority of the water gun was already acquired before the semester in which
the project was to be built even started. The pump, reservoir and nozzles are all

                                                                                   83
from the 1999 Dodge Dakota. The wire, switches and relays that were needed for
it were included in the parts that were ordered from Waytek for the drivetrain
wiring. The prototype for the water gun was pretty simple. The spray nozzles
were be mounted on the fenders by drilling a hole for each nozzle‟s connector
barb to pass through. The hoses connect to them from under the hood which
hides them and gives the nozzles a nice flush and stealth look. The important
thing to consider here is that there are other sensors mounted near the nozzles.
The IR receivers and ultrasonic obstacle detector are close by. The spray from
the water gun must not hit these sensors or expose them to any moisture from
leaks or drips, so they had to be carefully mounted. The hose continues through
the hood and down to the pump and reservoir which were mounted to what used
to be used as a floorboard for passengers. The microcontroller controls it by
using the same servo and switch that the RC system powers it. For the
prototype, this was all that is really required. Later on there could be an addition
of an audible horn and addition switching options but it was best to keep to a
minimum for the early design and to keep things simple.


Final Build
After individual systems passed basic testing the construction of the final build
was started. All the subsystems needed to be pulled together and made to work
as one fully functioning robotic vehicle. The chassis was the starting point since
all the subsystems had to mount to it. The basic layout for the component
locations is shown in Figure 33 Basic Layout of Components. The motors
were already installed in place from Power Wheels. They did not require any
different mounting techniques. The main vehicle batteries were mounted under
the payload platform the seats were removed and the body was modified for
them to fit and new battery hold downs them both down were fabricated. The
electronic speed controller was placed into the vehicle first. vent holes were cut
to reduce the heating from the electronics. The steering servo for the front
steering system was attached to the chassis and steering system of the original
Power Wheels design after heavy modification in the form of cutting and
fabricating steel mounts out of square box tubing.

With the basic design for driving functions taken care of, the control system
needed to be addressed. All of the microcontrollers including the master
controller and their power supply were placed under the hood. The RC receiver
was also being placed there and the hole for the antenna mast was drilled on the
right front fender of the vehicle. The receiver‟s wire style antenna will be fed up
through the mast and out through the top. The GPS logger also needed to be
attached to the chassis and it was positioned under the payload platform with the
batteries and motor controller. The antenna for it was fed up through like the RC
antenna was, however it was fed through on the rear side of the vehicle. The

                                                                                 84
antenna was mounted by screwing it into the body. Holes for connecting the new
wiring harness to the drive motors were drilled in the area under where the seats
used to sit and the wires fed through and connected to each motor. The signal
wires from the RC receiver and master microcontroller to the speed controller
and water gun servo were fed from under the hood, through the vehicles
floorboard, through the floor and then through under the payload platform and to
the controller and servo. The high current wires connecting the water guns power
needed to be fed from the main batteries under the payload area, through the
floor, to the water pump and reservoir. The holes for the nozzles were drilled and
the nozzles were inserted and secured in place. The hose for the water pump‟s
output fitting were fed up through from the floor, up under the fenders and to the
nozzles. The IR receivers were mounted up on the hood of the vehicle higher
than the nozzles. Their signal wires were ran all the way back to their
microcontroller and attached securely. They were run far away from main power
wires as the power wires to avoid electromagnetic interference. The front
ultrasonic sensor was mounted low on the vehicle‟s plastic bumper to give it an
accurate field of vision for all low obstacles. The signal wires for it were run
through the front of the body and then alongside those of the IR receivers. Once
all the main system components were in place and mounted securely, final wiring
connections were made. Wires were cut to their final lengths and terminals were
crimped onto wire ends and inserted onto switches and boards. Once all the
wiring was in place, all of it was covered with the plastic corrugated wire loom.
The wire loom was clipped into place to keep it from moving around or getting
caught on a wheel or other object or dragged on the ground.


        Wheel                 Pump and                              Wheel
                              Reservoir


                       Steering Actuator                                 M
                                                 All Batteries, GPS,     o
    Micro-                                       Motor     controller,   t
    controllers                                  and water gun           o
    and Receiver                                 servo                   r
                                                                         s


        Wheel                                                       Wheel



                   Figure 33 Basic Layout of Components




                                                                               85
Testing
It is important to test not only the completed vehicle but also each subsystem for
proper operation. Testing for each component began as soon as each was able
to be tested. Some components had to wait until all systems were finished. This
helped limit faults with bad parts and help minimize time spent troubleshooting. It
also gave a better understanding of how each part works. Testing of subsystems
began as soon as they were built and followed the testing plan outlined below.
Once each subsystem passed all of the tests, they were installed into the vehicle.
After completion of the build process, the entire vehicle was tested. This section
details the test plan, and testing environment for every aspect of the project.


Parts
Testing each of the parts prior to them being mounted in the Tailgate Buddy and
utilized was essential. Each part and accessories had to be inspected, setup
properly, calibrated and activated in order to verify they function properly and as
expected. Next, each part had to be run under simulated conditions to verify it
returned the correct output and ran under the normal environmental conditions.

The first group was made up of the passive devices and active devices. These
were the resistors, capacitor and inductors that were used in the project. These
only required a visual inspection prior to use that they are not damaged in any
way and that they are the correct size and spec that the design calls for. If the
design required a 250K Ohm resistor that is a 1/2 Watt and the resistor that is
ordered is a 250K Ohm resistor but only 1/8 Watt then it would definitely not work
for the design and a different resistor needs to be procured. The same goes for
all the other devices that were used in the design. If the part failed under normal
operation but was not inspected upon arrival, problems could have arisen upon
final assembly of the Tailgate Buddy that were previously unknown.

The next group of devices was made up of the critical parts. These parts needed
to perform as expected in order to make the design work. These parts were
tested individually to be sure that they performed correctly. For the IR LEDs,
they were tested for angle of radiation of the IR frequencies. They were also
tested to be sure that the specified amount of radiation is coming out of them per
the data sheet. This intensity was measured at intervals of three feet directly in
front of the device until the signal strength dropped too low to be read. The
electric motors were turned on and tested under no load to be sure that they do
not burn up, and spin without major problems (grinding noise, spraying grease,
bent rotating shaft, etc.). The batteries that powered the vehicle were used and
drained and then recharged to be sure that they function properly. The motor

                                                                                86
controller was tested on the motors and all functionality that was to be used in
the final design was tested.


Subsystems
Each subsystem was tested individually before the system was approved to be
installed on the final vehicle. Each subsystem had its own specific tests that
needed to be performed. These tests are specified in the appropriate section
below for the system in question. Once a subsystem had passed all the tests,
the design was then frozen, and a final version was made. It was this final
version that went into the vehicle. In some subsystems, where the parts were
expensive, the prototype was used in the final Tailgate Buddy vehicle.


     Chassis
The chassis is a very important part of the design of the vehicle because of the
environment that the robot operates in: the chassis needs to be able to be driven
off roads, across parking lots, and even be able to weather some light rain and
still function as expected. The decision was made to buy a prebuilt chassis to
ensure that there will not be extensive problems with the chassis that would take
away valuable time needed to design, test, and build other systems the Tailgate
Buddy would need. As with all the systems on the robot, any changes or
modifications made to the chassis had to be tested thoroughly to ensure that the
chassis could still support the required weight, and was not weakened due to the
design change. Any changes to the mechanical structure of the vehicle needed
to be very thoroughly tested in the environment the vehicle was to be operated in
before the parts that are susceptible to breaking were installed. Once the
chassis had passed these tests it was ready for the subsystems to be installed.


     Tracking System
The tracking system is composed of two main subsystems; the transponder and
the IR detector. For the proper functioning of the tracking both subsystems must
be in proper working order and had to pass all the tests as laid out in their testing
described below. The overall tracking system has a single primary goal and that
is to tell the drive system what to do. It does this with two detectors and a
transponder that is on the operator. While the operator is in the central zone of
overlap by both detectors the tracking system tells the drive system to drive
straight. The strength of the signal tells the drive system how fast the vehicle
needs to move in the forward direction. The system also compares the
difference in signal strength from the transponder to the two separate detectors

                                                                                  87
and uses this information to determine which direction to turn and how much to
turn. The best way to test the tracking system was in conjunction with the drive
system on the vehicle and to test as a part of a partially integrated system. The
GPS, water gun features as well as the obstacle avoidance did not need to be
integrated into the vehicle at the time of this testing.

To test this in the lab the vehicle needed to be set up so that not one of the
wheels was touching the ground. Then the drive and tracking systems were
turned on. The transponder was being placed directly in front of the vehicle at a
distance of five feet. The vehicle wheels should not move within six feet of space
from the vehicle. The testing table shown below Table 8 Tracking System
Distance Test and has the criteria for passing or failing this test. Once the
distance test had been passed the next important test to run was to test the
system for turning capabilities. The transponder was placed at a distance of 10
feet from the vehicle and then moved to one side and then the other using the
testing table shown in Table 9 Test for Turning Response. Both of these tests
were critical and required all elements of both tests to be passed for the device to
be ready to move on to outside testing.

                  Test of Tracking System for Distance


       Distance(ft)       Expected response of vehicle          pass     fail
            5                    no movement

            8              rear wheels slow movement

            10              increasing speed from 8ft

            12              increasing speed from 10ft

            14              increasing speed from 12ft
            16                   maximum speed
            18                   maximum speed
            20                   maximum speed
            22                   maximum speed
                 Table 8 Tracking System Distance Test




                                                                                 88
                         Test for Turning Response

        Distance(ft) and
                              Expected response of vehicle          pass fail
       direction off center

     2 left @10 ft            straight

     4 left @10 ft            slightly turning right at about 20°

     6 left @10 ft            slightly turning right at about 30°

     8 left @10 ft            sharply turning fight at about 40°

     10 left @10 ft           turning right at about 45°

     2 right @10 ft           straight

     4 right @10 ft           slightly turning left at about 20°

     6 right @10 ft           slightly turning left at about 30°

     8 right @10 ft           sharply turning left at about 40°

     10 right @10 ft          turning left at about 45°


                     Table 9 Test for Turning Response
The next series of tests that were run on these subsystems took place outside.
All of the subsequent tests described in the paragraph were performed in various
conditions. The first condition was a cloudy day with no direct sunlight to attempt
to minimize the potential interference, secondly was on a sunny day, and lastly
was on a day of light rain. These different weather conditions were needed to be
tested in because they could have had potentially different results of the
functioning of the vehicle. The tests that were performed outside were an analog
of the two previous tests that were run indoors with the vehicle up on blocks.
This required at least two people to run the tests one person to hold the
transponder and the other to record the data. The first test was the straight
ahead speed of the robot. The person with the transponder started at the front of
the vehicle and slowly walked away from the vehicle. The person who was
recording data noted the approximate distance when the robot started to follow.
The operator then walked at a constant speed and the robot was to follow at
about six feet behind. If the robot did this then the operator would start to vary his
or her walking speed to see if the robot correctly adjusted to this change in
distance to the operator. When this straight driving test worked as stated there
                                                                                   89
was one last test that needed to take place. This was a test of the ability of the
tracking system to turn the vehicle. The operator started to walk away from the
robot at a constant speed to get the robot to follow, and then he or she turned off
in one direction slightly. If the robot responded as it should and turned to follow
the operator, the turning radius was increased until the tracking system lost line
of sight of the operator. Then the operator performed the same steps but turning
the other direction. The person recording data wrote down as accurately as
possible how well the robot responded to the differing turning radiuses of the
operator. All the tests had to be rerun under the other test conditions to ensure
no systems would break down under normal operating conditions. When the
tracking system passed these tests it was ready for completion.


        Transponder
Since this device is critical to the proper functioning of the vehicle it needed to
undergo a little more testing than most subsystems of the vehicle. If any of these
subsequent tests did not pass then the design was to be changed or improved
upon. These changes were to ensure that the design passed the specifications
given to it by the group. The first few tests of the transponder were tests to
establish the maximum range for the system. This needed to be greater than or
equal to a minimum of 12 feet. If the range was not adequate the IR LEDs might
have needed to be replaced with higher performing ones that had better range.

The second test involves the IR detector as well and tested what frequency was
best suited for performance and battery life. If it was possible to pulse 10 times a
second vs. 10,000 times a second the circuit would consume much less power
and require less batteries to work correctly. But, if the IR detector does not
detect well above 1 MHz for example and not well below 250 KHz then the
frequency would need to chosen from between those two frequencies for proper
operation of the system. So there was a lot of testing that was required to find
this ideal frequency of operation. To easily change the frequency instead of a
resistor being soldered into place a variable potentiometer was used in its place
so changing frequencies is as simple as rotating a knob.

The transponder also needed to be tested outside the lab to be sure that it gave
off the correct energy outside with other things around to disturb the operation of
the circuitry and even the IR transmitted beam. All the tests that were performed
outside were the same as the tests that get performed inside. All data that was
tested for was recorded for further evaluation upon the completion of the test.
The evaluation was done by the system designer and if there were any major
changes required it was to be discussed with the entire group. A major change is
one that involves altering the design beyond changing values of passive
components. If a different circuit topology is required or more IR LEDs then the

                                                                                 90
consent of the group was needed before further work could continue on the
subsystem.

To ensure that this device would last long enough to provide for working
operation during the runtime of the vehicle a lifetime test took place. This test
took place in the lab but unlike before it was running from its battery supply. The
transponder was turned on for this test and the output was recorded once every
five minutes until the device battery either died or the received output went below
the detection threshold for minimum operation. If it was deemed important
enough then a rechargeable battery would have needed to be installed and have
proper connections for recharging the device.


        IR Detector
This device is in most robots and is the part that has the highest rate of failure or
works the most inconsistently of all the subsystems present. This meant that this
subsystem needed to built very robustly and be reliable. The design needed to
be simulated in SPICE a few times to be sure that it performed correctly. Then
the design was bread-boarded to ensure that it performs just as well in the real
world as it did in SPICE. All necessary changes encountered were made to the
circuit and then the circuit was retested for stability and function. To test for
function the transponder also needed to be working so that there was at least a
signal being transmitted by the device. With both devices working they then
needed to be tested together. This involved setting both devices up so that they
were pointed towards each other, turning both devices on and then seeing how
much signal was detected. There were a few parameters to vary and record data
on that aided in the tracking program. The first parameter that needed to be
varied was frequency. This was the hardest parameter to changes because it
required component changes on the transponder. A wide variety of frequencies
were tested from 1Hz to 500 KHz to see what frequency seemed to perform best.
After the ideal frequency had been found (38 KHz) the detector was tested to see
how much signal drop there was from increasing and decreasing the distance
from the transponder to the detector. Starting at least three feet away and
moving forward helped determine the distance at which the transponder is able
to pick up the signal. This max range where there was still a signal being
detected was to be a distance greater than twelve feet from the detector to the
transponder. If the max range was less than this major redesign would need to
be done to ensure the range criteria was meet. The next test involved testing the
off-angle sensitivity see Figure 34 Photodiode Angular Sensitivity, for a
diagram of what the device should read out according to the manufacture. A
chart similar to the one below had to be recorded to determine the position of the
target in front of the vehicle.


                                                                                  91
               Figure 34 Photodiode Angular Sensitivity
                     [Figure taken from Data Sheet Attached]

The next test that was run was angling the transponder so that it was not pointed
directly at the detector. This data while important to the running of the device is
not as critical as the photodiode angular sensitivity to the operation of the robot.
The detector was to be able to detect the transponder at angles of at least 30
degrees at a range of twelve feet. If the original design was unable to
accomplish this specification, then additional IR LEDS were needed to be added
to the transponder, these were angled in different directions so that the detector
is able to see the transponder in different angles with greater range and
accuracy. See Figure 35 IR LED Angular Sensitivity for the approximate
power that would be seen by the detector at various angles of the IR LED. It
appears from this that at 30 degrees of inclination the detector would only be
seeing half the power that is transmitted by the led. If this held true and the max
range was close to the twelve feet minimum then more IR LEDs were needed to
be added to the transponder to ensure correct operation of the tracking system.
However if the max range was for example twenty five feet then half of that
power would mean that at twelve and a half feet the detector would see the same
signal if the led was angled thirty degrees off the detector. All of these tests were
first run inside where the environment was controlled and there was minimal
interference from other sources. After the detector passed these tests it needed
to be tested in its working environment, which is outside during the day. All tests
were rerun in various conditions outdoors. The tests took place on a cloudy day
with no direct sunlight, on a clear day with plenty of sunlight striking the
transponder and the detector. Finally the devices were tested on a day of light
rain to ensure they could work through the rain and not malfunction.

                                                                                  92
                  Figure 35 IR LED Angular Sensitivity
                     [Figure taken from Data Sheet Attached]


     GPS
Before the GPS unit was installed in the chassis of the Tailgate Buddy, the unit
was tested independently of any other system. Since the unit is completely
independent of the other components of the Tailgate Buddy, the GPS module
can be tested regardless of the status of the rest of the project. The unit was
tested outdoors on a day with minimal cloud cover. The unit was tested for
periods of ten to twenty minutes. During part of the testing period, the unit was
driven around in a car to obtain a wide variety of coordinates. This also helped to
determine if there is any effect on the unit due to being in a vehicle, due to the
line of sight to the satellites being partially obstructed. During the other part the
testing period, the unit remained stationary to further confirm the accuracy of the
entire unit. The GPS unit will also as tested in the same conditions, but on a
cloudy day. The cloud cover appeared to have little effect of data being recorded
to the SD card. The indoor test of the GPS unit had to be conducted in a slightly
different fashion, since a car was inconvenient indoors. The unit was still tested
on a clear day, but had to be carried by hand around inside a building. The unit
was tested in a building with a metal roof, (the atrium of the Engineering II
building on the UCF campus). The unit was also tested in the same building on a
cloudy day. The cloud cover and the metal roof are probably the worst case
scenario for the GPS unit‟s performance, as both of these conditions, depending
on their severity, can impede a GPS receiver to varying degrees. The GPS unit
was also tested during the environmental tests. As the prototype Tailgate Buddy
traveled in its testing sites, GPS data was being collected, which also determined


                                                                                  93
how the GPS unit would fare in the rain (or simulated rain). Near the end of the
tests, the SD memory card was removed from the GPS unit and the data was
loaded into a PC. The data was then extracted from the SD card using a simple
C program to parse the data. The data was then mapped by
http://www.openstreetmap.org.


     Motors and Drivetrain
To properly test the motors and complete drivetrain, it needed to be tested in
phases. The first phase was required to test the motors in the original
configuration that they came in from the original Power Wheels vehicle. This was
a fairly easy testing procedure. The vehicle was assembled according the
instruction manual‟s procedure for use as a child‟s toy. This ensured that the
vehicle was working properly before it was modified. If something was wrong with
the vehicle from the factory, the problem may arise and then may be dealt with
before the building could begin. This is important because if the vehicle was
modified and then found to be problematic, it could not be returned to the place
of purchase. The vehicle needed a driver to do the initial test drive. Since the
weight limit is rated for only 130 lbs and there is a physical size constraint, none
of the members of this team were able to drive the vehicle. However one group
member did have a niece and a nephew whose combined weights equal almost
exactly 130 lbs. They had expressed that they are more than willing to go for the
first test drive. Having the appropriate weight, when testing the motors was
important, because the vehicle needed to carry loads near that weight on a
regular basis. If the motors were underpowered and could not work effectively at
what they were rated for, then the vehicle may not have been able to be used for
this application.

The next phase tested whether the motors could work properly when powered by
the electronic speed controller. This phase could happen only after construction
had started and the vehicle had been modified. This not only tested the motors
and how they could work with the speed controller but it also tested the main
power wiring that sends power from the batteries through the controller and then
out to the motors. The speed controller can take an analog input on each channel
and through the use of potentiometers speeds can be manually adjusted on both
motors. They were tested at low through high speeds first, keeping the speeds of
both motors the same as they are wired together. When the vehicle was able to
pass this phase, it was further built and moved on to testing driving systems as a
whole.




                                                                                 94
     Power Supply
The power supply had several different tests. Each battery subsystem had to be
tested. They were tested for function, capacity, and lifespan. The first battery
system to test was the original Power Wheels battery. It was tested in the vehicle
in its original unmodified form when the motors and the rest of the chassis were
being tested. During this procedure, the new battery must be charged to full
capacity for 18 hours. This was required according to the instructions and was
followed to ensure that the batteries are able to work at full capacity. The obvious
test was to see if they can even power the vehicle. The driving then continued to
see roughly how far and for how long the vehicle could travel. This was done to
make sure the battery was within the specs that it was rated for. To do this, the
test drivers were required to drive the vehicle in a loop, at a walking pace, around
their neighborhood as many times as they could before the battery drains. Their
progress was monitored by a group member and distance traveled was
calculated. At that point further testing on this battery was held off until testing of
the complete drive system was started.

The design called for the microcontroller and other electronics to have their own
battery supply. This battery had to be tested in a few ways. The first was to see
how long it could power the electronics at idle times. This was to test how long
the electronics can be left on while the vehicle is remaining stationary. It was
merely to determine the maximum standby time. The second test was with the
microcontroller performing a repetitive task of powering the speed control and
steering servo in a pattern of accelerating, slowing and stopping all while turning.
The speed control was powering small motors but they got their power from a
secondary power source. The microcontroller was only putting out low signal
power just like it would be doing when functioning as the complete drive system
does.

The tracking device or transponder also has its own battery for its power supply.
This battery was required to last for a full days worth of tailgating. The test for this
was very simple. It was only required to light IR LEDs, but it is required to do this
for hours. This was tested once the transponder was completed. It was simply
left on for as long as possible while the IR receiver that was used on the vehicle
could still track it successfully. If it could pass 12 hours the test would be ended
early, before the battery was completely drained. While the battery should last a
long time, if it couldn‟t last eight continuous hours, the user would need to shut
the transponder off when not needing the vehicle to be following them. Normally
this would not be a problem, but being able to last for 12 hours would ensure that
the user would not forget and drain it prematurely. IR cannot be seen by the
human eye so the user may be more inclined to forget to check the on-off switch
if there is no other visible means of detection. If needed, one IR LED may be

                                                                                     95
replaced or another LED with coloring in the visible light spectrum could be
added instead, to remind the user when the device is on.


     Electronic Speed Controller
The first test for the speed controller was needed to be tested before most of the
vehicle was even built. The location of this test was not of great importance as it
was done in the prototyping process of the vehicle. It was done in the garage and
yard of a team member‟s residence. It involved a basic communications check
between it and the microcontroller and the RC receiver. The microcontroller
needed to output signals that the speed controller can understand. The first
check was with the speed controller wired to the motors and a sample program
flashed into the microcontroller. The program was a simple test of sending power
to the motors and controlling them for a few seconds at a time. This was done
with both the microcontroller and the speed controller installed in the vehicle.
This also tested how the vehicle moved. Once it could move on its own, the
maximum payload of 130 lbs was put into the vehicle and movement was tested
again.

The second test was to determine if the speed controller could accept control
from the RC receiver. The input was switched to the RC adapter and the speed
controller set for radio control. Full driving functions were tested as the
transmitter had full function once the controller was connected. This also was
tested with the maximum payload to establish how the speed controller handled
under heavy load and radio control. Once this test was passed, the input of the
speed controller was switched back to receiving control from the microcontroller.
This was to test whether the speed controller could successfully switch between
inputs and determine how it reacted to the change. If it did not react well to the
change, the RC system would have to be switched out for the basic two-channel
system that uses switches and relays to control the motors directly, thus
bypassing the speed controller entirely and allowing it to remain connected for
the microcontroller. When the results of these tests were completed the vehicle
was considered mobile and the building of other systems of the vehicle could
begin.


     Obstacle Avoidance
The ultra sonic sensors have a range of seven and a half feet in front and a side-
to-side view of four and a half feet. Using these parameters to test the sensors,
the sensor was required to identify objects anywhere within its field of view. To
test the individual sensors, each sensor was connected to a serial port on a
standard PC and powered up. Using a simple program written in the C

                                                                                96
programming language to communicate with the serial port the computer
recorded all the data communicated by the sensor. A variation of this program
was used to develop and test an algorithm for the obstacle avoidance system.


        Ultrasonic Sensors
Each ultra sonic sensor was connected to a PC individually. The sensor was first
calibrated. The calibration cycle happens automatically on this model ultra sonic
sensor. To ensure accurate calibration of each sensor, all obstacles had to be
cleared out of the sensors range of sight. Within ten feet in front of the sensor
and 6 feet from side to side had to remain clear while the sensor was calibrated.
Once the calibration cycle was complete the sensor was tested. To test the
sensor, an object was introduced in the middle of the field of view to ensure the
sensor could see the object. When this was found to be true, the object was
removed. The next step in the process was to test the extremes of the field of
view. First an object was introduced at a distance of six feet to one side and
moved between zero feet to ten feet distance from the sensor. If the sensor did
not see the object the distance to the side was moved in by one foot and the test
was rerun. If the sensor still did not see the object, the distance the object is
from the side of the Tailgate Buddy would have to decrease by a foot. Once the
sensor saw the object and gave a distance reading of the object, this process
continued until the object was passed immediately in front of the sensor and
reached six feet to the far side of the sensor. This was repeated for each sensor
allowing the group to map the field of view for each individual sensor. This
helped to determine the best position on the Tailgate Buddy for the sensor and if
all three sensors were identical or if one of the sensors had a blind spot or
anomaly that could have been problematic in setting up an accurate detection
grid with few or no blind spots.




                                                                              97
            Figure 36 Obstacle Avoidance Testing Areas
The sensors were also tested for reaction time. To accomplish this, the sensor
was set up and connected to the computer and an object was be dropped in front
of the sensor and removed quickly. Under controlled conditions the simulator
recorded how long the object was present in the sensors field of view and the
distance the object was from the sensor. The computer recorded and displayed
the object being present in front of the sensor, the distance the object was away
from the sensor, and the amount of time the object was present. This allowed
the group to compare the results and determine the accuracy of the sensors. By
dropping the object in the sensors field of view for a very short amount of time
and removing it and comparing the results and repeating this process for slightly
longer amounts of time each attempt could help determine the sensors reaction
time. The reaction time is of vital importance to the sensors for determining if
they can maintain pace with the software and if the software has to take
immediate action upon detection of an obstacle or if the software can monitor the
obstacles progress for determining the best plan for avoidance.


        Algorithms
To test the algorithms of the obstacle avoidance system, a simulated
environment had to be set up in software. Using the C programming language
                                                                              98
the code was written to simulate the Tailgate Buddy‟s behavior. Having the three
ultrasonic sensors plugged into the PC setup in the manner and scale they would
be on the Tailgate Buddy allowed for the group to run obstacles in front of the
sensors and the computer would simulate the movement the Tailgate Buddy
made to avoid the obstacle without having a working vehicle or an integrated
system that had to be tapped into in order to make changes to the Tailgate
Buddy‟s obstacle avoidance system algorithms.

Each ultrasonic sensor had an independent algorithm associated with its
operation. Because of this each sensor was required to be tested individually.
Using the Tailgate Buddy simulator in the PC, the tester first started by testing
the right hand side sensor. Using the simulated Tailgate Buddy moving
approximately two miles per hour, the tester first started out by introducing an
obstacle in front of the right hand side sensor at a distance approximately ten
feet from the sensor and slowly started moving the obstacle towards the sensor
until the Tailgate Buddy made a turn to avoid the obstacle. The turn had to be
made at such a distance so that the Tailgate Buddy would have a clearance of at
least one foot between it and the obstacle. This clearance will help to prevent it
from hitting the obstacle with any overhanging objects from the Tailgate buddy or
the obstacle that the Tailgate Buddy was unable to detect. Once again using the
Tailgate Buddy and the tester simulated in the PC, the tester then tested the left
hand side sensor. Using the simulated Tailgate Buddy moving approximately
two miles per hour, the tester first started out by introducing an obstacle in front
of the left hand side sensor at a distance approximately ten feet from the sensor
and slowly started moving the obstacle towards the sensor until the Tailgate
Buddy made a turn to avoid the obstacle. The turn must be made at such a
distance so that the Tailgate Buddy would have a clearance of at least one foot
between it and the obstacle. This clearance will help to prevent it from hitting the
obstacle with any overhanging objects from the Tailgate buddy or the obstacle
that the Tailgate Buddy was unable to detect.

The next algorithm to test was the algorithm belonging to the front sensor of the
Tailgate Buddy. To test this algorithm the tester first set up the simulation to
always have the target directly in front of the Tailgate Buddy so that it would
setup to move in a forward direction. The next step was to locate an obstacle at
a distance of two feet from the front ultrasonic sensor. This distance should have
the Tailgate Buddy sitting at a complete stop. Next the obstacle moved away
from the front sensor to a distance of four feet, the Tailgate Buddy was to remain
stationary. Bringing the obstacle to a distance of five feet from the Tailgate
Buddy should cause it to begin to accelerate. The Tailgate Buddy will accelerate
up to one mile per hour in an attempt to match the speed of the object. The
Tailgate Buddy simulation would believe that that object is moving in front of it at
a constant speed because in theory the ultrasonic sensor should be moving that
the same speed of the Tailgate Buddy. By moving the object to a distance of six

                                                                                 99
feet in front of the ultrasonic sensor the Tailgate Buddy was to maintain its speed
allowing for error in reading. By moving the object to seven feet in front of the
ultrasonic sensor the Tailgate Buddy was to start accelerating to two miles per
hour to catch up with its target. If the object moved to ten feet in front of the
sensor or out of range of the sensor, depending on the range of the sensor, the
Tailgate Buddy was to start accelerating up to its maximum speed to attempt to
catch its target. If the Tailgate Buddy is above two miles per hour and the target
moves to seven feet in front of the sensor then to six feet within one second the
Tailgate Buddy was to slow to one mile per hour in preparation for an emergency
stop. If the target starts to move away the Tailgate Buddy was to increase speed
to two miles per hour in an attempt to match speed. If the object suddenly
appears at a distance closer than five feet from the Tailgate Buddy it was to kill
all power to the electric motors. If the object appears a foot or more closer than
previously the Tailgate Buddy as make an emergency stop meaning that the
Tailgate Buddy should kill all power to the electric motors and apply hard
breaking to stop before a collision. If the computer simulation output data verified
that the speed control algorithm was functioning to these specifications than the
algorithm was functioning properly.


        Two Side Sensors
Each of the side sensors has a viewing angle of forty-five degrees. They were
placed on the two sides of the Tailgate Buddy facing forward at an angle of five-
five degrees. This is illustrated in the picture below. This allows the ultrasonic
sensing system to see obstacles coming at the Tailgate Buddy from both the
front and obstacles that will be run into if the Tailgate Buddy were to turn into
them. To test these sensors the simulated Tailgate Buddy was to be setup to be
moving forward with no obstacles directly in front of it. This setup kept the
Tailgate Buddy moving forward at a constant set speed of two miles per hour.
The tester started by testing only one side sensor at a time, by mounting one
side sensor to the corner of a table to represent the front of the Tailgate Buddy
the tester was able to effectively simulate the conditions the sensor will be
operating in on the Tailgate Buddy. Once the sensor was mounted on the front
corner of the table, the ground was marked off with the coverage area of the
sensor. This technique made it easier to simulate moving obstacles around the
sensor. Having the ground marked off in front of the table to represent the
ultrasonic sensors viewing range the tester could easily pass objects or even
walk in front of the sensor to test its view and reaction times. This is illustrated in
the picture below.




                                                                                  100
                 Figure 37 Side Sensors Viewing Angles
The first step as to move obstacles into the ultrasonic sensors field of view on the
side of the table and see if the software recognized the objects location and sets
a flag to prevent the Tailgate Buddy from turning and clears that flag once the
Tailgate Buddy is past the obstacle. The next step was to introduce an object
coming at the vehicle from the front that will collide with it unless it makes a
maneuver to miss the obstacle. Depending on distance the vehicle will have to
make a calculated turn to avoid the obstacle. As the obstacle approaches the
sensor from the front, if the Tailgate Buddy starts to turn to avoid the oncoming
obstacle than the algorithm is functioning properly. If the Tailgate Buddy remains
traveling on its current trajectory or if it turns into the obstacle then the algorithm
is not functioning properly and needs to be rewritten to cause the robot to start
functioning properly.

It was also important to test the Tailgate Buddy‟s reaction to an object
approaching it from the side since the two side sensors see objects approaching
it from the sides the same as objects approaching it from the front. This should
cause the Tailgate Buddy to turn away from the approaching object the same as
if the object is approaching from the front. As the object clears the sensors field

                                                                                  101
of view the Tailgate Buddy should continue heading in the same direction for
about four feet to clear the obstacle then turn back to its previous course allowing
it to regain view of its target.


        Front Facing Sensor
To test the forward facing ultrasonic sensor, the sensor first needed to be
mounted to a table facing forward as if it were mounted to the front of the
Tailgate Buddy. The sensor was then to be connected to a PC. The sensor
needed to be turned on and allowed to run a calibration cycle. Following the
calibration cycle the simulation software needed to be started to monitor the
sensors results. The simulation software had to be setup to always read the two
side sensors as having no obstacles and the target always in front of the Tailgate
Buddy so that it will always be moving in the forward direction. To test the
sensor itself, it was necessary to present an object to the outer range of view and
slowly move the item inward until the sensor picked up the objects position. The
object was then moved to the extremes of view of the forward sensor to ensure
the sensor had a minimum side-to-side view of four feet. The object also needed
to be moved from immediately in front of the sensor to ensure the sensor can
detect objects as close as two feet to a maximum distance of twelve feet to
ensure the forward sensor can see at least seven feet in front of forward facing
sensor. The object needed to be dropped and removed in a timed manner to test
the reaction time of the sensor. The object also needed to be moved forward
and back at a set speed to test the reaction time and accuracy of the sensor.
The sensor needed to be able to pick up the changes in objects position in the
minimum time of a quarter of a second. If it failed to do this in actual operation
the Tailgate Buddy could run into its target causing injury. The sensors accuracy
is also very important as the Tailgate Buddy is depending on it to determine the
speed the Tailgate Buddy will have to travel in order to keep up with its target
without running its target over.


        Speed Control
The speed control required aggressive testing, as this may be the most crucial
section of the obstacle avoidance system. The speed control system is
responsible for matching the speed of the target. This system is crucial because
it is responsible for ensuring the Tailgate Buddy keeps up with its target and that
it does not run into its target. The first step to testing the speed control system
was to set up the front ultrasonic sensor on a table to represent the front of the
Tailgate Buddy. The sensor had to be plugged into a PC and was allowed to run
a calibration cycle. Next the simulation software was started and set to have no
obstacles to the side sensors and readings for the front sensor read from the

                                                                                102
serial port. The speed control algorithm is a complex algorithm therefore it
needed extensive testing to ensure proper operation. The first step was to place
an object within two feet of the sensor to simulate the target being very close to
the Tailgate Buddy causing it to be at a stop. The object was then slowly moved
away from the front of the Tailgate Buddy until it begins to move forward. This
was to begin to happen at about five feet from the front. As the object moved
farther away from the front of the Tailgate Buddy to a distance of five feet it was
to begin to accelerate to keep up with its target. As the target moved to a
distance of seven feet the vehicle was to increase speed up to two miles per hour
to keep up with its target. As the target moved out of range the vehicle was to
pick up to maximum speed to track its target. Moving the object back into range
the vehicle was to slow down to two miles per hour to adjust for speed and as the
target moved to a distance of five feet in front of it the Tailgate Buddy was to slow
to one mile per hour in an attempt to maintain a safe following distance from its
target. The reason for running these tests in a computer simulation was to
ensure complete safety for both the people testing the Tailgate Buddy and the
Tailgate Buddy itself while the obstacle avoidance systems and the speed control
systems passed the tests and to measure accurate distances and reaction times
in both the software and hardware. The simulation also allowed the simulator the
ability to estimate acceleration and deceleration delays of the Tailgate Buddy and
with these figures the simulator could derive a good estimation of how far the
Tailgate Buddy would require in order to safely stop and accelerate allowing the
tester to more accurately program the speed control algorithm to prevent any
harmful accidents.




                    Figure 38 Forward Facing Sensor

        Obstacle Avoidance Simulation
Once each of the three sensors were tested individually they needed to be
plugged into the simulation software at the same time to verify that the algorithms
for the different sensors did not conflict with each other as this would cause some

                                                                                 103
undesired effects. To test the system as a whole, the first step was to set up
each of the sensors on a table in the exact layout they will be on the Tailgate
Buddy. It was prudent that the sensors be laid out to scale to make sure that
there is no interference or blind spots in the physical layout. Next the area must
be cleared of all clutter within ten feet in front and four feet side to side for each
one of the sensors before they are powered up to ensure that the calibration
cycle is successful and the sensors are accurate. The next step to setting up the
simulation environment was to power up the sensors, and let them run a
calibration cycle, then startup the simulation software. The software had to be
setup to monitor all three sensors and to figure out that the target was moving
straight ahead.

Placing a false object two feet in front of the forward facing sensor and increasing
the distance to six feet in front of the forward facing sensor trained the software
that the object was the target and it should start the simulation moving at two
miles per hour to maintain speed with the target. Once the simulation was
underway, it was necessary to try to trip up the simulation and the sensors. The
tester started by first simply introducing objects in front of the two side sensors
and monitoring the simulations movement. If the simulation attempts to turn to
avoid the obstacle then the two side sensors were functioning properly. The next
attempt to trip up the sensors was to introduce an object suddenly in front of the
forward facing sensor at a distance of two feet. If the Tailgate Buddy attempts to
make a sudden stop to avoid the obstacle then the front sensor algorithm was
working successfully. The next step was to start the simulation moving forward
again then walk from one side of the of the simulation layout to the other side
passing through the field of view of all the sensors. At a close distance to the
sensors should cause the Tailgate Buddy to attempt to turn to avoid the obstacle
and when passing in front of the front sensor, the Tailgate Buddy should stop to
avoid the obstacle and remain stopped until the obstacle clears. Other methods
that were tried, were walking in front of the sensor grid at an angle of five
degrees from far away to close to it causing the first sensor to ignore the obstacle
as not being a threat the front sensor to decrease speed, if passing at a close
enough distance to the sensor, and the last sensor will detect the obstacle and
attempt to turn to avoid the obstacle. The next attempt the tester got the
simulation moving again and reversed this movement to test the system in the
reverse direction. When this was successful, the tester then introduced an object
that all three sensors could see, like a wrap around wall, to ensure that the
Tailgate Buddy successfully stopped and didn‟t turn into the sidewalls or run into
the front wall. This test was necessary as this could trip up the algorithms. The
last test the tester ran in simulation was to introduce an object that one side
sensor and the front sensor could view and ensure that the simulation slows
down for safety and turns to avoid the object. When this simulation was
successful the tester then attempted the same test on the other side sensor to
ensure the response was the same.

                                                                                  104
        Entire Obstacle Avoidance System
Testing the entire system was different than testing the sensors in the simulator
because the environmental variables are changing and the obstacles are
constantly moving towards the Tailgate Buddy. This test was to ensure that the
obstacle avoidance system communicates accurately with the other systems on
the Tailgate Buddy. To test the entire system first the ultrasonic sensors had to
be mounted in place on the vehicle. The ultrasonic sensors were then connected
to the microcontroller, which was connected into the main drive system of the
Tailgate Buddy. The ultrasonic system had to be powered up and the area in
front of the Tailgate Buddy cleared up to ten feet in front and four free side to
side of it to allow the ultrasonic sensors to calibrate properly. After the Tailgate
Buddy was up and running, a target was positioned in front of the Tailgate Buddy
vehicle. This target starts within 3 feet of the front of the vehicle and then slowly
moves away from the vehicle. Once the target is beyond four feet from the front
ultrasonic sensor the vehicle should start to move more forward to maintain this 4
foot distance between the vehicle and the target. The front sensor on the robot
should start detecting the increasing distance to the target and ultimately cause it
to start accelerating forward to match the speed of its target. Once the front
sensor is performing its task reliably it is then time to move on to testing the side
sensors.

While the vehicle is moving forward via the front ultrasonic sensor, the tester
introduced obstacles moving towards the vehicle on the left side to observe if it
turns to avoid the obstacle or not. Then once the left side is debugged and
works properly the tester will do the same tests on the right hand side. The next
test was to drop an obstacle in front of the forward facing sensor to determine if
the Tailgate Buddy would slow down and then apply the braking procedure to
make an emergency stop to avoid hitting the object. The act of doing this made
a full test of the vehicles braking system. For the remainder of the tests that
were run are very similar to how they were run in the simulations. It was of vital
importance to run these tests again with the Tailgate Buddy as a whole as this
tested how the subsystems communicate with each other and the reaction time
of the microcontrollers and subsystems. The reaction time is a vital factor to test
as this could cause the Tailgate Buddy to run into an obstacle it didn‟t know was
present because it failed to read from the sensor often enough. Another
important test to run was to place an object in a location to the front but offset to
one side to cause the Tailgate Buddy to turn to avoid the obstacle and observe if
it lost the target when it turns to avoid the obstacle. When the Tailgate Buddy
was able to avoid obstacles, handle emergency stops and stay focused on its
target through a maze of obstacles than the obstacle avoidance system is
functioning properly.


                                                                                 105
     RC Tx/Rx
Once an RC system was finalized and built the real testing of driving function
could be tested. At this point it was tested for range, control and function. The
vehicle needed to be driven at various distances away from the user to determine
a maximum driving range. This was where vehicle control was tested. One test it
needed to pass here was what happens when the vehicle goes out of the range
of the transmitter, or the transmitter was turned off, or the battery in the
transmitter died. If any of these things happen, it is crucial that the vehicle does
not continue on out of control. Doing so could potentially hurt someone or
damage property. Instead the vehicle must come to a safe stop and remain
stationary until control is regained. The vehicle obviously must respond to normal
commands of forward, reverse, left and right. It is possible for any of these
functions to not have been programmed correctly or for outputs of the receiver to
be wired incorrectly subsequently causing unwanted results. Since the manual
activation of the water gun uses a mechanical setup, with a switch and servo, an
additional step was required. The throw of the switch is not very far, yet a servo
can move a great deal in rotation. To keep from tearing the switch apart by
torquing down on it and over-rotating the servo horn, the travel distance of the
servo had to be limited using the adjustments on the transmitter.


     Complete Drive System
This phase tested how the motors, drivetrain, speed controller, radio equipment,
batteries, and driving functions of the microcontroller all worked together to
perform the driving task. To pass this section, the vehicle first had to be able to
drive itself. This meant first being able to power itself into motion off the vehicle‟s
main drive battery system. That system is designed to be a 12 volt. It is possible
that even though the vehicle was able carry a the load in its original
configuration, that once it was wired up to the speed controller it might not be
able to efficiently drive the vehicle at that low voltage. This could have happened
if the controller could not drop enough current for low speed travel while
remaining at a high enough voltage to function. If this happens the 12 volt
configuration may have had to be sacrificed to a 24 volt series configuration that
would add cost to the build as another battery would be needed. This would not
have been ideal as the motors are designed to work at 12 volts, but it may have
had to happen if low speed operation did not work properly. If that was needed,
the motors would have to be tested for reliability and efficiency when working at
up to 24 volts. They may have worked properly at first but after a period of time
burned out and needed to be replaced. At that point, the power system would
have to be redesigned or 24 volt motors that fit the original mounts would have to
be found. Ideally the plan would have been to use motors rated to handle 24

                                                                                  106
volts. However if none will fit the application, original motors must be used again
and the batteries may have had to be replaced with something like an 18 volt
setup or even worse the speed controller would have had to be replaced with a
different kind and most systems would have to be redesigned.

 After it passed the main battery power tests for function it needed to be able to
operate under control from the microcontroller and also be switched into manual
mode and accept control from the receiver. The motors needed to perform
identically so as to drive the vehicle in straight. The vehicle also needed to be
easy to control. It needed to drive as one would expect an ordinary RC car would
drive. A manual driving mode would be worthless if an average person cannot
use it effectively and safely. Early driving tests were still done at a team
member‟s residence as full robotic functions, IR and ultrasonic obstacle
avoidance systems, were not needed for this test to be successful. Those
systems were to be incorporated in final prototype testing.

With the drive system completed and operating properly, runtime had to be
determined by starting each subsystem with full battery power and running the
vehicle through what hopefully turns out to be a full days worth of usage before a
battery system dies. If any battery system dies prematurely, it would have to be
redesigned to allow for more runtime. The main drive battery system for the
motors was tested under radio control. This simultaneously tested that system as
well as the batteries for the radio control system. The result was measured in
time spent driving and in distance the vehicle was able to travel in that time.
Distance was important to measure because the vehicle normally travels faster
under radio control than it does when it is operating under IR tracking and the
drive batteries drain faster at this higher speed. During this test if the transmitter
batteries died before the vehicles drive batteries, they would have to be switched
out for fresh ones to complete the test of the drive batteries. If they die before the
vehicles drive batteries, but lasted long enough to get a decent amount of RC
runtime out for a day of tailgating, they could be left alone. The vehicle is mostly
operated under IR tracking mode anyway and manual drive mode is just an
occasional use in comparison. Also the RC transmitter‟s battery system is the
one system that is completely designed by the maker of the transmitter and
would be harder to reconfigure for more runtime. However, these batteries
typically last a very long time for most RC devices and as such this was not of
great concern.


     Water Gun
Like many of the other systems, even a system as simple as the water gun had
to be tested in multiple ways. The first test was a manually triggered test that was
be done as soon as the reservoir, tank, hose, and nozzle were installed into the

                                                                                 107
vehicle. The tank was filled with water and the pump was directly wired to the 12
volt drive batteries. This test ensured the pump was working; there were no leaks
and the nozzle sprayed in a correct pattern at the right angle and at a decent
distance. This also showed how great of a volume the pump can output through
one nozzle. If it was not enough water and there was more than enough distance
coming from the nozzle, a second nozzle could be added to create a
configuration like originally intended when the system was used in the truck it
came off of. If after adding the second nozzle, the distance and pattern was still
acceptable for soaking obstacles, the test was completed.

For the second test, when the more advanced 3-channel RC system passed the
speed controller communication tests it could be used for radio control. This is
required for manual firing of the water gun through RC. If that test was not
passed, this option would have to be removed and the water gun would only
function off the microcontroller‟s obstacle avoidance feature. Since the 3-channel
RC system did pass the speed controller communication test, the test for using it
to fire the water gun was a very short test. All that was required for this to pass,
was when the transmitter signals for the water gun to fire, the receiver sends the
signal to the servo that toggles a standard toggle switch that sends power to the
pump. When it fires it needs to stay on for as long as the transmitter is sending
that signal and the reservoir has water in it. The third test is similar to the second
only it is testing the microcontroller‟s control of the water gun. For it to pass this
test, it needed to fire the water gun whenever the IR receiver does not have a
signal from the user‟s transponder and the ultrasonic detector is showing an
obstacle blocking the vehicles path. To test this, the IR transponder was be used
by one team member while another team member walked in front of the vehicle
and take a soaking for the team. When the victim moved out of the way, the
microcontroller had to kill the output to the water gun. If the water gun fires with
only one of the two conditions being met, it would be considered as failing and
will have to be reconfigured to work properly. Once all the previous tests had
been passed, the fourth test was more of a convenience factor than a function
factor. This test was to show how long a full reservoir of water can last before
needing to be refilled. The reservoir was filled to the top and the water gun was
activated and held on while a stopwatch ran. When the tank emptied and the gun
stops firing the time was stopped. This was be the maximum amount of time the
water gun could be operated for.

The very last test the water gun needed to pass was how well it can get
unsuspecting people out of the vehicle‟s path. This was harder to test than the
previous tests as several test subjects had to be gathered separately and get
them to set off the water gun one at a time. They were curious as to what the
vehicle was and wanted to approach it. Normally they triggered the water gun.
Once they did their desire to get away from the vehicle was noted. When the
majority of test subjects ran out of the way instantly like they were expected to,

                                                                                 108
the test was considered a success. However if they had barely noticed the water
spray soon enough or the water blasts don‟t hit them well enough, the test would
have been a failure and this system may have had to be reconfigured. This
would be the point where the horn option may have been needed to be
implemented. The combination of the water gun and horn should get every
subject to take notice and get out of the way. If this happens that test would be
considered successful.


Entire System
The testing procedure for the Tailgate Buddy was as follows. For environment-
specific testing procedures, please refer to the next section, Testing
Environments. The first set of tests that was performed on the entire Tailgate
Buddy system was to observe how well the Tailgate Buddy tracks and follows the
infrared transponder while moving in a linear fashion. The user carried the
transponder within the specified range of the robot and proceeds to walk in a
straight path. The distances at which the Tailgate Buddy followed were measured
and recorded, and were compared to the required distance outlined previously in
this document. The next test that was performed on the entire Tailgate Buddy
system was to observe how well the robot tracks and follows the infrared
transponder while moving in a nonlinear fashion. The user carried the
transponder within the specified range of the Tailgate Buddy and proceeded to
walk in a nonlinear fashion; that is, the user frequently changed the direction of
his or her walk, making the vehicle perform turns of varying degrees and
magnitude. The distances at which the Tailgate Buddy followed were measured
and recorded, and were compared to the required distance outlined previously in
this document. The next following test involved the user moving away from the
Tailgate Buddy at its top speed (five miles per hour). The purpose of this test was
to measure the time the Tailgate Buddy took to accelerate to top speed, and to
measure lag distance the Tailgate Buddy exhibits as the user accelerates. The
user then gradually slowed down and stopped.

Once the proper following distance was achieved, the next set of tests that was
performed on the Tailgate Buddy involved testing how well it stops. The user
carried the infrared transponder within the specified range of the Tailgate Buddy,
walked in a linear fashion, and then gradually stopped walking. The time the
Tailgate Buddy took to stop, and the distance the Tailgate Buddy took to stop
was measured and recorded. These data were compared to the required
distance at which the Tailgate Buddy was supposed to follow the user. The
vehicle was not to stop closer than or farther away than the following distance
described previously in this document. The time the robot took to stop is
important because even though the motor is not running, the Tailgate Buddy may
still roll toward the user for a period of time. If this time had been too large, the

                                                                                 109
stopping algorithm would have been adjusted to begin stopping earlier. The user
then repeated this process, but stopped more suddenly to measure the stopping
distance and stopping time of the Tailgate Buddy. These data were compared to
the range in which the Tailgate Buddy was supposed to follow. These data were
also compared to the data from the previous data when the user stopped less
suddenly. Finally, this test was repeated a third time. For this test, the user
repeated the same process as the previous two tests, only this time the user
stopped as suddenly as they could possibly stop. These data were then
compared to the range in which the Tailgate Buddy was supposed to follow.
These data were also compared to the data from the previous data when the
user stopped less suddenly.

The next set of tests performed on the Tailgate Buddy was more stopping tests.
For these new stopping tests, the user carried the infrared transponder within the
specified range of the Tailgate Buddy, and moved quickly away from the Tailgate
Buddy in a linear fashion. The Tailgate Buddy was not designed to move faster
than 5 miles per hour, so the user moved away from it faster than this speed. The
amount of time the user took to leave the range of the Tailgate Buddy was
measured. The amount of time which the Tailgate Buddy followed the user
before the user was out of range was also measured. For the next stopping test,
the user moved at approximately the vehicle‟s top speed (5 miles per hour), and
then stop suddenly. The distance the vehicle took to stop was measured, and
compared to the desired following range specified earlier in this document. If the
final distance between the user and the Tailgate Buddy fell outside of this range,
the stopping algorithm was adjusted. This test was repeated at various speeds
with the user stopping suddenly to varying degrees.

The next set of tests performed for the entire Tailgate Buddy system was loading
tests. The Tailgate Buddy was designed to carry a maximum payload of 100
pounds. The first payload test performed was with an empty payload. The user
carried the infrared transponder, and walked away from the vehicle. The user
then turned while walking. Some turns the user made were wide and gradual, to
observe how the Tailgate Buddy handled these. The other turns were sharp, to
varying degrees, to see how the Tailgate Buddy handled these. The purpose of
this test was to observe if the vehicle was too top-heavy to make turns
successfully. The next test that was performed was with a solid load of the
Tailgate Buddy‟s maximum payload of 100 pounds. The user then again carried
the infrared transponder and move away from the Tailgate Buddy. The user then
turned while walking. Some turns the user made were wide and gradual, to
observe how the Tailgate Buddy handled these. The other turns were sharp, to
varying degrees, to see how the Tailgate Buddy handled these. If the Tailgate
Buddy did not make turns successfully (meaning it fell over while turning), the
maximum payload or vehicle design may have had to be reconsidered. The third
such test was with the Tailgate Buddy half-full of water. This was well under the
Tailgate Buddy‟s maximum payload capacity. This test was to serve two
                                                                              110
purposes. The first purpose this test was to serve was to observe how the
Tailgate Buddy handled a medium payload. The second purpose of this test was
to observe if there was any effect of fluid motion on the way the vehicle drives.
This was a practical test because the Tailgate Buddy was designed to carry
drinks and ice. The worst case scenario for the robot for fluid motion is after there
are no more drinks, and after all of the ice inside the cooler has melted. This test
presented more fluid than will most likely ever be in the cargo hold of the Tailgate
Buddy. For this test, the user again carried the infrared transponder and moved
away from the Tailgate Buddy. The user then turned while walking. Some turns
the user made were wide and gradual, to observe how the Tailgate Buddy
handled these. The other turns were sharp, to varying degrees, to see how the
Tailgate Buddy handled these. If the Tailgate Buddy did not make turns
successfully (meaning it fell over while turning), the maximum payload or vehicle
design may have had to be reconsidered.

The next test involved the RC control aspect of the Tailgate Buddy. The user
activated the remote control, and attempted to control the vehicle with it. The
user maneuvered the vehicle in straight paths and turns. The user also navigated
the Tailgate Buddy around obstacles and in narrow hallways to ensure manual
control sensitivity. The manual control circuitry bypasses the obstacle avoidance
system. This put the Tailgate Buddy completely under the control of the user‟s
hands. This test also verified that the infrared tracking system turned off
automatically when the Tailgate Buddy was used via the RC controller.

The next test involved the obstacle avoidance system. For this test, the user put
the transponder, and proceeded to walk around a small object. The user then
walked up to the object, then walked in a semi-circular path around the object,
and continued on the original trajectory (as if the object had not been there). The
Tailgate Buddy needed to successfully navigate around the small object and
continue following the user as they continued to walk. The next test involved the
obstacle avoidance system and the water gun. The user put the transponder, and
walked away from the Tailgate Buddy. After the vehicle was moving, another
person stepped between the user and the Tailgate Buddy and remained
stationary. The Tailgate Buddy was to successfully activate the water gun,
spraying the obstacle person with cold water.

     Testing Environments
The Tailgate Buddy was tested in several different environments with a few
different variables. In any environment in which movement, torque, and friction
was observed, the Tailgate Buddy was tested empty, almost completely full of
water, and with a solid load of seventy pounds. The first environment the Tailgate
buddy was tested in is an even-terrain, vacant parking lot. This is a likely
environment in which the robot is to be used. This environment was for very
                                                                                 111
basic tests. Testing the Tailgate buddy in a parking lot ensured that it can move
by remote control, turning radius, move by itself, track its target, remain within the
specified range of its target, and stop when it is supposed to stop. The Tailgate
Buddy was tested at various speeds. Speed bumps in the parking lot were
effective for determining how the Tailgate Buddy handled such an obstacle
during the course of its use. The Tailgate Buddy will also be tested when the
pavement in the parking lot was wet. This will allowed it to be determined if the
Tailgate Buddy could compensate for the lack of friction created by the water on
the pavement. The amount of torque output to the wheels needed to be observed
to make sure that the Tailgate Buddy did not slip too much when it is supposed to
move, and did not over compensate and injure the user by colliding with him or
her.

A similar environment it was tested in was a cement wheelchair ramp. This is a
possible environment for the use of the Tailgate Buddy. This allowed it to be
determined whether the vehicle could produce enough torque to move up an
incline. It also ensured that it did not produce too much torque up an incline in an
attempt to compensate for the increased resistance to the wheels. This
environment also ensured that the Tailgate Buddy could move down an incline
under its own power, instead of just rolling down when it is not supposed to be
moving. It also indicated whether the Tailgate Buddy was producing too much or
not enough torque down the incline, avoiding the user leaving it behind, or injury
to the user. The Tailgate Buddy was tested at various speeds, both up and down
the ramp. This testing environment was also tested when wet (after the Tailgate
Buddy is tested on it dry). This was the worst-case scenario for torque versus
friction. Again, the Tailgate Buddy was tested both up and down the ramp to
make sure that it properly compensates for the increases and decreases in
friction it will experience, and did not get left behind and did not injure the user.
How the Tailgate Buddy handled a change of incline was also tested here, both
wet and dry, by driving it onto the wheelchair ramp, and off of the wheelchair
ramp.

Another environment the Tailgate Buddy was tested in was a flat, grassy area,
known as Memory Mall on the UCF campus. First, the Tailgate Buddy was tested
on dry grass, because it is a relatively even terrain, but not as even as the
parking lot environment. How well the Tailgate Buddy performed in the pits and
grooves of the grass under various speeds was observed, and adjusted if
necessary. This environment provided much of the same data as the parking lot,
such as how well it performs when the remote control was used, how well it
tracked its target, how well it stayed in the specified range of its target, and
whether it would stop when it was supposed to stop. The grass provided a
variable in the testing process, and since grass is a likely place for the user to
use the Tailgate Buddy, it was an appropriate testing environment. After the
testing on dry grass was completed, the same grass was wet with water. This

                                                                                 112
allowed it to be determined if the Tailgate Buddy could compensate for the lack
of friction created by a wet surface. It was noted whether the Tailgate Buddy
overcompensated torque, possibly injuring the user, or did not compensate
enough, which could have caused it to fall out of the specified range of its target
and get left behind. How well the Tailgate Buddy turns on wet grass is also
important. It needed to be made sure of that the Tailgate Buddy did not tip over
while turning or slide while turning, and possibly spilling its cargo or injuring the
user or a bystander. How well the Tailgate Buddy handled the transition from the
grass to the cement was also observed. A similar environment in which to test
the Tailgate Buddy was on gravel. This again, made sure the Tailgate Buddy
compensates with the proper amount of torque to make up for lost friction due to
the rolling friction caused under the wheels by the gravel. The gravel was also
wet, as this was most likely the worst case scenario for non-incline loss of
friction.

A fifth environment the Tailgate Buddy was tested in was the roof of a parking
garage with many stationary objects of different height and shape. This tested
the obstacle avoidance components with respect to the entire system. The user
walked around an obstacle very quickly, and the Tailgate Buddy‟s behavior with
respect to the object was observed. This was to make sure that the Tailgate
Buddy did not crash into the stationary object or get stuck behind the stationary
object, but drove around it to find the user as it was intended to do. The user also
walked between several objects to make sure that the Tailgate Buddy also did
not crash or get left behind in this scenario. A similar environment to test the
robot in was a narrow hallway. The user walked through the narrow hallway, and
made an abrupt turn, and the Tailgate Buddy‟s reaction was observed. It needed
to be made sure that the vehicle did not crash into the wall, and that it did not get
left behind because the user steps out of range of the Tailgate Buddy‟s IR
sensors. Since the terrain tests had already been performed at this point, there
was no need to wet either of these environments.

Another environment for testing the Tailgate Buddy was a place with many
people, like on a busy sidewalk. This was to test how the Tailgate buddy reacted
to many moving objects that are not its target (the user). The intention was that
the robot would follow the user even as he or she was moving through a crowd of
people. If someone stepped in front of the Tailgate Buddy, the water gun would
spray water at him or her. In this manner, the water gun was also tested with
respect to the entire system. It was also a more complex test for the ultrasonic
obstacle avoidance system.

In the preceding outdoor environments, the temperature may range from
approximately 75 degrees Fahrenheit to 90 degrees Fahrenheit, with humidity
ranging from 60% to 90%. If possible, the Tailgate Buddy was tested in the rain
in all three environments. When this was not a possibility, rain was be simulated

                                                                                 113
as close as it can be in these environments. This was to observe how the
ultrasonic sensors reacted in inclement weather, due to the ultrasonic waves
reflecting back to the sensor off of the rain drops. The ultrasonic sensors also
change sensitivity with changing heat and humidity. This also allowed
observation of how much the sensitivity of the ultrasonic sensors change, and the
effects it has on the overall performance of the Tailgate Buddy (although, in
theory, this problem could be corrected by re-calibrating the sensors by powering
them off and powering them back on). This was also to make sure that none of
the electronic components got damaged due to water. The tester also tested
indoor environments to test for changes in light, temperature, and humidity.

The first indoor environment in which the Tailgate Buddy was tested was in the
atrium of Engineering II building on the UCF campus. This location was chosen
because there were both stationary objects (tables, chairs) and moving objects
(people) to avoid. This location was also chosen because there was less
humidity, and a decreased temperature. There was also a decreased amount of
light, which could simulate cloud cover, or other low-light conditions. This allowed
the Tailgate Buddy to be tested in different conditions than before. The
Engineering II building atrium has polished terrazzo flooring, which provided
additional data for friction versus torque, even though it was unnecessary at this
point. The vehicle does drift due to the plastic wheels on the Power Wheels
vehicle. The Tailgate Buddy was also tested in a hallway connecting to the
Engineering II building atrium in a similar manner to the narrow hallway testing
environment, as previously mentioned. This was to allow the group to test the
Tailgate Buddy on wall-to-wall carpet. The Tailgate Buddy was also tested
through glass. One of the doors in the building that contains a large glass pane
was used to see if the Tailgate Buddy would try to drive through the glass, or
recognize the glass as something to avoid.

The next few environments to be discussed were for testing the Tailgate Buddy
in realistic circumstances with extreme temperatures. The first such environment
was outdoors. Since the Tailgate Buddy most likely will not be in constant motion
throughout the duration of its use, the Tailgate Buddy was tested by leaving it
outside on cement in the sun for a length of time to see how it reacted to the
heat. Another environment to test extreme heat was inside of a car. The
temperature of the inside of a car or was measured in three different vehicles,
and these data will be cross-referenced with temperature tolerances of the
individual components to ensure that the prototype was not destroyed because of
melted or otherwise heat-damaged internal components. The final environment
to test extreme temperature was a refrigerator. The expected temperature of the
refrigerator is 35 degrees Fahrenheit to 45 degrees Fahrenheit. After cross-
referencing the temperatures of the individual electronic components with the
temperature of the refrigerator, parts of the Tailgate Buddy will be placed in the
refrigerator, and left to set for a length of time. After the time had passed, the

                                                                                114
user activated the parts of Tailgate Buddy being tested to see how they
functioned. This was a realistic scenario because it can be foreseen that the
Tailgate Buddy could be used in such weather outside.




                                                                         115
Users Manual
This section will describe how to correctly operate the vehicle and all its systems.
The manual will be broken down into the basics, radio controlled mode,
autonomous mode, and a trouble shooting section.


Basics
The vehicle has several systems that must be connected in order to work. The
first and foremost of these is the power system. The batteries inside the vehicle
need to be charged to make the vehicle ready for operation. The 12volt and
6volt batteries are easily removable from the chassis for easy charging. The
12volt battery is charged with the supplied power wheels battery charger. This
will charge the battery and not let it become overcharged and malfunction. The
6volt battery needs to be charged by a user supplied charger. This will most
likely not have a built in protection for charging the battery; so care needs be
taken to insure the battery does not get damaged during its charging.

When installing the batteries make sure the power is switched off to the
electronics and the motors because installing the batteries with these switches
could fry electronics and break the Tailgate Buddy. Take care to install the
batteries correctly; positive terminal to the positive voltage wires and negative
terminal to the negative voltage wires. Securely mount the batteries in place via
the straps mounted inside the vehicle.

Before turning the vehicle on make sure that all power and ground wires are
connected properly see attached System Wiring Diagrams. For proper vehicle
operation check that all wires are connected to the master microcontroller and
the tracking system. Once all the connections are double checked it is safe to
power on the vehicle for use.


RC Mode
There are two operating modes on the vehicle, RC and autonomous. All it takes
is a simple flip of a switch on the back of the vehicle to change between the two
vehicle modes. When the switch is in the down position it is in RC mode. In this
configuration all control of the vehicle functions is taken from the microcontroller
and given to the outputs of the RC receiver. To move the vehicle forward,
squeeze the trigger gently and slowly until desired speed is obtained. To reverse
apply the same technique only push the trigger away instead of squeezing it. To
steer the vehicle left, rotate the steering wheel on the controller counter-

                                                                                116
clockwise. To steer right, rotate it clockwise. To operate the water gun, use       the
red toggle switch mounted on the grip of the controller. When the switch is in      the
down position, the gun is off. When the switch is toggled to the up position        the
water pump starts and water is sprayed out the nozzles continuously until           the
switch is toggled back to the down position.


Autonomous Mode
To power on in autonomous mode, first turn on the 6 volt power to the vehicles
main computer by toggling the RC/Autonomous modes switch to the up position.
Then turn on the 12 volt power to the drive motors. Before turning on the 6 volt
power ensure that there are no objects within a 6 foot range to the front or sides
of the vehicle. Any objects in this range during the initialization could cause the
vehicle to behave unexpectedly. After turning on the 6 volt power and 12 volt
power walk around to the front of the vehicle standing at least 3 feet from the
front, you will have about ten seconds to do this before the vehicle completes its
boot cycle. It is normal for the vehicle to jump at you and stop short. The vehicle
will attempt to get within 3 feet of you, so it may start moving towards you to fill in
the distance or increase speed to keep up with you as you are walking. If you
make a corner the vehicle should follow you around the corner, as you start to
turn the vehicle will maintain its current speed. If the vehicle detects an obstacle
in its path while turning it will stop to keep from hitting an obstacle, however it will
remain stopped waiting for you to take action to free it from its predicament. If
the obstacle has moved from the path, simple walk straight in front of it with the
remote and the vehicle will straighten the front wheels and resume following. If
an obstacle is too close to the vehicle it will stop to avoid hitting the obstacle and
spray the water gun to warn the obstacle to get out of the way.

Debugging
If the vehicle doesn‟t start moving within 20 seconds of turning on the main
power or refuses to follow, open the hood and look at the LEDs on the main
board. You should have a pattern of 1011 on the LEDs demonstrating the
vehicle should be running straight ahead, if the vehicle is attempting to turn you
will have a different pattern depending on the direction, however if all the LEDs
are lit the microcontroller never completed a boot cycle. If the microcontroller
never completed the boot cycle, you need to check the connections associated
with the main ultrasonic sensor. Make sure this sensor is plugged into the main
board and that it still has power and ground connections.

If the obstacle avoidance system has come unplugged, the vehicle will continue
to operate normally. This is a feature allowing you to unplug the system if it is

                                                                                   117
malfunctioning and continue operating the vehicle under autonomous mode. The
same applies to the tracking system, however if you unplug the tracking system
the vehicle will only travel straight ahead, detecting objects directly in front of it.
It will not turn to follow your path.




                                                                                  118
Administrative Details

Budget
The group had decided to finance the entire project on our own. All the group
members intended to equally share in the cost of the project. This meant that
none of us wanted to waste parts because everything would be coming out of the
own pocketbooks. This made all group members more cautious of what parts
they buy and ensured that they are of high quality to make sure that the parts
lasted for the duration of the project. It was also to eliminate members trying
things without thinking them through first and causing parts to break and
increasing the cost of the project.

Each group member was responsible to keep all their receipts for any purchases
on the project in order to get reimbursed. At the end of the semester the group
tallied up the cost of the vehicle and compared what each member had spent to
the other members. Since one group member spent significantly more than the
other three, the group has decided to let him keep the prototype. The table on the
next page Table 10 Expected Budget Cost shows about what was expected for
the entire group to spend on this project. Since there were part failures, design
changes, and other mishaps the cost for the budget rose past the total cost.
What was actually spent on the project is shown in Table 11 Actual Cost.




                                                                              119
                         Expected budget
                                              Unit               Total
Item Number           Description             Cost  Quantity     Cost
      1         Power Wheels Vehicle        $200.00   1        $200.00
      2            Speed Controller         $300.00   1        $300.00
      3              GPS Module              $30.00   1         $30.00
      4        misc electronic parts GPS     $10.00   1         $10.00
      5           Ultrasonic Sensors         $30.00   3         $90.00
                 misc electronic parts
    6             Ultrasonic Sensors        $15.00     1        $15.00
    7                RC controller          $50.00     1        $50.00
               Misc electronic parts RC
    8                  controller           $10.00     1        $10.00
    9           Master Microcontroller      $40.00     1        $40.00
    10             Tracking System          $60.00     1        $60.00

    11        Printed Circuit Board Costs   $44.00     6       $264.00

    12        Misc. Wiring and Connectors   $40.00     1         $40.00
                           Subtotal                            $1,109.00
                             Tax                                  7%
                          Total Cost                            1186.63
                 Table 10 Expected Budget Cost

 Items                Our Costs  Parts Cost   Production Cost
 Power Wheels            $255.57      $255.57             $255.57
 Microcontroller          $56.95       $39.95              $49.95
 Ultrasonic               $29.95       $24.95              $29.95
 Motor Controller        $108.00      $100.00             $100.00
 Servo Motors            $213.25      $213.25             $213.25
 GPS Components          $216.67      $216.67             $216.67
 Tracking System         $100.00       $15.00              $10.00
 DC Regulators            $24.00       $24.00              $19.00
 RC Control               $64.90       $64.90              $64.90
 Total:                $1,069.29      $954.29             $959.29
                       Table 11 Actual Cost




                                                                      120
Timeline


        Planning     Jan-28
       Research       Feb-03
   Aquiring parts
                          Feb-28
           Design
                              Mar-08
     Prototyping
                               Mar-15
           Testing
                                       Apr-23




                                        121
 Team Bios
Greg Koeppen is a graduating from the University of Central Florida in May of
            2009 with a Bachelor‟s degree in Electrical Engineering. Greg
            hopes to work in a power company, FP and L or Progress Energy
            as examples, and design power system to increase the efficiency
            of the current power grid and help make green energy easier to
            implement for future use.



John Maskasky is a senior student of the College of Computer Engineering and
           Computer Science at the University of Central Florida. John plans
           to graduate in the summer of 2009 with a Bachelor‟s of Science in
           Computer Engineering. After graduating he hopes to pursue a
           career in software engineering.



John Fuoco is a senior at the University of Central Florida. He is graduating with
            his Bachelor‟s Degree in Electrical Engineering in May of 2009,
            and at time of publication is still debating between taking a job at a
            large engineering company or continuing at the UCF in a Masters
            program.



Ken Kauffman is currently a senior at the University of Central Florida and will
           receive his Bachelor‟s of Science in Computer Engineering in May
           of 2009. He received his Associate in Arts degree from St.
           Petersburg College in July of 2006. He has attended the UCF for
           three years, and plans to begin pursuing a Masters degree in
           Computer Science in the fall of 2009.




                                                                              122
Appendices
The documents are attached in this order.


System Wiring Diagrams

Copyright permissions

Data-Sheets

Source Code




                                            123

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:8
posted:12/25/2011
language:
pages:128