My current logo. Click here to go directly to Home Page. Last update: 9:44 PM 9/5/2008
Copyright© 2007 by Dustin, webmaster of this site, all rights reserved.
Side toolbar.

To Home Page.

Projects.

DSMDIC is for Dustin's (EGO BOOST!) Stepper Motor Driver Integrated Circuit


I'm going to assume that you know what a stepper motor is and how to drive one.

Yes, another one of my integrated circuit designs. This one drives a bipolar stepper motor so that the rest of the logic circuits don't have to remember where the stepper motor is, how fast it should go, etc.
The goal of this project was to prove it's feasibility. Oh, and I was bored.

Operation:

You make the stepper motor GO by pulsing the STEP pin. Direction would be determined by the DIR (direction) pin.

Also, a PWM (pulse width modulation) pin for easy control of how much power goes to those coils. The PWM input can be thought of as an "enable input".

The outputs, while the STEP pin is pulsed, counts up from ouput 1 to output 4 (only one output at a time can be on), and if the DIR pin reverses, the counting goes in reverse, right where it is (this keeps the motor from getting confused).
Now, as you'll see, I've spent a great deal of time and effort getting this counting effect with two "divide by two" circuits, and a demultiplexor. Now, I think I've seen something like a "4 bit up/down counter" in the 4000 series IC's, but I didn't have one of those on hand.

Below is a schematic symbol my my IC, showing placement of inputs and outputs:

Schematic symbol of DSMDIC

Internals, block diagram(s):



Below is a simplified internal block diagram for my IC (PWM input circuit and output separating doides not shown):

Stupid photobucket fuzzying jpg's!

{I'm assuming you know what 1 to 8 demultiplexors and "divide by 2(two)"'s are and how they operate. If you don't know what a demultiplexor is, see this article. And if you don't know what a divide by two does, see this one.}



The two divide by 2's help convert the pulsing STEP input into two binary counting outputs. The demux then takes the number state from these inputs and sets one output of the two separated groups of four outputs high (blegh, that was a rough sentence!). The DIR decides which of the two groups of four outputs will be selected.
One set of outputs counts up, the other down(actually, the outputs go high from 1 to 8 sequentially, but I split them in half).
Since only one output can be high at a time, we can connect these outputs together in such a fashion that we can switch between these two counting sets!

So we get up counting that loops, down counting that loops, and reversing at will.
The next part of the IC is the amplification part, the one that hopefully drives that stepper motor without too much external circuitry.
You'll be delighted to know that this part is the simplest, consisting of H-bridges, which have excellent documentation on them everywhere on the internet.


Divide by twos



From here forward, I'll refer to "divide by twos" as "DB2's" for my own convenience in writing this article).


I used two separate 4017's to give me a high on the output for every other high on the input, simple as that.

Before I used the 4017's, I tried using a 74LS74 dual D-flip-flop to do this in a smaller, easier package, but at the time, I couldn't get it to work. Turns out that I need to use some pull down resistors with TTL---GASP!


4017's are pretty nifty little things. Forgiving too. You just put a pulse on its clock input, and it counts up through the outputs, one at a time, assuming that the other extra pins were dealt with properly.
For simplicity (at the time), I just put a 1N914 diode on every other output, and did what was neccessary to the other in/outputs to give me my counting, and nothing more. A schematic of one of the DB2's can be seen below:
[If the image seems small and distorted, right click, and hit "save as", saving it to your hard drive. You can probably see it better then.]



Now, after building this on my breadboard, I thought of a way of getting exactly the same functionality without using so many diodes by using the reset pin. A schematic diagram of the improved DB2 can be seen below:



More information about doing fun things with the 4017 can be found here and here.

The 1M resistor is there to keep the 4051's inputs from floating and provide a solid LOW while the 4017 is on an output that doesn't have a diode on it.

Another alternate DB2 design (which I am in the process of bread boarding now) is one that uses a D-flip -flop. Just connect the inverted output (the one with a Q that has a line on top of it) to the D input, and there you go. Put your pulses in the clock input, and the non-line-on-top Q output will give the DB2 function, that is, if it's a CMOS D-flip-flop you have. For TTL, you need a 4.7k (tops) resistor to ground where the inverted Q goes to the D input, and another resistor to ground (from here forward referred to as GND because I'm lazy) on the clock input. Oh, and if the new DB2 is gonna output to another TTL logic gate, you'll need yet another resistor to GND on the noninverted output.
Took me a while to find out that I needed those resistors.
Below is a picture of one of the DB2's on my breadboard. And below that is the same picture, but with labels to help understand it.

Everyone loves big pictures, except for dial-up!





Demultiplexor and H-Bridges



From here forward, I'll refer to "4051 demultiplexor" as a "demux").



Perhaps an animated gif would help to show the counting effect with the DB2's:

All of the bubbles with a leter in them only attach to all other bubbles with the same letter in them, just as if they were all attached with an invisible wire. This saves from having to read a web of rat's nest wires.



"Why not just use a 4017 to control the stepper motor?" you ask. The demultiplexor is the one that gives us control of what output we want high at any time while the 4017 doesn't. The 4017 would only let us drive the motor one way, but not the other.

The H-bridges are there to amplify the current available for the motor, simply because the most that the demultiplexor can do is light LED's. Nothing unusual here. On the breadboard prototype, I had to use two 74AC240's to amplify the demultiplexor's output to run the H-Bridge, which was made of 2N4401 and 2N4403 transistors, which are cheap and generic [the motor I used was a power gobbler, probably meant to run at 24v instead of 15v].




Results



I eventually got that darn motor to turn under my control. I could run it step by step, or hook up an oscillator to have it automatically send pulses for me. Then, I could vary it's speed. Direction was controlled by just reversing the polarity of a single wire. The stepper motor wasn't very strong(not enough power?), or fast, but it does turn in very precise increments. Very good for when an armature or somesuch needs to reliably return to the exact same spot every time. This is advantageous in a manufacturing setting. Below are more pictures:


Finding output sequence using an aplhanumeric LED display from Parallax.
Finding the correct sequence of outputs with a mess of LED's and diodes.
Overview after 

74AC240's have been added.

Closeup of 

74AC240, taken with the use of a magnifying glass over the camera lens.

The demux 

and a DB2 closeup.


Adding the TTL 74LS32 quad two input OR. This is how I got the inputs to come together for the H-

Bridge driving.
Finished 

circuit without oscillator. This setup requires pulses on the input.
Another picture of the finished product, but with my (copyrighted) oscillator in the bottom left. I 

can vary the speed with this setup.
No oscillator here; closeup.
With 

oscillator, faraway overview.

The 

wire mess I've had to sort through. Not so bad when building, but becomes a nightmare when a problem 

develops.
A pic of 

the very spot upon which this project was built. Yes, very messy, and it was a pain to try turning the 

page on my notebook, but that ringbinder sure made a good carrying platform.

A full schematic is on the way, but other projects need updating too!

Hosted by www.Geocities.ws

1