Anal. chem. 1988, 60, 1142-1145
1142
Complexometric Analysis Using an Artificial Intelligence Driven Robotic System W. A. Schlieper and T. L. Isenhour*' Department of Chemistry and Biochemistry, Utah State University, Logan, Utah 84321 -0300
J . C. Marshall Department of Chemistry, Saint Olaf College, Northfield, Minnesota 55057
Expert system software has reached a degree of 8ophWkatlon such that lt can be used to make decisions based on analytical chemlcal rubs. Combining thls type of software wlth standard laboratory automation, such as robots, opens up a new field of dkovery. These new systems are able to makesomedeclsknswlthouthunanlnterventlonandpoodMy make new analytical dlscoveries. A microcomputer-based expert system is described that controls a standard, laboratory robotlc system. The expert system is capable of performing direct complexometrlc tltratlons on metal cations In solutlon. Users of the experthobotic system can provlde lnstructlon by forclng the system to analyze samples under certain condnlons. The system can also use heurlstlc rules, based on condltlonal staMlity constants, to make declslons. By storing ail tltratlon resuns, the system is capable of iearnlng from past experience.
The use of laboratory robots is particularly advantageous when the work is too tedious for humans to perform with sustained accuracy and efficiency (1-5) or when conditions make the work impossible or hazardous for humans (3). Recent advances in robotics include sophisticated techniques to monitor the progress and reliability of analyses (6). Future laboratory robots must be able to adapt to changes in experimental conditions and make appropriate modifications in their procedures without human intervention. They must be able to learn from their past experience and that of their human operators. Through the use of expert systems, this type of "intelligent" robotics is possible. Expert systems are computer programs capable of making decisions based on knowledge. This knowledge is comprised of relational data bases and heuristic rules used to manipulate the data. Data can be collected from user input. Lochmiiller (7)has shown how a simple expert system can be incorporated with laboratory robotics to perform a group 1 inorganic, qualitative analysis. The ANALYTICAL DIRECTOR is a project to create an expert system that combines knowledge about analytical chemistry and robotics. The ANALYTICAL DIRECTOR is capable of analyzing problems, proposing appropriate solutions, and performing experiments by manipulating laboratory instruments. The goal of this research is to develop an expert system that is capable of interacting with a user that has a minimal background in chemistry. The expert system described here is capable of analyzing a sample containing an unknown amount of metal cation by performing a complexometric titration. The expert system fiist determines the appropriate experimental conditions from user responses to queries, then performs the titration, and 'Present address: De artment of Chemistry, Kansas State University, Manhattan, K! 66506. 0003-2700/88/0380-1142$01.50/0
reports the results to the user. The experimental conditions that can be adjusted are the titrant, pH, indicator, analytical wavelength for end-point detection, and masking agents.
EXPERIMENTAL SECTION Microcomputer. All work was performed on a Leading Edge microcomputer runningunder an MS-DOS operating system. The microcomputer is equipped with one 360K floppy disk drive, one 10M Winchester hard disk, and 640K of RAM (random access memory). Laboratory instruments, including a robot, are controlled through RS-232C serial communication ports. Software. The expert system software described in this paper is a modular system composed of several executable programs. Due to the limited computer memory, smaller expert systemswere written to solve portions of the larger problem. The decisionmaking software was written by use of Turbo Prolog while the task-oriented prwams were written by use of the C programming language. Laboratory instruments are controlled from the expert system using ARTS (8),a flexible laboratory control language also written in the C programming language. Robotic System. A Zymate I robot was used to perform all experimental manipulations. The robotic system includes a robot arm with three removable hands, a centrifuge, a vortex mixer, a solvent delivery system, a hot water bath, and an analytical balance. The layout for the laboratory robot, including the UV-vis spectrophotometer, is shown in Figure 1. Communication between the Zymate I and the microcomputer is implemented through the Zymate 2480 controller. A program written in EasyLab, the control language of the Zymate I system, processes commands from the microcomputer. Spectrophotometer. A Hewlett-Packard 8451A diode array spectrophotometer was used to collect all UV-vis absorbance spectra. The spectrophotometer has a wavelength resolution of 4 nm over the range from 190 to 820 nm. A BASIC program running on the spectrophotometeris used to monitor and process commands from the ARTS system. The cell compartment lid has been removed from the spectrophotometer and replaced with a piece of black cardboard. A hole has been cut into the cardb0ar.d shield to allow cells to be placed in the holder. This design does not suffer from any adverse affects of stray light. Circular cells are used so they can be easily manipulated by the robot. Data. All data collected from the laboratory instruments was analyzed by the software running on the microcomputer. The end points in the complexometric titrations were determined spectrophotometrically. The end point detection requires that regression lines be calculated by using the absorbance data collected both before and after the equivalence point. THEORY Complexing agents must fulfill certain requirements to be suitable as titrants for the volumetric analysis of metal cations (9). The reaction of a titrant with a metal must be stoichiometric, the reaction must be relatively fast to ensure a sharp end point, the stability of the resulting complex must be sufficiently high, and the reaction should have as few steps as possible. Conditional Stability Constants. Since the stability of the complex, MY, is determined by the concentration of the 0 1988 American Chemical Society
ANALYTICAL CHEMISTRY, VOL. 60, NO. 11, JUNE 1, 1988
1143
USER INTERFACE
z AND
I
I
A
I
SYSTEM CONTROLLER
I
4
i
EXPERIMENTAL
CONTROL
CONDITIONS
INSTRUMENTS
STANDARDS ANALYZE
AND UNKNOWNS
Figure 2. Hierarchy of the expert system.
Figure 1. Layout of laboratory robotic system: (1) Zymate laboratory controller with a 2-840 computer interface; (2) Zymate laboratmy robot; (3) Hewlett-Packard 8451A diode array spectrophotometer: (4) S/P water bath: (5) Mettler AElOO balance with a 2-850 balance interface: (6)Zymate general purpose hand; (7) Zymate sample rack; (8) Zymate syringe tip rack; (9) Zymate liquid distribution hand; (10) Zymate blank hand equipped with cannula; (1 1) contact switch station; (12) Zymate liquid dispensing station; (13) waste dispensing station; (14) Zymate vortex station; (15) Zymate master laboratory station: (16) Zymate capping station: (17) Zymate centrifuge: (18) Zymate power and event control station.
free metal (M) and ligand (Y),any additional cations or ligands may interfere. The conditional stability constant (10) given by
KhY = [MYl/[M’l[Y’l
(1)
was used to include these interferences in stability calculations. In this equation, [M’] is the concentration of all forms of the metal cation that has not reacted with the titrant, and [Y’] is the concentration of all forms of the titrant that has not reacted with the metal. If another complexing agent, L, is present, [M’] would take the form
[M’] = [MI
+ [ML] + [ML,] + ...
(2)
For the ligand, interfering cations including hydrogen have to be considered and [Y’] takes the form
[Y’] = [Y] + [HY] + [HZY] + ...
(3)
The conditional stability constant is a measure of the stability of the metal-ligand complex for a given set of experimental conditions. The success of a complexometric titration can be controlled by adjusting the experimental conditions under which the titration is performed. Interferences that lower the conditional stability complex can be eliminated either by shifting the pH or by adding a complexing agent that will specifically bind with the interfering ion. By proper choice of experimental conditions, the value of the conditional stability constant can be maintained at a value that may lead to a successful titration. The magnitude of the conditional stability constant can be used to predict the success of a particular experiment. A successful titration can usually be performed if the conditional stability of the metal-titrant is greater than about lo5. While the value of a conditional stability constant can be used to guide the choice of experimental conditions, it does not guarantee a successful titration. A possible solution therefore must be first checked against standards before being used to analyze a sample of unknown concentration. After a possible solution is tested against standards, the results are stored in a f i e of solutions and labeled according to the success of the titration. With this type of labeling system, the expert system learns from past experience and never repeats unsuccessful experiments.
End-Point Detection. The end point in complexometric titration can be determined spectrophotometrically if a difference occurs in the absorbance of the solution before and after the end point at a chosen wavelength. Some metals can be titrated without using an indicator since the molar absorptivity of their aquo complex differs sufficiently from the molar absorptivity of their titrant complex while other metals need an indicator added to observe a change in absorbance at the end point. The plot of absorbance, at a particular wavelength, versus volume of added titrant forms two straight lines that intersect at the end point of the titration (10). Occasionallythe lines are sllghtly rounded in the immediate vicinity of the end point. Due to this rounding, the end point is determined by calculating two regression lines that fit the data preceding and following the end point. The end point can then be calculated from the intersection of the two regression lines. RESULTS AND DISCUSSION The outline for the expert system is shown in Figure 2. The first program contains the user interface and controls the execution of the subsystems which determine the appropriate experimental conditions, control analytical instrumentation, and analyze standards and unknowns. All information is passed to the subsystems as needed. Communication between the user and the expert system is accomplished through menus and queries. The user can describe the sample to be analyzed by choosing the appropriate responses from the menus. Any additional information required to perform the titration is supplied by the expert system. The user can also require the expert system to evaluate the sample under user-specified conditions. Alternately, the user can specify just the metal to be analyzed and have the expert system determine aJl of the needed conditions. An arbitrary limit of ten interferences can be included in the conditional stability calculations for each sample. The user is required to know and supply the approximate concentrations of interferences. The concentrations given to the expert system should be the same magnitude as the actual concentrations of the interferences or the calculations will be inaccurate. These user-specified concentrations could cause the calculations of the conditional stability constants to vary considerably from the actual values. Liberal cut-off values for the conditional stability constants are used in the heuristic rules for this reason. The result being more experimental conditions are checked by the robot than would be if more conservative values are used. The solubility products for complexes used by the system are entered by the user. The values can be added to the system data base prior to the actual experiments. However, if the system encounters complexes that not been used previously, it will request the user to enter the stability products. Once the stability products are entered, an entry is added to the data base for future use. A problem is analyzed by first determining whether the same problem has been solved previously. If a solution exists,
1144
ANALYTICAL CHEMISTRY, VOL. 60, NO. 11, JUNE 1, 1988
the experimental conditions are recalled and used. If the problem has not previously been encountered,a set of heuristic rules, based on conditional stability constants, is used to limit the set of possible solutions. From the constrained set of solutions, one possible solution is extracted. The system will then check a file of past experiments to determine if the chosen solution previously failed to produce adequate results. If the procedure failed, an alternate solution is sought. Any unverified experimentalconditionsare tested against standard solutions prior to the titration. Each analytical wavelength is tested for accuracy in determining the concentration of the metal in the standards. If the method was unsuccessful, a new solution is sought. All information collected from the standards is stored for future reference. Experimental Conditions. At this point in the development of the expert system, availability and suitability are the only deciding factors used to initially select reagents. Other factors that could be used to guide the choice of reagents are cost and stability. The present expert system is not yet able to determine appropriate masking agents. Although, the user may specify masking agents to be used in possible solutions. When a previous solution is not known, the selection of experimental conditions is a stepwise process. A titrant is chosen from a list of available titrants and the best pH determined. The pH choice is limited by the buffer solutions that are available to the robot. The conditional stability constant of the metal-titrant complex is calculated. If the conditional stability constant for the metal-titrant complex is greater than lo5,the next step is to choose an indicator. If the conditional stability constant for the metal-titrant complex is less than IO5,a different pH is chosen. If the available buffers are exhausted without finding a suitable solution, a different titrant is chosen and the process is repeated. The indicator selection requires that the conditional stability constant of the metal-indicator complex be greater than but less than the conditional stability constant of the metal-titrant complex. This range for the stability constant of metal-indicator complex was made intentionally broad to allow indicators only marginally acceptable to be tested by the expert system. If all available indicators are examined and an indicator is not found, the conditions are set so that no indicator is employed. After all conditions have been chosen, the conditions are checked to verify that they have not previously failed. Any changes made in the selection of reagents are made in reverse order from the way they were set until a possible solution is determined. If no solution can be found, the failure is reported to the user. As noted above, the user may set any or all the experimental conditions. The system will not change any conditions specified by the user. Setting all conditions forces the robot to evaluate the users choice of conditions. The user may supply the system with any number of sets of conditions, both optimum and incorrect, to help with future decisions. A list of possible solutions can conceivably be generated for any given experimental conditions. This expert system stopped searching for possible solutions once a feasible solution was found. If the solution was adequate, no additional solutions would be tested unless directed to do so by the user. This methodology was used to decrease the development time of an experiment. A given set of experimental conditions could have several solutions archived. Unless forced by user responses, this system will choose the archived solution that gave the best previous results. Controlling Laboratory Instrumentation. Aqueous samples are expected by the expert system. Robotic systems are not adequately equipped to dispense powdered samples. Although, pelletized sample delivery systems could be included with minor modifications to the software. These alterations
would be needed to allow the system to dissolve the samples using proper robotic procedures. Solutions can be delivered from the liquid dispenser, the blank hand dispenser, and the syringe hand. The user must specify the locations of titrant(s), buffer(s), indicator(s),and sample(s) prior to their use. From these locations, the expert system will perform the appropriate robotic manipulations to access the dispensing devices needed for each reagent solution. The titration reactions occur in test tubes that hold approximately 14 mL of solution. A small portion, usually 1d, of the sample is transferred to the reaction test tube. Water is added to the sample if dilution is needed. Approximately 3 mL of buffer is added to the sample. Indicators, if used, are always added after the buffer since they tend to decompose if placed in solutions with extreme pH values. The solution volume, prior to the titration, is approximately 4-5 mL. The sample is thoroughly blended in the vortex mixer after each addition of reagent. Two milliliters of the sample is transferred from the reaction test tube to a circular spectrophotometer cell. The cell is placed in the spectrophotometer and the absorbance is measured. The cell is removed from the spectrometer and the sample is returned to the test tube. The same cell is used throughout a complete titration. The titration begins by adding the titrant in small increments. After each increment, the sample is mixed and transferred to the spectrophotometer cell and the absorbance is recorded. To ensure proper mixing, the sample volume in the test tube must never exceed 11 mL. The vortex mixer cannot force a vortex to occur in the test tube if it is too full. If an end point does not occur prior to filling the test tube, a smaller sample volume or a more concentrated titrant must be used and the experiment repeated. The present robotic system is limited to the modules listed in Figure 1. Therefore, a limited number of solutions are immediately accessible at any given time. Only three reagents can be dispensed through the present solvent delivery station. Additional solutions can be placed in test tubes if needed by the experiment. A test tube rack has been placed in the water bath for solutions requiring temperatures different than room temperature. The expert system has a list of reagents that are available in the laboratory. If a solution is chosen that is not presently on the table, the user must supply it and notify the system of its location. The laboratory instruments are controlled by using the ARTS software package. The experimental conditions along with instrumental parameters are passed to ARTS through files. The instrumental parameters sent include the location and volumes of the reagents needed in the titration. If the sample being examined is a standard, all analytical wavelengths are stored for analysis by the appropriate software. If the sample is of unknown concentration, the absorbance values of particular wavelengths, determined from standards, are stored. Analyzing Standards and Unknowns. The system requests that the user supply a standard solution to analyze any conditions that have not been corroborated experimentally. Any interferences should also be included in the standards using the same relative concentrations. Samples of various concentrations are made from the supplied standard and each is analyzed. Absorbance values are collected at each wavelength after each addition of titrant. The relative error in determining the standard concentration is used to assess the wavelengths usefulness in determining the concentration of an unknown. The relative error, wavelength, and experimental conditions are stored for future reference. The curve in Figure 3 is from an EDTA titration of a Ni2+ solution determined by the expert system. The titration was
ANALYTICAL CHEMISTRY, VOL. 60, NO. 11, JUNE 1, 1988 0.18,
0.20,
0.16
, 0
-I
0 /
I
1 _ . I "
1145
0.5
2
1.5
1
VOLUME OF TITRANT (ml) Flgure 3. Titration curve for the determination of a Ni2+ solution using a 0.1004 M EDTA solution. Absorbance values were recorded at 480 nm after each addition of titrant. No indicator was required.
Table I. Comparison of Expert System and Human Counterpart" expert system
human
trial 1 trial 2 trial 3
0.1006 0.1004 0.1007
0.0981 0.0983
av std dev % std dev
0.0001
0.1006 0.12
0.0981
0.0982 0.0001 0.09
"Results for the titration of a Ni2+ solution using 0.1004 M EDTA without an indicator. Absorbance data were collected at 480 nm.
carried out at a pH of approximately 10 using a NH3/NH4+ buffer. No indicator was added. Absorbance values used by the expert system were collected at 480 nm. Table I shows the results from the titration shown in Figure 3 along with two more replicates. Triplicate determinations by a human are also shown for comparison. The end points for the human titrations were determined visually. The sample sizes for the determinations were each 1 mL. Figure 4 shows the curve from the EDTA titration of a Ca2+solution using Calcon as an indicator. Table I1 shows the precision from triplicate determinations of this solution by both the expert system and a human. The precision shown for these experiments shows the consistency of the expert/robotic system. The conditions in the previous examples were discerned by the expert system. In the first example, the indicator was set to NONE by the user. The expert system filled in the rest of the conditions. In both cases, the conditions are adequate for determining the concentrations of the metal cations. Although, not all experimental conditions chosen by the system are as favorable since the choices, when previous solutions are not known, are determined from conditional stability constants.
CONCLUSION This expert system shows that it is feasible to control an analytical laboratory from a single microcomputer using an expert system. The decisions made are based on chemical theory, data collected from actual experiments,and user input. The ability of the user to set experimental parameters allows the expert system to learn from instruction. Since the expert system keeps a record of past experiments, it is able to learn from past experience.
LITERATURE CITED Owens, Grover D.; Ecksteln, Rodney J. Anal. Chem. 1982, 5 4 , 2347-2351. Woo, Nancy H.; Rosenberg, Arthur S. Ami. Chem. 1983, 55, 1234A. Bellus, Peter Anal. Chem. 1983, 55, 1240-1242A. Dittenhafer, Mark L.; McLean, James D. Anal. Chem. 1983, 55, 1242A. Beni, G. J . Electroanai. Chem. 1982, 140, 137-140. Advances in Laboratory Automation-Robotics 1986, Strimaitis, J. R., Hawk, G. L., Eds.; Zymark Corp.: Hopkinton, MA, 1986. Lochmiiller, C. H.; Lung, K. R.; Melseles, Advances in Laboratory Automation-Robotics 1986; Strimaitis, J. R., Hawk, G. L., Eds.; Zymark Corp.: Hopkinton, MA, 1986. Schlieper, W. A.; Isenhour, T. L.; Marshall, J. C. J . Chem. Inf. Comput. Sci., in press. Flaschka, H. A. EDTA Tffrations; Pergamon: Oxford, 1964. Ringbom, Anders Treatise on Analytical Chemistry; Kolthoff, I. M., Elving, P. J., Eds.; The Interscience Encyclopedia: New York, 1959; VOI. 1, pp 543-628. Johansson, A., Wannlnen, E. Treatise on Analytical chemistry; Kolthoff, I. M., Elving, P. J., Eds.; The Interscience Encyclopedla: New York, 1959; Vol. 11, pp 7117-7182.
RECEIVEDfor review June 29, 1987. Accepted December 23, 1987. This research was supported by the National Science Foundation under Grant CHE-8415295.