DPRG List  

DPRG: Motor Divers

Subject: DPRG: Motor Divers
From: Roger Arrick rarrick at ix.netcom.com
Date: Thu Jul 17 09:42:54 CDT 1997

fellow stepmotor users:

Sorry for the intrusion.  I haven't read most of this thread but I 
thought I would bounce some ideas off you fellow robot builders.

I see a lot of people struggling over what drive/translator chip to use 
for small steppers.  By small, I mean less than 500ma current per coil. 
 These chips provide both the translation function (conversion of 
step/direction into phase patterns), and output drivers.  Believe it or 
not, there is not much reason to use these sometimes-hard-to-find 
chips.  And they often cost $5 or more.

Some will point to the following reasons for their use:

1. quick and easy
2. only 2 wires needed (step & direction)
3. translation performed automatically

Ok, I'd like to address each one.

1. These things don't appear to be so easy if it takes weeks to decide 
which one to buy, find a vendor, meet the minimum order, etc.

2. Step and direction are not the only wires needed.  There is also an 
inhibit line(turn off all phases) and usually a step-type line (half, 
full, etc).  So, you end up needing at least 3 if not 4 signals.

3. These chips normally accept step and direction signals which seems 
easy enough, right.  It probably takes 4 lines of assembly code to do 
step/direction, and 10 lines to generate the 4 phases yourself.

So, I offer this simple alternative:

Use a ULN2803A.  Avaliable from mouser for .62.  Each package has 8! 
high-power drivers (500ma I think).  This is enough for 2 4-phase, 
unipolar stepper motors, or 1 stepper, and 4 addition high power 
outputs such as lights, etc.  These devices also have the flyback 
diodes inside!  Your processor may need a simple 4.7k pullup to +5 on 
the input to help it drive.  Translation is done in your software.  
You'll have complete control over step pattern, direction, speed, 
phases-off-on, etc.  

Performing the translation in software:
Simply create an 8 element array in memory for your step patterns along 
with a pointer to select the next step pattern.  Motor direction is 
determined by going up or down through the array, grabbing the nibble 
(4 bits) and outputing it to the port.  Put your array on an even 
address boundry and simply add or subtract 1 to the pointer, then AND 
it with 7 (111) to get the next step pattern.  This eliminates the need 
to check for top and bottom of the array and makes the time to process 
each step the same.  Do a simple software or timer delay between each 
step to set the motor's speed (you'll have to do that anyway for the 
step/direction chips).

It's as easy as it looks.

Jim: You're welcome to put this in the DPRG faq.  What?  You don't have 
one yet?  Well, here's the first article.

Happy roboting and stepping,
- -- 
    /       Roger Arrick       /     Arrick Robotics       /
   /    roger at robotics.com    /       P.O. Box 1574       /
  /     Ph: (817) 571-4528   /   Hurst, Texas 76053 USA  /
 /     fax: (817) 571-2317  /   http://www.robotics.com /

"Talk" is inversely proportional to "do"


More information about the DPRG mailing list