provided by a four-bit output from a controller into the
driver circuit. DC motors are also available in a wide range
of voltages and can have a simple on/off control circuit,
such as a transistor or MOSFET, or you can have directional
control using an H-bridge. For speed control, the input to
the driver must be pulse width modulated (PWM). Finally,
since PWM is also used for controlling lamps and RGB
LEDs, it seems only right to include that support in a
controller, as well.
Design
Many servo and motor controllers are based on SX,
PSoC, AVR, or PIC microcontrollers and each tends to have
functionality specific to the type of controller it is used on
with no provisions via hardware or firmware to add or change
that functionality — especially by the end user. Achieving
our goals of a multi-purpose controller can be most easily
realized using the Parallax Propeller™ chip. The Propeller
chip has eight 32-bit onboard processors. Each processor
has 2K of its own local memory, and the Propeller chip has
32K of shared RAM, as well as 32K ROM. Each of the eight
processors has dedicated hardware which can be used for
counting pulses, generating signals, and even generating
video. The open-source nature of the Propeller chip
community means there is already an abundance of
example code for controlling many types of hardware. One
of the design goals with this project is to be open-source
and provide multiple examples. Due to the amount of
information we'll be covering, this will be a four part series.
In this part, I will be covering the design of the hardware, as well as the construction of a prototype. For those
who do not wish to have a PCB made, the prototype design
will provide an alternative method of constructing this
controller. In the second part, David Carrier will cover servo
control and provide an open-source object for the Propeller
which will mimic functions of the Parallax servo controller,
as well as provide some other interesting features. In Part 3,
Kevin McCullough will demonstrate stepper motor control
and provide an open-source object, as well as a simple
driver circuit for stepper motors. Finally, in Part 4, I will
round out this series with some examples of PWM control
FIGURE 1. Parallax Propeller proto board.
including an open-source object along with hardware
interface schematics, including a simple H-bridge.
Prototyping
For the prototype, it was easy to prove the design using
the Parallax Propeller proto board. This board already
provides much of the circuitry we'd need to build our
multi-controller such as a prop plug programming interface,
a 3.3V regulator, and a power switch, which allows us to
power the logic supply and the servo pads independently.
There is also a reset button which can help in testing and
debugging code. Figure 1 shows the Propeller proto board
as it comes from the company.
The first thing I did was allocate the first 16 I/O pins
for the main outputs. These are conveniently located along
the right side (P0 through P7) and top (P8 through P15) of
the Propeller chip. Next, I populated the board with 16
three-pin SIP headers. On the proto board, the first two
holes coming from each I/O pin are connected together.
Using the outer hole as I guide, I left room for a 3.9K series
resistor and a three-pin SIP header along each of the 16 I/O
pins. Figure 2A and Figure 2B show the top and bottom of
the Proto Board after being populated. Note the 1/2W
resistors were unnecessarily large; 1/4W resistors are called
FIGURE 2A. The stuffed proto board.
The servo voltage jumper at the top is set to VIN.
FIGURE 2B. Solder side of the stuffed proto board.
SERVO 09.2008 43