AME 3623: Project 2: Beacon Following I
In project 1, we designed a robot controller that was capable of
orienting to and then moving toward an infrared beacon.
In this project, we will expand on this experience:
you will program your robot to follow a particular sequence of
beacons.
Project Goals
To gain experience in:
- Microcontroller programming
- Writing programs that interface with the real world
- Design and implementation of finite state machines
Project Due Date
Deadline extended to:
Friday, April 1st.
Robot Task
The robot will operate in two primary phases:
- Phase 1:
- Move toward the beacon in front of the robot
- Scan for another beacon to the left
- When the beacon is found, turn toward it and begin phase 2.
- Phase 2:
- Move toward the beacon in front of the robot
- Scan for another beacon to the right
- When the beacon is found, turn toward it and begin phase 1.
Within either of these phases, an exception may occur if the robot
loses sight of the forward beacon (as defined by both the left and
right sensor signal strengths dropping to "00").
If this exception occurs, then:
- Phase 1:
- Rotate the turret to the right
- If a beacon is found in the new direction (immediately), then the robot
will turn toward it and continue with phase 2.
- If no beacon is found, then turn the turret forward and stop moving.
- Phase 2:
- Rotate the turret to the left
- If a beacon is found in the new direction (immediately), then the robot
will turn toward it and continue with phase 1.
- If no beacon is found, then turn the turret forward and stop moving.
Test Courses
We will use a set of standard test courses for demonstration
purposes. We already have one set up in the lab. We will document
the others shortly.
Design Process
- Design
- Identify the FSM states
- Identify the FSM inputs (events). How do the FSM inputs
relate to the sensory inputs?
- Identify the FSM outputs. What are the actions that your
robot must take?
- Define the state transition function.
- Define the output function. What does the robot do at
each state transition?
- Implementation
- Design and assemble a circuit based on an Atmel Mega8 processor.
- Implement your FSM design in C.
- Burn your program onto your processor.
- Get it to work (do not underestimate the amount of time
that this step will take).
Hints
- See the Atmel HOWTO for details about
circuits and programming.
- Remember that events are instantaneous (e.g., a change in a
sensory input) and that states are about maintaining a
memory of the situation between events.
- Think about what control actions that your program must issue
between events.
- Implement and debug your program incrementally. As with many
embedded systems, you only understand the complete problem once
you begin to work with the hardware. So - expect your design
to evolve over the next few weeks. Here is a list of practical
steps that you might consider taking before implementation of
your FSM:
- Build the test circuit described in the Atmel HOWTO. Compile and
download the test program. (and make sure that the
lights blink as you expect)
- Design and implement the connections to the beacons
receivers (the 8 bits), the robot control lines (3
bits), and the turret control lines (2 bits). Write
several interface routines that are responsible for
reading from or writing to the appropriate port bits
(this is where the bit masking comes in!).
A good way to handle the beacon receiver reading is for this
interface routine to fill in an array of length 4 (one
for each receiver) in which each element of the array
can take on a value between 0 and 3.
-
Write simple test routines that generate a robot/turret
movement, followed by a delay, followed by a "stop" (in
the case of the robot).
- Design and implement a routine that takes the receiver
state and generates a robot motor command that steers
the robot toward the beacon in front of it (a coded
version of your lab 1). This
routine should make a single movement decision & then
return (we will call it repeatedly from the next level
up).
- Design and implement a routine that effectively turns
away from the beacon in front of the robot and toward a
beacon to either the left or right. This routine should
return once the rotation is complete.
- Finally, design and implement your FSM, using the pieces
that you have developed above. Get your FSM to work first
without the exception handling (just transition to a
HALT state if you lose sight of the beacon). Then - add
the exceptions.
- LED's on extra output pins can be used by your program to
communicate debugging information to you.
- You may construct paper shields for your infrared sensors.
This will allow you to better control the angular sensitivity
of these sensors.
- Sensor filtering: as you discovered in lab 1, despite
preprocessing, the infrared sensors can be somewhat noisy.
This problem becomes more significant as we add more beacons to
our environment. One way to deal with this is to filter these
signals. A simple filtering mechanism is to sample the beacon
receiver bits multiple times (e.g., separated by 1 msec
intervals), and to sum the results. This will tend to give you
more reliable sensor readings.
Robot Interface
The interface to the robot is identical to that which you used in
project 1.
What to Hand In
Project Report
Your report should include the following:
- The names of the group members
- Describe the details of your FSM design (the components listed
in the design section).
- A diagram of your circuit.
- A copy of your documented program (this may be handed in as a
separate file).
The reports are due at 5:00 on April 1st. We prefer that these
be turned in via the Blackboard drop-box (one copy per group) in
either postscript or pdf format.
Personal Reports
Your personal report must include the following information:
- Your name
- An estimate of your contribution to the project in terms of
percentage of effort.
- An estimate of the contribution of each of your fellow group
members.
The personal reports are due at 5:00 on April 1st. These must be
turned in via the Blackboard drop-box in raw text format.
fagg at ou.edu
Last modified: Mon Mar 28 19:04:13 2005