This is only a preview of the October 1999 issue of Silicon Chip. You can view 37 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 "Backup Battery For Cordless Phones":
Items relevant to "Build The Railpower; Pt.1":
Items relevant to "Semiconductor Curve Tracer":
Items relevant to "Autonomouse The Robot; Pt.2":
Items relevant to "An XYZ Table With Stepper Motor Control; Pt.6":
Purchase a printed copy of this issue for $10.00. |
YZ TABLE
WITH STEPPER
MOTOR CONTROL
Part.6: Pen Holder &
Plotting Procedure
We hope you didn’t break any drills
playing around with the XYZ table and
the software last month. In this final
article, we describe the pen holder and
the plotting software.
By RICK WALTERS
While it may seem a bit back-tofront to have presented the article to
drill a PC board before running one
to plot it, the reason is quite simple.
It was a much easier task for us to
develop the drilling project rather
than the plotting one. This month,
plot it we shall.
But before talking about plotting,
we need to briefly discuss pens and
the pen holder.
One of the major problems with
plotting is finding a suitable pen
which will draw satisfactorily on
the copper laminate. Also the ink in
the pen must be waterproof to allow
it to stand up to the etching process.
Once we have found the pen, we
need to be able to clamp it securely
to ensure consistent relocation each
time we fit it.
The diagram of Fig.1 shows how the
pen holder was made. The top lip and
turned body fit neatly into the plastic
drill clamps and ensure consistent
location and positioning of the pen.
If you use a different brand of drill
stand you will quite likely have to
Extract from PCBDRAW.BAS
5570
5580
5590
5600
5610
WHILE NOT EOF(2)
INPUT# 2,X$,Y$
XNEW = VAL(X$): YNEW = VAL(Y$)
IF RIGHT$(X$,1) < “:” THEN 5630 ‘not P (U or D)
IF RIGHT$(X$,2) = “PU” THEN GOSUB 7230
ELSE IF RIGHT$(X$,2) = “PD” THE GOSUB 7130
5620 DPEN = RIGHT$(X$,2) ‘store new value
5630 WHILE XNEW <> XOLD OR YNEW <> YOLD: GOSUB 3030: WEND
’move to new X & Y position
5640 WEND
82 Silicon Chip
modify the holder shape to fit your
clamps. Our prototype was turned
up in mild steel while the threaded
insert was in brass.
Software
The software files we need for
plotting the PC board are as follows:
PCBDRAW.BAS, PCBDRAW.EXE,
DRWSETUP.BAS, DRWSETUP.EXE,
DRWSETUP.FIL, PENTEST.BAS and
PENTEST.EXE. You will see that they
follow a similar sequence to those
supplied in the July issue which allowed you to drill the PC board. The
first two are the programs that actually
draw the PC tracks and these will be
described shortly.
The next two are the setup files
which allow you to set the maximum
X and Y co-ordinates, the motor stepping rate, the XY card address, the Z
card address, the fast and slow pen
down positions and select the parallel
port you wish to use. All the values
except for the fast and slow pen will
be the same as you used in the DRLSETUP program. DRWSETUP.FIL is
the file which stores these parameters
and it is accessed by both PCBDRAW.
BAS and PCBDRAW.EXE.
The PENTEST programs work in
the same manner as the DRLTEST
programs described previously, allowing you to set the distance the pen
sits above the PC board when it is not
drawing and the amount of pressure
it applies to the copper while it is
actually drawing. It will most likely
take you a couple of attempts to get
these positions just right.
Again, as with PCBDRILL, PCB
DRAW lets Protel do most of the hard
work. We use the values in the plotter
file, generated by Protel, to move to
the X and Y co-ordinates, then the
pen up and pen down instructions
to control the Z-axis motor. A small
PC board called TRACKS.PCB, which
consisted of a number of tracks of
increasing thickness from 10 to 60
thou, was laid out as a test board then
Protel was used to generate the plot
file called TRACKS.PBL. This text file
is listed in Table 1.
Plotter file
We elected to use the Roland GL1
plotter file as this plotter was the one
we used at SILICON CHIP and our copy
of Protel was set up for this device.
After the preamble the first significant entry is PU102,102; ie, pen up
then move to X102,Y102. The next entry PD102,203; says draw (pen down)
a line from X102 to Y203 and so on.
This line is the vertical corner mark.
The pen point thickness is given to
Protel as part of the setup procedure
and if you trace the next few values
you will see that the pen (12 thou)
draws another vertical line then a
diagonal line, moves in a 5 thou arc
and redraws the line, ie, the track
is 17 thou wide. Actually, it should
be 20 thou but who’s going to argue
about 3 thou?
Protel suggest that you experiment
with the pen width setting until you
find the best value for the particular
pen you are using. They actually recommend using 13 thou for a 0.3mm
(11.8 thou) pen.
The program continues to read
through the file, lifting and lowering
the pen until it finds the entry SP0;
at which time it has reached the end
of the useful data, so the program
terminates.
Creating a temporary file
That is the big picture but as the
saying goes, the devil is in the detail.
To make things easier for the software
we first open a new file called PCBDRAW.TMP, then search through the
PBL file until we locate SP1;. We then
move PU from the beginning of the X
entry to the end; ie 102PU, then save
102PU,102 in the new file. At the same
time we store the X and Y values in
XBIG and YBIG. Each entry is changed
in a similar manner and written to
the new file.
Fig.1: the pen holder details. The top lip and turned body fit
neatly into the plastic drill clamps and ensure consistent
location and positioning of the pen. The prototype was turned
up in mild steel while the threaded insert was in brass.
If the new X or Y value is bigger than
the saved BIG value then it replaces
that value. At the end of this subroutine if the XBIG or YBIG value exceeds
the value you have allocated to the
X maximum or Y maximum values
in the setup program the PCBDRAW
program will terminate, writing an
error message on the screen indicating
an out of limits condition.
Assuming there is no error message the pen will then move to the
fast down position, the software will
read the first entry in the TMP file
and (in this case) the table will move
to 102,102.
Why rewrite the file you may ask?
There are two reasons; the first is
because we had to read through the
file anyway to find the maximum X
and Y values. The second is because
the value of PU102 in Basic is zero,
but the value of 102PU is 102. Thus
it is a little quicker to compute the
next X and Y values and with older
machines we need to save as much
time as we can, although in the long
run the time taken by the X and Y
mechanical movements will be the
limiting factor.
Plotting
The X and Y co-ordinates will be
read and the pen moved up and down
until the end of the file is reached. The
computer’s speaker will then beep
to alert you to this fact, the message
“Drawing completed. Homing table.”
will be displayed and the table will
return to 0,0.
The motors will then be de-energised and the TMP file will be deleted
before the program closes.
As with the drilling program, if any
keyboard key is pressed while the
program is running, the computer’s
speaker will beep to acknowledge
the keypress, a message to this effect
will be printed at the bottom of the
screen, then the pen will home and
the program will terminate.
If you look at the Basic listing (from
October 1999 83
The photograph above shows how the pen holder goes together (note
that the spring that fits over the ink reservoir is missing), while at
right is the completely assembled unit. The unit is secured by the
plastic drill clamps but if you use a different brand of drill stand to
ours, you may have to modify the holder shape to fit your clamps.
our web site or on the floppy we can
supply), you will see that a lot of the
code is identical or very similar to
PCBDRILL. The initialisation, opening screen, X and Y axis movement,
pen control and file code are identical.
The plot file (PBL) structure is different to the text (TXT) file used in the
drilling program and it needs different
software to process it. Subroutine
5000 does this.
You will note that on line 5550 we
use DPEN to keep track of the pen
position. PEN is a reserved word in
GW Basic, and if you look at line 1030
you will see we defined words starting
with D as strings, thus DPEN allows
us to keep track of PU and PD (pen up
and pen down) commands.
So all we have to do is read through
the file, moving to the X and Y positions as dictated by the file values
and take the pen up or down. This is
done in lines 5570 to 5640 (see panel
at start of article). The software keeps
looping through the six lines 5580
to 5630 until the end of the file is
reached, then the program terminates
as explained previously.
First PC board
The first PC board we plotted and
drilled is shown in the accompanying
photo. All the plotting and drilling defects are due to the excessive backlash
in the drillstand mechanism, not the
XY table. It is not a huge amount but
by the time it reaches the pen tip or
drill point it can be quite a few thou.
Hopefully, your drill stand mech
anism is better in this regard than the
one we used.
Normally, the PC board is etched
before it is drilled and during the
drilling process the drill tip wanders
to the pad centre which has been
etched away. In the present setup,
the drill tip will have no guide to the
pad centre and can wander a little
in any direction before beginning to
make the hole. We had about 25mm
of the 0.8mm drill protruding from
the drill chuck and this contributed to
the problem. A shorter length would
probably have helped.
More on pens
This photo shows the test PC board that we plotted and drilled. Note that the
plotting and drilling defects are due to the excessive backlash in the drill stand
mechanism that we used, not the XYZ table.
84 Silicon Chip
Back to the pen: the only pen we
found to be really usable with our
Roland plotter was a refillable type,
which was quite messy to use, as the
ink had to be washed out and the pen
cleaned thoroughly each time a plot
was done. The ink is a waterproof
type which comes in 22ml bottles
but a bottle this size is sufficient for
a great number of plots.
To our disappointment, this pen
proved to be unsuitable for the XYZ
table as the writing speed was too
slow, causing the ink to flow into
blobs whenever a pad was drawn.
Even when plotting long tracks the
ink tended to puddle. The plot in the
photograph was done with a Pentel
type CVP 0.35mm tip pen. The ink
in this pen is not waterproof but the
photo gives an indication of the result
you can expect.
We are led to believe that the Pentel
type CPF, which is used to plot on
film, contains a waterproof ink so we
are chasing one at the moment. We
will publish the outcome as soon as
we get hold of it and can test it.
Setting up plot files
Just as we set up Protel to generate
drill files last month, this time we
have to set it up to create the correct
plot files for drawing. You did most of
the difficult work last month setting
up the directories. All we need to do
now is to allocate the correct plotter
driver to create files that can be read
by our software.
Load TRAXPLOT or EASYPLOT,
move down to SETUP (press Enter)
and move down to PLOTTER (press
Enter). The type of plotter we need
is ROLAND RD-GL 1. If there is a
different type press Enter and either
you will be presented with a list of
plotters or asked for a path to where
you have saved the plot files. Move
down to the correct one then press
Enter again.
Move down to DEVICE and press
Enter. Move right down to FILE and
press Enter once more. If you have
loaded a file it should then read DEVICE C:<at>Filename. We’re nearly there
now. Move down to OPTIONS (Enter)
and if type of plot reads BOTTOM
LAYER you are set otherwise press
Enter and select it.
Lastly, move down to FLIP LAYER
SETUP and ensure that they all show
normal. Pressing Enter will toggle
the entry. Right, all done, now keep
pressing Escape until you get back to
the FILE menu from whence you can
exit the program.
To generate a plot file you must first
load TRAXPLOT then a file, move
Table 1: Protel Tracks.pbl Test Plot File
∧[.<at>;
1:IN;
SP;
VS10;
SP1;
PU102,102;
PD102,203;
PU203,203;
PD203,381,200,384,353,536,357,537,360,534,358,531,206,378,
202,377,199,380,200,384,203,381,356,533,356,540,635,540,640,
538,642,533,640,529,635,527,356,527,351,529,349,533,351,538,
356,540,356,533,635,533,641,540,819,362,822,358,822,353,819,
349,815,347,810,347,806,349,629,527,626,531,626,536,629,540,
633,542,637,542,641,540,637,536,815,358,811,353,633,531,637,
536,635,533,813,356,827,356,827,152,826,148,824,143,820,140,
815,138,810,138,806,140,802,143,799,148,799,152,799,356,799,
360,802,365,806,368,810,370,815,370,820,368,824,365,826,360,
827,356,818,356,818,152,807,152,807,356,818,356,813,356,813,
152,813,133,559,133,554,134,549,136,545,139,542,143,540,147,
539,152,540,157,542,162,545,166,549,169,554,171,559,172,813,
172,818,171,822,169,826,166,830,162,831,157,832,152,831,147,
830,143,826,139,822,136,818,134,813,133,813,142,559,142,548,
152,559,163,813,163,824,152,813,142,813,150,559,150,559,155,
813,155,813,150,813,152,559,152,542,135,364,313,361,317,358,
321,357,326,357,331,357,337,359,341,362,346,366,349,370,352,
375,354,380,355,385,354,390,353,394,351,398,347,576,170,579,
166,582,161,583,156,583,151,582,146,581,141,578,137,574,133,
570,131,565,129,560,128,555,128,550,130,546,132,542,135,546,
139,368,317,363,335,376,348,394,343,572,165,577,148,564,135,
546,139,550,144,372,321,372,339,390,339,568,161,568,144,550,
144,554,148,377,326,385,335,563,157,554,148,559,152,381,330,
559,153,559,152,381,330;
PU203,102;
PD102,102;
PU102,508;
PD102,610,203,610;
PU914,610;
PD1016,610,1016,508;
PU1016,203;
PD1016,102,914,102;
SP0;
SP;
IN;
down to PLOT, then confirm YES to
CONFIRM PROCEED WITH PLOT.
The message “PLOT FILE GENERATED C:<at>FILENAME.PBL Press any key
to continue” will display, and upon
pressing a key you will be returned to
the FILE menu from whence you can
exit. Running PCBDRAW will now
find the PBL file and draw it.
Well that wraps up this series. We
hope those of you who were interested
in the project will give us some feedback on your successes or otherwise
and any problems you might have
experienced.
Free EasyTrax software
The EasyTrax software is available
FREE from the Protel web site (ie,
protel.com.au). But note that they will
not provide any support for it; you
are on your own! However, after you
play around with it for a while you
will find it rather easy to use, as the
drop down menus guide you through
SC
each step.
October 1999 85
|