Digital Signal Processing Reference
In-Depth Information
paint stripes or black drafting tape and count the pulses from the IR sensor to determine
movement of the wheel. Another option would be to draw the radial stripes using a PC
drawing program and print it on clear adhesive labels made for laser printers. The labels
could then be placed on the flat side of the wheel. If a transmissive sensor arrangement is
used, holes can be drilled in the main wheel or a second smaller slotted wheel could be
attached to the servo output shaft that periodically interrupts the IR light beam from the
LED to the sensor. In this case, the LED and sensor are mounted on opposite sides of the
wheel. This same optical sensing technique is used in many mice to detect movement of
the mouse ball. Use the position feedback to implement more accurate variable speed and
position control for the motors.
5. Design a state machine using a counter/timer that will move the robot in the following
fixed pattern:
Move forward for 6 seconds.
Turn right and go forward for 4 seconds (do not count the time it takes to turn).
Turn left and go forward for 2 seconds.
Stop, pause for 2 seconds, turn 180 degrees, and start over.
Determine the amount of time required for 90- and 180-degree turns by trial and error. A
10Hz or 100Hz clock should be used for the timer. Use the clk_div FPGAcore to divide
the UP3 on-board clock. The state machine should check the timer to see if the correct
amount of time has elapsed before moving to the next state in the path. The timer is reset
when moving to a new portion of the path. Use an initial state that turns off the motors
until a pushbutton is hit, so that it is easier to control the robot during download. Since
there is no motor position feedback, all turns and the actual distance traveled by the
FPGA-bot will vary slightly.
6 sec.
Start
2 sec.
4 sec.
4 sec.
2 sec.
Turn 180
Degrees
6 sec.
Figure 13.29 Simple path for state machine without sensor response.
6. Using a ROM, develop a ROM-based state machine that reads a motor direction and
time from the ROM. Put a complex pattern such as a dance step in the ROM using a
MIF file. For looping, another field in the ROM can be used to specify a jump to a
different next address.
Search WWH ::




Custom Search