TH ESlS F—llluvmmm 2 7 £117" “mink ‘ TN??? '."|'.\ 5?: "~' "E? if ‘ Ex“ J~ - " K”. z“ N." y ' f -3 '2. -' -. 1 ‘. ,4"; ..- 9! '? t ‘ ‘ . I hathm ‘1 > .A _ tv g Wm ~31" five? of" -' ' "r fr‘FTt-teft This is to certify that the thesis entitled A MICROCOMPUTER-CONTROLLED BOXCAR INTEGRATOR FOR LASER SPECTROSCOPY EXPERIMENTS presented by John David Stanley has been accepted towards fulfillment of the requirements for M. S . degree in Chemistry Major professor Date A; ' 8 2’ 0-7639 MSU LIBRARIES “ V RETURNING MATERIALS: Place in book drop to remove this checkout from your record. FINES will be charged if book is returned after the date stamped below. A IICROCOMPUTER-CONTROLLED BOXCAR INTEGRATOR FOR LASER SPECTROSCOPY EXPERIMENTS By John David Stanley A THESIS Submitted to Michigan State University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE College of Natural Science 1982 ABSTRACT A MICROCOMPUTER-CONTROLLED BOXCAR INTEGRATOR FOR LASER SPECTROSCOPY EXPERIMENTS By John David Stanley The large amount of data presented to the modern experimenter. if manipulated by hand. requires a great amount of time to process. Time to perform more experiments is lost while past results are analyzed. The limited control functions on some data collection equipment also prevent the efficient use of an experimental system. One such system is a laser enhanced ionization (LEI) or dual laser ionization (DLI) spectroscopic system that uses a boxcar integrator for data collection. The construction of a microcomputer interface to the boxcar integrator. and the software written to control the boxcar integrator is presented. A study was performed to determine the noise reduction capability of the computer controlled boxcar integrator, and to verify the proper Operation of the LEI/DLI data collection electronics. TABLE Chapter LIST OF TABLES . . . . . LIST OF FIGURES . . . . . INTRODUCTION . . . . . . HISTORICAL Introduction . . . . . Laboratory Microcomputer Boxcar Integrators . . INSTRUMENTATION Introduction . . . . . Boxcar Integrator . . Model 164 . . . . . Mainframe Model 162 The Microcomputer . . Interface . . . . . OF CONTENTS Dual Digital to Analog Converter Digital Interface . LSI-ll/23 Minicomputer ii Page vi 11 12 15 17 17 19 20 Chapter SOFTWARE Introduction . . . . . Microcomputer Software PARAM . . . . . . . TAKE . . . . . . . DUMP . . . . . . . SAVE . . . . . . . DOWNLD . . . . . . LSI-11/23 Software . . UPCHUCK . . . . . . RAIZCOOK . . . . . ICING . . . . . . BOXCAR INTEGRATOR NOISE REDUCTION Introduction . . . . . Noise Reduction . . . Noise . . . . . . . . Experimental . . . . . Results . . . . . . . Discussion . . . . . . Conclusions . . . . . DECAY OF SODIUM ION POPULATIONS Introduction . . . . . Experimental . . . . . iii Page 22 23 24 27 35 35 36 37 37 38 4o 42 42 47 47 50 56 62 65 68 Chapter Results . Discussion Conclusions FUTURE DEVELOPMENTS APPENDIX A: LISTING APPENDIX B: LISTING BIBLIOGRAPHY OF RA'2COOK OF ICING iv Page 69 71 76 78 81 89 96 LIST OF TABLES Table Page 1 Observed Data and Calculated SNIR V‘luos O O O I O I O O 0 O 0 O O O O 55 LIST OF FIGURES The Instrumentation Block Diagram . TAKE. STOP. NEW. and START . . . . The Interrupt Handler . . . . . . . A Typical DOC File . . . . . . . . The Exponential Decay/ Noise Source The Decay Signal and Noise . . . . Observed Signal and Noise . . . . . The Frequency Spectrum of the Noise MM5837 Noise Spectrum . . . . . . . The Experimental Parameters . . . . The Collection Circuit . . . . . . Time Resolved Sodium Decay With Varying Load Resistors . . . . vi Page 10 28 30 39 49 51 53 60 63 70 72 73 CHAPTER 1 INTRODUCTION In the past few years. a new analytical technique called Dual Laser Ionization (DLI) Spectroscopy has been developed in this laboratory. The DLI technique involves the measurement of both the relative amplitude and the time decay characteristics of laser-induced ionization signals in a flame. These signals are present at low repetition rates (~20Hz) and.for short periods of time (10 us to 100 us). and are superimposed on a noisy DC background. The ionization signal also has some radio frequency noise produced by the nitrogen laser present at the beginning of each peak. The types of signals encountered in the DLI technique preclude the use of simple DC integrators and amplifiers for measuring the desired quantities. Previous workers [1] have lessened these measurement problems by the use of a boxcar integrator, which provides many of the functions necessary to measure brief, noisy signals. The boxcar integrator integrates the input signal for a brief period of time after the application of a trigger signal. The delay between the trigger signal and the beginning of the integration period can be varied. The time period integrated is called the aperture time. and the time between the trigger and the beginning of the aperture is called the aperture delay. If a noisy. repetitive signal is observed with a boxcar integrator. and the aperture delay is held constant, the boxcar integrator will serve to average the signal from many repetitions into one value, thereby reducing the amount of noise measured. If the aperture delay is increased at a rate that is slower than the repetition rate of the observed signal, the boxcar integrator will sample progressively later and later portions of the input signal. and plotting the output of the boxcar integrator with respect to time will produce a time resolved picture of the input signal. The boxcar integrator, however, generates a data reduction problem. The output recording device from a boxcar integrator is usually a stripchart recorder. The amount of time consumed in averaging multiple passes of time resolved data. or noisy non-time resolved data limits the amount of time available to the experimenter, and is a psychological hurdle to long experiments. A second problem. or rather, challenge, is presented by the fact that for this application, more fuctional variables need to be controlled than are available from the boxcar. For example. using the front panel controls, the boxcar aperture can be scanned linearly across the aperture delay range. The exponential nature of the decay curves means that the early part of the signal should be sampled with higher resolution than the later regions of lower slope. Fortunately, the boxcar being used has most of the control lines brought out to the back panel. so that the user can generate control signals apprOpriate to the experimental requirements. The work presented in this thesis represents the author's attempts to solve these two problems by interfacing a microprocessor to the boxcar integrator. This microprocessor controls the Operation of the boxcar integrator. and collects the data generated. The data are then sent to an L81 11/23 minicomputer for manipulation and storage. This work consists of five major parts: the historical aspects, a discussion of the instrument. the software developed. an evaluation of the system with well-behaved test signals, and a presentation of data from the DLI spectroscopic system. CHAPTER 2 HISTORICAL Introduction With the advent of LSI integrated circuits. the ease and practicality of interfacing a computer to analog data collection circuitry has greatly increased. Prior to that time the cost of minicomputers often prohibited their dedication to a single instrument for the length of time required for data collection and the control of experimental parameters. Early data collection schemes generally required the entry of data to the computer by hand; however. systems have been devised to circumvent this. For example. one early system[2] converted the binary coded decimal output of a Keithly digital multimeter to the ASCII codes required to run a Teletype paper tape punch. This paper tape could then be loaded into any computer that had a Teletype terminal. As late as 1980. a system that used a Tektronix 4051 programmable calculator and an X-Y strip chart recorder with an image sensor in place of the pen was developed to convert an analog chart recording into the form required by a digital computer automatically[3]. Laboratory Microcomputers The Digital Equipment Corporation (DEC) PDP8 series of minicomputers has been a popular choice for laboratory computer applications. This series has a large base of software support (OS/8 Operating system. FORTRAN. BASIC, etc.). but because of the cost of memory (both core and mass storage) that is needed to run these higher level operating systems and languages. the PDP8 is still a larger system than desired for dedication to a single. small laboratory instrument. The Intersil IM6100 integrated circuit provided the answer to the cost versus software problem for PDP8 users. The IM6100 is a one chip implementation of the PDP8 processor; it made dedicated control of experimental equipment practical. This chip was easily adapted for use in a master/slave processor system. The IM6100 processor. control electronics. and just enough memory (either read-only or random access) for the desired application are connected to the experiment. A PDP8 which can run 08/8, FORTRAN, etc. could function as the master minicomputer, and could be used to compile programs to run on the 6100 system. which would recieve these programs over a serial communication line. The same serial line would then be used to send data back to the PDP8 for storage. This technique has been successfully used in this 1aboratory[4.5]. The PDP8 and IM6100 suffer from two problems: 1) a weak instruction set, and 2) complicated interfacing requirements. Advances in LSI technology and microprocessor architecture have made available processors with the speed and power of larger machines at a cost that permits system dedication. The interfacing electronics have also been simplified by the production of integrated circuits designed to interface to specific microprocessor bus systems. The Intel 8080, an 8 bit, one-chip micrOprocessor, is such a processor, and it has been used in such a dedicated system[6,7] with a cross assembler and a downloader running on a PDP8. Further developments at both Intel and DEC have led to more powerful microcomputers and minicomputers for less cost. The Intel 8085 is the offspring of the 8080. and is the microprocessor used in this work. The 8085 is also an 8-bit processor. but is faster than the 8080. and requires only a +5 volt power supply, while the 8080 requires +5. +12, and -5 volt supplies. The 8085 also has four interrupt and serial input and output lines not present on the 8080. Other workers [8.9] at this university have developed a relatively inexpensive. twin bus system based on this microprocessor and the support chips designed by Intel. The master minicomputer is a DEC LSI-11/23 with the RSI-11M multi-user. multi-tasking operating system. An 8085 cross assembler which uses the extremely powerful Macro-11 assembler available on the LSI-ll has been developed by Steve Johnson and Hugh Gregg. This sytem will be described in more detail in the next chapter. Boxcar Integrators Boxcar averagers and boxcar integrators have become a familiar sight in many laboratories in which noisy repetitive signals must be measuredllO]. The cost of these devices has decreased. as should be expected. with the increase in the large scale integration (LSI) of the modules needed in a boxcar integrator. High speed and high resolution devices are still not inexpensive. and may not be compatible with modern microcomputers. The interfacing problems can be avoided by designing one's own boxcar integrator. One such device has been developed for use in a transient detector. which has nanosecond resolutionIll]. This design used emitter coupled logic for the high speed section of the digital logic. which for lower resolution (~us) boxcar integrators is not necessary. With the increasing use of microcomputers in the laboratory. boxcar integrator manufacturers have begun to provide user access to what used to be internal signals. The boxcar integrator used in this work has most of the control voltages available on a rear panel connector. Microcomputers themselves have begun to take over the functions of the control logic in the boxcar integrator. The AIM—65. a low cost microcomputer based on the 6502 processor. is able to function as a boxcar integrator. with the addition of a sample-and-hold and an ADC[12]. CHAPTER 3 Instrumentation Introduction The electronics in this instrumentation project consists of two parts: the boxcar integrator and the microcomputer. The time scale of the measurements prevents the use of a microcomputer and an ADC alone as a software boxcar integrator. The flexibility desired requires use of more than a boxcar integrator alone. Together. the two allow measurements of fast signals with a large degree of flexibility. The boxcar integrator is discussed first. followed by a brief description of the microcomputer. A block diagram of the instrumentation is in Figure 3-1. Boxcar Integrator The boxcar integrator used is a Princeton Applied Research Model 162 boxcar averager mainframe with a Model 163 sampling integrator. and a Model 164 gated integrator 10 sauna:— uoo; 23:33:33»: 2:. . Hum one»; 33 48 58.2... ll museums? 202232. «49.8 mam Jog—.750 024 8.40 mOmmmUOE tomoi 11 module[l3]. The Model 164 allows greater flexibility in the aperture duration selection than the Model 163. and is the module with which the data are acquired. Model 164 The Model 164 gated integrator module is designed so that upon each trigger signal generated by the mainframe. an integrator inside the 164 integrates the input signal for a time determined by the setting of the aperture duration switch on the mainframe front panel. The aperture duration can be set from 5 ns to 500 us. Two different modes of operation may be selected for the integration. In the summation mode. the input signal samples are integrated linearly. so that the output signal is the simple sum of all the input samples. In the exponential mode. the difference between the input signal and the output signal is integrated. In this mode. the output exponentially approaches the value of the input. and after 5 time constants of the integrator. will be essentially the same as the input. The value for the time constant is switch-selectable from the front panel of the Model 164. This is the mode normally used. as the output value is independent of the number of samples taken. within 12 the time constant constraint. The output from the Model 164 goes to the function switch of the mainframe (at lower right in Figure 3-1). The function switch selects the output of either channel A. channel B. the difference between the A and B outputs. or one of several options as the Model 162 mainframe output. In this system. the Model 164 is installed in channel B of the boxcar integrator. Mainframe Model 162 The mainframe of the boxcar integrator provides two functions. It determines the time delay for the aperture. and provides signal conditioning for the output of the Model 164. The aperture delay is the time between the trigger signal to the boxcar integrator. and the opening of the aperture in the gated integrator. This delay time is determined by 3 factors. The aperture delay range determines the largest delay available. and is set by a Model 162 front panel switch. The choices for delay range vary from 0.1 as to 50 ms. The 5 Initial A and S Initial B controls are 10 turn precision potentiometers located on the 13 front panel of the Model 162. and set the lowest value the aperture delay can have. in terms of the aperture delay range. The final parameter in the determination of aperture delay is the scan signal. When using the internal scan function of the boxcar integrator. a voltage ramp is generated. which slowly sweeps the aperture delay from the limit set by the % Initial control. to the limit set by the aperture delay range control. However. when placed in the external scan mode. the ramp signal can be externally supplied via back panel connectors. It is this input signal that allows the computer to control the aperture delay time. The method by which the microcomputer does this is discussed later. The three inputs work in the following way. The aperture delay range switch determines the amount of time from the application of the trigger signal it will take for an internal ramp signal to go from 0 to full scale. The time for this to occur is equal to the aperture delay range. This signal is sent to three comparators. The first comparator determines when the delay ramp has reached full scale. and resets the ramp generation circuitry. The other two comparators generate the gate signals for 14 the Models 163 and 164. The second input to these comparators receives the sum of the S Initial control for the appropriate channel and the scan voltage. In the internal scan mode. this signal is a slow ramp. When the delay ramp passes the summed scan ramp. the gate signal for the channel is generated. Mathematically. the aperture delay is a function of three variables: the aperture delay range. R. the S Initial A or B represented by 51. and the voltage from the internal scan circuit or from the rear panel V. The equation relating aperture delay D to these three variables is: D = R($I + 10V)/1OO (3-1) where V is the magnitude of the input scan voltage. and D has the same units as R. The contribution. S. to the aperture delay from the scan signal is: RV/lO (3-2) 15 The second function of the mainframe is to provide various combinations of the channel A and B outputs. As only channel B is used in this work. the function selector for the mainframe output is set to channel B out. The mainframe also contains a filter on the output to help reduce the noise components of the signal. The time constant for this filter is switch selectable from the front panel. and can vary from 0.1 ms to 10 s. The Microcomputer The microcomputer used was designed by Bruce Newcome. and is described in detail elsewhere[8]. The processor used is the Intel 8085A. an 8-bit data. 16-bit address device. This processor runs at 3 MHz. and has a maximum address space of 65.534 bytes. The 8085 is mounted on the CPU board. which contains the electronics to buffer the address. data and control lines as they go off the CPU board. The CPU and all other boards are mounted on a motherboard. which has the sole function of carrying the microprocessor bus from module to module. The main motherboard is connected to other motherboards in the system by a backplane. which carries the processor bus between motherboards. 16 The entire system. called the Multi-Micro System. is modular in design. Instead of having each peripheral device decode it's own address. one module performs this function. This module. the Chip Select (CS) board. generates 8 non-qualified selects. and 8 qualified selects. The qualified selects are only active during a processor read or write operation. while the non-qualified selects can be activated by random states Of the address bus. Terminal I/O, and I/O to the minicomputer is controlled by a USART module which contains 2 Intel 8251A Universal Synchronous Asynchronous Receiver Transmitters. The system interrupts are controlled by an Intel 8259 Programmable Interrupt Controller (PIC). Memory is provided by two modules. a 16k RAM/ROM board. and an 8k RAM board. The RAM/ROM board in the system used in this work. contains 4k of ROM which stores the operating system SLOPS. and 10k of RAM. which contains the software to control data collection. The Operating system and software are discussed in detail later. One final standard module is used. the Intel 8255 Programmable Peripheral Interface (PPI). also referred to as a Parallel I/O (PIO) module. This module allows for 3 parallel 8-bit input or output ports. The configuration of 17 this device is discussed later. Interface The interface between the boxcar integrator and the microcomputer consists mostly of buffering to protect the microcomputer from being damaged. One additional module for the microcomputer system has been designed. and one external circuit board contains the buffers. This board also contains the comparator used in the analog-to-digital converter (ADC). Dual Digital-to-Analog Converter The only function missing in the basic Multi-Micro system was a means of converting the analog output Of the boxcar integrator to the digital signals required by the microcomputer. and vice versa. This function was provided by a module which contains two Analog Devices AD558 digital-to-analog converters (DACs). The AD558 is a 16 pin IC which has an internal voltage reference. and can provide either 10 or 2.56 volts full scale output. In order to set an analog output voltage. all that is necessary is to write the digital value to the address of one of the CS selects. 18 This signal is connected to a chip select on the AD558 which latches the data into the converter. The output of one of the two DACs is used as an input to the external scan input on the boxcar integrator. The output voltage on the 10 volt scale from the DAC is 108/256 where B is the 8-bit data value. It follows from equation 3-2 that the aperture delay due to the external scan input is: S = RB/256 (3-3) where R and 8 have the same meaning as in equation 3-2. The other DAC is used with an LM311 comparator to function as a successive approximation ADC. under software control. This software ADC was chosen for use because a general purpose Analog-to-Digital Converter (ADC) module had not been designed for the multi-microsystem. However. a 12-bit ADC module was designed recently[14]. Future plans include the use of this module for data acquisition. 19 Digital Interface The remaining interfacing is accomplished using digital signals. The boxcar integrator provides a copy of the aperture gate signal fed to the Model 164. and a reset function is available from a 50 conductor edge connector on the rear panel. The rear edge connector also makes the analOg signals available. and the one external circuit board connects to the back of the boxcar integrator. with power supplied by the boxcar integrator. The aperture gate signal from the Model 164 is used to trigger an interrupt in the microcomputer. The gate out is connected to the clock input of a J/K flip-flap on the interrupt controller board. which latches the trigger pulse. The output of the flip-flop is sent into the interrupt 3 line of the 8259 PIC chip. One of the qualified CS selects is used to reset the flip-flop at the end of the interrupt. The boxcar integrator can be reset by taking an external reset line L0. This function is provided by bit 7 of port C on the PIO module. Port A. bit 0 is used to examine the output of the LM311 comparator. 20 LSI-11/23 Minicomputer The computer used for storage and data manipulation is a Digital Equipment Corporation (DEC) LSI-11/23 minicomputer. with 128K words of RAM. and 2 DEC DLV-llJ boards. each of which provides 4 serial data lines. Thirty seven million bytes of hard disk storage are available. as are dual density floppy disk drives. Printed listings and graphics are generated on an Integral Data Systems Paper The Operating system used on the minicomputer is RSI-11M. supplied by DEC. This system has Fortran and Macro programming languages available for data manipulation software. The hardware connection between the mini and microcomputers consists of a 4 wire cable connected to a serial line on the LSI-ll. RSX-ll treats this line as if it were a terminal. and programs have been written which accept data coming in this line for storage on the hard disk. The other end of this cable is connected to the second USART on the microcomputer's USART board. A routine in the microcomputer connects the user's terminal to the link to the LSI-ll through software. This transparent mode allows one terminal to be used for both the LSI-ll and the microcomputer. 21 CHAPTER 4 Software Introduction Because much of the instrumentation was purchased commercially. a major effort was in the develOpment of software. There are three major sections to the software. The first is the section written to run on the microcomputer. and the second is the part written for the LSI-ll minicomputer. The final section is that written for communications between the two computers. The latter portion of code was deveIOped primarilly by other workers[15]. and will not be described extensively here. The development of the software was guided by one major philosOphy: the microcomputer should be used for instrument control. and any mathematical Operations on data should be done on the larger machine. This leads to lower equipment cost. since only one mass storage device is needed within the laboratory. and overall faster data turnaround. The 22 23 availability of higher level languages and plotting packages is also greater on the LSI-ll than on the microcomputer. Microcomputer software The microcomputer has 5 functions to perform: 1. Allow the operator to adjust experimental parameters 2. Control the boxcar integrator 3. Collect data from the boxcar integrator 4. Store the data temporarily 5. Send the data to the LSI-ll Prior workers[15] have develOped the Operating system used on the microcomputer. which is called SLOPS. SLOPS is a very simple system. stored in ROM. which allows an Operator to enter commands from the terminal keyboard. SLOPS then searches a linked list of names to find the command. When a match is found the machine code immediately following the matched command is executed. The code to accomplish the desired function is written in assembly language. which is cross assembled on the LSI-ll. and downloaded into the microcomputer memory. The operator interface (no. 1 above) is the largest section of code and 24 will be discussed first. The portion of the software that allows the user to control the parameters for data collection is called PARAM; it is executed by typing PARAM from the terminal keyboard. Once started. PARAM displays the current Operating parameters. and waits for user action. This action consists Of one of several commands. most of which are the names of the parameters that can be modified. Those parameters are: IPDPT - the number of laser flashes. and therefore interrupts. between data point collection RESADP - should the boxcar integrator be reset between data points DBUFF - the beginning of the data buffer BUFFE - the end of the buffer Those parameters dealing with time resolution are: 25 STSCAN - start of scan LSCAN - length of scan SCANINC- the increment of change during the scan PPSCNC - the number of data points to be taken between scan steps The use of these parameters is discussed later along with the programs in which they are employed. The remaining commands do not deal with parameters. They are: DISPLAY. EXIT. and PB. The commands do not need to be entered in their entirety. Once enough of the command has been entered so that the program can unambiguously determine what is desired. the remainder of the command is displayed on the terminal. For example. to change IPDPT. only the letter I need be typed. A carriage return (CR) is then entered. and the command is echoed back on the screen to ascertain that the proper command was entered. The operator may then enter a number. which will replace the old entry. If no number is entered. the old entry is not changed. 26 Since values in PARAM are used to control the collection of data. it is important that once data are being collected the parameters not be changed accidentally. Included in the table in which all the parameters are stored is a software lock. which is set by the data collection routine as soon as one data point is taken. This lock prevents the operator from changing any parameters. Commands to change parameters are rejected until the operator unlocks the table with the UNLOCK command. A secondary function of the PARAM program is the recording of the Operating parameters of the boxcar integrator. This function is activated by using the PB command. The entries in this table are a description of the settings Of the boxcar integrator front panel. There are locations for the entry of time constants. SA INITIAL. and other settings. There are also two lines for the entry of textual comments. The entries in this table are accessed by entering the line number of the desired line. Entering an 11 returns the user to the main PARAM program. The entire parameter table is stored immediately in front of the data buffer. and is sent with the data to the LSI-ll for storage. This provides a permanent record of the experimental parameters with the data. 27 After the operator has set the parameters to the desired values. PARAM is exited with the EXIT command. or the values are listed with the DISPLAY command. TAKE This is the second major portion of the microcomputer software. TAKE is responsible for actually taking the data. and controlling the boxcar integrator. When the Operator types TAKE in response to the SLOPS prompt. the following events occur: 1. BUFFE (the pointer to the end of the data buffer) is set equal to DBUFF. 2. The interrupt counter is reset to O. 3. The parallel input/output (PIO) port is initialized. 4. Interrupt line 3 is activated on the interrupt controller IC. .A flowchart of the Operation of TAKE is shown in Figure 4-1. Conttwsl Of the processor is then returned to SLOPS. The remainder of the data collection Operation is under interrupt control. A flowchart Of the interrupt handler 28 em) em 2 Jr \lz j C 11 EV I a N Unmask Interrupt 3] . Call START Q G (“30 (31m) DBUFFEsBuffer Start INTCNT.PNTCNT=0 ‘ [ "‘Sk Int"'“pt 3 l Initialize PIO @ Set RESET high \I: I NOWSCNsSTSCAN Figure 4-1. TAKE. STOP. NEW. and START 29 Operation is in Figure 4-2. As the laser fires. it sends a trigger pulse to the boxcar integrator. which in turn. generates a gate signal for the sampling head. This gate signal is sent to the microcomputer to act as an interrupt. This interrupt causes control Of the processor to pass tO the data collection routine through a CALL to an entry in the interrupt table. which contains a JUMP to the beginning of the interrupt handling routine. This routine is the one that uses the parameters entered during PARAM to control the operation of the boxcar integrator. The interrupt handler first saves all the processor's registers so that at the end of the interrupt. the processor can return to what it was doing earlier. The status of the reset line (C7STAT) is examined first. to determine the state of the reset line. If the C7STAT contains the number 16. the boxcar integrator is being reset by the user. and the interrupt handler will not attempt to collect data. If C7STAT if any other non-zero value. the boxcar integrator is being reset by virtue of RESADP after collecting a data point. The value of C7STAT is then decremented by one. and if it becomes zero. the reset signal is removed from the boxcar integrator. and the handler exits. This use of a count in C7STAT is necessary to provide the electronics Turn off all Ints Save all Registers INTCNTnO Get ADC Data F RESADP m 0’ Set RESET low C78TAT23 3() GP [ Decrement C7STAT ] I Set RESET high [Increment PKTCNT ] Purcnrso NOVSCN-NOUSCN .scxnc YES Call STOP I DATA-DATA e aoooa I G Store DATA DBUFPE-DBUFFE+2 LOCKBI Output NOVSCN ‘je: Restore Reorsters Enable lnterruota I »Figure 4-2. The Interrupt Handler 31 within the boxcar integrator enough time to properly reset. If C7STAT is currently zero. the boxcar integrator is collecting data. The interrupt counter. which counts the number of interrupts since the last data point was taken. is incremented. and compared to IPDPT. the desired number Of interrupts per data point. IPDPT can vary from 1 to 255. If IPDPT equals zero. then there will be 256 interrupts per data point. If the two numbers do not match. the interrupt handler replaces the processor registers. and exits. If the proper number of interrupts has occured. the interrupt handler gathers a data point. It first clears the interrupt counter. and blinks a light so the Operator can tell that the routine is working. A subroutine is called to convert the present analog output from the boxcar integrator into an appropriate digital value. The conversion is accomplished using one 8-bit digital-to-analog converter (DAC) and a comparator. A serial approximation conversion is accomplished in software. and the output of the comparator is sensed using one bit of one input port from the PIO. This conversion takes approximately 400 microseconds using non-Optimized assembly language. Even at the fastest repetition rate of the laser (~60 Hz). this speed is sufficient to prevent data overrun. 32.. The data point returned is only 8 bits long. but it is treated as if it were 12 bits: this leaves 4 empty bits in the 16 bit processor word for use as flag bits. Only one flag bit is used presently. and it is discussed later. After the data point is collected. RESADP is checked. If it's value is zero. no action is taken. If it is any non-zero value. the active LO reset line to the boxcar integrator is set LO. using one bit of one port Of the PIO. To insure that this signal is held LO long enough to reset the boxcar integrator. a count of three is placed in C7STAT. Next. the data point counter is incremented. and compared to the value PPSCNC. the desired number of data points for each scan increment. This value can take the same range as IPDPT. If the two values are the same. then bit 14 of the data point is set HI. which indicates to the software on the LSI-ll that a time scan increment will occur on the next point. When this occurs. the data point counter is also reset to zero. The current scan location is incremented by SCANINC. the amount to increment the scan after PPSCNC is reached. The value of SCANINC is in the range from 0 to 255. An overflow of the current scan location causes a call to STOP. This subroutine performs the same function as the STOP command. which is discussed later. 33 When the acquired data point is ready to be stored in the data buffer. the value is written to the memory location pointed to by DBUFFE. the end of the data buffer pointer. As a safety precaution. to detect the end of RAM memory. the data point is read back. and compared to the value still in the processor's registers. If the two do not match. usually due to memory overflow. the subroutine STOP is called. The interrupt handler must now check for the end of a time resolved scan. The value STSCAN. the beginning value Of the scan position. is added to LSCAN. the desired length of scan. If the sum of these two overflows 8 bits. the resolution of the scan DAC. STOP is called. The current scan location is compared to the sum. and if the current location is greater. the end of a scan has been reached. and STOP is called. As data are being taken. the lock on the parameter table is set to prevent accidental parameter changes. At this point the interrupt handler has finished its task. The registers saved at the beginning are restored. after sending the end-of-interrupt (EOI) command to the interrupt controller to enable further interrupts. The interrupt handler also clears a J/K flip flop used as a latch on the interrupt input. The interrupt handler then executes a RETURN instruction. which returns the processor to the task 34 it was performing before it was interrupted. Because the data routine is interrupt controlled. SLOPS is available to perform other tasks while data are being taken. One such task is called by the command STOP. The routine STOP masks. or disables. the interrupt input which coincides with the input from the boxcar integrator. Since the computer can no longer 'see' the interrupt. no more data are taken. None of the counters or parameters are affected by STOP. so that data collection can be resumed by re-enabling the interrupt line. This function is performed by the command START. One additional command is available. called NEW. which does the same things TAKE does. with the exception that interrupt 3 is not enabled. TAKE. in reality. performs NEW followed by START. It is important to discuss the use of the time resolved scan parameters. They were designed originally to control the time function of the boxcar integrator. They are quite useful. though. when no time resolution is desired. For example. if STSCAN is 0. LSCAN is 0. and SCANINC is 100.. the computer will take only PPSCNC data points. Once that number of points is taken. the scan location is incremented past STSCAN + LSCAN. stopping the data collection. This is quite useful when one wishes to obtain 50 or 100 points for each of several concentrations of analyte ion. and then 35 later average all 50 or 100 into one point. Software on the LSI-ll to be covered later automatically averages these points. and calculates their standard deviation. DUMP DUMP is a command which causes the current contents of the data buffer to be displayed on the screen. This allows the Operator to see if erroneous data (for example. underflow or overflow of the ADC) are being collected. and to perform immediate corrections. SAVE Once the data have been collected. they are sent to the LSI-ll for storage and reduction. This function is performed by the routine SAVE. The greater portion of SAVE. called UPLOAD. was written by P. Hoffmanll6]. UPLOAD was not originally written to run under SLOPS. and has thus been modified for use in this work. SAVE passes the begining address of the information to be saved. and the end address to UPLOAD. UPLOAD then asks 36 for a file name under which to save the information on the LSI-ll. UPLOAD causes RSX-ll. the Operating system in use on the LSI-ll. to execute a task called UPCHUCK. which accepts the information sent up the serial line and stores it in a file on the LSI-ll's disk. These routines are the major programs written to handle the boxcar integrator. Several debugging and status aids were also written. Since they are not needed in normal Operation. they are not discussed here. DOWNLD Because the microcomputer has no mass storage devices and the data collection routines are not in ROM. there must exist some method for loading these programs from some other source. This is done by the routine. stored in the ROM Operating system. called DOWNLD. A program on the LSI-ll. called DOWNLOAD. sends programs down the serial line to the microcomputer. where DOWNLD places them in the correct memory locations. The programs that are sent to the microcomputer have been written on the LSI-ll in assembly language. and assembled by a cross-assembler. which has been written to use the extremely powerful MACRO-11 assembler and a set of macros defining the 8085 assembler nmemonics. A 37 screen oriented text editor. VTECO. is also used during program development LSI-11/23 Software The LSI-ll is the logical choice for any data manipulation that needs to be done because of its mass storage. its high speed. and the availability of higher level languages. A high level plotting package. MULPLOT[17]. makes presentation of the data in graphical form easy. UPCHUCK The data sent to the LSI-ll by the micro are received by the program UPCHUCK. This program takes the data. and stores them in a disk file in unformatted binary. That is. each data byte is stored exactly as it looks coming up the serial line. The parameter list is sent as the first 512 bytes. with the actual data making up the remaining file. Each data point is stored as 16 bits. and is the Y value only. The X values are determined later. by RAW2COOK. 38 File names on the LSI-ll consist of two parts; a 9 letter file name. and a three letter extension. Because of the way the microcomputer software was written. the extension of each of the raw data files is blank. From this point. two different programs are used to Operate on the raw data. The first separates the parameters from the data. and stores them in a file with the extension .DOC. It also assigns an X value to each point. The second program takes the output from the first. does a small amount of statistical treatment of the data. and allows several separate data files to be consolidated into one file. RAW2COOK RAW2COOK Operates on the raw data file. and creates two output files. One file is the parameter table formatted into a text file. This file has the extension .DOC. The DOC file also has the name of the raw data file saved in it. After processing the data. the minimum and maximum X and Y values are also stored in the .DOC file. A sample DOC file is shown in Figure 4-3. The second file created contains the data. properly formatted for MULPLOT use. A listing of RAW2COOK is in Appendix A. 39 PARENT RAW DATA FILE IS: 8T50KDCE BUFFER START: 16896 END: 17716 INTERRUPTS PER DATA POINT: 10 RESET AFTER DATA POINT: NO START OF SCAN: 0 LENGTH OF SCAN: 200 SCAN INCREMENT: 5 POINTS PER SCAN INCREMENT: 10 >>> Boxcar parameters <<< Aperture delay section 1) SInitial A: 2) SInitial B: 20S 3) Range: 10 microseconds Aperture section 4) Duration: 0.5 microseconds 5) Scan time: Time constants section 6) Boxcar: 0.1 second 7) Model 164: 10 microseconds 8) Comments: Time resolved Na New ckt 9) 50k load DC coupled 1 M Exponential DATA FILE WRITTEN: 8T50KDCE.DAT XMIN: 2.0000 XMAX: 9.8120 YMIN: 0.0000 YMAX: 8.2812 SD DATA FILE 8T50KDCE.DAT STDDEV INTO FILE 8T50KDCE.ICE Figure 4-3. A Typical DOC File 40 When RAWZCOOK executes. it asks for three file names: the raw data file. the DOC file. and the output data file. It then asks for the initial X. and X increment values. Now the X values are assigned to the data points. This allows the microcomputer to collect data with many different abcissa's. without the microcomputer having to worry about which was used to take the data. If the ionization signal from a 10 ppm Na solution were recorded. the initial X would be 10. and the X increment would be 0. If a wavelength scan of the Na D lines were done. X would be the starting wavelength and might be 588.5 nm. In the latter case. the X increment would be calculated from the dye laser scan rate. After writing the data to the DAT file. RAW2COOK displays the X and Y extremes. and writes them to the DOC file. ICING is the program which takes one or more DAT files and creates from them a single file. with the extension ICE. It also averages all the consecutive data points with the same X value into one point. and Optionally calculates the standard deviation of the Y value. When the standard deviation Option is chosen. this information is written to the output file in such a way that MULPLOT automatically draws standard deviation bars on the plot that it generates. 41 When ICING is run. it asks only two questions. The first is for the name of the output data file. The second is whether the standard deviation Option is desired. After these questions are answered. the program responds with the prompt 'Ice)’. The data file names which are to be combined to form the output file are then entered. one for each prompt. To end the program. a control-Z ( FORTRAN end of file mark ) is entered. All files do not need to be entered at one time. The data written to the output file are appended to the file. so a user can end ICING. then add more data files at a later time. The standard deviation option can even be turned on for portions of the ICE file. and off for others. A listing of ICING is in Appendix B. It is this software which provides the enormous flexibility in the microprocessor-boxcar integrator experimental system. over the boxcar integrator alone. The number of parameters that the user may vary increases the complexity of data collection. but by the proper selection Of these parameters. many hours of manual data reduction may be eliminated. CHAPTER 5 Boxcar Integrator Noise Reduction Introduction A critical test of any data collection system comes in using well behaved data (i.e. data for which the expected results can be predicted) to verify that the expected results are obtained. Because the signals which are Observed in laser ionization experiments are pulses that decay exponentially with time. this type of signal was chosen to test the system. An integrated circuit noise generator was used to add random noise to this signal. and the system's ability to discriminate against this noise was determined. Noise Reduction One reason for using a boxcar integrator is the signal-to-noise enhancement capability Of the integrator. The magnitude Of the enhancement can be expressed as the 42 43 ratio of the signal-to-noise ratio (S/N) of the output to the S/N of the input. This ratio is called the signal to noise improvement ratio (SNIR). The SNIR for the entire system can be calculated by multiplying the SNIR's of each portion of the system together. This system can be broken down into three sections. for SNIR purposes. The first SNIR is that due to the electronics in the Model 164 sampling integrator. The amount of improvement in this section is dependent on the integratiOn mode selected on the Model 164. In linear integration mode. the SNIR is simply the square root of the number of samples integrated. since the output value is the linear sum of the input values. This assumes that the noise present is truly random. white noise. In the exponential mode. however. the SNIR does not depend upon the number of points sampled. within the constraint that the total time the aperture is open exceeds 5 times the input filter time constant. The SNIR in this mode is: SNIR = SORT ( 2TC/AD ) (5-1) where TC is the input time constant. and AD is the aperture duration[18]. For example. if the time constant is 10 us. 44 and the aperture duration is 5 as. the SNIR of this stage is 2. The SNIR calculations are based upon the assumption that the noise present is white noise. A constant noise power spectrum allows the simplification of the SNIR equations by removing the boxcar integrator's frequency dependent amplitude transfer coefficient. and using instead the noise equivalent bandpass. When the noise source is not white. however. the variance of the output signal will be a convolution of the true noise power spectrum P(e) and the amplitude transfer function H(f). The equation for the variance is: ‘33 = I p(e)|n(r)l’ df (5-2) If the noise power spectrum is constant with respect to frequency. it can be removed from within the integral. The equation then becomes: ‘E3 = P(e) I H(f) 'df (5—3) 45 where the integral is defined as the noise equivalent bandpass (NEB) [19]. The NEB for a simple integrator is given by l/(2t) where t is the total integration time. For exponential mode integration. the equation for an RC filter holds. and the NEB is given by l/(4RC). where RC is the filter time constant. The amplitude transfer function for the boxcar integrator is not readily available. and it’s calculation is beyond the scope Of this work. The exact quantization of the effect of non-white noise upon the expected SNIR is not possible: an intuitive qualitative treatment is presented later. The second contribution to the total SNIR is from the output electronics of the Model 162 mainframe. The ratio at this point depends on the sampling rate of the Model 164 and the output time constant. A rough approximation for this is: SNIR = soar ( r‘ / f ) (5-4) 00 46 where fa is the sampling frequency. and fco is the cutoff frequency for the output filter. The cutoff frequency of this filter is related to the time constant by: fco = 1 / ( 2 n TC ) (5-5) If the time constant is 0.1 second. and the sampling frequency is 20 Hz. the cutoff frequency is 1.6 Hz. and the SNIR would be 3.5. The final contribution to total SNIR comes from the data averaging performed by the microcomputer and minicomputer. When N data points are averaged into one data point. the SNIR is the square root of N. When the system is controlled by the microcomputer. large numbers of data points can be collected. and the major contribution to the final SNIR will come from this data averaging. The total SNIR will be limited by any noise introduced between the boxcar integrator output and the microcomputer data averaging step. One source for noise at that point is the noise added by the analog-to-digital conversion process. The amount of this noise is determined by the resolution of the ADC. the value being the smallest resolvable voltage of 47 the ADC divided by the square root of 12 [20]. If the noise contributions from other portions of the system are smaller than this conversion noise. than this will be the limiting factor in increasing the S/N of the system. If the domain conversion is the primary noise source. an ADC of higher resolution can be used to lower the conversion noise. Because the statistical treatment of noise depends on that noise being random and white (equal noise power density at al frequencies). it would be nice to have a simple random noise generator. This function is provided by the National MM5837 noise generator chip[21]. The MM5837 is a pseudo-random noise generator. which consists of a 17 bit shift register. and an exclusive-or gate to generate the input to the shift register from two of the bits Of the register. As the shift register has only a finite number of states. the output of the 5837 must repeat. The number of states for the 5837 is so large. however. that the minimum repetition period is 1.1 seconds. Experimental The schematic for the source of the test signal is 48 shown in Figure 5-1. The exponential decay is taken from the charging curve of the timing capacitor for an NE555 timer circuit. By use of 1C2. 1C3. and 1C6. this charging curve is converted to an exponential decay that varies from -10 millivolts to O millivolts. The noise generated by the 5837 is first passed through C3 to remove any DC bias. then through a filter formed by IC5 to cut off extremely high frequencies. The amount of noise added to the signal is set by R7. and a variable DC offset is provided by R10. The square wave output of the NE555 is used as the trigger source for the boxcar integrator. During the course Of the experiment the aperture duration was set to 5 us. the input time constant was 10 us. and the output time constant was 0.1 second. Both A and B channels were set to external scan mode. and the scan range was 50 ms. The input circuit was set to 50 O impedance. DC coupled. The front panel SB delay control was adjusted so that the overlap light remained unlit. The software was set so that 30 repetitions of the input signal Occured for each data point taken. One hundred data points were taken before the data were saved on the minicomputer. For the data taken in exponential mode. RESADP was set to zero. For the linear mode. the integrator had to be cleared after each data point 49 ooueom camoz \heoon unannouonum ugh .Hln ouemfim . unease—— neoouuk ’ 0.. n a «u. .o g _ 0 man «o o u «u .u~ _ n No. no. a . soc. _ an n «2 ..--—u I a . as “K OI a“ a“ see. so. am . o.m m.+ p .. a. + .nm sausao - .aco.m acoo.o see. c an“ 306' oz flood U . a so. a: no 2 «.2 .. o2 AMV no nnoc.a 50 to prevent overflow. and RESADP was set to 1. The SNIR of the system was determined for both modes of integration. In each case. 30 repetitions of the signal were integrated to generate one data point. and 100 data points were collected by the microcomputer. This process was repeated 5 times for each Of three different measurements. One measurement delayed the aperture until the lowest point of the decay curve. which was used as a baseline value. The input signal was adjusted until this point was at zero volts. The second measurement was at the lowest aperture delay possible on the range that included one entire cycle of input signal. This value was used as the signal level in the S/N calculations. The final measurement was taken at the same aperture delay as the second. with the addition of approximately 50 mV p-p noise. This provided the noise value. The entire decay curve was also observed. using the time resolved scan function of the boxcar integrator. controlled by the microcomputer. A photograph of the oscilloscope output of the exponential decay is in Figure 5-2a. Figure 5-2b is the Immwmmll llmwmmmm mum a 52 same signal. with the addition of the 50 mV p-p noise. As can be seen in Figure 5-2b. the noise almost obliterates the desired signal. Figure 5-3 is the recovered signal for the signal with and without noise. The earliest available point on the decay curve was used as a test point to determine the system's SNIR. The boxcar integrator limited this point to 9S of the aperture delay range. or 4.5 ms. For the linear integration mode. the SNIR of the input circuit should be V30. The repetition rate of the signal was 28 Hz. but because the aperture delay range was longer than one cycle of the signal every other cycle was ignored. making the sampling frequency 14 Hz. The output filter SNIR is then (II47I76. The SNIR due to signal averaging should be 500. The total SNIR should be J33 t J14/1.6 - Jso . or 349. To determine the true SNIR for the system. the following procedure was used. First. each set of 100 data points was averaged. to give an average value and the standard deviation for each point in the set. The five average values obtained were then averaged into one final value. and the standard deviation of each of the five points was calculated from the five points themselves. The standard deviation of the final average value was calculated by improving the standard deviation of the five points by 53 ofloz can 63% 33030 .mlm 235 A25 .38 Rate? 3 ca 0 —»PPE..FPFRL_PL.»..b—p.pL.»br.FLPPE.._-p— 2.... .2. a . 3:... cz .. (Aw) Kym: an.” 54 [7. To help verify the final standard deviation value. the final standard deviation was also calculated from the standard deviations of each of the original data points. This was done by improving the average standard deviation of each of the points by ([500. since 500 points were averaged overall. In only one case did this give a different value than that derived from the preceding method. and in that case the value provided by the second method was used. The results for the linear and exponential mode are shown in Table 1. The value of the signal was determined by subtracting the baseline value from the value of the signal without noise. The noise on the signal is the standard deviation of the difference between the values for signal with and without noise. Dividing the signal value by the noise value gives the S/N ratio. which for the linear mode is 217. The noise on the input signal was approximately 50 mV p-p. Since there is a 99S probability that the RMS noise value is within 2.5 standard deviations of the mean (in this case. zero)[22]. the standard deviation (or RMS noise value) is one fifth the peak to peak. or 10 mV. The signal level at the point measured on the decay curve was 10 mV. so the Table 1. Baseline Signal Signal+Noise S N S/N SNIR SNIR (calc) 55 M09; inear 0.915 1.001 6.33 1.001 6.09 1.050 5.41 0.025 217. 217. 349 Observed Data and Calculated SNIR Values Egponengial 0.0884 1.0003 1.07 1.0004 1.08 1.013 0.99 0.0067 147. 147. 127. 56 SIN ratio for the input signal was 1. For the linear integration mode. the SNIR is then 217/1. or 217. The theoretical value for the SNIR was 349. The possible causes for this discrepancy are discussed later. The theoretical SNIR for the exponential mode depends upon the time constant Of the input. and the aperture duration. For this work. the time constant was kept at 10 us. and the aperture duration was 5 us. This leads to an expected SNIR for the input electronics of 2. Combined with the following SNIR's. the total SNIR of the system in exponential mode shoud be 127. Using the same procedure as for the linear mode. the the calculated S/N ratio for the exponential mode was 147/1. giving an SNIR of 147. Discussion The first important result is the standard deviation of the points with no noise added. Because the analog signals from the boxcar integrator are first converted to the digital domain. there will be a certain amount of noise added to the signal from the conversion process. The collection of the linear mode data was done by using the 10V full scale range of an 8-bit ADC: the smallest step is 0.04 V. Each point taken had 0.04/\fIE. or 0.012V added to the standard deviation. and the final average would have 57 0.012/ JSOO. or 0.0005V added. The observed standard deviation is larger than this. which would indicate that the noise introduced in the system due to the quantization process is not the primary source of noise. Since the voltage levels observed during the use of the exponential mode were so small. the DAC was switched to 2.56V full scale. The resolution was then 0.01V. and the added noise to the final average should be 0.0001V. Once again. this is smaller than that observed. which leads to the conclusion that the quantization process is still not the largest source of noise. Because the noise from the ADC is smaller than the current system noise. the inclusion of a 12-bit ADC in the system should not greatly improve the S/N of the system. When laser ionization signals are observed. the system noise is expected to increase. due to the radio frequency noise present from the laser discharge. One early worry in the design of this system was that the use of an 8-bit DAC to drive the external scan of the boxcar integrator might lead to a jitter in the time resolution of the data. The fact that the noise on the signal at an early point on the decay. where the signal changes the fastest. is the same as the noise at a later point on the curve indicates that this jitter is negligible. If the other contributions to the system noise can be 58 reduced in the future. some jitter may be exposed. but at the present time none is seen. There are 2 main reasons that the experimental SNIR values vary from the theoretical. The first deals with the method of measuring the noise on the input signal. The amplitude was estimated from an oscilliscope display by observing the maximum peak-to-peak variation in the noise display. The level of noise was adjusted so that it was approximately 50 mV p-p maximum. This level is only a rough approximation to provide a S/N ratio for the input close to 1. It is more important that the noise level remain constant during the course of the experiment. so that any comparison between modes may be accurate. The level control was not adjusted after the level was set: the presence or absence of noise was determined by connecting or disconecting the noise source. If the signal to noise value for the input signal was wrong. it would yield the same relative amount Of error in both SNIR's. so clearly this must not be the only source of error. The second source of error is the noise source itself. The approximations used to calculate the SNIR for the input module depends on the frequency spectrum of the noise having a constant power density. Also. the noise spectrum should not extend beyond 1/(2AD) Hz [18]. For an aperture duration 59 of 5 us. the cutoff frequency should be 10 kHz. In order to determine the frequency spectrum of the noise a Federal Scientific Ubiquitous Signal Analyzer Model U-14a was used[23]. The photograph in Figure 5-4 is a picture Of the frequency spectrum of the noise source. The x axis is in units of frequency. with the Observed trace going from 0 to 10kHz. The y axis displays power density. and the spikes on the signal are markers placed every 1 kHz. Zero output is located on the first division from the bottom. Clearly. the amount of noise above 10 kHz is minimal. Also it can be readily seen from Figure 5-4 that the noise is not white. A numerical correction to the calculated SNIR is not available. but the direction of the error can be explained. The calculated SNIR for the linear integration mode is a factor of 2.7 larger than that calculated for the exponential mode. The Observed SNIR is only 1.5 times as large; the discrepancy arises in the input module. The signal that passes thru a filter or integrator is proportional to the reciprocal of the noise equivalent bandpass. The noise is inversely prOportional to the square root of the NEB. The S/N is then inversely prOportional to the square root Of the NEB. The NEB for the integrator in linear mode is 1/2t where t is the total integration time. 60 Figure 5-4. The Frequency Spectrum of the Noise 61 Thirty samples were integrated. each sample was 5 as long. The NEBI is then 1/(300x10’5 s). or 3.3 kHz. In exponential mode. NEBa is 1/4TC. where TC is 10 us. The NEBo is 25 kHz. The ratio of the S/N ratio for the linear mode to the S/N ratio of the exponential mode is 2.7: it is here that the factor of 2.7 seen in the final SNIR's appears. The preceeding discussion depends upon the noise source being white. but it is the basis for understanding the pink noise correction. Because there is less total noise in the noise power spectrum than the calculations require. the observed SIN ratios should be higher than those calculated assuming white noise. The fact that the observed SNIR is less than the calculated SNIR for the linear mode is due to the inaccuracy in measuring the initial noise added to the signal. Because the noise bandpass for the linear mode is much smaller than that for the exponential mode. the actual noise power spectrum deviates from white noise less for the linear mode than for the exponential mode. The increase in S/N ratio will not be a great as for the exponential mode. where the noise deviates more from white. The proportionally greater increase in the exponential S/N ratio will cause the observed ratio between exponential and linear SNIR to be less than 2.7. In this work. the observed ratio is 1.5. The Observed deviation of the SNIR from the calculated value of 349 in the linear mode is due to the 62 measurement of the noise superimposed on the input signal. but the relationship between the Observed SNIR's is explained. The noise power spectrum could be corrected by changing the filter circuits. as the output of the 5837 without any filtering has the spectrum shown in Figure 5-5. The peaks at every 5 kHz are produced by the spectrum analyzer as reference points. the peak at 48 kHz is believed to be due to the internal clock of the 5837. The specifications of the 5837 list the half power frequency at a minimum value of 26 kHz; the actual -3 dB point is at approximately 21 kHz. Conclusions From the data presented. the microcomputer-boxcar integrator interface and the software to control it perform the functions they were designed to perform. The use of a low resolution DAC as the scan source does not introduce any apparent noise in measuring data that involve high rates of change for small differences in aperture delay. The noise reduction capability of the boxcar integrator. even though not totally quantifiable. is able to extract a signal buried beneath large amounts of noise. One data collection method in this experiment used the 63 ~13 On 3 0 ES... 88.00% 8.2 Ramos... .ml... 8:9... A u: v mucus—OE... .0805 .0000“ .o 3....:...._::..4.....:.j:.::.:.2......I rIII.IIII...II._.II.....II......II._.III.IIII.III...III _ . _ . . _ . . _ . u ..III.I..I:.II.....III.II..I...II...III.IIII.I..I4III.. .... I.I.......III..-II...IIII...II.III...I...II......I-_.III1 . _ _ _ . . _ . _ _ I ..I .IlIIIII+I.....TIII.II..+.....I.|...II.I..I+II|1 _ . . . . . . _ _ _ n .... .III...11......II........I_III.IIII.IIII.II.....IIII rill? ILIIIEIIIFIILIIIEIII.IIILIIIFIIIJ . . . . . _ . . . . n III......I|.III..III.IIII_IIIAIII.I..II.II..4III.. IIIrII .I Ikl..|.....II_III._.III.I..II_III._.IIII . . . . _ _ . . .1. III II III IIITIII.....I+III.III...II..+III.. .. IIIIII III.II _III.III|..III_IIII.III...III.. _ . fl. . . . . . . 1 ..|II_IIILI..I III II II +IIITIILIII+IIJ . _ _ . , . _ . . . IIIIIIII _ III..-III.II......III III II I , _ rlll_llll_lll.rllIFIILIIIFIIIFIILIIIFIII o.— 0.. Em. ( sloqpci 0L): ) £18an JaMOd 64 linear summation mode of the boxcar integrator. Using this mode of the boxcar integrator without the microcomputer interface would be very difficult. since the number of points collected has to be known. The use of this mode with the microcomputer will allow for the observation of lower level signals. with higher resolution. CHAPTER 6 Decay of Sodium Ion Populations Introduction The DLI experimental system consists of four parts: the nitrogen pump laser. a tunable dye laser. the atomization system. and the ion detection system. Probes having a DC bias impressed upon them are placed in the flame to capture the ions and electrons produced by the laser-induced ionization of the analyte atoms. Because the nitrogen laser is pulsed. the tunable dye laser is also pulsed. as is the observed ionization signal. Since the pulse length of both lasers is small (5-10 ns). and the time between pulses is large (10-30 ms) the flame can be treated as a static system. with periodic perturbations provided by the laser pulses. As with any such relaxation technique. there are two types of measurements that can be made. The first. and probably the easiest. is the measurement Of the height of 65 66 the peak produced by the perturbation. In the DLI/LEI system. this magnitude depends upon the number of ions formed: the number of ions produced depends upon the concentration Of analyte in the sample solution. Other work on the DLI system in this laboratory [24] has shown that the relationship between peak height and analyte concentration is linear over several orders of magnitude. The peak height does not provide much information about how the system returns to equilibrium. To obtain this information. the signal behavior versus time is studied. A boxcar integrator is used to study the signal intensity at various times after the nitrogen laser pulse. and the time domain behavior Of the signal may be Observed by plotting signal intensity versus the aperture delay time of the boxcar integrator. Other work being done in this laboratory [25] uses the decay time of the signal to match a theoretical model for ion/electron migration in the flame to experimental results. and to calculate the temperature of the flame. Ion migration. the movement of ions due to an applied field within the flame. is one measurement that requires the determination of the decay time r of the ionization signal. The equation relating t to the voltage applied to the probes. the distance between the probes. and the mobility 67 is: t = L3 / piEp (6.1-) where L is the distance between the probe and the ionization region. pi is the mobility of the ion. and Ep is one half the applied potential to the probes. The mobility of sodium ions in the DLI flame has been shown to be on the order of 20 cm3v_.’-. [11' Other parameters also affect the decay time of the ionization signal. One such parameter is the rate the ions are withdrawn from the flame. As the ions are removed more quickly. the time it takes for the ions to reach the probes (migration rate) will begin to affect the signal. At very low currents. the voltage generated across a resistor in series with the high voltage supply to the probes depends only on the total charge generated within the flame. and the flame acts as a capacitor. when considering the rate of decay of the ionization signal. At relatively high currents. the voltage Observed depends only on the amount of charge arriving at the probe at that time; the depletion of charge giving an exponential decay. At currents in between. the observed signal will be a convolution of both effects. 68 Because the amount of current drawn from the flame depends upon the size of the resistor in series with the power supply. or the effective load resistance of a current-to-voltage (i/V) converter. at low resistances the decay time will be independent of the load resistor. Previous work done in this laboratory [1] using a simple load resistor has shown this to be true. In order to assist the boxcar integrator in noise reduction. and to reduce DC baseline offsets. the collection circuit was changed from a simple resistor to a 30 kHz high pass filter. A buffer amplifier was also included to allow the signal transmission line from the flame to the boxcar integrator input to be a low impedance line to help reduce noise pickup. Because of these changes. it became necessary to verify the correct operation of the new collection circuit. Experimental The DLI experimental system has been described in detail elsewhere [1]. and only a brief description will be given here. A nitrogen discharge laser [26] provides 337 nm radiation to pump a Hlnsch design tunable dye laser. The output of the dye laser is focused into a laminar flow hydrogen-oxygen-argon flame. which has an outer mantle flame 69 to provide a constant temperature radially across the flame. A portion of the nitrogen laser pulse is also focused into the flame. colinearly with the dye laser pulse. Nichrome or iridium wire probes are mounted on translation stages. and positioned in the flame so that the negative probe is directly beneath the region where ionization is to be observed. and the positive probe is one or two cm above that region. The instrumental parameters are shown in the documentation file in Figure 6-1. The boxcar integrator was set to exponential mode. with DC coupling. and a 1 MO input impedance. Because the aperture delay range was 10 us. the aperture duration was reduced from the usual 5 as to 0.5 us. Results In the newly designed collection circuit. the resistor of the 30 kHz filter served as the passive i/V converter. To keep the filter cutoff frequency constant. the capacitor was changed as the load resistor was changed. Along with changing the load resistance. this circuit also changed the observed decay times of the signals. The observed times varied from 1 to 12 us. exhibiting a marked dependence on the load resistor. There was also a very long time constant 70 PARENT RAW DATA FILE IS: 8T50KDCE BUFFER START: 16896 END: 17716 INTERRUPTS PER DATA POINT: 10 RESET AFTER DATA POINT: NO START OF SCAN: 0 LENGTH OF SCAN: 200 SCAN INCREMENT: 5 POINTS PER SCAN INCREMENT: 10 >>) Boxcar parameters (<( Aperture delay section 1) SInitial A: 2) SInitial B: 20S 3) Range: 10 microseconds Aperture section 4) Duration: 0.5 microseconds 5) Scan time: Time constants section 6) Boxcar: 0.1 second 7) Model 164: 10 microseconds 8) Comments: Time resolved Na New ckt 9) 50k load DC coupled 1 M Exponential DATA FILE WRITTEN: 8T50KDCE.DAT XMIN: 2.0000 XMAX: 9.8120 YMIN: 0.0000 YMAX: 8.2812 SD DATA FILE 8T50KDCE.DAT STDDEV INTO FILE 8T50KDCE.ICE Figure 6-1. The Experimental Parameters 71 added to the signal. giving a slow return to the baseline which was not reached even at long aperture delays. After examining this circuit. a replacement circuit was designed [27]. This circuit is shown in Figure 6-2. The effective load resistance is determined by the selection of the resistor in the voltage divider in the feedback loop. The 30 kHz filter is fixed between the i/V converter and the output buffer. A switch is placed across the capacitor in the filter to allow easy removal of the filter. and DC coupling of the signal path. The decay noticed at times longer than 5 time constants was not removed by the use of this circuit. Changing the input coupling of the boxcar integrator to DC did remove this last added time constant. The results obtained using the new circuit. with DC coupling. are shown in Figure 6-3. The aperture delay range of all but Figure 6-3e is 10 as. that of Figure 6-3e is 50 as. Discussion Upon inspection. it is clear that the time constants for the ionization decay for the three lowest load resistances are the same. These constants RIO: 72 eueeeuo ceaseeuaeu one .uue eeenum cod see m.s e scam .e sou N soc. .u D. son .0 e a no. .2 e an .e a new caoc. co. «m cams co. _ <.m .o ’ >I+ soc" Intensity (MI) 0.9 2.0 IO 6.0 4.9 2.0 0.0 73 0) 4 4 4 ..\/\/\/\ /—\L~- [A \\ \ 4 V"\/ V v r I r ' I 'T I v v ' 1 2.0 «0 6.0 no 100 4 \ 4 I\ .1 l 4 4 V/\ —4 fi 1 ’\\ / ,1 A 4 l”'\ _ f / / \‘r‘ ‘ \F\_ / \\’l \/ I ' I r tv I r 1 r . i 20 40 6.0 80 10L q . c) d .1 d d .1 d d - - I! g—\ I l ' 1 ' I ' I ' l ' I l 2.0 40 0.0 0.0 no Aperture Delay ( pa ) 0.0 "l 6.0 -‘ 4.0 - O'O'I'Tff Tfif‘t'tri 2.0 4.0 6.0 8.0 100 e) 7.5 5.5 3.5 ‘05 'TYTW‘Y'WYT' 10 13.0 erTYY‘rYTIW 2.30 YVITWY'IYYYYIYj Figure 6-3. Time Resolved Sodium Decay with Varying Load Resistors. a) 5 k b) 10k c) 50k d) 100k 0) 500k 74 Load Resistance Decay Time 5 k0 1.1 as 10 k0 1.1 as 50 k0 1.2 as 100 k0 >1.2 us 500 k0 5.0 us It appears that the time constants for the higher load resistances are longer; however. problems begin to occur with 100kO and larger load resistances. Measuring the decay time at different portions of the decay curve gives different decay times; the decay time towards the end of the decay approaches 1.2 as. The problem is more apparent in the decay curve for the 500 k0 load resistor. What appears to be the beginning of the ionization pulse at 3 us aperture delay is really a remnant from the noise pulse that appears on the signal at the instant of laser pulsing. This noise pulse generates a damped sine wave signal superimposed upon the ionization signal. As the circuit gain goes up ( i.e. larger load resistances ) the length of the ringing signal increases. It is this ringing that causes the odd shape of the decay curve for the 100k0 load resistor. and it’s presence also prohibits the observation of times earlier than 2 us for the lower load resistances. This ringing is triggered by the discharge in the nitrogen laser. and is generated in the collection circuit electronics. Bypass capacitors. and 100 O resistors have 75 been used in the circuit to try large amounts are still present. to determine spark gap when, reached on the capacitors within electrodes did not eliminate it. As the i/V converter gain is reduced. the system goes down. has been introduced after the i/V present in the the gain of the signal would also the S/N ratio would be the same. longer aperture delays is reduced by integrator at 50 0 input impedance. the collection cable between integrator as an antenna for RF noise. input impedance is limited to higher level signals. because the introduction of two output of the buffer amplifier to limit and reduces resistive divider network. it's former value. Equation 6-1 can be rearranged mobility of the sodium ions in the probe is positioned by raising the the laser. converter. signal directly off the probes. decrease In practice. Operating circuit 100 O to reduce this ringing. but The nitrogen laser uses a the prOper voltage has been and cleaning the in this spark gap helped reduce the ringing. but the S/N ratio of This would be observed if the noise If it were decreasing the noise. and the noise at the boxcar which would point to the and the boxcar The use of the 50 0 though. resistors in the ringing creates a the signal to 1/5 of to solve for the flame. The negative probe towards the 76 ionization region until the dye laser strikes the probe. The probe is then lowered slightly. This method allows the negative probe to be placed in the closest possible proximity to the ionization region. When adjusted in this manner. the probe is approximately 0.5 mm from the ionization region of the flame. This measurement is only approximate due to the difficulty in forming a perfectly straight probe from the nichrome wire stock. The potential applied to the probes was 100 V. The mobility is then on the order of 40 cm’v-1‘-1' This is larger than that obtained previously. One reason for the difference between present and past work is that the gas flow rates for the flame have been changed. and the temperature of the flame will affect the ionic mobility. Conclusions The evidence shown herein would indicate that the current data collection electronics do not seriously interfere with the Observation of time resolved ionization decay signals from the DLI system. The restriction imposed in DC coupling the entire system does not seem detrimental to the data collection process. Careful attention must be paid to experimental parameters in order to discriminate against the noise generated by the nitrogen laser. 77 The measurement Of peak heights in quantitative analysis with the DLI system is not affected by the factors influencing the time decay measurements. Any effect seen in the peak height should be seen in all of the peaks observed in the same amount. If this were not the case. the high degree of linearity now observed would not be seen. CHAPTER 7 Future DevelOpments The use of the microcomputer controlled boxcar integrator. even though much easier than control of the boxcar integrator by hand. has several limitations. These limitations are present in both the. software and the hardware. The software is currently limited by the use of assembly language. and a cross-assembler. Even though assembly language can give code which will execute faster than that generated by higher level languages. the time required to re-assemble and download the code after every minor correction is extremely large. The current Operating system (SLOPS) does not allow the creation of functions from the keyboard: that is. every Operation must be programmed. The FORTH language can solve two of these problems. An internal compiler allows the definition of new commands from the keyboard. Minor changes in higher level commands can also be made directly from the keyboard. FORTH is currently 78 79 being installed on the DLI microcomputer. There are also some improvements that can be made to the hardware. Even though the resolution of the ADC used is high enough that the domain conversion process is not the primary source of noise. the cost of a 12-bit ADC is low enough that one should be used. The use of a one-chip ADC will also remove the A-to-D conversion burden from the software. and increase the speed of the conversion. Experiments also being done involve the wavelength scanning of the dye laser. The tuning element for the dye laser is a Heath monochromator. with the grating mounted so that the laser radiation is diffracted from it. The scanning function is still controlled by the manual controller. If the monochromator were controlled by a microcomputer. experiments that require wavelength scans. or detuning from the central wavelength could be controlled entirely by the microcomputer. One problem anticipated is the large amount of RF noise that will be in the area of the control circuit. The monochromator is placed next to the nitrogen laser. an excellent RF source. and the source of much of the noise in the rest of the system. The improvements listed here are such that they can be accomplished concurrently with other projects. The highest 80 priority of these is the change of language. and this change will involve re-writing the microcomputer software. APPENDICES OOOOOOOOOOOOOGOOG G 0000 APPENDIX A Listing of Rawzcoox PROGRAM RAW2COOK CONVERTS RAW DATA FROM THE MICRO INTO A MULPLOT COMPATABILE FILE. AND A DOC FILE WHICH CONTAINS INSTRUMENTAL PARA- METERS AND AN AUDIT TRAIL OF DATA MANIPULATIONS. 7-MAY-1981 JOHN D STANLEY DEPT OF CHEMISTRY MICH STATE UNIVERSITY SET UP DATA AREAS BYTE CMDLIN(80).FILES(32.10).FLAGS(10.10) BYTE BUFF(512).DOCFIL(32).DATFIL(32) BYTE RAWFIL(32).RD(2).SPACE BYTE PSTR(35.13).IPDPT.RESADP.LSCAN.SCNINC BYTE STSCAN.PPSCNC BYTE BYT(2) INTEGER ITABLE(96).DBUFF.BUFFE.CBASE INTEGER BUFF2(256).DOC.DATA REAL’4 X.Y.XINC.XMIN.XMAX.YMIN.YMAX.TEMP.DAC THESE EQUIVALENCES SORT PARAMS FROM BUFF EQUIVALENCE (PSTR(1.1).BUFF(23)) EQUIVALENCE (DBUFF.BUFF(1))e(BUFFE.BUFF(3)) EQUIVALENCE (IPDPT.BUFF(5)).(RESADP.BUFF(6)) EQUIVALENCE (CBASE.BUFF(7)).(LSCAN.BUFF(9)) EQUIVALENCE (SCNINC.BUFF(10)).(BUFF(1).BUFF2(1)) EQUIVALENCE (PPSCNC.BUFF(13)).(STSCAN.BUFF(11)) 81 0000000 GOOD GOO GOO GOO GOO 000 C C C 82 EQUIVALENCE (IWORD.BYT(1)) esseeseeeeeeeeeeeeeeseeeeeeeaseseeeeeeeeeeeeeeeeeeeeeesees BEGIN CODE INITIALIZE EXTREMA VARIABLES XMINB 100000. YMIN= 100000. XMAX=-100000. YMAX--100000. AND MULPLOT DATA TAGS RD(1)='R' RD(2)='D' SPACE=' ' SET UP LUN INFORMATION DOC=2 DATA=3 TTY=5 GET MCR COMMAND LINE CALL GETMCR(CMDLIN.NUM) PARSE OF FILE NAMES PARSE RETURNS FILE NAMES FROM CMDLIN TO ARRAY FILES CALL PARSE(CMDLIN.FILES.FLAGS) COPY FIRST FILE PARSED INTO RAWFIL CALL COPY(FILES(1.4).RAWFIL.32) IF NO FILE NAME THERE. ASK FOR ONE IF (RAWFIL(1) .NE. 0) 00 T0 2 1 WRITE(5.1000) 1000 FORMAT('/RAW FILE T0 c00x: ') READ (TTY.1010.ERR-1.END=999)RAWFIL 1010 FORMATt32Al) SIMILAR TO RAWFIL ACTION ABOVE 2 CALL COPY(FILES(1.2).DATFIL.32) IF (DATFIL(1) .NE. 0) GO TO 3 WRITE(TTY.1020) 1020 FORMAT('fDATA FILE TO WRITE: ') READ (TTY.1010.ERR=2.END=999)DATFIL 000 006 600 C C C C C 83 3 CALL COPY(FILES(1.3).DOCFIL.32) IF (DOCFIL(1) .NE. 0) GO TO 4 WRITE(TTY.1030) 1030 FORMAT('fDOC FILE TO WRITE: ') READ (TTY.101O.ERR=3.ENDB999)DOCFIL REMOVE CONTROL CHARS AND CR'S 4 CALL ZEREND(DATFIL) CALL ZEREND(DOCFIL) CALL ZEREND(RAWFIL) OPEN THE FILES CALL UNFORM(0.IERR.ITABLE.RAWFILE.O.3.1) IF (IERR .LT. 0) GO TO 800 OPEN (UNIT8DOC.NAME=DOCFIL.TYPE='UNKNOWN'e 1 ACCESS='APPEND'.ERR=810) OPEN (UNIT-DATA.NAME=DATFIL.TYPE='UNXNOWN'. 1 ACCESS='APPEND'.FORM='UNFORMATTED'.ERR=820) GET X AXIS VALUES 10 WRITE(TTY.1100) 1100 FORMAT('fX VALUE OF FIRST POINT: ') READ(TTY.1110.ERR=10.END=999)X 1110 FORMAT(F10.4) 11 WRITE(TTY.1120) 1120 FORMAT('/X INCREMENT: ') READ(TTY.1110.ERR-11.END-999)XINC 12 WRITE(TTY.1125) 1125 FORMAT('/DAC Voltage: ') READ(TTY.1110.ERR=12.ENDB999)DAC DAC IS CONVERSION OF NUMBERS FROM ADC TO VOLTAGE DAC=DACI256. COCO COO C C C 84 GET FIRST BLOCK OF DATA INSTRUMENT PARAMS CALL UNFORM(1.IERR.ITABLE.BUFF.512) STORE STUFF IN DOC FILE AS ASCII 2010 2020 2030 2040 2050 2060 2070 2080 2090 2099 NOW 20 3000 3010 WRITE(DOC.2010)RAWFIL FORMAT(lX.'PARENT RAW DATA FILE IS: WRITE(DOC.2020)DBUFF.BUFFE FORMAT(' BUFFER START: '.I6.’ END: BYT(1)-IPDPT BYT(2)=0 WRITE(DOC.2030)IWORD FORMAT(' INTERRUPTS PER DATA POINT: TEMP='NO' IF (RESADP .NE. 0) TEMP='YES' WRITE(DOC.2040)TEMP FORMAT(' RESET AFTER DATA POINT: WRITE(DOC.2050)CBASE FORMAT(' CURRENT BASELINE: BYT(1)=STSCAN WRITE(DOC.2060)IWORD FORMAT(' START OF SCAN: BYT(1)=LSCAN ‘ WRITE(DOC.2070)IWORD FORMAT(' LENGTH OF SCAN: BYT(1)=SCNINC ‘ WRITE(DOC.2080)IWORD FORMAT(' SCAN INCREMENT: BYT(1)=PPSCNC WRITE(DOC.2090)IWORD FORMAT(' POINTS PER SCAN INCREMENT WRITE(DOC.2099) FORMAT(' ') ADD BOXCAR PARMS DO 20 I=1.13 '.32A1) '.16) '.I6) '.A4) '.16) '.I6) '.16) '.16) : '.I6) WRITE(DOC.3000)(PSTR(J.I).J=1.32) CONTINUE FORMAT(3X.32A1) WRITE(DOC.3010)DATFIL FORMAT('DDATA FILE WRITTEN: '.32A1) 85 c eeeaesaeeeeeeeeeeaaeeeeeeseeeeeaeseeeassessesseeseeeess C NOW WRITE DATA FILE C C ICOUNT IS NUMBER OF POINTS WRITTEN C INUM IS NUMBER TO WRITE C INUM=((BUFFE-DBUFF)/2) IF ( INUM .LE. 0 ) GO TO 600 ICOUNT=0 C . C. SAVE DOCFIL NAME IN DATA FILE C WRITE(DATA)SPACE.DOCFIL C C GET BLOCK OF DATA C 100 CALL UNFORM(1.IERR.ITABLE.BUFF.512) IF (IERR .NE. 0) GO TO 700 C DO 110 I=1.256 C C LOOK AT TWO BYTES OF DATA AS INTEGER‘Z WITH BUFF2 C THEN CONVERT TO REAL NUMBER C Y=FLOAT(BUFF2(I)) C C CORRECT FOR FLAGS C DOXINC=0. C C IF Y < 0 THEN BASELINE FLAG SET C IF (Y .LT. 0.) Y=Y+32768. C C IF Y ) 29‘15 THEN SCAN INCREMENT C , . IF (Y .LT. 16384.) GO TO 105 C C INCREMENT X NEXT POINT C . Y-Y-16384. DOXINCBl. C C CORRECT NUMBER TO VOLTAGE C 105 YBDAC‘Y C C CHECK EXTREMES C IF(X .GT. XMAX) XMAX=X IF(X .LT. XMIN) XMIN=X 000 86 IF(Y .GT. YMAX) YMAX=Y IF(Y .LT. YMIN) YMIN=Y WRITE UNFORMATTED DATA 110 600 6000 WRITE(DATA) RD.X.Y ICOUNT=ICOUNT+1 IF(ICOUNT .EQ. INUM) GO TO 700 X=X+(XINC*DOXINC) CONTINUE GO TO 100 WRITE(TTYe6000) FORMAT(' Warning - empty data file ...') 87 C C NOW EXIT GRACEFULLY C 700 CLOSE (UNIT=DATA) C WRITE(DOC.4000)XMIN.XMAX 4000 FORMAT('E XMIN: '.F10.4.' XMAX: '.F10.4) WRITE(DOC.4010)YMIN.YMAX 4010 FORMAT('E YMIN: '.F10.4.' YMAX: '.F10.4) C CLOSE (UNIT-DOC) C WRITE(TTY.4000)XMIN.XMAX WRITE(TTY.4010)YMIN.YMAX C C ALL DONE. BYE BYE C CALL EXST(1) c eseeaeseeesseeeeeaseeeseesasseseesesesaeaseeessseasssas C ERROR EXITS C 800 WRITE(TTY.8000)RAWFILE 8000 FORMAT(' ERROR IN OPENING : '.32A1) STOP C 810 WRITE(TTY.8000)DOCFIL STOP C 820 WRITE(TTY.8000)DATFIL STOP C C BYE. EOF DURING TTY READ C 999 CALL EXST(O) END CCCOOCC COCO CCC APPENDIX B Listing of ICING PROGRAM ICING A PROGRAM TO TAKE DAT FILES AND AVERAGE THE DATA POINTS WITH THE SAME X VALUES INTO ONE X VALUE. AND GIVE SD INFO TOO. PROVIDE (1001 DATA POINTS REAL ARRAY(1000) LOGICAL EOF.NODOC.SDOFF.CMDLIN BYTE DATFIL(32).DOCFIL(32).OUTFIL(32).GRUNGE.SDINP BYTE INLINE(80) INTEGER RD.FN.DM.COUNT.TTY.DOC.DAT.OUT DEFINE LUNS TTY=5 DOC=3 OUT=2 DAT=1 DATA TAGS RD='RD' FN='FN' SET NO INPUT COMMAND LINE CMDLIN=.FALSE. CALL GETMCR(INLINE.ILEN) IF (ILEN .LT. 1) GO TO 1 CMDLIN-.TRUE. NOW PUT INLINE INTO ALL THREE FILE NAMES DO 6 I=1.ILEN J-I+4 DATFIL(I)=INLINE(J) 89 CCO C C C C C C C OCC COO COCO 6 9O OUTFIL(I)=INLINE(J) CONTINUE STRADD ADDS STRl TO STR2 GIVING STR3 1 1000 1 CALL STRADD(DATFIL.'.DAT'.DATFIL) CALL STRADD(OUTFIL.'.ICE'.OUTFIL) IF (CMDLIN) GO TO 7 WRITE(TTY.1000) FORMAT(lX.'Data icing program. ver 1.3'/ 'IOutput file name:') GET OUTPUT FILE NAME 1010 7 READ(TTY.1010.END=900)OUTFIL FORMAT(32A1) CALL ZEREND(OUTFIL) OPEN OUTPUT FILE. IF NOT PRESENT. CREATE vwaI-A OPEN(UNIT'OUT. NAME=OUTFIL. TYPE='UNKNOWN'. ACCESSB'APPEND'. ERRB910) SDOFF=.TRUE. IF CMDLINE ENTERED. SKIP THIS QUESTION IF (CMDLIN) GO TO 11 ASK IF SD BARS WANTED. 1011 1 1012 1. WRITE(TTY.1011) FORMAT('IStandard deviation feature '. 'desired [YIN] 7') READ(5.1012)SDINP FORMAT(Al) IF ((SDINP .EO. 'Y') .OR. (SDINP .EO. 'y')) SDOFF= .FALSE. SKIP SPECIAL FEATURE IF SDOFF = TRUE SET IF (SDOFF) GO TO 10 UP OUTPUT FILE FOR SPECIAL FEATURES STD DEV BARS WRITE(OUT.5090) C C C C C C OCC OCOC OCC C 91 5090 FORMAT('..LNMO3') TELL USER I'M READY FOR FILE TO ICE 10 WRITE(TTY.1020) 1020 FORMAT('IIce>') GET FILE TO ICE. IF 2 NO MORE FILES EOF = .FALSE. READ(TTY.101O.END8920)DATFIL 11 CALL ZEREND(DATFIL) OPEN DATA FILE OPEN(UNIT=DAT. NAME=DATFIL. TYPE='OLD'. ACCESS='SEOUENTIAL'. FORM='UNFORMATTED'. ERR=930.READONLY) M‘WNH READ DOCFIL NAME FROM DATFIL. GRUNGE IS ONE CHARACTER FIX FOR CARRIAGE CONTROL BLANK IN DATFIL READ(DAT.ERR=940)GRUNGE.DOCFIL INITIALIZE NODOC IN CASE NO DOCFILE EXISTS NODOC=.FALSE. CALL ZEREND(DOCFIL) OPEN DOCFILE. IF NONE EXISTS. ERR OPEN(UNIT=DOC. NAME=DOCFIL. TYPE='OLD'. ACCESS='APPEND'. ERR=950) waI-i SAVE DATFILE NAME IN NEW DATAFILE FOR AUDIT TRAIL 20 WRITE(OUT.5000)FN.DATFIL 5000 FORMAT(A2.32A1) GET FIRST DATA POINT. IF NOT RD TAG - IGNORE 30 READ(DAT)DM.XLAST.ARRAY(1) IF(DM .NE. 'RD') GO TO 30 COUNT=1 GET NEXT POINT CCCCCC COCOO COO COO COO 92 100 READ(DAT.END=150)DM.X.ARRAY(COUNT+1) IF ( DM .NE. 'RD') GO TO 100 IF THE NEXT POINT'S X VALUE DIFFERENT THAN LAST. THEN WE HAVE AN X INCREMENT. TIME TO AVERAGE AND STD DEV LAST DATA SET. KEEP NEW POINT IN ARRAY ONE HIGHER THAN LAST POINT THIS SET. IF ( X .NE. XLAST ) GO TO 200 COUNT=COUNT+1 GO TO 100 IF END OF FILE. SET EOF FLAG. TEST LAST DATA POINT FOR RD TAG Last point read eof. bad data 150 EOF = .TRUE. TIME TO AVERAGE DATA SET WE HAVE 200 SUMBO. DO 210 I81.COUNT 210 SUMBSUM+ARRAY(I) AVERAG=SUMIFLOAT(COUNT) NEW SUM USED IN STD DEV PART SUMBO. SKIP THIS PART IF NO STD DEV WANTED IF (SDOFF) GO TO 223 (IOCOCBCCO (5C3C ()C¢5(2C(5 C¢5C3C 93 O....OOOOOOOOOOOO..OOOOOOOOOOOOOOOOOOOOO3.0.30.0...Oi.O BEGIN STANDARD DEVIATION PART OF PROGRAM CORRECT FOR N<6 TO BE N-l IN STDDEV N=COUNT IF (N .GT. 5) GO TO 215 N=N-1 IF (N .LE. 0) N81 SUM THE SQUARES OF THE ERRORS 215 D0 220 I=1.COUNT 220 SUM=SUM+(ARRAY(I)-AVERAG)“2 DIVIDE BY N This gives ad of averaged point. not ad of each point in average STDDEV=SQRT(SUM)IFLOAT(N) END STANDARD DEVIATION PART ..OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO. 94 C C NOW OUTPUT TO FILE C 223 WRITE(OUT.5010)RD.XLAST.AVERAG 5010 FORMAT(A2.E14.6.'.'.E14.6) SKIP IF STD DEV TURNED OFF OOC IF (SDOFF) GO TO 225 WRITE(OUT.5020)XLAST.AVERAG.O..STDDEV 5020 FORMAT('..LNDR '.4(El4.6.'.')) C C C GET FIRST VALUE OF THIS SET INTO ARRAY(1). C SET NEW XLAST VALUE C 225 ARRAY(1)=ARRAY(COUNT+1) COUNT=1 XLAST=X C C NOW BACK TO GET MORE. IF NOT END OF FILE C IF ( .NOT. EOF ) GO TO 100 C IF (NODOC) GO TO 240 WRITE(DOC.2000)DATFIL.OUTFIL 2000 FORMAT('SD DATA FILE '.32A1.’ STDDEV '. + 'INTO FILE '.32A1) CLOSE(UNIT=DOC) C 240 CLOSE(UNIT=DAT) C . C BACK FOR MORE INPUT FILES C IF (CMDLIN) STOP 'ONE FILE DONE' GO TO 10 95 OOOOOOOOOOOOOOCOCO...OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO...O ERROR ROUTINES END OF FILE DURING OUTPUT FILE NAME READ. GRACIOUS EXIT COOCOCO 900 CALL EXST(1) ERROR IN OPENING OUTFIL. OR READING FILE NAME ON INPUT OOC 910 WRITE(TTY.9100)OUTFIL 9100 FORMAT(lX.'I don"t understand file '.32A1) GO TO 1 C C END OF FILE ON INPUT OF DATA FILE NAME. GRACIUOS EXIT C 920 CLOSE(UNIT=OUT) CLOSE(UNIT=TTY) GO TO 1 C C ERROR OPENING DATA FILE. TRY AGAIN C 930 WRITE(TTY.9300)DATFIL 9300 FORMAT(lX.32A1.' not found. Try again.') GO TO 10 C C PROBLEM READING DOCFILE NAME IN DATA FILE C 940 WRITE(TTY.9400)DATFIL 9400 FORMAT(lX.'Error on docfil read in '. + 32A1.'. file abort.') CLOSE(UNIT=DAT) GO TO 10 ERROR ON DOCFILE NAME. OR NO DOCFILE MAY CREATE. OR SET NO DOCFILE FLAG TO FORGET ABOUT DOCFILE ALL TOGETHER CCOCO 950 WRITE(TTY.9500)DOCFIL 9500 FORMAT('I'.32A1.' not found. Create7') READ(TTY.9510)TEMP 9510 FORMAT(Al) IF(TEMP .NE. 'Y') NODOC I .TRUE. IF( .NOT. NODOC) 1 OPEN(UNIT=DOC.NAME=DOCFIL.TYPE='NEW'. 1 ACCESS='APPEND') GO TO 20 C C END ERROR ROUTINES C C OOOOOOOOOOOO0.0.0000000000000000000000000...‘OOOOOOOt END BIBLIOGRAPHY BIBLIOGRAPHY 1. C.A. vanDijk. F.M. Curran. K.C. Lin. S.R. Crouch. Anal.Chem.. 1;. 1275 (1981) 2. D. Larsen. Anal. Chem.. 11. 217 (1973) 3. R. Lum. R. Jones. Rev. Sci. Ins.. 11. 954 (1980) 4. C. Calkin. Ph.D Thesis. Michigan State University. 1981 5. D. Christmann. Anal. Chem.. 1;. 276 (1981) 6. J.P. Avery. Ph.D thesis. University of Illinois. 1978 7. J. Perry. M. Bryant. H. Malmstadt. Anal. Chem.. 12. 1702 (1977) 8. B. Newcome. C. Enke. 'A Modular Microprocessor System for Laboratory Automation with a Novel Twin Bus Construction.’ . work in progress. 9. H. Gross. P. Hoffman. Ph.D research in progress. 10. H.V. Malmstadt. C.G. Enke. S.R. Crouch. Electrggigg 12g lgg1ggggg1gtiog for Scieg11111. Benjamin/Cummings. Menlo Park. Ca.. 1981 11. P. Dryden. Ph.D Thesis. Univ. of 111.. 1975 12. F.J. Holler. J.P. Avery. S.R. Crouch. C.G. Enke. 22221122218 in Elastreniae. 12212222212112; and M1ggggggpg1ggg. Benjamin/Cummings. Menlo Park. CA. 1981 13. Princeton Applied Research. Princeton. NJ 14. E. Ratzlaff. Ph.D research in progress 15. H. Gregg. Ph.D research in progress. 16. P.Hoffman. Ph.D research in progress 17. T. Atkinson. MULPLT 1 A Mul11ple Data §g11 Filg Baseg 911; Plotting System. Chemistry Department. Michigan State University. 1981 18. Model 162 Boxcar Integrator Operating Manual. Princeton Applied Reasearch. Princeton N.J. 96 97 19. J. D. Ingle. S. R. Crouch. 9211311 Spggtrochemicgl Mgthods of Analygig. being written. Prentice Hall. 1985 20. H.V. Malmstadt. C.G. Enke. S.R. Crouch. Electronic Mggguremeg11 for Scientis11. Benjamin. Menlo Park. CA. 1974. p852 21. National Semiconductor Corporation. Santa Clara. CA 22. H.V. Malmstadt. C.G. Enke. S.R. Crouch. G. Horlick. Optimization 21 Electronic Measurements. Benjamin. Menlo Park. CA. 1974 23. Federal Scientific Corporation. New York. NY 24. F. Curran. Ph.D research in progress 25. K. Lin. Ph.D research in progress 26. National Research Group. Madison. WI. 53705 27. M. Rabb. Electronic Engineer. Michigan State University IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII lllIIWflllLlllMINwilling!llfllljllllllllll