This is only a preview of the June 1998 issue of Silicon Chip. You can view 32 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "Universal High-Energy Ignition System":
Articles in this series:
Articles in this series:
Articles in this series:
Items relevant to "Universal Stepper Motor Controller":
Items relevant to "Command Control For Model Railways; Pt.5":
Purchase a printed copy of this issue for $10.00. |
Universal Stepper
Motor Controller
This circuit can be used to drive a stepper motor
for a preset number of revolutions in the
forward or reverse direction at a speed which
can be varied. Jumpers on the board allow it to
drive steppers with 1.8 or 7.5 degree increments.
By RICK WALTERS
This circuit is a “grown-up” version
of the manual stepper motor driver
that we featured in the June 1997 issue
of SILICON CHIP. It was very popular
but a number of readers asked us how
it could be modified to drive larger
stepper motors. And they want
ed
74 Silicon Chip
several other features as well.
As it turned out, modifying the
original circuit was not that straightforward and we decided that rather
than “bodgie up” the previous design,
we should produce a new version
with all the bells and whistles that our
readers have been asking for.
This new stepper motor driver has
a RUN/STOP switch, a FORWARD/
REVERSE switch and a speed control.
These functions are similar to those
on the previous board but with the
addition of four more ICs, a couple of
transistors, a few small components
and two thumbwheel switches it becomes a motor driver which can be
programmed to step a motor for 1-99
revolutions. Jumpers on the board
allow you to use steppers with 1.8
degree or 7.5 degree increments.
One immediate use which springs
to mind for this option is as a coil
winder. We looked at adding a third
thumbwheel and the associated com-
ponents but it would add a fair bit
more to the cost and rarely would you
ever need to wind 999 turns.
How it works?
Fig.1 shows the new circuit. The
core of the circuit, involving IC1a,
IC2 & IC3, is similar to that in the
June 1997 issue. However, to make
the circuit programmable via decade
switches, we have added four 4510
presettable up-down counters.
Since many readers may not have
seen the previous circuit, we will
give a complete circuit description.
As before, the circuit can be divided
into three sections: one controlling
the duration of operation, one controlling the speed and direction of
stepping and the third controlling the
stepper motor drivers. Let’s look first
at the speed section, involving IC1a,
a NAND Schmitt trigger configured as
a clock pulse generator.
With switch S1 in the STOP position, the output of IC1a is held high
and there are no clock pulses into IC2,
a 4017 decade counter. When S1 is
moved to RUN, IC1a is enabled and
it will begin to oscillate. Its output
will be a square wave, the frequency
of which is dependent on the value
of the capacitor from its input, pin 2,
to ground (0V) and the value of the
resistance between its output, pin
3, and input, pin 2. By including a
250kΩ potentiometer in this path we
can vary the frequency over a wide
range.
IC1a’s square wave output clocks
IC2 and causes each of its outputs
(pins 3,2,4,7,10,1) to go high (+5V)
in sequence. The output pulses from
pins 2 & 7 are fed via diodes D5
and D7 (wired as an AND gate) and
inverter IC1b to clock flipflop IC3a,
while the outputs from pins 4 and 10
are fed via diodes D6 & D8 (another
AND gate) and through IC1c to clock
flipflop IC3b.
When IC2’s pin 1 goes high, it resets
IC2 via diode D1, after a slight delay
introduced by the 10kΩ resistor and
.001µF capacitor. Thus one complete
cycle of IC2 is actually four motor
steps.
Parts List
1 PC board, code 10106981,
112mm x 98mm
1 plastic instrument case, Jaycar
HB-5910 or equivalent
1 power transformer, Jaycar
MM-2002 or equivalent 1 amp
(T1)
or 1 power transformer, Jaycar
MM-2004 or equivalent 2 amp
(T1)
2 SPDT toggle switches (S1,S3)
1 SPDT toggle switch (S7,
optional)
1 DPDT toggle switch (S2)
2 BCD thumbwheel switches,
Altronics S-3300 or equivalent
(S4,S5)
1 pair of end plates for above,
Altronics S-3305 or equivalent
1 250VAC mains switch (with
indicator), Jaycar SK-0985 or
equivalent (S6)
1 IEC mains input socket (with
fuseholder), Jaycar PP-4004
or equivalent
1 0.25A slow-blow 5mm x 20mm
fuse
1 IEC mains lead, Jaycar PS4106 or equivalent
1 6-pin connector, Jaycar PP2024 or equivalent
Semiconductors
1 4093 quad NAND Schmitt
trigger (IC1)
1 4017 decade counter (IC2)
1 4027 dual JK flipflop (IC3)
4 4510 presettable up-down
counters (IC4-IC7)
1 78L05 voltage regulator
(REG1)
6 BC548 NPN transistors
(Q1,Q6,Q7,Q12-Q14)
4 BD680 or BD682 PNP
Darlington power transistors
(Q2,Q4,Q8,Q10)
4 BD679 or BD681 NPN
Darlington power transistors
(Q3,Q5,Q9,Q11)
8 1N914 small signal diodes
(D1-D8)
1 1N4004 1A power diode
(D9)
1 1N4004 1A power diode (D10)
or
1 1N5404 3A power diode (D10)
1 BR610 100V 6A bridge rectifier
(BR1)
Capacitors
1 4700µF 25VW PC electrolytic
1 470µF 25VW PC electrolytic
1 100µF 16VW PC electrolytic
1 10µF 25VW PC electrolytic
1 0.22µF MKT polyester
3 0.1µF monolithic ceramic (MC)
2 0.1µF MKT polyester
1 .01µF MKT polyester
2 .001µF MKT polyester
Resistors (0.25W, 1%)
3 100kΩ
15 10kΩ
7 47kΩ
8 4.7kΩ
Miscellaneous
1 knob for speed control
1 1.6mm baseplate, 220mm x
150mm
4 6PK x 6mm self-tapping
screws
13 PC stakes
1 4mm x 15mm screw
2 4mm x 6mm screws
5 4mm nuts
4 4mm flat washers
4 4mm toothed washers
3 earth lugs
4 3mm x 10mm threaded
spacers
11 3mm x 6mm screws
1 3mm x 12mm screw
3 3mm flat washers
3 3mm star washers
4 3mm nuts
100mm rainbow cable
red & black hookup wire
tinned copper wire
Note. While the Jaycar MM2004
power transformer is shown in their
catalog as having identical output
voltages to the MM2002, the one
we were supplied with only had
6V, 9V, 12V and 15V taps. These
voltage taps are probably satisfac
tory for this project.
Bridge drivers
Before we describe the logic operations any further, let’s have a look at
the stepper drivers. The type of stepper motor specified has two windings,
designated here as MA and MB. Each
winding is connected across a bridge
of four transistors (ie, like a bridge rectifier in reverse) comprising Q2, Q3,
Q4 & Q5 and Q8, Q9, Q10 & Q11. We
will first describe how winding MA
is driven; the drive to MB is identical.
Assume pin 1 of IC3a is high and
therefore its complement, pin 2, will
June 1998 75
76 Silicon Chip
Fig.1 (facing page): the heart of the
circuit is formed by oscillator IC1a,
decade counter IC2 and dual JK
flipflop IC3 and these control the
direction and speed of the stepper
motor. Counters IC4, IC5, IC6 and IC7
control the number of steps.
be low. Pin 1 will turn Q1 & Q5 on,
and Q2 will be turned on, as well. Q6,
Q3 & Q4 will be turned off. Therefore
current will flow through motor winding MA via Q2 & Q5. When IC3a is
toggled, pin 1 will go low and pin 2
will go high. This will turn off those
transistors which were on and turn
Q3, Q4 and Q6 on. Current will now
flow through MA in the other direction, via Q4 & Q3. A similar sequence
occurs with flipflop IC3b and the
motor winding MB.
This sequence of voltage and current reversals causes the motor to step.
The reversing switch, S2, is wired
to the MB winding and reverses the
direction of the current relative to
MA, causing the motor to change its
direction of rotation.
The resistor and capacitor from pins
4 & 12 of IC3 reset these flipflops at
power-up, ensuring the motor will
always rotate in a known direction.
To recap so far, the motor is started
by S1, the speed is varied by VR1
and the direction (selected while the
motor is stopped) is set by S2.
Revolution counter
To count the number of revolutions
of the motor we first need to know
whether we are driving a 1.8 or 7.5
degrees per step unit. A 7.5 degree
motor takes 48 steps per revolution
while a 1.8 degree unit has to make
200 steps.
The steps are counted by IC4 and
IC5 which are arranged as presettable
dividers. Each time IC2 completes one
cycle and resets itself via its pin 1
output (as previously described) this
pulse also clocks the dividers. But we
are getting slightly ahead of ourselves.
When S1 is moved to RUN, the
low to high voltage transition on its
common pin is coupled through the
.01µF capacitor to the preset enable
inputs (pin 1) of IC6 & IC7 and via
diode D4 to IC4 & IC5. This loads the
BCD value which is present at the “P”
inputs into each counter.
IC4 has P1 (bit 1) tied high and a
jumper to pull P3 (bit 4) high. This
Fig.2: this is the component layout for the PC board. It also shows the
wiring for the optional switch (S7) to take the place of jumpers J1 & J2.
This will allow easy switching between 1.8 and 7.5 degree steppers.
will give a division of 10 or 50. Similarly, IC5 is able to divide by 0 or 2.
By using the appropriate link we can
divide by 12 (10+2) or 50 (50+0). This,
together with the four steps provided
by IC2, makes up one complete revolution for each type of motor.
So each time counters IC4 and
IC5 count down to zero, pin 7 of
IC4, which is normally high, will go
low, momentarily turning Q13 off.
This transistor is normally held on
by the 47kΩ resistor at its base. The
positive-going pulse at its collector
reloads the preset count into IC4
and IC5 through diode D3 and also
applies a clock (count down) pulse
to IC6 and IC7.
Thumbwheel setting
Thus, IC4 and IC5 continuously
count down and after each full revo-
lution of the motor they are preset by
transistor Q13 which also clocks IC6
and IC7. These are also presettable
down counters. When S1 is moved to
RUN, they are loaded with the value
set on the thumbwheel switches as
described earlier.
After the preset number of revolutions has occurred, pin 7 of IC6 will
go low, turning transistor Q14 off. This
allows its collector to go high, holding
IC2 reset through D2. With no drive
pulses from IC2 the motor will stop.
To make the controller as flexible
as possible we have added a MODE
switch, S3, which we have called the
PRESET/CONTinuous switch. In the
CONT position, the motor will run
continuously while S1 is set to RUN.
Conversely, in the PRESET position,
the motor will turn for the number of
revolutions set on the thumbwheels
June 1998 77
Fig.3: use this diagram to complete the wiring from the PC board to the front
and rear panels and to the mains transformer.
and then stop. Switching to STOP
then RUN will rotate the motor again
for the same number of preset revolutions.
Thus, by setting the thumbwheels
to 75 and running the motor for three
cycles, it would rotate it for 225 rev78 Silicon Chip
olutions.
Assembling the PC board
The circuitry for the new Stepper
Motor Controller is accommodated
on a PC board which measures 113
x 99mm and is coded 10106981. The
component layout for the board is
shown in Fig.2.
The first step in assembly is to
inspect the board for etching faults
or open circuit tracks. The tracks
between IC pads should be checked
with a multimeter to ensure they are
not shorting to the pads.
Begin by inserting and soldering the
15 links. Then continue by fitting the
This view inside the case shows the wiring to the PC board and to the mains
transformer and front-panel. Note the rainbow cable that’s used to wire the
decade switches.
resistors, capacitors, diodes, transistors and ICs. Add the components a
few at a time, soldering and cutting
the leads as you go. Double check the
direction of diodes and capacitors
before you solder them in.
We have specified a choice of two
types for diode D10 in the parts list.
If you are using a low current motor
you can use a 1N4004 diode type but
if the motor coils are going to draw
around 1A or more then the type
1N5404 should be fitted. The power
transformer we have specified will
readily supply the higher current.
Once the PC board assembly is complete, it’s time to drill the front and
rear panels as well as the baseplate.
The easiest way to cut the required
rectangular holes in the plastic panels
is to mark the cutout on the rear with
a scriber, then using a hammer and a
sharp chisel, outline them from the
back. When the panel is turned over
you can see the hole outline and it can
be readily chiselled from the front.
After mounting all the hardware
you can begin the wiring, as shown
in the diagram of Fig.3.
You will see that there are four
wires shown dotted on the PC board.
These are run under the PC board to
keep the heavy motor currents away
from the digital circuitry.
We used a short length of rainbow
cable to wire the thumb
wheels as
there are nine wires and it is easy to
get them mixed up if they are all the
same colour. The wires from the tens
switch (S4) go to IC6, while those
from the units switch (S5) go to IC7.
The diagram of Fig.3 shows the wiring
details.
Make sure you sleeve and heatshrink all the connections to the
mains switch (S6), power transformer
and the mains input socket. A large
sleeve should also be fitted right over
the IEC socket for added safety. Note
that the leads to the mains switch
should also be sleeved in heatshrink
tubing for some distance as shown
in the above photo, so that the mains
wiring cannot possibly come adrift.
Alternatively, you can use cable ties
to securely bind the mains wiring.
We also recommend that the case
of the pot be earthed to the baseplate
– see Fig.3.
We have made the mains connections to the transformer fairly inaccessible, as they are quite difficult to
sleeve adequately.
We have used a power transformer
with a multi-tapped sec
ondary to
cater for the wide range of stepper
motors which are available. The
6.3V or 7.5V tap should be suitable
for most 5V single winding motors
and the 8.5V or 9.5V tap will drive
5V centre-tapped motors (where the
tap is not being used), or 12V motors
without tapped windings.
The higher voltage taps will allow
you to add a resistor in series with
each winding to obtain higher torque
June 1998 79
The rear panel carries the IEC mains input socket (with fuseholder) plus a 6-pin
output connector for the stepper motors.
without exces
sive current flowing,
or even run the somewhat rare 24V
steppers.
Testing
It is wise to check the 240VAC
mains wiring with a multimeter before
applying power. You should read zero
ohms from the earth pin on the IEC
socket to the metal base plate. When
the mains switch is off there should be
an extremely high resistance between
the Active and Neutral pins but when
the switch is turned on, the reading
should drop to around 60-70Ω which
represents the resistance of the trans-
You can use this Universal Stepper Motor Controller to drive a range of stepper
motors for a preset number of revolutions in the forward or reverse direction at
a speed which can be varied
80 Silicon Chip
former primary winding. A reading
of around 1-2Ω is bad news. Fix the
problem! If the reading stays very high
you have either mixed up the switch
wires or forgotten to fit the fuse.
You will have to determine the
voltage necessary for the motor you
plan to use and connect the bridge
rectifier to the appropriate tap on the
power transformer. Leave the motor
un
plugged at this stage. Plug the
mains lead into the IEC socket, turn
on the front panel POWER switch and
then plug the 3-pin mains plug into a
power point.
Turn the mains on, checking that
the power indicator in the front panel
switch lights. If not, turn the mains off
immediately, remove the 3-pin plug
from the power point and recheck all
your mains wiring.
Once the indicator is working
you should measure the vol
tage at
the 4700µF capacitor. It should be
roughly 1.5 times the AC tap voltage you selected. Next, measure the
voltage between pins 7 and 14 of IC1.
This should be 5V ±5%. This voltage
should also be present at pin 16 of
each of the other ICs, while keeping
the meter’s negative lead on pin 7
of IC1.
The phasing for 1.8 degree steppers
appears to be black to pin 1 on the
rear connector, red to pin 2, white to
Fig.4: above is the full-size etching pattern for the PC board, while
at right is the full-size front panel artwork.
pin 5 and green to pin 6. This will rotate the motor to agree with
the front panel switch. If your stepper has different colours, use
your multimeter (switched to Ohms) to find the wire pairs and
connect one pair to pins 1 & 2. Poke the other wires into pins 5 &
6 and swap them if the motor runs in the wrong direction. Once
they are correct you can fit the pins and push them into the plug.
Mineba stepper motors (available from Jaycar) are 7.5 degrees
per step and are wired with brown - pin 1, red - pin 2, yellow pin 5 and orange - pin 6.
If you want to run different steppers at different times, you will
need a wired plug for each one. Alternatively, you could wire
the stepper up to a 4-way insulated terminal block (as shown in
one the photos) and then wire that up to the 6-way plug.
If you want to frequently change between 1.8 or 7.5 degree
steppers, it may be desirable to wire up a switch to take the place
of jumpers J1 & J2. We have shown the wiring for this optional
switch (S7) in the PC board layout diagram of Fig.2.
Fault finding
If you are careful with your assembly and check thoroughly
as you proceed, everything should work, but if bad luck inter
venes, you will have do some fault-finding with your multimeter.
If you turn the speed control to minimum and trace the clock
pulses through the circuit an analog or digital multimeter set to
read 5V will jump around if the clock pulses are present, but
give a steady reading if no clock is present.
Pin 3 of IC3 should continuously alternate between ground (0V)
and +5V. IC2 pins 2, 4, 7 & 10 should sit at ground and swing to
+5V sequentially. Pins 1, 2, 3, 13, 14 & 15 of IC3 should alternate
SC
between ground and +5V.
June 1998 81
|