Introduction: 2 Input Stepper Driver
this is my third project, it turned out very useful,so i'd like to share it with people.
i have a parallel port with only 6 functioning data outputs.
so i think twice before i do something.
for example,controlling two stepper motors at once.or sixteen at once etc..
there are probably tiny chips out there that do what my device does,but i like designing stuff.
this device accepts,only two inputs, a clock line (pulse), and a direction line for our motor.
and magically,it outputs the right sequence of bits to drive the motor with its four outputs.
i use it with my parallel port,but it can also be driven with a 555 timer,or any other clock source.
Step 1: Step1
this device is tested on my system,and works with the parts that i have, and i don't have extensive electronics knowledge ,so be careful before you hook this up to your computer,and do your math twice. i can't be held responsible for any damage to your equipment or if you hurt yourself.
i have a very old computer that i don't care about,and many transistors to burn.so i simply build the circuit,and try it out.
luckily this circuit turned out great,and powerful.
a little theory:
i have two kinds of steppers,4 cables and 6 cables.however they both require 4 control cables.
the stepper is a great toy to play with,but it won't start directly right after you apply some voltage.
you have to send the data in a sequence.so that the coils start making the armature turn.
here is the sequence i found out thru trial and error,plus some google search.
o1 o2 o3 o4
0 0 0 1
0 0 1 1
0 0 1 0
0 1 1 0
0 1 0 0
1 1 0 0
1 0 0 0
1 0 0 1
while it is easy to create this sequence thru the parallel port using four outputs,we can create it using only two cables. one for the pulse, and the other for the direction.
go to step 2 to see how
Step 2: Step 2
i spent some time thinking on how it could be possible to drive my stepper with only two cables.
then i could use the rest (i have 4 more good outputs remember), to address switches,and boom,i have 16 motors running with only 6 cables (in theory)
i have already built a 2 bit data select device prototype designed to work with this baby.
so i can control 4 motors with 4 cables. (2 for addressing,2 for this device i'm about to reveal)
at the heart of the device is a 4029 4bit up/down counter.
the counter creates a sequence on its four outputs,counting from zero to fifteen(in binary mode),
of fifteen to zero.
it has the four output lines we need,but not the right sequence.
let's examine the sequence:
as you can see,this is nowhere near our desired sequence.
if you go back and look at my previous sequence table required by the motor,
you will notice we have eight different output states from 0001 to 1001
if you're familiar with binary(because we are dealing with only 2 states,1 and 0,true or false,on or off),you will realize that in order to get 8 different states,
we have to solve this equation
2n = 8
n turns out to be 3 in this case.
so,in theory i should be able to create these eight consecutive binary outputs shuffling a three digit binary number.
Step 3: Step 3
our counter has four outputs,that is four binary digits.
in binary mode (not decimal),the three digits from right to left repeat themselves after eight counts.
so the last three digits remain the same when we're counting from zero to seven,
or eight to fifteen.
we can use these three outputs to create our sequence.they will keep repeating in the same order forever.
the rest is very simple.
for example for the very first number 'zero',that our counter throws at us,
we have to create '0001'
0000 ?=> 0001
now remember we don't care about the fourth digit,
000 ?=> 0001 output
so in order t get output 1 high,
we need, NOT a and NOT b and NOT c
output1 is 1 when a'&b'&c' is 1
we will have a table,of all these conditions once we write the logic statements for each member of our output sequence.
notice,the second count,which is 0001 must turn on output1 and output2 at the same time.
output1 and output2 is 1 when a&b'&c' is 1
to do this,i used general purpose diodes.
while the output of the first statement is directly connected to output1,
output of the second statement is connected to output1 and output2
to prevent unintended triggering,i simply placed diodes between the statements which trigger more than one output.
we will have only two inputs,one will be connected to pin 15 of 4029 (CLK)
and the other to the pin 10 of 4029 (1 up/ 0 down).
the outputs are more than strong enough to drive the steppers that i have,but i recommend using them as triggers.
the whole thing is easier to understand once you see the schematic.
i just wanted to go over the theory here.
parts used here are:
(8) NPN 2N3094 transistors
(8) 4001 diodes
(4) red LEDs (i was out of diodes,LEDs worked just fine for this application)
(1) 4029 4bit up/down counter
(1) 4009 hex inverter
(3) 4081 quad 2 input AND gates
i will try to post a video of the device running soon
please feel free to make suggestions,criticize,or ask questions.