This is only a preview of the August 1999 issue of Silicon Chip. You can view 38 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. Items relevant to "Remote Modem Controller":
Items relevant to "Daytime Runnings Lights For Cars":
Items relevant to "Build A PC Monitor Checker":
Items relevant to "An XYZ Table With Stepper Motor Control; Pt.4":
Items relevant to "Making Negatives From Positives":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
YZ TABLE
WITH STEPPER
MOTOR CONTROL
Part.4: Motor
Control Boards
This month, we describe the modified
motor controller boards for the XYZ Table.
The new controller boards include the
motor voltage interlock circuit described in
the May 1999 issue, to prevent possible
damage to the driver transistors.
By RICK WALTERS
The operation of the stepper motor
controller cards was first covered in
the August and September 1997 issues. There are two boards involved:
(1) a single controller which controls
the Z-axis stepper motor; and (2) a
dual controller which drives the X
and Y stepper motors. All motors are
driven under software control from
the PC.
For the sake of completeness, we
shall briefly cover these items again,
especially for those who may not have
the relevant issues to hand. Fig.21
shows the circuit for the single con
troller, while Fig.22 shows the dual
controller.
As can be seen, the front ends of the
two circuits are identical. It’s only the
output stages following IC2 that differ.
The data input to all cards is from
the parallel port of a PC via the Port
A data lines D0-D7. These are the signals that would normally determine
the character that would be printed
by a printer. In this application, they
determine which motor will step and
in which direction.
The Port C lines, C0-C3, are used
to select which card accepts the Port
A information. As there can be up to
eight different cards in a system, each
card’s address is selected by a jumper
C1-C8. We set the jumper to select
card 2 for the dual stepper driver and
card 3 for the single stepper.
Let’s look at this in a little more
detail. IC1, a 74HC137 one-of-eight
active low decoder, is used as the
address latch. This IC looks at the BCD
address data on its A, B & C inputs
and pulls the corresponding decimal
output (Y0-Y7) low. However, this can
only happen when the strobe goes
Fig.21 (facing page): this is the circuit
for the single motor controller. IC1
is the card select circuitry, while IC2
latches the data on the parallel port of
the PC and drives the stepper motor
via two H-bridge transistor circuits
(Q1-Q12).
60 Silicon Chip
AUGUST 1999 61
62 Silicon Chip
Fig.22: the dual motor controller is
similar to the single controller. In
this case, however, the 8-bit latch
(IC2) drives four H-bridge transistor
circuits to control two motors.
high and thus the output from inverter
stage IC4b goes low. This momentarily
pulls the latch enable (LE) input of IC1
low via the series .001µF capacitor.
As a result, the card will be addressed if the decoded output is
selected by the address link. In that
case, the decoded low will be fed
to pin 2 of IC4a and to the cathode
of D1. When the strobe signal goes
low, pin 3 of IC4a goes low and pin 1
momentarily pulls the LE input (pin
11) of IC2 high.
IC2 is a 74HC573 8-bit data latch.
When its LE input is taken high, it
latches the data fed to its D0-D7 inputs from Port A of the parallel port.
This data is transferred through to
IC2’s Q outputs and is used to drive
the stepper motor coils via transistor
driver circuits. The LE signal then
goes low 47ms later (as set by the
47kΩ pull-down resistor), so that the
data remains latched until the next
strobe signal arrives.
In the case of the single controller,
two transistor H-bridge circuits are
used to drive the coils in the Z-axis
stepper motor (MA & MB). Similarly,
the dual controller uses four H-bridge
circuits to drive the X-axis and Y-axis
stepper motors.
D1, IC3c and LED1 form a card
selected indicator. Normally, pins
8 & 9 of IC4c are pulled high via a
10MΩ resistor and so pin 10 is low
and LED1 is off.
When a valid address is received,
pins 8 & 9 of IC4c are pulled low via
D1. As a result, pin 10 switches high
and LED1 lights to show that the card
has been selected. The associated
0.1µF capacitor ensures that the LED
remains on for at least one second.
Motor interlock circuit
IC3 and its associated circuitry
forms the motor interlock circuit. Its
job is to switch the V+ supply to the
output transistors only after the software has set all IC2’s outputs low. This
is to prevent the driver transistors
from turning on in random fashion
at power up, which could cause one
of more transistors to self-destruct.
The circuit works like this: at
Parts List
Single Stepper Motor Card
1 PC board, code 07208992, 120
x 112mm
1 DB25 PC mounting right angle
male connector
1 8-way x 2 pin strip
1 jumper for above
1 3-way terminal block (5.08mm
pitch)
1 SPDT relay Jaycar SY4066 (or
equivalent)
Semiconductors
1 74HC137 decoder (IC1)
1 74HC573 8-bit latch (IC2)
1 74HC112 dual JK flipflop (IC3)
1 74HC02 quad NOR gate (IC4)
4 BD680/682 PNP Darlington
transistors (Q1, Q2, Q7, Q8)
4 BD679/681 NPN Darlington
transistors (Q3, Q4, Q9, Q10)
4 BC548 NPN transistors (Q5,
Q6, Q11, Q12)
1 BC338 NPN transistor (Q13)
4 1N914 small signal silicon
diodes (D1-D4)
1 5mm red LED (LED1)
Capacitors
2 100µF 25VW PC electrolytic
2 0.1µF MKT polycarbonate
2 0.1µF monolithic ceramic
2 .001µF MKT polycarbonate
Resistors (0.25W, 1%)
1 10MΩ
4 2.2kΩ
1 1MΩ
1 1kΩ
1 47kΩ
1 470Ω
9 10kΩ
1 74HC112 dual JK flip flop (IC3)
1 74HC02 quad NOR gate (IC4)
8 BD680/682 PNP Darlington
transistors (Q1, Q2, Q11-14,
Q23, Q24)
8 BD679/681 NPN Darlington
transistors (Q3, Q4, Q9, Q10,
Q15, Q16, Q21, Q22)
8 BC548 NPN transistors (Q5, Q6,
Q7, Q8, Q17-20)
1 BC338 NPN transistor (Q25)
4 1N914 small signal silicon diodes
(D1-D4)
1 5mm red LED (LED1)
Capacitors
2 100µF 25VW PC electrolytic
2 0.1µF MKT polycarbonate
2 0.1µF monolithic ceramic
2 .001µF MKT polycarbonate
Resistors (0.25W, 1%)
1 10MΩ
8 2.2kΩ
1 1MΩ
1 1kΩ
1 47kΩ
1 470Ω
9 10kΩ
Heatsink parts (optional)
1 aluminium bar 110 x 6 x 3mm
16 TO-220 insulating washers
8 3mm x 15mm bolts
8 3mm nuts
16 3mm flat washers
Case Assembly
1 PC board, code 07208991, 120
x 112mm
1 DB25 PC mounting right angle
male connector
1 8-way x 2 pin strip
1 jumper for above
1 3-way terminal block (5.08mm
pitch)
1 SPDT relay, Jaycar SY4066 (or
equivalent)
1 plastic case, 155 x 65 x 160mm,
DSE H2508 (or equivalent)
2 25-pin “D” IDC female connectors
Jaycar PS0846 (or equivalent)
1 25-pin “D” IDC male connector
Jaycar PP0842 (or equivalent)
1M 26-way IDC cable, Jaycar
WM4504 or equivalent (one
strand to be peeled off)
1 12-way terminal strip
1 4-way terminal strip
mounting nuts & bolts for terminal
strips
2 3mm x 10mm countersunk bolts
2 3mm x 6mm bolts
2 3mm x 25mm threaded spacers
Semiconductors
1 74HC137 decoder (IC1)
1 74HC573 8-bit latch (IC2)
Miscellaneous
Hookup wire, tinned copper wire (for
links).
Dual Stepper Motor Card
switch on, both flipflops in IC4 are
reset by the 1MΩ resistor and the
0.1µF capacitor connected to pins 14
& 15. This means that both Q outputs
(pins 5 & 9) are low and so the base
of Q13 (Q25) is held low via D2 & D3.
AUGUST 1999 63
The transistor will therefore be off
and so RLY1 is also off and no power
is switched through to the driver
transistors.
When the software is run, it first
sets all the Port A outputs low. It then
selects the dual motor card and so
all IC2’s outputs on this card also go
low. Next, it selects the single motor
card, again taking its IC2 outputs low.
This ensures that the motor windings
will be de-energised when the relay
is energised.
The software then takes pin 9 of
IC1 low then high, which clocks IC3b
on both cards. It then does the same
for pin 7 which clocks IC3a. As each
flipflop is clocked, its Q output goes
high. When both outputs are high, the
base of Q13 (Q25) is pulled high via
a 1kΩ resistor. Q13 (Q25) now turns
on and energises RLY1 which feeds
the V+ supply to the output drivers
on both cards. The main program is
then executed.
Card selection
Fig.23: follow this parts layout diagram to build the single motor controller. The
completed board is shown below, mounted in the case.
64 Silicon Chip
The card selection is done by applying the correct code for the card
to PORT C: C1-bar, C2, C3-bar and
C4-bar. The addresses are shown in
Table 1. The convoluted numbering is due to three of these inputs
having inverted logic (a high in the
program outputs a low on the Port C
pin). Thus, to select card 2, the value
9+STH (OUT PORTC, CARD# + STH)
is placed on PORT C (see the program
listing).
STH (STrobe High) is defined as -1,
so the actual value placed on PORT C
is 8 (9-1). Because strobe line C0-bar
is also inverted, this effectively takes
C0-bar and C1-bar high and the other
two lines low.
If IC4b’s inputs go high, its output
(pin 4) goes low. This momentarily
pulls pin 4 of IC1 low via a .001µF
capacitor. IC1 then decodes the input
levels (eg, A high = Y1 low, B high =
Y2 low & C high = Y4 low) and switches the decoded output (Y1 in this case)
low. As soon as the .001µF capacitor
charges, pin 4 goes high again and the
input data can be altered without the
output changing.
The next line in the listing is OUT
PORTC, CARD# + STL and if you
follow the logic, C0-bar will go low,
pin 4 of IC4b will go high and pin
3 of IC4a will go low. If the card selector link is in the C2 position, pin
2 of IC4a will also go low. Pin 1 of
Tabl e 1: Card Addresses
Card 1
11
Card 2
9
Card 3
15
Card 4
13
Card 5
3
Card 6
1
Card 7
7
Card 8
5
IC4a will thus momentarily pull the
latch enable (LE) input of IC2 high
via a .001µF capacitor and the data
on PORT A will be transferred and
stored on the Q outputs, as described
previously. Obviously, if the link selects a different card, the data on the
inputs of IC2 will not be transferred
to the Q outputs.
By putting high and low logic
levels on the various inputs, we can
therefore energise or de-energise the
MA and MB motor windings and determine the direction of the current
through the windings.
Construction
Fig.23 shows the assembly details
for the single motor control card,
while Fig.24 shows the details for the
dual controller. Install the parts on the
two boards as shown, taking care to
ensure that all semiconductors and
electrolytic capacitors are correctly
oriented.
Don’t mount the LEDs directly on
the boards though. In
stead, these
Fig.24: the parts layout for the dual motor controller. Power transistors
Q1-Q24 are all bolted to an aluminium heatsink – see text.
should be connected via 120mm-long
flying leads, so that the LEDs can
later be mounted on the front panel
of the case.
Be careful when fitting the transistors, as two different TO-126 types
are used. Note particularly that the
transistors don’t all face in the same
direction so be sure to orient the metal
tabs of the transistors as shown on the
layout diagrams.
The 16 TO-126 power transistors
Fig.25: this diagram
shows the drilling details
for the aluminium
heatsink that’s used for
the power transistors on
the dual controller card.
The heatsink is cut from
12 x 6mm aluminium bar
and is 111mm long.
AUGUST 1999 65
The dual controller card is attached to the base
of the case, while the single controller is mounted
above it on 25mm threaded spacers.
on the dual controller card are bolted to a common heatsink. This can be cut from 6 x 12mm
square-section aluminium rod and should be
111mm long. Fig.25 shows the drilling details
for the heatsink.
Note that the transistors must all be isolated
from the heatsink using insulating washers.
Smear all mating surfaces with heatsink compound if you are using mica washers. No heatsink
compound is necessary if you are using silicon
impregnated insulators.
The best procedure is to loosely attach all the
transistors to the heatsink before fitting the entire
assembly to the PC board. The BD682 PNP transistors are all mounted on one side of the heatsink
and the BD679 NPN types on the other. After
The rear panel carries a 12-way terminal block
for the motor connections, plus a 4-way terminal
block for the power supply connections.
66 Silicon Chip
ELECTRONIC
COMPONENTS &
ACCESSORIES
•
RESELLER FOR MAJOR KIT
RETAILERS
•
•
PROTOTYPING EQUIPMENT
•
FULL ON-SITE SERVICE AND
REPAIR FACILITIES
•
LARGE RANGE OF
ELECTRONIC DISPOSALS
(COME IN AND BROWSE)
Ph (03) 9723 3860
Fax (03) 9725 9443
Come In & See
Our New Store
M
W OR A
EL D IL
C ER
O
M
E
CB RADIO SALES AND ACCESSORIES
Truscott’s
ELECTRONIC WORLD Pty Ltd
ACN 069 935 397
27 The Mall, South Croydon, Vic 3136
email: truscott<at>acepia.net.au
www.electronicworld.aus.as
P.C.B. Makers !
•
•
•
•
•
•
•
•
•
Fig.26: the external wiring details for the two controller cards. The card select
jumpers are set to C2 for the dual controller and C3 for the single controller.
mounting them, use a multimeter
(set to a high ohms range) to confirm
their collectors are all isolated from
the heatsink.
The two controller cards were
stacked (single board on top) and
fitted into a small plastic instrument
case. As shown in the photos, we
drilled two 3mm holes in the front
corners of both boards. The dual con-
If you need:
P.C.B. High Speed Drill
P.C.B. Guillotine
P.C.B. Material – Negative or
Positive acting
Light Box – Single or Double
Sided – Large or Small
Etch Tank – Bubble or Circulating
– Large or Small
U.V. Sensitive film for Negatives
Electronic Components and
Equipment for
TAFEs, Colleges and Schools
FREE ADVICE ON ANY OF
OUR PRODUCTS FROM
DEDICATED PEOPLE WITH
HANDS-ON EXPERIENCE
Prompt and Economical Delivery
KALEX
40 Wallis Ave E. Ivanhoe 3079
Ph (03) 9497 3422
FAX (03) 9499 2381
• ALL MAJOR CREDIT
CARDS ACCEPTED
AUGUST 1999 67
Fig.28: this is the full-size etching pattern for the single controller card.
Fig.27: here's how to make the cable
that connects the controller cards to
the parallel port of the PC. The two
25D female connectors are wired in
parallel and must be at least 50mm
apart. The red stripe of the 25-way
cable goes to pin 1 of each connector.
troller board was then secured to the
base using countersunk head screws
into 25mm spacers.
The top board is secured to these
two spacers at the front. The back
of this board then simply rests on a
piece of foam glued to the top of the
heatsink on the dual controller board.
Make sure that this strip of foam is
correctly attached, so that the heatsink doesn’t short to any of the parts
on the board above it.
Fig.26 shows the case wiring details. Two insulated terminal strips (1
x 12-way and 1 x 4-way) are mounted
on the rear panel and these terminate
the wiring connections from the stepper motors and the power supply. The
leads between these terminal strips
and the boards should be run using
medium-duty hookup wire.
When the wiring is complete, attach
the front panel label and drill the
mounting holes for the LED bezels.
The two “card selected” indicator
LEDs can then be pushed into bezels
from the back.
Fig.27 shows the details of the cable
Resistor Colour Codes
No.
1
1
1
9
8
1
1
68 Silicon Chip
Value
10MΩ
1MΩ
47kΩ
10kΩ
2.2kΩ
1kΩ
470Ω
4-Band Code (1%)
brown black blue brown
brown black green brown
yellow violet orange brown
brown black orange brown
red red red brown
brown black red brown
yellow violet brown brown
5-Band Code (1%)
brown black black green brown
brown black black yellow brown
yellow violet black red brown
brown black black red brown
red red black brown brown
brown black black brown brown
yellow violet black black brown
Software Listing
10 REM Driver software for drilling PC boards using Protel file
1140 STL = 0: STH = -1 ‘Strobe low & high
1150 PORTA = PPORT: PORTC = PORTA + 2 ‘Select parallel port
1160 OUT PORTA,0 ‘set all data lines low
1170 OUT PORTC, CARD1 + STH: OUT PORTC, CARD1 + STL ‘card1 - IC2 O/P’s low
1180 FOR PAUSE = 1 TO MDELAY: NEXT
1190 OUT PORTC, CARD2 + STH: OUT PORTC, CARD2 + STL ‘card2 - IC2 O/P’s low
1200 FOR PAUSE = 1 TO MDELAY: NEXT
1210 OUT PORTC,7 + STH: OUT PORTC,7 + STL ‘Clock IC3b
1220 FOR PAUSE = 1 TO MDELAY: NEXT
1230 OUT PORTC,5 + STH: OUT PORTC,5 + STL ‘Clock IC3a, 12V to motors
1240 FOR PAUSE = 1 TO MDELAY: NEXT
1250 OUT PORTA, 153: OUT PORTC, CARD1 + STH: OUT PORTC, CARD1 + STL ‘Home motor
1260 FOR PAUSE = 1 TO MDELAY: NEXT
1270 OUT PORTA, 105: OUT PORTC, CARD2 + STH: OUT PORTC, CARD2 + STL ‘Home motor
1280 FOR PAUSE = 1 TO MDELAY: NEXT
1290 OUT PORTA, 0: OUT PORTC, CARD1 + STH: OUT PORTC, CARD1 + STL ‘Motors off
1300 FOR PAUSE = 1 TO MDELAY: NEXT
1310 OUT PORTC, CARD2 + STH: OUT PORTC, CARD2 + STL ‘Motor off
1320 FOR PAUSE = 1 TO MDELAY: NEXT
Table 2: Motor Lead Connections
Lead Colour X-Motor Y-Motor Z-Motor
Red
1
5
9
Bl ack
2
6
10
Green
3
7
11
White
4
8
12
that runs from the boards to the parallel port of the PC. As shown, the two
25D female connectors are wired in
parallel and should be at least 50mm
apart. Be sure to wire the red stripe
of the 25-way cable to pin 1 of each
connector. Note that you will have to
buy 26-way cable and peel away one
of the outside leads (not the read one).
The cable exits the case through a
step filed in the top of the back panel,
above the 4-way connector.
Connecting the motors
The stepper motors used are 1.8
degree types from Oatley Electronics
and these have four coloured leads:
red, black, green and white. Table 2
shows how the stepper motors are
wired up. As shown, the X-motor has
its red lead connected to terminal 1,
black to terminal 2, green to terminal
3 and white to terminal 4.
Similarly, the Y-motor has its red
lead connected to terminal 5, black
to terminal 6, green to terminal 7 and
white to terminal 8. The Z-motor has
red to terminal 9, black to terminal
Fig.29: the full-size etching pattern for the dual controller card.
10, green to terminal 11 and white to
terminal 12.
Next month, we will describe the
power supply for the XYZ Table. We
will also discuss the software
drives the Z-axis motor, so that
can automatically drill a board
has been laid out using Protel.
that
you
that
SC
AUGUST 1999 69
|