A fully automatic apparatus for chemical reactions on the laboratory scale

It is also useful for the preparation of a given quantity of products simply by repeating the same reaction when scaling up is too difficult, or time-consuming. Moreover, the physical presence ofthe chemist near the apparatus is not necessary, which is helpful when hazardous reactions have to be studied. Furthermore, the strict control of many parameters, and the possibility of sampling the reaction medium during the course of the operation, means that information about the kinetics of the reaction


Introduction
The apparatus described here is designed to automatically perform common chemical reactions on some tens to hundreds of grams of reactants. Its principal application is the necessary optimization of parameters when going from the research-laboratory scale to the pilot plant in fine organic chemistry, an operation which requires numerous repetitive assays [1 and 2].
It is also useful for the preparation of a given quantity of products simply by repeating the same reaction when scaling up is too difficult, or time-consuming. Moreover, the physical presence of the chemist near the apparatus is not necessary, which is helpful when hazardous reactions have to be studied. Furthermore, the strict control of many parameters, and the possibility of sampling the reaction medium during the course of the operation, means that information about the kinetics of the reaction can be collected.
The system is fully automatic and all transfers are performed by the machine; most of them are quantified at the same time. A transfer for solid or liquid reagents involves two steps First, the product is brought into an intermediate vessel linked to a strain-gauge for weighing and then transferred to the reactor (see figure 3-an example with powder). The driving force for transfer is obtained by vibration (powders) or pumping (liquids).
There is an additional container to allow solvents to be used for rinsingpressure is applied to dispatch them to different parts of the apparatus.
For introducing small quantities of liquid over a long period of time, peristaltic pumps are preferred. Nonquantified introductions are also possible, and are generally used for neutralization under the control of such a parameter as pH or redox.
At the present time, the set can accommodate four solid reactants, seven liquid reagents and four solvents. All These considerations are important to all companies involved in fine organic chemistry (especially pharmaceutical firms); and several studies about automation at the laboratory scale have recently been published [3, 4 and 5].
An important characteristic of the authors' system is its versatility-it can carry out most of the chemical reactions currently used in organic chemistry, and its software allows user-friendly interactions between chemists and computer.
The system involves three parts" the chemical set, the computer and interfaces, and the software.
The chemical set Figure shows the main parts of the apparatus, and figure 2 is a partial schematic description of the chemical system. The reactor is of a classical design and is equipped with a stirrer and a cooler, including a splitter which allows either a reflux or a distillation of the solvent, depending on the state of an electromagnetic valve (not drawn on figure 2).
The heating is electrical, by means of a resistive silver coating applied to the bottom of the reactor, and the cooling is obtained by immersion of the reactor into a cooling-bath placed on a pneumatic jack.  weighing vessel for powders; D weighing vessel for liquid reagent with its transfer pump; E peristaltic pumps; F recuperation of the reaction mixture; G, H and I solvent weighing and distribution; and J pneumatic jack for cooling. introductions can be monitored in relation to the state of the reaction.
At the end of the chemical reaction, the reaction mixture is transferred to one of six flasks through an intermediate container and a distributor. Vacuum is used for the first transfer and the content of the reactors is flushed through the hollow axis of the stirrer. The second transfer is obtained by gravity. Several rinsings are usually carried out-they are either added to the reaction mixture or sent to the drain by appropriate positioning of the outlet. Finally, a general washing is performed and the different components are dried by a stream of hot nitrogen. The set is then ready for a new run.
A sampling system, applying principles used in analytical laboratories (figure 4), provides a means of automatically and quantitatively selecting samples for further analysis. It consists of a/hairpin-shaped tube immersed in the reacting mixture. One branch of the tube can be separated in two parts by a pneumaticjack. When open, a peristaltic pump samples a given volume of the liquid. Then the U-tube is closed and the sample is washed out by the solvent. Up to 10 analogue probes can be connected to the system. In most cases, only five are used to measure the temperature of the reactor, the temperature of the cooling-bath, the temperature at the entrance of the cooler, pH and redox potential.
Most of the sensors and actuators are part of machines widely used in the authors' research centre and have already been reported [7].
As certain reactions require intermediate decantation of the reactive mixture, an automatic device has been recently added to do this (the device is not shown in any of the figures in this paper).   A 20 000 points analogue/digital (A/D) converter is connected through a multiplexer (16 channels) to the specific interfaces of the sensors.
A command panel, shown on the lower part of the right-hand side of figure 5, allows manual back-up.
However, a reaction cannot be carried out by this method because all the control loops need the computer to be active; the manual switch can only be used to transfer the products and to bring the set back to its initial condition after a failure. Software like weighing, transferring, .measuring, heating, cooling, counting a time etc. has a corresponding routine not directly connected to the others. The exchange of information, logical or numerical, is possible through tables. It must be noted that in regulation loops only on-off control is used and three separate routines correspond to the three steps normally encountered in such a loop: that is measuring, comparing and actuating. Consequently, any actuator can be connected to any sensor through the same routine of comparison, which adds to the versatility of the system. On the other hand, a table of actions contains the addresses of the routines which may or may not be flagged. Every half-second, this table is examined and only the flagged routines are executed. The flagging of the right routines at the right time is obtained through a protocol. (A protocol is a sequence of steps, each ofwhich contains the code for the elementary action to be performed and several arguments for the transfer of the necessary information.) Every half second, an internal routine tries to take into account a new step but can only do it if the state of the apparatus allows it. This regulation is necessary because some operations can be performed simultaneously, but others cannot: for instance a reactant cannot be weighed and transferred at the same time.
Most of the interdictions are dependent on the apparatus itself, as is the example given above, and they are permanently present in the corresponding statement.
However, the chemist can introduce interdictions of his own for controlling the sequence of operations to any degree of complexity.
During a run, the protocol is stored on a disk and read, block-by-block, during the course of the reaction.
The protocol language, which can be understood by the machine, is practically undecipherable by the chemist. Therefore a language has been designed, which uses, as far as possible, .expressions common to chemists. The training necessary for its use is minimal; it can often be understood, without training.
The language uses two types of statements" the first type is declarations which indicate the location of reagents in the different containers (figure 6 provides some examples of the syntax of the declarations). On the left side of the sign '=', the chemist can use any word he likes. On the right-hand side there are a couple of codes separated by a semicolon, characterizing the actuators which transfer the specified product from its container to the reactor through the weighing vessel; these codes are fixed. In the protocol, when necessary, the different products participating in the reaction are named by the word that the chemist has chosen in the declaration.
Two objectives were kept in mind during the programming: versatility and simplicity for the chemist. Versatility has been obtained by a complete independence of the different actions. Every elementary operation- The second type of statement corresponds to instructions given to the machine to execute operations. One step of the protocol corresponds to one instruction (figure 6); the general syntax is as follows. XX is an integer for numbering the lines of the program. The part of the instruction, named 'operation' in figure 6, specifies the type of action wanted: for instance 'stirring, weighing etc.'. Self-explanatory terms are used, as far as possible, in such a way that a protocol can be understood with a minimum of training. The name of the action can be followed by arguments, the number of which depends on the nature of the action. Finally, the chemist may add interdictions so that the step cannot be allowed to proceed if the apparatus is not ready for it. For instance in figure 6, 'Eyy' means that the statement will become active only when a preceding step, 'yy', is completed. 'Tj' corresponds to a chronometer started by a preceding instruction: the instruction 'XX' will become active only when the time declared by the chronometer is over. Lastly, 'Lk' is a logical variable also declared in a preceding instruction. If this option is used, the instruction 'XX' will be taken into account the first time the logical variable takes the value 1.   A second type of measurmnent, less common to chemists, is one the authors' call 'digital measurement'. It is the integrated number of actions of actuators versus time. When the actuator is controlled by a variable characteristic of the reaction, this measurement is in close relation with the kinetics of the process; it explains the name ofthe statement. In figure 7, .the codes given correspond to the more relevant actuators of the system, pumps, cooling and heating.
The third type is computed measurements" that is measurements resulting from the combination of analogue, digital and possibly other computed measurements. At the moment, only five possibilities are offered-'SHIFT', 'DERIVATIVE', 'DIFFERENCE', 'INCRE-MENT' and 'SLOPE'. Others can be added if necessary, but some programming would be required.
The computations that these instructions perform need not be described in fullthey are outlined in figure 7. Closely related to the measurements is the statement 'NOTEBOOK', which allow storage of the data on the disk. As it is generally not necessary to record data every half-second, at least not for all phases of a reaction, the period can be chosen by the chemist.

