Date: Mon, 02 Dec 1996 14:59:34 GMT
Server: NCSA/1.4.2
Content-type: text/html
CSE477 Laboratory Assignment #3
CSE477: Digital Systems Design
Steve Burns, Spring 1996
Lab 1
Motors, Motor Driver Circuits, Optical Speed Sensors, and Feedback
Distributed: April 22 - Complete By: May 2
Objectives
When you have completed this lab, you should know how to:
- Run a DC motor using an H-bridge motor driver circuit and a duty-cycle
speed adjustment.
- Determine the speed of a motor shaft using an optical sensor,
- Integrate the two systems so that a motor can be run at a predetermined
speed under a variety of loading conditions.
Part 1: Setting Up the Motors and Optical Speed Sensors
You will need to fabricate a disk with black and white strips to be used
in conjunction with the optical sensors to determine the speed at which the
motor shaft is spinning. I've xeroxed enlarged copies of the disks shown on
page 124 of the Mobile Robots Text. Cut out the one with 16 black stripes
and paste it (using a glue stick) to a piece of foam board. Cut out
the combination. Punch a hole in the center using the sharp end of a
pair of scissors (be careful not to cut yourself) so that the disk pressure
fits onto the pully shaft of the motor.
You will also need to attach the motor and the sensor together. Scotch
tape works well for this. Before you do this though, acquire a sense for
how close the sensor needs to be to the spinning disk for it to obtain a
good signal. You can do this by wiring up the sensor: the blue and
white leads correspond to the anode and cathode, respectively,
of the transmiting LED, and
the green and purple leads correspond to the collector
and emitter of the receiving phototransistor, respectively.
No more than 20 mA should be allowed to flow through the LED. With a 5 volt
supply, an 180 ohm series resistor works well. On the receiving end, a
6.8 kiloohm series resistor will make an excellent voltage divider converting
the current change caused to the presense or absense of a reflecting surface
into a voltage change interpretable at CMOS digital levels. To determine how
close the sensor has to be to a reflecting surface, measure the voltage changes
between the resistor/phototransistor connection and ground as the distance
between the sensor and the surface varies. I found that the sensor had to be
be about 1/20 of a inch from the surface. Your sensor and circuit might be
slightly different.
To drive the motor, use the L293D bipolar driver chip. Please note the
unusual pinout. There are four
output buffers on this chip, so there is enough circuitry for 2 H-Bridges.
To vary the speed of the motor, vary the duty-cycle of the enable signal.
A larger duty-cycle will result in a higher average voltage and thus a
higher motor speed. Experiment with different duty-cycles and determine
the maximum/minumum no-load speeds of the motor.
Part 2: Connecting the Speed Sensors to the Motors Using Feedback
Since the speed of a motor depends not only on the applied voltage but also
on the amount of load, feedback from speed sensors is necessary
to accurately control the speed of your motor. Your are to devise a system
to control the speed of your motors using the optical speed sensors as
input and a variation in duty-cycle as output. More on this later.
Part 3: Operate Two Motors Simultaneously
Modify your microcontroller program to control two motors simultaneously.
Make sure that both motors have individual speed sensors.
What to Turn In
Demo the two motors spinning in lockstep
at three different rates to the TAs.
burns@cs.washington.edu