FIGURE 3. Here, we’re focusing
on performing basic stepper motor
operations that include the full step and
half step, and I also show you how to
change the stepper motor direction with
the simple experiment setup shown here.
including: full step, half step, and direction (clockwise,
counterclockwise) which should enable you to run most
common unipolar stepper motors found at places like
AllElectronics.com or recycled ones. Although the bipolar
stepper motors provide more torque, we will use unipolar
steppers for these experiments since they are easier to
control.
Advanced stepper motor subjects such as PWM,
chopper, L/R, current sensing, micro-stepping, motion
profiles, and complex motion control are beyond the scope
of this article and will not be covered here. They are used
for very specialized applications that require expensive
motion control hardware. Applications for these advanced
features include X-Y-Z platforms for electron microscopes,
high precision pick and place robots, for example.
What are the advantages to using stepper motors vs.
the standard DC motor or RC servo commonly found in
robotics? Well, the main advantages are precise angular
positioning and stepper motor “open loop” position control.
By open loop I mean that no position feedback is necessary
in most situations using stepper motors. Feedback for a
motor or other kind of actuator is usually provided by some
kind of sensor such as an optical encoder, rotary encoder,
contact sensor, or micro-switch. Disadvantages are that
stepper motors have less torque for their size and are much
slower when compared to standard DC motors.
Using the ULN2803A Driver IC
We will focus on performing the basic stepper motor
operations that include the full step and half step modes,
and I’ll also show you how to change the stepper motor
direction with the simple experiment setup shown in Figure
3. In addition, I’ll show you how you can use the same
circuits to drive other important actuators commonly used
in robotics including relays, solenoids, and even standard
DC motors, and even driving bright white LEDs or IR LEDs.
The main component of this circuit is the ULN2803A
which is a high-voltage, high-current Darlington transistor
array IC that replaces a handful of discrete components and
70 SERVO 10.2010
lowers the cost. The datasheet for the
ULN2803A (which is located on the web
at www.sparkfun.com/datasheets/
IC/uln2803a.pdf) shows you that it has
eight inputs and eight analog output
drivers, each capable of 500 mA that are
perfect for driving small stepper motors,
small DC motors, relays, and solenoids all
under the control of the VEX
microcontroller. In addition, you get the
added protection of its internal snubbing diodes that
prevent high voltage spikes generated by back EMF from
collapsing magnetic fields from the stepper motor or relay
coils. It also simplifies building the circuit using SparkFun
jumper cables and a RadioShack white prototyping board
(as shown in Figure 3). It is recommended that you use a
buffer or driver with the VEX microcontroller output.
Fun with Steppers
The best way to learn about stepper motors is to build
a simple driver circuit and use your VEX microcontroller to
send them commands using Easy C or PIC18 C. A stepper
motor circuit could be made from discrete components
including high power transistors; these types of circuits are
described in great detail in Gordon McComb and Myke
Predko’s book, Robot Builder’s Bonanza [1] which I highly
recommend. This book also provides an excellent
description of stepper motors in general, and how they are
decoded and connected. It also covers various stepper
motor driving circuits that use discrete parts.
For smaller stepper motors, we can simplify things a bit
and reduce the number of connections by wiring the
ULN2803A based stepper motor driver circuit shown in
Figure 4 and carefully connecting it to the VEX
microcontroller digital output pins on the I/O block shown
in the schematic.
In this experiment, a ULN2803A IC is used which
reduces the parts count and makes it easier to build stepper
motor control using the VEX microcontroller and a low cost
prototyping board. It can be purchased for around $2 from
SparkFun which is much less than purchasing the discrete
components. It works well with small stepper motors,
standard relays, and solenoids. For driving larger stepper
motors, a board made with discrete high power transistors
or HEXFETs can be more economical.
Each output from the ULN2803A is capable of driving
up to 500 mA of current, but you can also pair the outputs
to get four outputs each capable of driving one amp or
current for driving larger actuators. A single ULN2803A can
supply enough current to drive eight or more IR LEDs for a