28107 Parallax Inc, 28107 Datasheet - Page 2

KIT BOE-BOT DIGITAL ENCODER

28107

Manufacturer Part Number
28107
Description
KIT BOE-BOT DIGITAL ENCODER
Manufacturer
Parallax Inc
Datasheet

Specifications of 28107

Accessory Type
Digital Encoder
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Boe-Bot®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Parts List
Assembly
To assemble the Bot-Bot Wheel Encoder Kit,
you will need a small Phillips screwdriver and
a pair of needlenose pliers. Begin by removing
both wheels from the Boe-Bot. Next, remove
the top two screws (the ones nearest the crease
in the chassis) holding each servo. Loosen the
remaining servo mounting screws:
Plug a connecting cable into each sensor, as
shown:
2 ea. Reflective Sensors
2 ea. Connecting Cable
2 ea. Mounting Plates
2 ea. #4-40 x 1/4" Panhead
Machine Screw
2 ea. #4-40 Hex Nut
2 ea. 10K 1/4W Resistor
Remove
Remove
Loosen
Loosen
Remove
Remove
Loosen
Loosen
Next, take one of the mounting plates, and
thread the wires from one of the cables through
the oblong hole. Insert the sensor's alignment
pin into the mating mounting plate hole.
Secure the sensor to the mounting plate with a
screw through the other set of holes and a nut
on the back. Repeat for the other sensor, but
with the opposite orientation. When finished
you will have two mounted sensors that are
mirrors of each other:
Using the servo screws removed in the first
step, mount each sensor to the chassis so the
lenses are near to the servo shaft. Do not
tighten the screws yet. See photo:
Viewing the servos from the chassis bottom,
adjust their positions so that their shafts align
as closely as possible. Either center both in
their respective cutouts, or push them both
toward (not away from) the sensor connector.
Just make sure they're the same. Now tighten
all eight servo screws.
The sensor wires may now be brought out from
under the front of the printed circuit board and
inserted into the prototyping area. The wires
are assigned as follows:
The encoders should be wired according to the
schematic on the next page.
wires are red, black, and
Parallax for a different wiring diagram.
Red:
Black:
White: Signal (open collector)
Vdd
Vss
yellow
Note:
, contact
If your
A typical implementation of this schematic is
shown below:
P15
P14
P13
P12
P11
P10
P9
P8
P7
P6
P5
P4
P3
P2
P1
P0
Operation
The sensors emit infrared light and look for its
return from a reflective surface. They are
calibrated for optimal sensing of surfaces a few
millimeters away. The Boe-Bot's wheels, even
though they are black, reflect sufficient IR to
cause the sensors to respond. When a sensor
"sees" part of a wheel, it pulls its output low.
When it's looking through a hole, its output
floats, and the pullup resistor pulls it high.
Because the sensors emit and detect only
modulated IR (at about 7.8KHz) they are
relatively insensitive to ambient light. Be
aware, though, that some fluorescent fixtures
may also emit light at this frequency and could
interfere with their operation.
As a Boe-Bot wheel turns, the sensor will see
an alternating pattern of hole - no hole - hole -
no hole, etc. Its output will be a square wave
whose frequency corresponds to the speed of
rotation. If the Boe-Bot is rolling along the
Left
Sensor
Right
Sensor
Vdd
Rd
Wh
Bk
Rd
Wh
Bk
Vin
Vss
Vdd
Vss
Black Wires
to Sensors
Red Wires
to Sensors
White Wire
to Left Sensor
White Wire
to Right Sensor
2 x
10K
P11
P10
floor, each edge of the square wave will mark
an increment of travel slightly more than 1/2
inch (1.27 cm), as shown in the illustration
below:
By tracking changes in the encoders' outputs,
it's possible for a BASIC Stamp program to tell
how far the Boe-Bot has traveled. Notice that
the encoders themselves do not tell the Stamp
which direction the wheels are turning — only
when and how far. But if the Stamp program is
driving the wheel servos, it knows which
direction each wheel is turning and can apply
this additional information along with the
encoder outputs. In the most sophisticated
applications, it is possible not only to keep
track of the Bot-Bot's position and direction,
but also to coordinate the rotations of the two
wheels, using the encoders as feedback, to
obtain any desired motion contour.
Be aware, though, that wheel encoders are
never perfect. Uncertainties in the effective
wheel diameters can lead to position errors.
Further uncertainties in effective wheel
spacing during turns can result in direction
errors. And even small position and direction
errors have a way of accumulating quickly if
not periodically corrected using external
references. To obtain the best accuracy, always
run on a hard, flat, smooth surface, such as a
vinyl or hardwood floor — never on carpet.
The following sample program uses feedback
from the encoders to traverse a star-shaped
pattern on the floor. It is uncalibrated so is
therefore unlikely to return exactly to its
starting point. But try it anyway to see how
close it gets. More complicated examples,
including coordinated motion, X-Y position
and direction odometry, calibration techniques,
and the theory behind them, may be
downloaded from the Parallax website at:
www.parallax.com/detail.asp?product_id=28107
0
Direction of Motion
1
2
About 0.5"
Encoder Output
3
4
5
6
7

Related parts for 28107