EECS for Speed
EECS373 Winter 2009 - Final Project
Team members and tasks performed:
- Stepan Tikhonov
- Studied MPC 555
- Built circuits to
power the MPC555-controlled vehicle and LEDs
- IR Sensor and Beacon
System integration
- Servo and Motor
integration
- 4-line Character LCD
display integration
- Wrote ISR and device
drivers for internal and external components in Codewarrior
- Game System / User
Interface design and coding in Codewarrior
- Vehicle design and
fine-tuning
- Jong Yoo Chung
- Studied MPC 555
- Wrote C code to
interface LCD character display in Codewarrior
- IR Sensor and Beacon
System integration
- Servo and Motor
integration
- 4-line Character LCD
display integration
- Wrote ISR and device
drivers for internal and external components in Codewarrior
- Game System / User
Interface design and coding in Codewarrior
- Vehicle design and
fine-tuning
Introduction
We
have created a ‘Need for Speed’ type game, where one vehicle is in pursuit of
another vehicle. In our case we had a
vehicle that is remotely controlled by a user (the runner) and a vehicle that
is controlled by a MPC 555 mobile microprocessor (the chaser).
The
objective of this game for you as a player is to run away from the AI vehicle
which will follow a beacon that is attached to your RC-controlled vehicle. You are scored based on how well you dodge
the pursuer. While the game is running,
we have programmed and integrated our 4-line character LCD display to display
the game status. The game has been
configured to run for 3 minutes, which can be adjusted. The software will keep track of your score
while the game is running and when the game over condition is reached (3
minutes elapsed), proper game over message will appear and will display 3
highest top scores. The game scoring
system will be discussed in detail below under Software Component Section.
The
major functions:
1)
Upload
software to flash memory in MPC555.
2)
AI
vehicle running on MPC555 will take inputs from an IR sensor beacon system and 3
ultrasonic sensors in order to chase the user-controlled vehicle
3)
The
game software in the AI vehicle will keep track of how well you are evading the
pursuer to calculate your final at the end of the game.
4)
When
the game ends after a certain time, display a message on an LCD display
attached to the AI-vehicle to notify the user that the game has finished.
High Level Design

Hardware Design
Due
to the fact that the MPC555 does not involve a FPGA, the hardware design was
focused primarily on building the AI vehicle.
We have mounted our MPC555 on the flat surface located in the middle of
our vehicle as shown in the picture below.
Then, we have mounted our 3 sensors in front, left, and right side of
our vehicle. Our beacon system consisted
of a receiver and transmitter, where the receiver was mounted on our vehicle
and the transmitter was mounted on our human controlled RC vehicle. In addition, we have mounted our character
display LCD screen on the back of our AI vehicle to display the status of the
game while the game is in session as well as its score when the game over
condition is reached.
All
the above-mentioned hardware components were wired to the corresponding pins in
the MPC555. As for the servo and the
motor, we have created a power supply circuit using a breadboard. Furthermore, we have created two separate
breadboards specially dedicated to powering and controlling the 4 LEDs which
were mounted on the vehicle to provide the feel of a police vehicle in pursuit.
As
for our beacon system, we have implemented an IR beacon system developed by a
company named Pololu. The Pololu IR
Beacon System consists of a pair of identical IR beacons. Each IR beacon consists of 4 IR sensors that
detect high intensity IR produced by the other IR beacon and outputs its
direction in North, South, East, and West.
Software Design
Most
of our work in this project was dedicated in designing the software. The major components of our software design
are as follows:
1.
PWM for 3 ultrasonic sensors, a servo, and a DC motor.
2.
Vehicle control algorithm
3.
Game status output to LCD display
When
the MPC 555 is powered on, our software will be loaded from the flash memory,
automatically initiating the game sequence.
At the start-up of the game, the program will be in a wait state while
constantly polling to see if a push button is pressed. The player will be prompted to press the push
button to begin the game via LCD display.
Our
vehicle control algorithm was based on the input values from the 3 ultrasonic
sensors and the beacon system. The
software first checks to see which direction the human controlled RC vehicle is
located with respect to the current position of the MPC555 controlled
vehicle. Once it has determined which
direction the vehicle is located, it will then look at the sensor values to see
how fast it should rotate the motor (motor speed) and how much it should turn
the wheel (servo angle). Instead of
measuring the exact distance of the human controlled vehicle, we have used the
time values generated by the ultrasonic sensors as references to determining
the distance. The measurements and their
corresponding approximate distance are summarized in the table shown below.

When
the beacon system is turned off or the vehicles are out of the detectable range
of the IR sensors on the beacons, the vehicle software will enter ‘recovery
mode’ where the vehicle will propel on its own while dodging the obstacles on
its way until it senses the beacon values again to start pursuing the human
controlled vehicle again.
While
the game is running, the 4-line character LCD display will show the current
score and the time remaining. We have
created global variables to store and display the score and the time remaining
in real-time on the LCD display. Once
the game is finished, the software will determine how well you have been
dodging away from the AI-controlled vehicle based on the score and display
corresponding messages on the LCD display.
The list of possible messages is as follows.
1.
If score is less than 5000 points
“YOU NEED MORE PRACTICE”
2.
If score is greater than 5000 points
“YOU ARE PRETTY GOOD”
3.
If score is larger than one of the three high scores
“NEW EECS FOR SPEED MASTER”
“WE ARE PROUD”
After
displaying the appropriate message, the LCD display will show the 3 high scores
which will be updated accordingly.
Conclusions
Due
to the fact that our vehicles depended on the beacon system to operate
properly, it required sufficiently large space with low IR noise. Under such environment, our vehicle operated
well.
Given
more time, we would have improved our motor control by implementing a H-bridge
to allow backward movement. The backward
movement would have allowed our MPC555 controlled vehicle to be able to dodge
its obstacles better and even allow the vehicle to escape from corner
conditions (when the vehicle is stuck in a corner).
Media
Under
construction