COMPUTER CONTROL OF BATCH AND DISCONTINUOUS PROCESSES
J.
S. Noble and P. I. Burton, Kent Instruments Limited, Luton, United Kingdom
AUTOMAT ION
PAPER 3.6 SUMMARY
SYSTEM ORGANISATION
This Paper discusses the requirements in the application of computers to batch and discontinuous control of chemical and plastics processes. These requirements include a programming language that will allow process engineers to write a wide variety of sequence programs without detailed knowledge of assembly level programming. The programming language Prosel developed for this purpose is discussed in detail. Examples are given of its use for sequence control, including its application to a number of identical plant units. A computer sequencing system, unlike a continuous DDC scheme, cannot easily be provided with back-up controllers in case of computer failure. A description is given of the various methods of using two computers for this purpose, including two or three examples of installed systems.
Prosel programs operate in real time as part of the K70 Computer Control System. The K70 hardware includes input and output interfaces to connect the computer to the plant and also control panels and printers for operator communication. Referring to figure 1 PROCON is responsible for the executive functions of a process control system - both plant oriented functions and the handling of communication devices. It performs all input and output scanning, filtering, alarm checking, DDC calculations, etc. Essentially, it maintains the plant at the desired status stored in the data area and keeps the date area informed of the actual plant status. PROSEL Operating System
INTRODUCTION Early attempts at process sequence control by computer were solved either by writing the entire program in machine code or by developing special purpose software based on a high level language such as FORTRAN . Both of these approaches have disadvantages. The use of a high level language in a small computer means inefficient use of core and hence excessive core requirements. On the other hand, machine code programs are efficient in terms of core and time usage, but are time consuming and hence expensive to write. PROSEL has been developed as a solution to this dilemma. It is a semi-high level language which combines the features of a high level language with the core requirements and execution time of a machine code program. The Prose I language consists of instructions whose names have been chosen to correspond to normal sequence terminology (i. e. OPEN, WAIT, STOP, etc.) . Hence, the chemical or control engineer who does not have a deep understanding into the complexities of machine code programming, is able to understand and write Prose I programs with ease. Each plant input, output or control loop can be given a meaningful name, i.e. TEMP12, MOTOR2, LEVEL6. Control loops may be put on or taken off control, controller parameters may be altered and if required, the type of control action may also be altered - all under direction of the Prose I user program. The computer control panel allows the operator access to Prosel and he may start or stop a sequence of events and monitor the current state. Other operator communication is via the Prosel message facility. If required, on completion of an important section, or after a failure, a defined message can be printed to inform the operator.
PROSEL
User Program
Control Panels
Plant
Fig. 1. System Organisation
The Prose I Operating system interprets the user program and when the user program needs plant status information, this is taken from the data area instead of directly from the plant. In a similar manner, Prose I places desired plant status information in the data area, relying upon Procon to perform the actual output to the plant. USER PROGRAM ORGANISATION I n order to write a Prosel program, the flow charts defining the operation of the plant should be broken down into a number of sequences. Usually each sequence corresponds to a single thread on the flow diagram. Each sequence is then divided into a number of phases. A phase consists of a logical block of Prosel instructions. Thus, the user program can be considered to be a matrix of phases. The Prose I executive examines each sequence in turn to see whether it is active or inactive. I f active, it finds the current phase of the sequence and then attempts to execute the whole of the phase. This will normally be possible but some instructions (e. g. WAIT)
160
return control to the executive before the phase has been completed. On normal completion of the phase, the executive updates the current phase number of the sequence before looking for the next active sequen::e. It can be seen that WAIT is equivalent to "go back to the start of the current phase". Sequence 0
S~c.l
S ~uenc.
2
OPEN; INLET PHASE 23 CKAN; LEVEL; 50 0 / 0 WAIT CLOSE; AGITATOR
Sequence N
(!) •
PHASE 24 , CKAN; LEVEL ; 95 0 / 0 WAIT CLOSE ; INLET
P..... 0
------~
D
Fig. 2. Prosel Executive Operation
Referring to figure 2, on the first pass of the executive, sequences 02 & N are active and an instruction to start sequence 1 at phase 1 is encountered in sequence 2. On the second pass a WAIT is found within sequence 0, and the STOP, N found in sequence 1 causes sequence N to become inactive. On the third pass, sequence 0 is re-entered at phase 1 because of the WAIT found there during pass 2. This time, the condition which caused the WAIT is satisfied (e. g. a time delay has expired or a temperature has reached a certain value) and the phase proceeds to a normal exit. It can be seen that to the plant, all of the sequences appear to run independently w ithout any interaction except for that specified by the user. EXAMPLE OF PROSEL Referring to figure 3, the flow diagram on the right shows the events and decisions contained in a small section of a sequence. The inlet valve to a vessel is opened and when the level reaches 50 0 / 0 , an agitator is started . When the vessel is 95 0 / 0 full, the inlet valve is closed again. The section of user program to the left shows the close correspondence between the flow diagram and the user program . The first instruction - OPEN - sets the des ired status of digital output LEVEL in the data area to open. The next instruction - PHASE 23 - marks the start of the next phase. As will be seen, it is logically necessary to begin a new phase at this point. The next instruction
Fig. 3. Prosel example
- CKAN - compares the value of analog input LEVEL against 50 0 / 0 of full scale. If LEVEL is less than 50 0 / 0 , the next instruction - WAIT - is obeyed. This is effectiveIya jump back to the start of the current phase - hence the requirement for the PHASE 23 instruction immediately after the OPEN; INLET. If LEVEL is greater than 50 0 / 0 , WAIT is omitted and the agitator is started by means of the CLOSE; AGITATOR instruction. In a similar manner, the remaining instructions wait for the level to reach 95 0 / 0 when the inlet is closed. The example shown occupies 16 words of memory. PROS EL INSTRUCTIONS In standard systems, Prosel contains about 40 different instructions. These are of several types defined below. Executive instructions are those which allow sequences to control themselves and each other. I n addition to PHASE and WAIT already described , STOP allows a sequence to disable itself or some other sequence, CONTI NUE re-enables some other sequence at the po int at which it was STOPped. START enables some other sequence at a phase defined as an argument. GOTO causes the sequence to jump to a defined phase. The timer instructions, DELAYSand DELAYM, allow a sequence to wait for a specified number of seconds or minutes respectively. SFLAG, CFLAG and CKFLAG are instructions which allow sequences to communicate with each other by setting, clearing or testing marker flags. These would be used where two independent sequences must have reached certain points before they can continue as one. Plant instructions allow the user program to examine the state of the plant and modify its desired status. OPEN, CLOSE drive digital outputs . CKOPEN, CKCLOSED examine the state of digital inputs. Where motorised valves have associated limit switches,OPENV and CLOSEV are used to open or close them and check that they do become fully open or closed within a spec ified time .
161
CKAN and COMPAN are used to test an analog input :Jr compare two analog inputs. SETREG is used to position a regulator and SETPT and RAMP are used to alter or ramp the setpoints of ~ ontrol loops. A variety of other instructions exist for handling auto/manual status, flow totals, printing messages, etc . The Prosel operating system is designed so that special purpose instructions, unique to a particular application, are readily implemented. PARAMETER LISTING Parameter lists are of particular use when several similar products are to be produced in the same batch equipment, i. e. where each product requires the same basic sequence of operations except for the changes caused by the different chemistry. By writing one general sequence and referring to product dependant parameters via a parameter list, it becomes no longer necessary to write one specific sequence for each product. Each parameter list then becomes a recipe for a particular product and contain those parameters which distinguish one product from another. Any number .o f sequences can be attached to the same parameter list, either by means of the Prosel ASSIGN instruction or via the Operator's Control Panel. Any instruction argument may be placed on a parameter list, allowing not only reaction times, setpoints, quantities, etc. to be changed, but also allowing different valves to be used. Items on a parameter list are numbered from zero and when it is intended that the nth item on the list should be used as an instruction argument, the argument is replaced by the expression PL n. I n the example shown in figure 4, if the sequence is attached to list 5, it will behave in an identical manner to the one shown in figure 3. If instead it is attached to list 6, a different valve will be used and the levels at which the agitator is started and the valve closed are changed.
SUBSEQUENCES Prose I is enhanced considerably by the use of subsequences which allow the user to write a frequently occurring set of logical operations only once and call it whenever he needs it. Subsequences, like sequences, consist of a series of phases each containing several Prosel instructions. A sequence calls a subsequence n by means of the EXECUTE; n instruction and the subsequence .returns to the instruction after the EXECUTE by means of the RETURN instruction. Any number of sequences are permitted to execute the same subsequence at the same time without any program interaction. The arguments to instructions within a subsequence may be specified normally or be PL expressions in which case the list attached to the calling sequence is used. An additional facility is that of DUMMY arguments within the subsequence. This allows the user to write a list of arguments immediately following the EXECUTE instruction and these are numbered from zero. The nth item on the list will be used if the user uses an expression of the form DUMMY n as an argument. The user is allowed to put a PL expression in a dummy list and indeed, he is allowed to put dummy expressions in a parameter list. Referring to figure 5, the main sequence calls the subsequence which then opens OUTLET. After a 60 second delay, OUTLET is closed again, and 15 seconds later, the subsequence returns to the main sequence. SUBSEQUENCE 4 PHASE 36 EXECUTE; 4 OUTLET (60)
PHASE 1 DELAYS; DUMMY 1 CLOSE; DUMMY 0 PHASE 2 DELAYS; (15) RETURN
PLlST 5 OPEN; PL 2
5~0/0
Fig. 5. Subsequence examplE:
95 0 / 0 PHASE 23 CKAN; LEVEL; PL 0 WAIT CLOSE; AGITATOR PHASE 24 CKAN; LEVEL; PL 1 WAIT CLOSE; PL 2
PHASE 0 OPEN; DUMMY 0
INLET ADVANCED TECHNIQUES On some types of plant, there may well be several identical plant units performing the same operations although perhaps with different recipes. I nterna lIy to the Prose I operating system, there is usually, but not necessarily, a one to one correspondence between a sequence and a user program. It is also the sequences not the user programs that are attached to parameter lists. I f several sequences all use the same user program, then the differences between units are defined by the parameter lists. This, however, does not allow individual units to change recipe. To allow any unit to produce any recipe, whilst only having one user program, one sequence must be provided for each unit since they are producing concurrently and each sequence must be attached to two parameter lists. The first of these wi II be one of the set
PLlST 6 45 0 / 0
80 0 / 0 WATER
Fig. 4. Use of Parameter Lists
The logical behaviour of a sequence may be made to vary from product to product by including the instruction GOTO; PL n within it where n will vary from recipe to recipe.
162
containing recipe dependent information and the other will be one of the set containing unit dependent information . These two lists accessed by a sequence are known as its A list and B list, and the original PL n expression is now written as PLA n or PLB n depending upon which list is to be accessed . This technique is being used successfully in several applications giving a considerable reduction in size of the user program. Usually, the Prose I user program is stored in co re memory, but for systems with over about 4000 user statements it becomes economic to store it on disc. The operating system then fetches the current phases of the active sequences into a buffer area in core memory and executes them at the order of 100 phases per second. Th is allows the user to write his program without regard to the memory size of his system at the penalty of a disc and an increased core overhead for the Prosel Operating System .
163
CONCLUSIONS Since its introduction in 1968, Prosel has shown itself to have the following advantages. Since it is interpreted, user errors cannot corrupt the main control program . Engineers with no previous experience of programm i ng computers have gained proficiency in the language in a matter of hours. With their intimate knowledge of the plant these same engineers are able to implement batch control systems or modifications to them quickly and reliably. All of the above lead to increased confidence and decreased overall costs. REFERENCES
1. Wade and Noble, PROS EL - A new process control language, Control and Instrumentation, February, 1970. 2. PROSEL User Manual, Kent Automation Systems Limited, Frederick Street, Luton, Bedfordshire, England .