This is only a preview of the September 1999 issue of Silicon Chip. You can view 34 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 "Autonomouse The Robot":
Items relevant to "Voice Direct Speech Recognition Module":
Items relevant to "Digital Electrolytic Capacitance Meter":
Items relevant to "An XYZ Table With Stepper Motor Control; Pt.5":
Purchase a printed copy of this issue for $10.00. |
YZ TABLE
WITH STEPPER
MOTOR CONTROL
Part.5: Power
Supply & Software
This power supply has been specifically
designed to power the controller cards and
the stepper motors used in the X-Y-Z Table, as
presented in last month’s issue. In addition,
we show you how to drill your first PC board.
By RICK WALTERS
The software which controls the
three motors energises the Z-axis
motor continuously. Conversely, the X
and Y motors have the power removed
when they are not stepping. This allows us to use a 15V supply for the X
and Y motor driver stages, to ensure
that at least 12V is fed to the motors
after the voltage drop across the driver
transistors is taken into account.
By contrast, the Z-axis motor driver
stages are powered from a +12V rail.
The resulting lower voltage applied
to the Z-axis motor ensures that it
doesn’t overheat during the long periods for which it may be energised.
Keeping the voltage constant on the
X and Y stepper motors allows us to
consistently step them at their maximum speed, regardless as to whether
one or both motors are driven. If the
voltage varied (as it would with an
unregulated supply), we would have
to reduce the maximum stepping rate.
Fig.30 shows the circuit of the
power supply. This is similar to the
Stepper Power Supply described in
the December 1997 issue. The previous unit provided unregulated +18V
& +12V rails, along with a regulated
+5V rail. The revised unit described
here does away with the +18V rail
and provides a regulated +15V rail
instead. It also uses a larger power
transformer.
This was done because the output
of the original supply varied quite a
bit, depending on whether one, two
or three motors were being driven at
any given time.
Circuit details
The circuit is built into a standard plastic case, with binding post terminals
used for the supply outputs. A LED provides power on/off indication.
72 Silicon Chip
As shown in Fig.30, the 30V centre-tapped secondary of the power
transformer is full-wave rectified by
diodes D1 & D2. The output from
the rectifiers is then filtered using a
4700µF capacitor to give around 2022V, depending on the load.
This rail is then fed to 3-terminal
regulator REG2, which provides a
+15V regulated rail to power the
X-axis and Y-axis stepper motors.
This adjustable regulator is rated at
3A, since the X and Y motors will
draw a total current of 1.5A when
they are both stepping. The output
voltage can be trimmed by changing
the 150Ω resistor.
A 470µF capacitor and a parallel
0.1µF capacitor are used to filter the
output from REG2.
The second regulator, REG1, provides a stable +5V rail for the logic
circuits on the controller cards. Its
output is fil
tered using 10µF and
0.1µF capacitors. This bypassing of
the regulator outputs is a precaution
to prevent the regulators from oscillating if we have long leads between
the power supply and the controller
cards and motors.
The +12V rail for the Z-axis stepper
motor is derived from D3. This diode
half-wave rectifies the output from
a 24V tap on the transformer, while
a 4700µF capacitor filters the output. The unloaded output voltage is
around 13.5V but this drops to around
11V as soon as the motor is energised.
For this reason, the software drives
this motor at a slower stepping rate
than the X & Y motors, so that it operates reliably with the lower voltage.
Assembly
Most of the parts are mounted on a
PC board coded 10108993. Fig.31(a)
shows the assembly details.
Fig.30: the circuit provides regulated +5V & +15V supply rails, plus an
unregulated +12V rail.
Begin by installing eight PC stakes
at the external wiring points, then
install the resistors, diodes D1-D3
and 3-terminal regulator REG1 (7805).
Note that D1 & D2 are both 1N5404
types, while D3 is a 1N4004.
Next, install the capacitors, taking
care to ensure that the electrolytics
are correctly oriented. Don’t install
REG2 at this stage, as it’s not mounted
directly on the board.
The completed PC board is housed
Fig.31(a): follow this parts layout diagram
to assemble the PC board.
in standard plastic case, along with
the power transformer. The front
panel carries four banana sockets (0V,
+5V, +12V and +15V) and the power
indicator LED, while the rear panel
carries the cordgrip grommet, safety
fuse and mains switch.
Both the transformer and the PC
board are mounted on an aluminium baseplate (see Fig.32), which is
earthed to ensure electrical safety.
Drill out all the mounting holes in the
Fig.31(b): this is the full-size etching
pattern for the PC board.
September 1999 73
This close-up view shows the completed PC board and the front-panel wiring.
Note that regulator REG2 is mounted on the copper side of the board and has
its metal tab bolted to the baseplate for heatsinking – see Fig.33.
Fig.32: this diagram shows the drilling details for the aluminium baseplate.
74 Silicon Chip
baseplate, then mount the transformer
and earth lug as shown in Fig.34. The
transformer is secured using 4mm
screws, nuts and lockwashers, while
the earth lug is mounted using a 3mm
screw nut and lockwasher.
It’s also a good idea to fit a second
nut to the earth lug, so that the first
nut is locked into place. Make sure
that this assembly is tight.
Regulator REG2 is mounted on the
baseplate, beneath the PC board. This
is necessary to ensure adequate heat
sinking. Fig.33 shows the mounting
details for this device. It must be
electri
cally isolated from the baseplate using an insulating pad and
bush. Make sure that the mounting
area is smooth and free of any metal
swarf (which could puncture the
insulating pad) before bolting the
device down.
Flying leads are used to connect
REG2’s terminals back to its copper
tracks on the PC board. Take care to
ensure that these connections are
all correct (a pinout diagram for the
LM317 is shown on Fig.30) and keep
the leads as short as possible.
It’s a good idea to use a multimeter
to confirm that the metal tab of the
Fig.33: the mounting details for regulator
REG2. Be sure to isolate its metal tab
from the baseplate using an insulating
washer and bush.
regulator is properly isolated from the base
plate. This done, the PC board can be mounted
on 5mm-long standoffs and secured using 3mm
screws, nuts and lockwashers.
The front and rear panels of the case can now
be drilled to accept the various hardware items.
The front panel is best drilled after attaching
the label. Four holes are required to accept the
banana sockets, plus a small hole in the middle
for the LED bezel.
The rear panel hardware can be positioned as
shown in the photos. Use a small file to carefully
profile the hole for the cordgrip grommet so that
it is a precise fit.
A slight problem here is that the plastic end
panel is a bit too thick to suit the grommet.
This means that you will need to chamfer the
top and bottom of the hole on the inside of the
panel to make sure that the grommet locks in
properly (ie, the top and bottom slots in the
grommet must engage the panel). We chamfered
the prototype’s panel using a Stanley knife and
a small file. Take your time with this job and
make sure that the grommet is a neat (tight) fit.
The hole for the mains switch can be made by
first drilling a series of small holes around the
inside perimeter of the marked area and then
knocking out the centre piece and filing the hole
to shape. Once again, make sure that the mains
switch is a tight fit so that it’s secured properly
when pushed into the mounting hole.
The baseplate assembly sits directly on four
standoffs moulded into the base of the case. You
will have to drill 3mm holes through the centre
of each standoff, so that 3mm mounting screws
can be passed through from outside the case.
Once this has been done, the baseplate assembly
can be mounted in position and firmly secured.
Wiring
Now for the internal wiring. The mains cord
Fig.34: the wiring details for the Stepper Power Supply.
September 1999 75
Once the mains wiring has been
completed, the rear panel can be
slipped into position. After that, it’s
simply a matter of completing the
wiring from the PC board to the front
panel and to the secondary terminals
of the transformer. Use medium-duty
hookup wire for this job.
LED1 is wired by connecting it in
series with a 330Ω resistor across the
+5V and 0V output terminals. Its cathode (K) lead must go to the 0V terminal
and this lead will be adjacent to a flat
surface on the LED body (it’s also the
shorter of the two leads).
Testing
Before applying power, check your
wiring carefully and use a multimeter to confirm a good connection
between the transformer metalwork
and the earth terminal of the mains
plug. This done, attach the lid, apply
power and check that the indicator
LED comes on.
Finally, use your multimeter to
check the voltages on the front panel
sockets. You should get readings of
around +15V, +13.5V and +5V with
respect to the 0V terminal.
Modifying the original supply
The rear panel carries the on/off switch, the safety fuseholder and the cord
clamp grommet. Make sure that the mains cord is properly secured and that all
mains wiring is installed in a professional manner.
must be securely clamped by the cordgrip grommet and the Active (brown)
wire connected directly to the fuseholder. The Neutral (blue) lead goes
directly to switch S1, while the Earth
lead (green/yellow) is soldered to the
earth lug on the baseplate. Make the
Earth lead somewhat longer than the
other two leads, so that it will be the
last to come adrift if the mains cord
is reefed out by brute force.
The two primary leads of the power
transformer go to the bottom of S1,
while the remaining terminal on S1 is
76 Silicon Chip
connected back to the second terminal
on the fuseholder. Be sure to sleeve
all terminals on the mains switch and
fuseholder with heatshrink tubing.
This is done by pushing a short length
of heatshrink tubing over each lead
before it is soldered. After soldering,
the heatshrink is then pushed over the
exposed terminal and shrunk down
using a hot-air gun.
Be sure to use 250VAC-rated cable
for all mains wiring. This includes
the wiring to the fuseholder and to
switch S1.
If you built the supply described in
the December 1997 issue, the diodes,
5V regulator and capacitors can be
salvaged for the new PC board. You
will need to purchase the LM317
adjustable regulator plus a few extra
capacitors and the four resistors.
Unfortunately, the old transformer
doesn’t have a high enough secondary
voltage and we had to use a different
type. The good news is that the new
transformer fits on the old baseplate
and you can use the same case.
Although we haven’t tested it, it
may be worthwhile trying the old
transformer if you already have the
previous supply. We suggest that you
connect the +18V rail to the LM317
input and then adjust the 150Ω resistor to give a regulated +14V output.
The existing +12V output can be
used for the Z-axis card. Check this
voltage under load and if it is much
above +12V, fit a 5W series resistor to
drop the voltage to around +12V when
the motor is energised. Because the
motor draws 0.6A, each 1Ω of resistance will drop about 0.6V.
The indicator LED can be added
to the existing +5V rail, as shown in
this article.
Drilling A PC Board
Right, all systems should now be go.
You have built and tested the power
supply and stepper motor driver cards
and wired them to the stepper motors.
The XY table is running smoothly and
you are just itching to drill the PC
board for your latest project.
Well, hopefully, you soon will be
able to. There are just a few more
checks to be made before you get into
the nitty gritty.
We will step back a little for a moment and cover the ground for those
of you who may be a little hesitant
to plough ahead without guidance.
First, if you have already obtained
the XY table software and followed
the wiring in last month’s issue, you
will find that the X arrow keys move
the table in the Y direction and vice
versa. In the XY table software, the
first four terminals at the rear are for
the Y motor and the next four are for
the X motor. However, for all other
software the sequence is X, Y then Z.
To keep all the wiring consistent,
we have modified XYREAD and XYTABLE to conform to this pattern. The
new files are named XYREADM and
XYTABLEM (Modified) to allow you
to distinguish them from the previous
versions. If you wish to modify your
BAS files, all you need to do is edit
line 3140 in each to read FOR A = 1
TO 4: STP(A) = STX(A) * 16 + STY(A):
NEXT. Now you can swap your X and
Y motor connections to conform to
those shown last month.
Pressing R while running the XYTABLE software allows you to select
the stepping rate for the motors. This
is very dependent on the processor
in your computer. We used a 386 for
this project and running under GW
Basic a value of 50 gave good results.
When using the EXE files a value of
2400 gave excellent results.
To get a feel for your machine, start
with these values and set new X and
Y values an inch larger (or smaller)
and listen to the motors step. Keep
increasing the value until they begin
to step smoothly.
You will soon know from the
“clunking” noise they make when
they are mis-stepping, or not stepping
at all, compared to the smooth steps
they make once the stepping rate
value is large enough. Set the count
value so that you can move over the
entire table area without any problems. Remember this number as you
will need it shortly.
We have mentioned previously that
the BAS files are too slow and would
take far too long to carry out any task
but they are fine for experimenting.
This is especially if you wish to alter
the software to suit your needs.
The seven files we mentioned
in the July issue were DRLSE
TUP.
BAS, DRLSETUP.EXE, DRLSETUP.
FIL, DRLTEST.BAS, DRLTEST.EXE,
PCBDRILL.BAS and PCBDRILL.EXE.
We glossed over them briefly then,
as the power supply and new driver
boards were not available at that stage.
We shall now describe the function
of each of these BAS files in a little
more detail.
Setting up
The first (DRLSETUP) is the program to set up the drill parameters.
This simply asks for the maximum X
dimension for your table in inches,
the maximum Y dimension again in
inches, then the stepping rate. Here’s
where you enter that value you had
to remember. The DRLSETUP.FIL has
initial values loaded which you can
accept by pressing the Enter key.
Next the card number (ie, jumper
setting) for the dual stepper motor
card is requested, followed by the card
number for the single stepper card.
Then you are asked whether you want
to display Imperial or metric values.
As we have said in a previous article,
the system was actually designed for
steps of one thousandth of an inch,
as all PC board layouts are in these
measure
ments. The metric display
is only a conversion of the Imperial
value to the closest equivalent.
The next decisions you have to
make are how many fast down and
slow down steps the drill should
make. When a PC board is drilled, the
Z axis motor moves the drill down
until it is a little above the board
and holds it there. When a hole is
to be drilled it just makes a small
movement down and up, thus drilling
the hole.
The initial movement is the number
of fast down steps; the latter is the
number of slow down steps. The sum
Power Supply Parts List
1 240V-15/0/15V power
transformer, DSE M1991 or
equivalent
1 plastic case with plastic end
panels, 190 x 100 x 80mm
4 adhesive rubber feet
1 PC board, code 10108993, 75
x 60mm
1 front panel label, 83 x 67mm
1 240VAC 2-pole mains rocker
switch, Altronics S3212 (or
equivalent)
3 red panel mount banana
sockets
1 black panel mount banana
socket
1 cord grip grommet
1 mains lead with moulded 3-pin
plug
1 M205 safety 240VAC screw
type fuseholder Altronics
S5992 (or equivalent)
1 500mA M205 fuse
1 solder lug
8 PC stakes
4 5mm pillars
1 3mm x 10mm bolt
4 3mm x 15mm bolt
5 3mm nuts
5 3mm star washers
4 3mm flat washers
2 4mm x 12mm bolts
2 4mm star washers
2 4mm flat washers
Semiconductors
1 7805 5V regulator (REG1)
1 LM350T variable output
regulator (REG2)
2 1N5401/5404 power diodes
(D1,D2)
1 1N4001/4004 power diode
(D3)
Capacitors
2 4700µF 25VW RB electrolytic
1 470µF 25VW RB electrolytic
1 10µF 16VW RB electrolytic
2 0.1µF monolithic ceramic
Resistors (1%, 0.25W)
1 1.2kΩ
1 150Ω
1 120Ω
Miscellaneous
Hookup wire, 12mm-diameter
heatshrink tubing, 4mm-diameter
heatshrink tubing.
September 1999 77
Fig.35: this is the test PC board pattern
included with the software. When you drill
a test board following the procedure in the
text, its pattern of holes should match this
artwork.
of these two values cannot exceed 25 as this represents
half a revolution of the motor. Pick 10 and 5 for these for
the moment; you will get another chance later.
The penultimate question is which parallel port you
wish to use. If it is your workshop machine you probably don’t have a printer connected and in this case it
will be LPT1.
The last (ultimate) question is whether you wish to
re-drill the PC board. If you answer no, it means that you
fit an 0.8mm drill and only drill all the holes to this size,
then drill the larger ones by hand later.
To redrill means you want all the holes drilled with
the smallest size drill. The table then returns to home
and asks for the next size drill to be fitted in the chuck.
It then drills all these and so on, until all the holes on
the board are the correct size.
Calibrating the drill depths
The next program, DRLTEST, is used to confirm and
adjust the drill fast down and slow down settings. The
values given previously were just starting values. This
program moves the drill to the fast down position, then
allows you to move it up or down until it sits the distance you desire above the PC board. Once this is done,
it then moves the drill down the number of slow steps
you set in DRLSETUP. If this is unsatisfactory you can
decrease or increase the number, which moves the drill
up or down to the new position.
When you exit the program, the new values are saved
and used in PCBDRILL. Obviously it is wise to make sure
that there is no PC board in the way each time you carry
out this test, as the drill will break when it hits the board
unless you have the drill motor running.
If you look closely at the picture on page 72 of the July
1999 issue, you will see two clamps on the drill support
bar, one towards the table base and one at the other
end. These allow you to readily set the stand position
for plotting or drilling a PC board. We fabricated these
clamps but two automotive hose clamps from the nearest
auto parts outlet would be a lot cheaper.
Once you get the drill in position and moving correctly, slide the clamp up to the drill support and tighten
it. Next time you plan to drill a PC board you can just
slide the support down until it touches the clamp, then
tighten the support knob.
Drilling a test board
The remaining program is PCBDRILL which should
indicate its purpose. If you don’t yet have Protel or are
not familiar enough with it to lay out a PC board, we
have included a file called LCOSW.PCB, available both
from our website (www.siliconchip.com.au) and on
the floppy we supply with this software. The two files
generated by Protel (LCOSW.TOL and LCOSW.TXT) are
also included.
78 Silicon Chip
LCOSW.PCB is just a small board 100 x 20mm with
61 holes, including 14 for an IC, which will let you play
around with the program and confirm the motor stepping
rate and general operation of the XYZ table.
PCBDRILL asks for the name of the PC board file to
drill. In this case you type LCOSW in upper or lower
case. If you add the .PCB suffix it will be accepted; if
you omit it, the program will add it. Computers are supposed to save us time so why should we type any more
characters than necessary?
You will then be asked whether you want to flip the
artwork. Normally, you lay out a PC board from the top
(called the laminate or component) side and that is the
side you would drill from. But as we plan to plot our
boards then drill them, we will be working from the copper side and this is why it will be necessary to flip the
layout. Pressing Enter or Y will flip it, while N maintains
the view from the component side.
Just to make things awkward, LCOSW.PCB was drawn
looking at the copper side and does not need to be flipped.
If you only plan to drill boards this could be a reason
to alter the software to make Enter the no flip default.
You now have to set up your computer with a directory named PROTEL, then two subdirectories below this
named TRAXEDIT and TRAXPLOT. The software looks
for LCOSW.TXT and LCOSW.TOL in the TRAXPLOT
subdirectory. If you don’t follow this setup, the software
won’t work.
Setting up directories
All software accessing output ports (printer) directly
should be run from DOS, so if you run Windows select
START, SHUTDOWN, then click “Restart in MSDOS
Mode” and click OK. You will be dumped in the WINDOWS directory. Then Type CD\ and press Enter, which
will place you in the root directory of your hard disk.
To make a directory, type MD PROTEL and press Enter,
then type MD PROTEL\TRAXPLOT and press Enter.
Next, type MD PROTEL\TRAXEDIT and press Enter.
Now you must copy the files to the TRAXPLOT directory. Type COPY A:LCOSW.TXT C:\PROTEL\ TRAXPLOT (press Enter), then type COPY A:LCOSW.TOL C:\
PROTEL\TRAXPLOT (press Enter). This assumes you
have obtained a floppy from SILICON CHIP.
Alternatively, if you download the files from our
website, you must also place the two LCOSW files in the
TRAXPLOT subdirectory. LCOSW.PCB must be copied
to the TRAXEDIT directory (COPY A:LCOSW.PCB C:\
PROTEL\ TRAXEDIT). The other seven files should be
placed in the BAS directory. If you haven’t yet created
one, from the root directory (where you should still be),
type MD BAS (press Enter). Then COPY A:P*.* \BAS
(press Enter), then COPY A:D*.* \BAS (press Enter). The
messages should read 2 files copied, then 5 files copied.
When you want to run the programs, load DOS as
described above, then when C:\WINDOWS shows,
type CD\BAS (press Enter) and you will be placed in
the BAS directory, from where you can run any BASIC
or EXE program.
Setting up Protel
Once you have laid out a PC board using Protel and
saved it, you have to create the TXT and TOL files we
have just talked about. To do this, change to the PROTEL
TRAXPLOT directory and type TRAXPLOT. Press the
spacebar to access the first menu and the FILE menu
will be highlighted. Press ENTER, then use the down
arrow key to move to LOAD and then press ENTER again.
If the entry does not read C:\PROTEL\TRAXEDIT\*.
PCB, then type this and press ENTER.
You should now see LCOSW.PCB highlighted and
pressing ENTER will load this file then return you to
the FILE menu. Pressing ESC will get you back to the
TRAXPLOT menu. Move down to SETUP, press ENTER,
then move down to NC DRILL and press ENTER again.
The box should read:
OUTPUT FILE : C:<at>LCOSW
X OFFSET 0.000 inches
Y OFFSET 0.000 inches
METHOD : GENERATE
TOOL TABLE C:<at>LCOSW
MATCH OVERSIZE: 0
MATCH UNDERSIZE: 0.
If all these entries are correct, press ESC twice to get
back to the main menu. If these entries aren’t all correct,
move to the line(s) with the incorrect entry and press
ENTER to allow you to edit the value.
Move the cursor down to NC DRILL and press ENTER.
You will be asked CONFIRM PROCEED WITH NC DRILL
(press Y). The box will show:
TOOL FILE GENERATED LCOSW.TOL
Press any key to continue
When you do this, the next message will be:
DRILL FILES GENERATED
C:\PROTEL\TRAXPLOT\LCOSW.DRL
C:<at>LCOSW.TXT
Press any key to continue
Pressing a key will get you back to the main menu after
which you press ENTER as FILE is highlighted, move to
QUIT (press ENTER) then enter Y to exit to DOS.
This probably all sounds quite daunting if you have
not done it before but believe me, it is heaps easier to
actually do it than to describe how to do it. In any case,
the reason we supply the LCOSW files is to save you
these initial hassles.
By the way, if you have downloaded Easytrax or if you
have Autotrax, you will have to save all the EDIT files
to the PROTEL\TRAXEDIT directory and all the PLOT
files to the PROTEL\TRAXPLOT directory. If you don’t
do this, you won’t be able to set up the files using Protel
as described above. Note also that if you have Easytrax,
you should type EASYPLOT and EASYEDIT instead of
TRAXPLOT and TRAXEDIT.
Next month we will describe the pen holder and the
software for plotting a pattern directly onto the copper
of a PC board. This will allow you to make your own PC
SC
boards, provided you have etching facilities.
September 1999 79
|