CPLDs — Part 5
A CPLD Project
complex programmable logic devices
by David A. Ward
For the final article in this series, I
decided to incorporate a CPLD to
control a mobile robotics platform or
tank-bot (see Photo 1). Normally, a
microcontroller is used to control the
tank-bot, but I thought that it might be
fun to see if a CPLD could be used to
accomplish some of the same tasks that
the microcontroller does. The tank-bot
chassis consists of a Tamiya track kit and
double gear box mounted on three
pieces of aluminum. See Table 1 for the
details and sources for some of the
parts used to build the tank-bot chassis.
APCB (printed circuit board) is located on the bottom front of the tank-bot that holds an infrared LED in the center and two infrared phototransistors with
one on each side (see Photo 2). The LED and
phototransistors are used as sensors so the tank-bot can
follow a black line of electrical tape laid out on a light
colored table top. All of the circuitry involved is shown in
the schematic diagram in Figure 1. The two
phototransistors produce more of an analog output, so
Schmitt trigger inverters were placed between their outputs
and the CPLD. A L293 quad half H-bridge IC is used to
handle the 6 VDC used to energize the two drive motors.
To start a truth table for this project, let’s first look at
how the infrared phototransistors will behave. When the
LED’s light reflects off of a light colored object — such as a
light colored table top — back to the two phototransistors,
they will be in an ON state. When these transistors are ON,
they will take their collectors to ground and the CPLD pins
high since their signals are being inverted through the
Schmitt inverters. This would be the case if the tank-bot
were placed on a table top without any black line under the
46 SERVO 07.2011
PHOTO 1.
TABLE 1. Tank-bot Parts List.
Track and wheel set
Tamiya #70100
www.pololu.com
Double gear box
Tamiya #70168
www.pololu.com
L293 motor driver IC L293DNE (296-9518-5-ND)
www.digikey.com
IR LED
106526
www.jameco.com
IR phototransistor
112176
www.jameco.com
PHOTO 2.