Actions
The instructions of this class concern the actuators. The action can be continuous. In that case, the statements are paired and are characterized by the letters 'G' and 'S'. Some are shown in figure 8  'STIRRING' switches the stirrer on and controls the speed. 'ACTUATE' energizes the actuators, the code of which is given as an argument if, and only if, the logical variable is one. This variable is defined by a special statement described in the next paragraph. 'THERMO' controls the heating and the cooling of the reactor. Of course, 'Li' and 'Lj' must not take the value '1' simultaneously. If they do, an error signal appears which stops .the operation.
The other actions are discontinuous (Examples of statements related to some of them are illustrated in figure 9).  In this special case, the same quantity is weighed, then transferred. This is not compulsory: the introduction can be made in several steps, provided that the weighed quantity is not smaller than the sum of the introduced quantities.
'Volume' concerns the quantitative introduction of liquids by peristaltic pumps. Here, the optional argument 't' defines the total time allocated to the introduction of the given volume. If omitted, the introduction is done at the highest speed.
'SAMPLING' governs the sampling of a given volume of the reacting mixture for analysis.
'TRANSFER' is used for solvents.
'DRAW-OFF', 'STORE' and 'TANK-A' control the transfer of the reacting mixture into one of the collector's flasks.
'DRYING' is for the drying ofthe set after cleaning. 'C' means 'Cold' (cold nitrogen is used), and 'H' is for 'Hot'.
Logical operation Sequential operations as well as control loop are of the 'on-off' type. So logical variables and the means of computing them are important.
'LOGIC' allows the computation of more or less complex Boolean expressions. The chemist has at his disposal up to 16 logical variables ('LI' to 'L16') which he can define as indicated here. Figure 10 is an example of the syntax used.
'CHRONO' is used when time is an explicit parameter. 'Ti', where 'i' can take the values to 4, is a logical variable which is zero when the statement is taken into account by the program and becomes when the time 't' has elapsed. The optional argument allows the operation to be repeated 'r' times. 'STABILITY' is a more specific statement.
'Li' takes the value when another logical variable 'Lj' defined previously, keeps on the value for at least 'n' seconds. (The optional slash inverses the proposition, that is 'Li' is one when 'Lj' remains at zero for at least 'n' seconds.) This statement is used to define the end of an operation: a neutralization for instance. Close to the equivalence point, the pH oscillates around the threshold value at each drop of the reagent. The reaction is considered finished when the period of these oscillations becomes longer than a given value. This statement allows this operation.
In the automatic set described here, control loops are explicitly detailed: that is sensor, comparator and actuator are related to specific statements. For instance, the  This last statement allows the chemist to deliver discrete orders to the set. When one statement, or a group ofthem, is followed by 'WAIT', the machine executes it and remains in the corresponding final state until a new group of statements is given. This semi-automatic type of working is useful when, at the beginning of a study, the chemist is not confident about his experimental procedure. He can then orient the reaction from his observations.
With the 'utilities' statements, practically any procedure compatible with the chemical hardware of the apparatus can be performed.
This language might appear rather sophisticated for such an application, but a principal objective was that this automation be a tool for chemists: easy to use, even occasionally, without the help of a specialist in computer science.
A second objective was that the executives in charge of research groups be able to understand any protocol with practically no training. Figure 11 shows the beginning of a protocol for studying the hydrolysis of ethyl allylacetylacetate, followed by a condensation with pyruvaldehyde and a decarboxylation. It illustrates the ease with which this language can be followed.
Protocols composed in this way are easy to understand but cannot be directly interpreted by the program monitoring the apparatus. It must be compiled by a special background program.  Once compiled, the protocol is stored in an intermediate file. For starting a new run, protocols are concatenated if more than one rection is to be monitored, then the first protocol is started.
At operating time, many tests are carried out and if an anomaly is detected, a diagnostic is issued. Some of them are just warnings, others are fatal, in which case the reaction is stopped.
The cooling device is designed in such a way that if such a condition occurs (even a power failure) the reactor gets immersed in the cooling bath; moreover, a batteryoperated device allows the introduction of a neutralizer if necessary.
These features help to keep the system safe, even in the event of a major breakdown.
In addition to the program just described, some 'utilities' routines are used for performing various tasks before, during and after the reaction-they are briefly described in figure 12.

Conclusion
This set has been in operation for three years and is now totally reliable.
It has been well accepted by the chemists who rapidly became expert in the use of the language for writing protocols and who now apply entirely new procedures without any prior testing in the laboratory, which shows the versatility of the system.
Reproducibility is generally good, of the order of magnitude of the analytical error, that is to 1.5% over a period of several months.
At the moment, the set's most striking advantage is certainly an important gain in time, especially for reactions lasting more than 8 to 10 h and requiring intricate procedures. Furthermore, a chemist's time previously spent in surveying can now be devoted to more creative work, for instance studying new synthetic pathways or designing procedures for optimization, as a result of which the productivity of the laboratory is increased.
Furthermore, the various possibilities offered by the set of instructions allow sophisticated protocols not practicable manually to be designed, but at the present time lack of theoretical support prevents the full use of this option.