Table 2.
Figure 13. Interfacecircuit for connecting an Airpax 82424 stepper motor to the game part connectors of an Apple computer.
900 INPUT 'WHAT LOW VARIABLE?'; Y
950 POKE - IbM,O 1000 POKE 4P241,O: POKE 49245,O 1030 FOR I = I TO N: E I T : I F PEEK ( - lbSB4) ) 127 EDTO 1110 1040 PUKE 49244,O 1050 FOR I = I TO W: NEXT : I F PEEK ( - lb384) ) 127 MTO 1110 1060 PQKE 49240,O 1070 FOR 1 = 1 TO 11: K I T : If PEEK ( - 16384) ) 127 6010 Ill0 1080 WKE 49245,O 1090 FOR I = I TO N: YEIT : I F PEEK ( - 16384) ) 127 60TO 1110 1100 POKE 49211,O: MID 1030 1110 PRIIIT 'YOU STDPPED ITm: P W - 16368,O 1 1 1 1 Rffl : 19240 = MIOt OFF 1112 REM : 49241 = M(O) ON 1113 REfl : 49244 = M(2) O f f 1114 REfl : 49245 = M(2) ON Figure 14. Program that generates the step sequence for an Airpax stepper motor interfacedto AN@) and AN(2) of lhe Apple game port.
Journal of Chemical Education
Step 1 Step 2 Step 3
hi
low
low low
Steo 4
hi
hi hi low
low low
hi
hi
hi low
hi
low
#276-2068) are used to advantage because of their high gain (25001,high Vb, (60 V), high speed and power dissipation (65 W). They should he very resistant to burnout and thus afford protection to the Apple annunciators, and the T I P 120 can he driven by T T L devices directly as long as the 4.7 kR current-limiting resistors are used. Diodes (IN4004) protect the circuitry from inductive spikes generated by the motor coils. Stepper motor handbooks, which describe stepper motor operation and drive circuitry and give specifications of some currently availahle motors, are availahle from Airpax Corporation, Sigma Instruments, or the Superior Electric Company." The driver program is incredibly simple in BASIC (and even in assemhly language). It must supply current to the four coils of the steooer motor as indicated in Tahle 2 for forward rotation. ~ e v e r s rotation e is obtained by the reverse steo seauence. Fieure 14 shows a BASIC oroeram that eenera& t'he sequence of high and low signalson ~ ~ ( 0 ) ~ a n d AN(2), which are applied to coils 0 and 2, or inverted and applied to coils 1 and 3. Each time the sequence is changed (e.g., in going from line 1040 to line 1060 or from Step 1 to Step 2) the motor turns 7.5'. The execution time of the program limits the motor speed to 56 rpm when a loop variable of 1is used. A gearbox on the Airpax 82424 reduces the final output speed to 4.6 rpm. For faster operation, two assemhly language programs have been written with BASIC drivers, and they are availahle free with documentation if a blank diskette and stamped, self-addressed mailer is provided. In each case the BASIC driver program allows easy input of the direction of rotation and speed. One BASIC program then allows the user to specify the numher of rotations to he completed, while the other prints the numher of rotations completed between start and stop signals. Control of the motor is thus possible with only limited BASIC programming knowledge. A grant from the NET Ben Franklin Technology Center, Bethlehem, PA, in support of this work is gratefully acknowledged. ~~
82424
In our work, an Airpax Series 82400 stepper motor was used because it is cheap and readily availahle.3 We used a 5V motor with hifilar coils, which allow the motor to operate with a unipolar power supply with for example, +10 V and ground terminals, rather than a bipolar supply with +10 V, ground, and -10 V terminals, as required by other stepper motors. Airpax terms this a two-phase motor because it has two center-tapped (hifilar) coils, but some manufacturers term this a four-phase motbr because the four coils operate independently. The software described below will work only with this type of motor, which is diagrammed in Figure 12. To improve performance, the motor is operated at a higher than nominal voltage with a 50-ohm, 10-W series resistor limiting the current to about 0.3 A. The drive circuit is shown in Figure 13. Two Apple game port annunciator outputs ("AN(0)" and "AN(2)") on the game port pins 15 and 13 are connected directly to the bases of driver transistors 0 and 2, and through a 74LS04 hex inverter to driver transistors 1and 3. The collectors of these transistors are connected to the corresponding stepper motor coils. T I P 120 Darlington transistors (Radio Shack 804
Stepping Sequence for an Airpax Series 82400 Stepper Motora
~
An Apple-Computer-Controlled Autosyringe Edward W. Vitz
Kutztown University Kutztown. PA 19530 In the previous Bits and Pieces article we described a simple method of interfacing stepper motors to Apple computers. This paper describes inexpensive apparatus that can he driven with a stepper motor to transfer known volumes of liquid a t controlled rates. A simple BASIC program is presented that uses t h t hardware to perform an automated conductometric titration. The motor driven syringe is shown in Figure 15. I t is constructed from two disposable plastic syringes. The ruh-
' Alrpax Corporat#on,Chesh~reDwslon. Cheshire. CT 06410. Sagma lnstrments. Inc Bramtree. MA 02185. or The Super or E ectrlc Company. 383 Mnddle Slreet Br~slolCT 06010
20 INPUT 'RDD 5 Pi TO BURET IY 0 R Nl7':Rf O: I F RI = 'Y' 60TO 36 52 I F AS = 'N' 6010 44 3b L = 2500: 60SU8 910: 6010 20 14 V = 0 45 INPUT 'HOU MIIY HL SHOULD BE AOOEI I N THIS TITRRTI0N';H 46 PRINT 'PUSH '1' TO TITRRTE" 48 6ET T I 50 I F T I < ) '1' THE!: 48 51 H6Ui : HCOLOR= 3: POKE 49245. 0: HPLOT V, PDL Ill: POKE 47 242.0 52 FOE I = 1 TO N 53 OV = 2b0 / N 54 V = Y t W:L = 500: 605'58 960 5b FOR J = I TO 444:: NEXT 50 POKE 47243.0 59 R = POL 11) bO POKE 47Z12,O b l HPLOT V,R b4 NEXT I 65 TEXT : HOHE bb 6110 20 810 POKE 49241.0: PCIE 49245.0 820 FOR H = I TC L 840 PORE 49241.0 EbO POKE 47245.0 880 POKE 47240,O 700 POKE W?44,0: NEXT H 710 RETURN PbO POKE 47241.0: POLE 4 9 2 3 . 0 970 FOR )1 = I TO L 1040 POKE 49241.0 1060 POKE 49240.0 1060 POKE 47245.0
d
Figure 15. Motordriven syringe with stepper motor far computer control.
her seal is removed from the plunger of a 20-mL syring (A) and placed over a '/2-in.-0.d. washer soldered to the end of a 10-24threaded rod (El. The plastic plunger from the syringe is discarded. The threaded rod passes through a nut (F) that is glued with epoxy cement to a sliding hracket (H), and the end of the rod is connected to the motor shaft with a coupler (G). Two 3/16-in.holes are drilled in the finger grips o i t h e syringe body (A), and i t is bolted with 8-32 machine screws to the sliding hracket (H) so that, when the threaded rod turns, the syringe bodyibracket assembly slides on tracks in the hase (J). which remains motionless with . ., and the nluneer. . respect to the hase, draws in or ejects liquid. A second syrinee (B) . . of 60-mL caoacitv . - is connected throueh " a dual pall checkvalve (C) to serve as a titrant reservoir, and a '/-in.-i.d. Tygona tube (D) delivers the liquid. The hase (J) is 7 X 12 X '/-in. PlexiglaE to which 1 X 12-in. (K) and 1.25 X 12-in. (L) strips of V4-in. Plexiglas are bolted, forming slots in which Plexiglas sliding hracket rides. Extra the 5 X 5.5 X clearance is provided by placing small washers on the bolts between strips (K) and (L). Some care must he taken to mount the motor hracket (M) and motor (N) so that the motor shaft is aligned with the nut in the sliding hracket (which also must he aligned with the center axis of the svrinee . " (A)). . .. Microswitches mav he added to limit the travel of the plunger in the syringe, but with the motor operating a t iust sufficient voltaee to drive the svrinee it has insufficient . power to break a w k b u i l t unit. The apparatus described above can he used to demonstrate anautomated conductometrir titration oi rvughlv 10-'M h~drorhloricacidwith 10-'Msodium hydroxide. \Ye use a ty&cal conductance cell with platinized platinum electrodes of 1.5 cm diameter and about 3 cm apart, immersed in about 200 mL of the hydrochloric acid. When connected to the Apple Game Port, the conductance cell produces low values (10-20) on the 0-255 digit scale, which represents analog resistances of zero to about 150 kn. Large relative chanees in resistance are ohtained durine the titration if low initial al~solutevalucs are ohtained by modifving the various ex~erimentalparameters. The BASIC Droeram listed in Fizure 16 allowsthe user to add 5-mL &cr&ents of sodium hvdroxide solution to the buret. Under BASIC control, the maximum rate of aspiration or delivery is 15 s/mL with a 20mL syringe and 10-24 threaded rod. The apparatus allows flexibilitfin the rate of delivery and accura& and precision of the volume added, because larger or smaller syringes and finer or coarser threaded rods may he substituted. The loop beginning at line 970 runs the stepper motor in reverse for 10.000 steps to draw in 5-mL increments. as necessarv. to fill thk buret..~heuser is then prompted tospecify the &mher of 1.0-mL increments of titrant to he added and to begin the titration by pushing the "T" key. The loop beginning a t line 820 drives the motor to deliver 1.0 mL of titrant, a delay in line 56 allows the mixture to equilibrate, and the resistance is measured in line 59. The resistance is plotted against volume of hase added in line 61, and because the ordinate w
.
-
-
Figure 16. BASIC Program that controls a conductometric tihation
values increase downward on the Apple screen, the plot shows first a negative slope, then a positive slope. In a typical titration where twelve l-mL increments were added, the calculated standard deviation of the volume increments is 2% (0.02 mL) and the error in the total volume is usually about 1%. The 2% precision in the volume increments is due to the flexibility of the rubber plunger and rather wide tolerances in the construction of the sliding track assembly. The accuracy to which large volumes are delivered could probably he increased above 1%by careful calibration, since around 2000 steps deliver 1 mL, and for stepper motors, step errors are noncumulative. Therefore the total rotational error in 2000 (or any number) of steps is the same as the error in one step, typically less than lo.The relative error is thus 1" in 2000 steps where each step is 7.5', or 0.007%! We determined errors for the titrator gravimetricallv bv deliverins water into a CUD on an analvtical balance. Only a skeleton program is provided here to save space, and users will ~ r o h a h l vwish to tailor the nroeram to local needs and eq"ipmen< Desirable additions Lclude (1) a means of automaticallv stopping the svstem after an optimum number of additions excess base, (2) conversion to true conductance bv calibration of the A D converter and taking the rrriprwaltfthe resiqtance calculated. (3) making n wlume correction ( I : ) , 1.1) providing linear least-squares analysis of selected linear portions.of the plot and automati-
- -
-
of
Volume 63
Number 9
September 1986
805