Russell R. Markman, Patricia L. Bean, Gail L. Heinrich, Stephen J. Freeland, ond Fredi Jakob California State University Sacramento, California 95819
A Data Acquisition Experiment for Instrumental Analysis
I
Perusal of current scientific literature reveals the tremendous impact of lahoratory computers. Publications in diverse fields such as physics, psychology, biology, chemistry, and engineering indicate a universal interest in the use of comnuters for data acauisition. data reduction, and for control of experimental devices. Complex instrumentation svstems controlled bv a dedicated didtal " - computer are becoming increasingly common. Many scientists are of the oninion that within the next five to ten vears, all major analytical instruments will operate under computer control or have data outnut terminals that produce data which is computer compatible. Tedious and routine operations can he controlled by the untiring computer, freeing the scientist for more creative activities. There are, in addition, experiments and procedures that would not be feasible without the aid of computers. Examples of the latter include techniques such as Fourier Transform Spectroscopy ( I , 2), sophisticated signal averaeine (2. 3) and data acquisition systems used to measure rapihly changing electrochemical signals (4). We have long felt that our undergraduates should he introduced to modem experimental methods and apparatus. The importance and widespread use of computers has prompted us to incorporate computer concepts into several of our courses. Freshman, enrolled in the honors course, are currently using an Olivetti-Underwood Programma 101, a programmable calculator to perform all of their laboratory computations. They are required to write fairly sophisticated programs for this machine, e.g., linear regression analysis and successive approximation solutions of polynomial equations. The Chemistry Department also offers a Fortran IV programming course that emphasizes the use of this high level language in solving problems in the physical sciences. The experiment described in this paper was developed for our senior level course in Chemical Instrumentation. It is in this course that the student is introduced to a wide varlet? oi analog and digital circuits, analog and digital computers. and their application to problems oi interest to experimental scientists. Our objective was to develop an experiment that illustrates the computer's ability to operate in an on-line mode. Students in the Chemical Instrumentation course receive 8-10 1-hr lectures on the use of minicomputers in the chemical lahoratory. The lectures cover computer organization, machine and assembly language programming and computer peripherals. A series of required programs, of increasing difficulty, written in machine language and in PAL 111, the assembly language for the PDP-8 family of computers, develops the student's abilities to the point where he is ready to program the data acquisition experiment described herein. These preliminary assignments are summarized in Table 1. First order svstems are common to manv scientific disciplines. The current-time relationship in an RC circuit is analogous to the concentration-time relationship observed
Table 1. Programming Assignments Assignment 1. Clear locations snnn. t" . ..." .. 4nnn. ...."
Language Machine
Purpose Familiarization with machine laneuaee instructions andVen&ringof programs via the swZch
2. Telcrype output Asremblv of students name (PAL 111, on a dragvnal r g.
Illwtrates how peripherals rommunwatr uithand arc cmtrulled by the computer
rpniqter ..".. ... .
~
-
3. Computational
Assembly (PALIII)
4. Subroutines
Assembly (PAL 111)
Routines
Studentswrite an integer multiply subroutine which gives them additional experience in pro gram .~ preparation. . Students incorporate a floating point package in a program they write to solve an algebraic equation.
with a first-order chemical reaction. The importance of first-order behavior, in addition to the ease with which this kind of svstem can be simulated, was a major factor in our choicevof conditions for this experiment.- he rate constant for a first-order svstem can he obtained by computation of the slope of the log (signal) versus time function, a computational task eminently suitable for on-line solution with a minicomputer. Experimental A Digital Equipment Company PDP-81 computer equipped with an AX08 lahoratory peripheral was used for this experiment. Major components of the lahoratory peripheral include a 9 bit analog to digital converter (AID), four channel multiplexer, Schmitt triggers, an RC and a crystal clock and digital to analog converters (D/A), that can drive the X and Y axis of an oscilliscope. Each of the peripherals is called into operation with appropriate PAL III instructions. An enable register, which also is part of the basic AX08 package, is used to set up conditions to "enahle" actions by the above-mentioned elements of the laboratory peripheral. Loading the enable register with a particular data word allows one to take experimental points at precisely known time intervals. Analog to digital conversions can he started, after a predetermined number of clock pulses or the conversion can he initiated after one of the clock flags, RC or crystal, is set. This decision is also implemented with the enable register. Figure 1 illustrates how the components of the AX08 lahoratory peripheral, which were used in this experiment, are interconnected to provide a flow of information from the experiment to the computer. The student must make only a single external connection between the first order simulator, Volume 50, Number 4, April 1973
/
295
Figure 1. AX08 Operational flow diagram.
described below, and channel zero of the multiplexer. Additional operational details for the laboratory peripheral are given in literature supplied by the Digital Equipment corporation (5). A first order voltage signal, e.g., one that obeys the equation
where V is the voltage a t time t, V' is the initial value of the voltage, e is the base of natural logarithms, and h is the first-order rate constant is available from several types of chemical transducers. For example a spectrophotometer cuvet could contain a reactant that is undergoing a first-order reaction. If only the reactant absorbs radiation a t the selected wavelength, then the transmitted radiation intensity is related to the concentration of this reactant. Suitahle intradomain modifiers (6) can be used to transform the initial electrical signal, one that is proportional . to the transmission of radiation through the sample, to a loearithmic simal. The amplitude of this logarithmic sign; is, accordTng to ~ e e r ' L L a w ,directly p;oportional to the concentration of the absorbing species. A plot of this logarithmic signal versus time would obey eqn. (1). We elected not to use a chemical system because of the extra time and effort required for sample preparation and the necessity of designing or purchasing a suitable logarithmic amplifier to convert the transmittance to an ahsorbance signal. Since we also wanted to vary the rate constant over a large range of values we would require a great number of reactants, each adhering to the previously described conditions, if we were to attempt to evaluate our programs with "real" chemical systems. Simulation was selected as the best approach and has proven to be very satisfactory. A conventional operational amplifier circuit, shown in Figure 2, was employed to generate voltages that obey eqn. (1). Those readers familiar with analog computation methods will recognize this circuit as the one employed for the solution of the differential equation that describes a firstorder system (7-9).
where V is the voltage at time t, and k is the first-order rate constant. Equation (1)is the integrated form of eqn. (2). Component values for the analog circuit were selected so that h could be varied over a range of 0-10.0. The curves generated with the simulator were equal in quality to those obtainable on an analog computer (9). The initial condition on the integrator is set at -2.0 V. The output of the first-order simulator is fed to a summing amplifier that also has a fixed +1 V input. The output of the summing amplifier goes from +1 V to -1 V when the simulator voltage goes from -2 to 0 V. This was done to take advantage of the full range of the AID converter which is +1.020 to -1.024 V. The resolution of the input signal is increased by a factor of two by this scaling procedure. Program Description
Figure 3 illustrates the program in flow chart form. A more complete description of the program follows. The program is capable of evaluating the rate constant for first-order systems. The initial monologue gives the programs capabilities, available input and output formats, and other user options. Experimental parameters which
Description Of Program Capabilities And Formats For l n p u t And Output
,
Time Interval rpired?
Make And Average Two A To D Conversions
Compute Andoutput Rate Constant
L i s t Data NO
Figure 2. First-order simulator. All amplifiers are Philbrick model number PSSAU.
296
/ Journal of Chemical Education
Figure 3. Computer flow chart for the data acquisition program
include the time interval between data acquisitions and the number of data points to be acquired are entered via the teletvne. in floatine noint notation. The floatine uoint number ;;presenting autime interval from 1 X 10-4-to 400 sec is multinlied bv 10.MX). converted into a double nrecision octal number, negated, incremented by minus one and saved. The time is multiplied by 10,000 because the crystal clock flag is set 10,000 times per second. The floating point number representing the number of data points to be acquired, from 1 to 200, is converted into a single precision octal number, negated and saved. These convers i o x to binary notation are made to simplify further arithmetic operations. The computer determines the time interval by counting the crystal clock. The negated double precision time interval is incremented before each crystal clock flag. When the contents of this word reaches zero the computer will c o m ~ l e t ea nine bit AID conversion of the voltaae auat channel zerp'of the multiplexer. A seconh A ~ D conversion will be initiated immediatelv thereafter. These two values are averaged and stored as a single data point. The crystal clock flag counter is then reset and the data acquisition procedure is repeated until the desired number of experimental points have been acquired. The rate constant, k , is calculated by evaluating the slope of a plot of the linear natural log (voltage) versus time function. A standard linear regression analysis procedure is used to compute the rate constant. Although floating point notation for inputs simplifies the use of the program by the operator it does complicate the program in that a floating point to double precision interchaneer is required. Therefore, the promam could be simp~ifiedatthe expense of user c&venien& by requiring octal format for inputs. A double preci&on-floating point interchanger subroutine has been developed and can be obtained bv reauesting Decus 8-379 from Digital Equipment company, users Society, 146 Main Street, Maynard, Mass. 01754. After the output of k observed has been completed the computer, depending on the configuration of the switch register, will halt, return to start, or dump the data via the teletype. The data dump outputs each point in four columns; octal, scaled decimal, natural log, and the associated time interval. After completion of the data dump the computer will halt or return to start. A listing of the program is available from the authors. Results
The program was executed with four different rate constants covering the range of -0.045 to -0.944, set on the first order simulator. Several repetitive runs were made with each selected rate constant. The results of these experiments are summarized in Table 2. A data dump routine is included in the program; the data can be output by a teletypewriter under computer control. Future Work
The data acquisition program we have reported meets all of our current pedagogical objectives. Students that successfully complete the required set of programs are ca-
Table 2.
Computer Calculated First-Order Rate Constants
Rate Constant Set on Simulator
Number of Data Points
Data Point Intewal (sec)
Computer Calculated Rate Constant
-0.045 -0.368 -0.545 -0.944
200 20 50 100
0.1 0.5 0.1 0.04
-0.0451 -0.368 -0.545 -0.943
pable of preparing software for a variety of computer controlled experiments. There are still many improvements that we can and will make in the future. We are building a more sophisticated interface between the experiment and the computer. One function of the interface is to start the exponential decay, aenerated on the simulator. under comnuter control. At present, the operator must start the simulator and then initiate the data acauisition routine. Fortunatelv. the calculated rate constants are independent of the bortion of the exponential curve that is used for the rate constant computation. Manual starting, however, limits the range of rate constants that can be examined. With large rate constants the exponential decay would be essentially complete before the operator hit the program start button. An alternative to improved hardware is a change in the software. The computer could be started before the simulator and initial non-changing signals could be rejected. We will also investigate this latter alternative. Data acquisition intervals are selected by the operator and input, via teletypewriter, to the computer at the start of the experiment. These time intervals could be too short or too long depending on the particular rate constant that is selected. For example, if a small rate constant is set on the simulator and the required number of data points is obtained rapidly then because of the limited resolution of the A/D converter it is not possible to compute an accurate rate constant. Pardue and James have developed software that overcomes this difficulty (10). A few initial points are obtained a t a fixed time interval and are used to calculate the optimum data acquisition rate. Similar features could be incorporated into our current software. The data dump feature provides us with a tabulation of voltages, from the simulator, at fixed time intervals. Since the Ax-08 option includes D/A converters interfaced to an oscilloscope i t is relatively easy to display the stored data. We are in the process of preparing a display subroutine which will he made available for mcorporation in the students' programs. Literature Cited (1) Fidyard. J. N. A.. Colloq. Inl. CentreNofionalRecm. Sci. IGI. 62119671 IEng.). (21 N i t t r o w . C . A.. "Mndrrn Signal Processing Techniques for Overcoming Noise." Technical Notes T-2M. Princeton Applied Research. 1968. (31 B i m . F. J.Ana1. Chsm., 42,537 11970). (4) Booman. G. L..Anol. Chem.. 39. 1141 (19661. (51 Digital Equipment Company. "AX08 Laboratory Peripheral Instruction Manual." DEC. Maynard. Mars.. 1968. 161 Barnartt. S.. andJohnsan. C. A.,Anol. Chem., 43,69A(l97L). Electronic Associates. Inc.. "Hendbaok of Analog Computation.'' EAI. West Long (71 Branch. N . J.. 1956. (81 Jsekron. A. S.. "Analog Computafian." McGrsw Hill Book Co.. Ine.. New York. 1960. I91 Tabbutt. F.D..J.CHEM. EOUC..44.M(19671. 1101 J a m e s . G . E . . a n d P s d u e . H.L..Anol. Chem..41.1618119691.
Volume 50, Number 4, April 1973 / 297