The use of a microprocessor for flexible automation of an experimental procedure

During the development phase of a new design of multichannel blood-analysis machine, it was necessary to perform empirical tests to determine exact volumes of specimen to be sampled and volumes of reagents and diluent to be dispensed during the normal run of the machine. This is because sample volumes measured in clinical laboratory situations are often in the range of microlitres, and great precision and care is needed in handling such small amounts. From the sampling and dispensing mechanisms of the system, fluid was led through PVC tubing to a multichannel peristaltic pump (the pump’s outlet was connected to an input of a z-path cuvette), and finally to drain [1]. The pump was driven by a stepper motor. This is an electromechanical device used here because of the good properties inherent in its stepwise motions when used for precise positioning of objects [2-4]. Thus the pump-stepper motor assembly aided sampling, mixing of reactants, cleansing and draining of the reaction channel during each process cycle.


Introduction
During the development phase of a new design of multichannel blood-analysis machine, it was necessary to perform empirical tests to determine exact volumes of specimen to be sampled and volumes of reagents and diluent to be dispensed during the normal run of the machine. This is because sample volumes measured in clinical laboratory situations are often in the range of microlitres, and great precision and care is needed in handling such small amounts. From the sampling and dispensing mechanisms of the system, fluid was led through PVC tubing to a multichannel peristaltic pump (the pump's outlet was connected to an input of a z-path cuvette), and finally to drain [1]. The pump was driven by a stepper motor. This is an electromechanical device used here because of the good properties inherent in its stepwise motions when used for precise positioning of objects [2][3][4]. Thus the pump-stepper motor assembly aided sampling, mixing of reactants, cleansing and draining of the reaction channel during each process cycle.
To ensure a high degree of precision it was imperative to establish the most suitable working parameters of the pump-stepper motor assembly. Hence it became necessary to run the pump at variable speeds and number of rotations until the appropriate volumes were obtained. At first, this task was accomplished manually and proved to be rather tedious and also unreliable. Accordingly to perform a desired preprogrammed sequence of operations, an electromechanical cam-timer was introduced.
This served to switch 'on' and 'off a train of square-wave pulses from a function generator at predetermined intervals. This method, although straightforward, was of course rather inflexible.
To overcome the disadvantages inherent in the above techniques, microprocessor control was introduced, an Intel 8080 microprocessor was used to run the pumpstepper motor assembly in the STEP, REV and PRE-PROGRAMMED modes by issuing simple keyboard commands. For ease of program design, subhigh-level language PLS080 was used [5]; this language has all the features of structured programming. Program development was done on time-sharing basis, with the aid of an ICL 1902s mainframe computer which has a cross compiler. The compiled object program in Intel 8080 object code was then down-loaded into the microcomputer kit for debugging, testing and running.

Experimental set-up
As a prerequisite to using the pump-stepper motor assembly, a suitable means of control was needed. It was also necessary to provide an appropriate d.c. powersource and a motor-drive board, including compensating and suppression networks. Figure is a block diagram of the experimental set-up. In its normal mode ofoperation, the stepper motor will take a single step in response to each command pulse at the input of its drive circuitry. The step angle taken will vary according to the design of the motor. The microprocessor therefore issues a train of TTL-compatible pulses to the motor-drive board; the latter translates the command pulses into an alternate switching sequence of motor windings, thus creating discrete motions of the motor. The time taken to accomplish a requested task depends mainly upon the frequency of the input pulses and the step angle taken by the motor in response to each command pulse. The motor we chose was an Impex stepper motor, which has a full angle deflection of 1"8 per step [4]. Diluent, reagent and patient sample were propelled by a multi-channel peristaltic pump to the z-path cuvette of a colorimeter where observation of the coloured reaction product took place. Following a predetermined observation time, the reaction mixture was then pumped out to drain from the cuvette. Other tasks performed by the microprocessor included control of sample sequencing activities and probe transfer operations.
Stepper motor driver The pump-stepper motor assembly was controlled by the DRIVER program which had four main components: these are macros, utility routines, command-recognizing routines and command-handling routines (figure 2). On entry, the DRIVER initializes system variables, I/O ports, default motor parameters then prompts the user by printing the Header on the screen. The DRIVER then enters an endless loop, repeatedly scanning the keyboard. In its normal operation the DRIVER accepts and responds to keyboard commands and interacts with the user through a console device. Only user commands defined in the DRIVER command repertoire are accepted. For each valid command the DRIVER responds either by displaying a message or an action being taken. A built-in HELP command displays the available modes of operation and the existing commands. Commands can be issued either on-line (i.e. while the motor is running) or off-line (i.e. when the motor is at stand-still). These commands are mutually exclusive. When writing the DRIVER, structured and modular programming was statement was used to invoke command-handling routines. For ease of readability, the DRIVER and its main components are described in pseudo-Pascal algorithmic language. Figures 3 and 4 give the main body of the program and a branch-table of command-handling routines. For monitoring the input/output functions of the DRIVER, four distinct message types are available viz. informative, instructive, warning and error messages. The informative messages are automatically invoked upon first entry or upon mode selection. These messages consist mainly of Headers. Instructive messages are invoked by typing appropriate keyboard commands and are used to the user unfamiliar with the DRIVER mode of 70 operations. Warning messages are invoked if the user tries to override the limits ofpredefined input parameters. Error messages, on the other hand, are displayed if the set conditions have actually been violated and in this case the issued command is automatically ignored.
Off-line command handlers These are grouped in auxiliary and main subroutines. Auxiliary subroutines perform simple tasks of changing logic states: for example to reverse motor direction or to change stepping mode and to display information. These subroutines are of a general class of SET/RESET and ofa MESSAGE handler. A SET subroutine changes an output state from logic '0' to logic '1', leaving the rest of the output byte unchanged. A RESET subroutine is the opposite of a SET subroutine. The three modes of operations are defined by the main subroutines as described below.
(1) STEP mode is entered by invoking STEPFUNC-TION ( figure 5). This subroutine runs the motor in a uni-step or multi-step manner. On entry the routine expects the user to specify the number of steps the motor should rotate. Only a valid step count (1 to 255) will be accepted. The motor used had a step angle of 1"8 and hence requried 200 steps/rev. STEPFUNC    (2) REV mode is entered by invoking REVFUNC -TION (figure 6). The number of revolutions the motor is to rotate is specified by the user. As a valid input count is any number between and 255. The basic step count/rev is a function of the motor in use and this is stored in the microcomputer's memory. REVFUNC-TION instigates an error message if input conditions are violated.
(3) PREPRoGRAMMED mode is invoked by PRE-PROGFUNCTION and performs a desired sequence of operations, such as driving a small synchronous motor coupled to a kinematic linkage to more sample and reagent probes, as well as control diluent dispensing (figure 7). The sequence is completed by performing the necessary cleaning task, thus making the machine ready for the next sequence of operations. This routine also accepts input parameters, for example the desired motor speed and the number of revolutions. In all the above three cases, while the motor is running, the keyboard is scanned for possible detection of an on-line command and the end of an operation is signalled by a bell prompt.
On-line command handlers These are invoked while the motor is running. The available on-line commands are REPEAT (to repeat a task), SLOWSPEED (to decelerate the motor), FAST-SPEED (to accelerate the motor) and ABANDON (to terminate a task). DETECT (figure 8) is the on-line command-recognizing routine and is invoked in all three modes of operations. On entry, DETECT saves CPU status then scans through the keyboard for a valid command; if successful, an appropriate action is taken on-line. To reduce access time, macros were used in place of subroutine calls. At the end of execution, DETECT restores the CPU status. procedure preprogfunction; begin synchromotor; (*move probe to reagent and sample containers*) stepcount: stepsperrev; (*slowly to dispense reagent and patient sample*) synchromotor; (*return probe into distilled water trough*) transfermixture; (*rotate pump fast to dispense diluent and reaction mixture to cuvette*) delay; (*fifteen seconds to observe reaction rate*) s tepcount:stepsperrv; revcount: =count2; rotatepump (*fast to rinse the system*) end Figure 7. Preprogrammed sequence of operations.

Conclusions
In order to establish motor-pump working parameters necessary for dispensing correct volumes of reaction mixtures, an experimental set-up was built. As an efficient and flexible means of arriving at the desired volumes, software control was used. With the aid of an Inte18080 microprocessor, faster and precise results were obtained and the task, that would otherwise be arduous, was greatly simplified. The application program was general-purpose and could run the motor in any desired number of steps or revolutions and at variable speeds. 72 The program was also designed to handle a preprogrammed sequence of operations and for on-line command detection and execution.

Summary
The use of the microprocessor controlled, stepper-motor driven peristaltic pump described above permitted the development ofa simplified flow-injection system suitable for use in clinical chemistry. Aspiration of sample by the pump proved to be remarkably precise; for example, it was possible to measure serum albumen using bromocresol green on samples as small as 250 nl with a coefficient of variation of 2%.
Such precise volumetric control ofliquids by a simple and inexpensive device suggests a wide range of uses in metering reagents both in analytical chemistry and in process control. It is surprising that similar devices are not already widely used. The fee for the course will be 325 and includes accommodation in the University together with all meals. The number of places available is strictly limited and they will be allocated on a first-come first-served basis.
The conference organizers are: Dr P. Warwick and Dr J. R. Thornback, Nuclear Chemistry Laboratories, Loughborough University of Technology, Loughborough, Leicestershire LEll 3TU, UK.