overview_of_undergraduate_control.pdf

48
Process Control and Automation Richard D. Braatz * and Morten Hovd A. Introduction Automation and process control are vital for the safe and economic operation of refining and petrochemical facilities. Some specific reasons implementing process control systems are: 1. Stabilizing the process. Many processes have integrating or unstable modes. These have to be stabilized by feedback control, otherwise the plant will move into unacceptable operating conditions. Feedback also may be needed when an unmeasured disturbance has a sufficiently large effect on a process variable to cause unacceptably large variations in the value of a process variable. 2. Regularity. Even if a process is stable, control is often needed to avoid shutdowns due to unacceptable operating conditions. Such shutdowns may be initiated automatically by a shutdown system, but also may be caused by outright equipment failure. 3. Minimizing effects on the environment. In addition to maintaining safe and stable production, the control system should ensure that any harmful effects on the environment are minimized. This is done by optimizing the conversion of raw materials, and by maintaining conditions which minimize the production of any harmful by-products. 4. Obtaining the desired product quality. Control is often needed both for achieving the desired product quality, and for reducing quality variations. 5. Achieving the desired production rate. Control is used for achieving the right production rate in a plant. Ideally, it should be possible to adjust the production rate at one point in the process, and the control system should automatically adjust the throughput of up- or downstream units accordingly. 6. Optimize process operation. It is common in refining and petrochemical facilities to use automation and control to achieve the most cost-effective production. This involves identifying, tracking, and maintaining the optimal operating conditions in the face of disturbances in production rate, raw material composition, and ambient conditions (e.g., atmospheric temperature, cooling water temperature). Process optimization often involves the close coordination of several process units, and operation close to process constraints. Even plants of quite moderate complexity would be virtually impossible to operate without process control. Even where totally manual operation is physically feasible, it is unlikely to be economically feasible due to product quality variations and high personnel costs, since a high number of operators will be required to perform the many (often tedious) tasks that the process control system normally handles. Usually many more variables are controlled than what is directly implied by the above list; there are often control loops for variables which have no specification associated with them. Some reasons for such control loops are 1. To reduce the effect of disturbances from propagating downstream. Even when there are * University of Illinois at Urbana-Champaign, 600 South Mathews Avenue, Box C-3, Urbana, Illinois 61801-3602, U.S.A. Department of Engineering Cybernetics, Norwegian University of Science and Technology, N-7491 Trondheim, Norway.

Upload: bobanmikic

Post on 06-Nov-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

  • Process Control and Automation

    Richard D. Braatz* and Morten Hovd

    A. Introduction Automation and process control are vital for the safe and economic operation of refining and petrochemical facilities. Some specific reasons implementing process control systems are:

    1. Stabilizing the process. Many processes have integrating or unstable modes. These have to be stabilized by feedback control, otherwise the plant will move into unacceptable operating conditions. Feedback also may be needed when an unmeasured disturbance has a sufficiently large effect on a process variable to cause unacceptably large variations in the value of a process variable.

    2. Regularity. Even if a process is stable, control is often needed to avoid shutdowns due to unacceptable operating conditions. Such shutdowns may be initiated automatically by a shutdown system, but also may be caused by outright equipment failure.

    3. Minimizing effects on the environment. In addition to maintaining safe and stable production, the control system should ensure that any harmful effects on the environment are minimized. This is done by optimizing the conversion of raw materials, and by maintaining conditions which minimize the production of any harmful by-products.

    4. Obtaining the desired product quality. Control is often needed both for achieving the desired product quality, and for reducing quality variations.

    5. Achieving the desired production rate. Control is used for achieving the right production rate in a plant. Ideally, it should be possible to adjust the production rate at one point in the process, and the control system should automatically adjust the throughput of up- or downstream units accordingly.

    6. Optimize process operation. It is common in refining and petrochemical facilities to use automation and control to achieve the most cost-effective production. This involves identifying, tracking, and maintaining the optimal operating conditions in the face of disturbances in production rate, raw material composition, and ambient conditions (e.g., atmospheric temperature, cooling water temperature). Process optimization often involves the close coordination of several process units, and operation close to process constraints.

    Even plants of quite moderate complexity would be virtually impossible to operate without process control. Even where totally manual operation is physically feasible, it is unlikely to be economically feasible due to product quality variations and high personnel costs, since a high number of operators will be required to perform the many (often tedious) tasks that the process control system normally handles.

    Usually many more variables are controlled than what is directly implied by the above list; there are often control loops for variables which have no specification associated with them. Some reasons for such control loops are

    1. To reduce the effect of disturbances from propagating downstream. Even when there are

    * University of Illinois at Urbana-Champaign, 600 South Mathews Avenue, Box C-3, Urbana, Illinois 61801-3602, U.S.A. Department of Engineering Cybernetics, Norwegian University of Science and Technology, N-7491 Trondheim, Norway.

  • 2

    no direct specifications on a process variable, variations in the process variable may cause variations in more important variables downstream. In such cases, it is prudent to suppress the effects of disturbances on the upstream variables.

    2. Local reduction of the effect of uncertainties. By measuring and controlling a process variable, it may be possible to reduce the effect of uncertainties with respect to equipment behavior or disturbances. Examples of such control loops are valve positioners used to minimize the effect of valve stiction, or local flow control loops which may be used to counteract the effects of pressure disturbances up- or downstream of a valve, changes in fluid properties, or inaccuracies in the valve characteristics. This chapter provides an introduction to the automation and control of large facilities.

    First the overall structure of control systems for large facilities and each of the specific components are described, followed by a discussion of the design of experiments for collecting data for the purposes of process modeling, control, and monitoring, and the filtering and preprocessing of the resulting data. The subsequent topics are the derivation of dynamic models and the estimation from experimental data of the parameters in models, and their use in the design of feedback and model predictive control systems. The chapter ends with a description of the design and implementation of process monitoring systems.

    B. The Structure of Control Systems in the Process Industries B.1. Overall Structure

    Control systems in the process industries usually have the structure shown in Figure B1. The lower level in the control system is the regulatory control layer. The regulatory control system typically controls basic process variables such as temperatures, pressures, flowrates, and concentrations based on measurements from sensors for temperature (using thermocouples), pressure (using transducers), flow (using flowmeters), level (by floats, displacement meters, or differential pressure transducers), and concentration (e.g., by conductivity, pH meters, gas chromatographs, infrared probes). In some cases the controlled variable may be calculated based on several measurements, e.g., a component flowrate based on the measurements of both concentration and the overall flowrate. Most individual controllers in the regulatory control layer are single-loop implemented in a layered manner, with some multivariable controllers. There are many heuristics for selecting the order in which the individual controllers are designed and implemented. Typically feedback control loops whose purpose is to stabilize unstable process units are closed first, faster loops closed before slower loops, noninteracting loops closed before interacting loops, loops for handling inventories closed before loops for controlling product quality, etc.1,2 Most controllers in the regulatory control layer manipulate a process variable directly (e.g., a valve opening), but in some cases the manipulated variable may be a setpoint of a lower level control loop. Most control functions that are essential to the stability and integrity of the process are executed in the regulatory layer, such as stabilizing the process and maintaining acceptable equipment operating conditions.

    The supervisory control layer coordinates the control of a process unit or a few closely connected process units. It coordinates the action of several control loops, and tries to maintain the process conditions close to optimal while ensuring that operating constraints are not violated. The variables that are controlled by supervisory controllers may be process measurements, variables calculated or estimated from process measurements, or the output from a regulatory controller. The manipulated variables are often setpoints to regulatory controllers, but process variables also may be manipulated directly. Whereas regulatory controllers are often designed

    2

  • 3

    and implemented without ever formulating any process model explicitly, supervisory controllers usually contain an explicitly formulated process model. The model is dynamic and often linear, and obtained from experiments on the plant. Typically, supervisory controllers use some variant of model predictive control (see Section G).

    The optimal conditions that the supervisory controllers try to maintain may be calculated by a Real Time Optimization (RTO) control layer. The RTO layer identifies the optimal conditions by solving an optimization problem involving models of the production costs, values of products (possibly dependent on quality), and the process itself. The process model is often static and nonlinear and derived from fundamental physical and chemical relationships.

    Production planning/scheduling

    Real time optimization

    Supervisory control

    Regulatory control

    Process

    To manipulated variables From measurements

    Production planning/scheduling

    Real time optimization

    Supervisory control

    Regulatory control

    Process

    To manipulated variables From measurements

    Figure B1. Typical structure of the control system for a large plant in the process industries.

    The highest control layer shown in Figure B1 is the production planning and scheduling layer. This layer determines which products should be produced and when they should be produced. This layer requires information from the sales department about the quantities of the different products that should be produced, the deadlines for delivery, and possibly product

    3

  • 4

    prices. From the purchasing department, information about the availability and price of raw materials are obtained. Information from the plant describes which products can be made in the different operating modes and the production rates that can be achieved.

    In addition to the layers in Figure B1, there also should be a separate safety system that will shut down the process in a safe and controlled manner when potentially dangerous conditions occur. There are also higher levels of decision making that are not shown, such as sales and purchasing, construction of new plants, etc. These upper layers do not influence the design of control systems, and are not discussed further here.

    There is a difference in time scale of execution for the different layers. The regulatory controllers typically have sampling intervals on the scale of one second (or faster for some types of equipment), supervisory controllers usually operate on the time scale of minutes, the RTO layer on a scale of hours, and the planning/scheduling layer on a scale of days (or weeks). This difference in time scales simplifies the required modeling in the higher layers. For example, if a variable controlled by the regulatory control layer responds much faster than the sampling interval of the supervisory control layer, then a static model for this variable (usually the model would simply be variable value = setpoint) usually suffices for the supervisory control.

    It is not meaningful to say that one layer is more important than another, since they are interdependent. The objective of the lower layers are not well defined without information from the higher layers (e.g., the regulatory control layer needs to know the setpoints that are determined by the supervisory control layer), whereas the higher layers need the lower layers to implement the control actions. In some plants human operators perform the tasks of some of the layers shown in Figure B1, whereas the regulatory control layer is present (and highly automated) in virtually all industrial plants.

    Why has this multi-layered structure for industrial control systems evolved? It is clear that this structure imposes limitations in achievable control performance compared to a hypothetical optimal centralized controller which perfectly coordinates all available manipulated variables in order to achieve the control objectives. In the past, the lack of computing power would have made such a centralized controller virtually impossible to implement, but the continued increase in available computing power could make such a controller feasible in the not too distant future. Is this the direction industrial control systems are heading, in which an industrial facility is controlled by one unstructured centralized controller? No. In the last two decades control systems have instead moved towards an increasingly multi-layered structure, as increased availability of computing power has made the supervisory control and Real Time Optimization layers much more common. Some reasons for using such a multi-layered structure are:

    Economics. Designing a single centralized control system would require a highly accurate dynamic model of nearly all aspects of process behavior. The required model would be highly complex, and difficult and expensive to develop and maintain. In contrast, the higher layers in a structured control system take advantage of the model simplifications made possible by the presence of the lower layers. The regulatory control level needs less model information to operate, since it derives most process information from feedback from process measurements.

    Redesign and retuning. The behavior of an industrial plant changes with time due to equipment wear, variations in raw materials, changes in operating conditions in order to change product qualities or which products are produced, and plant modifications. Due to the sheer complexity of a single centralized controller, it would be difficult and time-consuming to update the controller to account for all such changes. With a structured

    4

  • 5

    control system, it is easier to see what modifications need to be made, and the modifications themselves normally will be less involved.

    Startup and shutdown. Common operating practice during startup is that many of the controls are put in manual. Parts of the regulatory control layer may be in automatic, but rarely will any higher layer controls be in operation. The control loops of the regulatory control layer that are initially in manual are put in automatic when the equipment that they control is approaching normal operating conditions. Once the regulatory control layer for a process section is in service, the supervisory control system may be put in operation, and so on. Shutdown is performed in the reverse sequence. Based on current practice, there may be scope for significant improvement of the startup and shutdown procedures of a plant, as quicker startup and shutdown reduces plant downtime. However, a model capable of describing all operating conditions including startup and shutdown is necessarily much more complex than a model which covers only the range of conditions that are encountered in normal operation. Building such a model would be difficult and costly. Startup and shutdown of a plant with a single centralized control system will be more difficult than with a structured control system, because it may not be difficult to put a large centralized control system gradually into or out of service.

    Operator acceptance and understanding. Control systems that are not accepted by the operators are likely to be taken out of service. A single centralized control system often will be complex and difficult to understand. Operator understanding obviously makes acceptance easier, and a structured control system, being easier to understand, often has an advantage in this respect. Plant shutdowns may be caused by operators with insufficient understanding of the control system. Such shutdowns are usually blamed on the control system (or the people who designed and installed the control system). Since operators are an integral part of the plant operation, the need for operators to understand the control system well enough to safely and economically operate the facility should be recognized during control systems design.

    Failure of computer hardware and software. In structured control systems, the operators retain the help of the regulatory control system in keeping the process in operation if a hardware or software failure occurs in higher levels of the control system. A hardware backup for the regulatory control system is much cheaper than for the higher levels in the control system, as the regulatory control system can be decomposed into simple control tasks (mainly single loops). In contrast, a single centralized controller would require a powerful computer, and it is therefore more costly to provide a backup system. However, with the continued decrease in computer cost this issue may become less of an issue.

    Robustness. The complexity of a single centralized control system will make it difficult to analyze whether the system is robust with respect to model uncertainty and numerical inaccuracies. Analyzing robustness is not always trivial even for structured control systems. The ultimate test of robustness will be in the operation of the plant. A structured control system may be applied gradually, first the regulatory control system, then section by section of the supervisory control system, etc. When a problem arises, it is easier to analyze the cause of the problem with a structured control system than with a single centralized control system.

    Local removal of uncertainty. It has been noted earlier that one effect of the lower layer control functions is to remove the influence of model uncertainty as seen from the higher layers. Thus, the existence of the lower layers enables simpler yet more accurate models to be used in the higher layers. A single centralized control system does not have this

    5

  • 6

    advantage. Existing control systems. Where existing structured control systems perform reasonably

    well, it is more economical and safer to put effort into improving the existing control system rather than to take the risky decision to design an entirely new control system. Also, there is a huge experiential knowledge on how to design structured control systems for various interconnections of process equipment, such as reactors and distillation columns connected with recycle loops. Designing a structured control system for a new industrial plant enables the control engineer to draw from past experience to design various components of the plant instead of starting from scratch with an entirely new centralized control design. Also, the design of any control system requires carrying out at least some model identification and validation on the actual plant. During this period some minimum amount of control will be needed to ensure safe and stable operations. The regulatory control layer of a structured control system requires more limited information, and therefore can be in operation during this model identification and validation.

    From this discussion it should be clear that control systems will continue to have a number of distinct layers for the foreseeable future. Two prerequisites necessary for a structured control system to be replaced with a single centralized control system are:

    1. The existing control system gives unacceptable performance. 2. The entire process must be sufficiently well understood to be able to develop a process

    model which describes all relevant process behavior. Since it is quite rare that a structured control system is unable to control a process for which detailed process understanding is available (provided sufficient effort and expertise have been put into the design of the control system), it should follow that majority of control systems will continue to be of the traditional structured type.

    B.2. Common Control Loop Structures for the Regulatory Control Layer The common control loop structures for the regulatory control layer are described here.

    B.2.a Simple Feedback Loop The simple feedback loop is by far the more common control loop structure for the

    regulatory control level (see Figure B2). The controller acts on the difference between the desired value for the process output (which is called the setpoint or reference value) and the measurement of the process output. The controller manipulates an input to the process to make the measurement follow the setpoint. Note that the measured value may not equal the actual process output value, due to possible measurement noise or sensor malfunctions. Note also that the manipulated variable is normally one of several process inputs which affect the value of the process output; the additional process inputs which are not manipulated by the controller are disturbances. The need for feedback of the process measurement arises from uncertainty both with respect to the value of the disturbances, and with respect to the process response. Namely, if we could know exactly the value of all disturbances, and the response of the process to both the disturbances and the manipulated value, the measurement would be superfluous, since we would know the exact value of the process output for a specific value of the manipulated variable. In practice such exact process knowledge is unrealistic, and hence feedback of the measurement is needed if accurate control of the process output is required.

    Section F describes the design of feedback control loops.

    6

  • 7

    Noise

    Feedbackcontroller ProcessManipulated

    variable

    Setpoint

    Disturbances

    Process output

    Measurement

    _

    +Noise

    Feedbackcontroller ProcessManipulated

    variable

    Setpoint

    Disturbances

    Process output

    Measurement

    _

    +

    Feedbackcontroller ProcessManipulated

    variable

    Setpoint

    Disturbances

    Process output

    Measurement

    _

    +

    Figure B2. Simple feedback control loop.

    Feedbackcontroller ProcessManipulated

    variable

    Setpoint

    Disturbances

    Process output

    MeasurementNoise

    _

    +

    +

    Feedforwardcontroller

    Feedbackcontroller ProcessManipulated

    variable

    Setpoint

    Disturbances

    Process output

    MeasurementNoise

    _

    +

    +

    Feedforwardcontroller

    Figure B3. Feedforward control for measured disturbances combined with feedback control.

    B.2.b Feedforward Control Feedforward control is used to counteract the effect of disturbances without first having

    to wait for the disturbances to affect the process output (see Figure B3). Feedforward control from measured disturbances combined with simple feedback control, that is,

    ffu u ufb= + (B1) where ffu and fbu are the outputs of the feedforward and feedback controllers, respectively. The ideal feedforward signal would exactly cancel the effect of the disturbance on the controlled variable. For example consider a static single-input single-output nonlinear process in which

    ( ) ( )ff dy P u P d= + (B2) where y is the process output (which is the controlled variable), d is a disturbance, and P and Pd are algebraic relationships for the process model and disturbance model, respectively. Then the ideal value for the output of the feedforward controller is

    1( ) ( ) 0 ( ( ))ff d ff dy P u P d u P P d= + = = (B3)

    assuming that the process model P is invertible for the full-range of process inputs and outputs. This feedforward approach generalizes to take into account dynamics and multiple variables, in

    7

  • 8

    which case more complex plant inverses are utilized.3,4 For feedforward control to give good performance, both the process model P and the disturbance model must be quite accurate.dP

    5 Since the feedforward controller cannot be expected to be perfect, it needs to be augmented with a feedback controller, as shown in Figure B3, if accurate control is required.

    The feedforward controller is always designed to be stable, that is, it produces a bounded output for any bounded input. A pure and stable feedforward controller cannot by itself induce instability of the closed-loop system, although it will result in poor performance if the model used to design the feedforward controller is inaccurate. When the plant and disturbance models are accurate and the measured disturbances have a large effect on the controlled variables, then feedforward control can give significant improvements in closed-loop performance. On the other hand, feedforward cannot be used to stabilize an unstable process. B.2.c Ratio Control

    Ratio control may be used whenever the controlled variable is strongly dependent on the ratio between two inputs. Simple examples of control problems where this type of control structure is appropriate are

    Mixing of hot and cold water to get warm water at a specified temperature. Mixing of a concentrated chemical solution with a diluent to obtain a dilute chemical

    solution. Ratio control may be considered as a special case of feedforward control. It is particularly appropriate when one of the two inputs cannot be controlled, but varies rapidly. Measuring the input that cannot be controlled and applying the other input in a specific ratio to the uncontrolled one, essentially amounts to feedforward control. Figure B4 illustrates a typical application of ratio control in mixing two streams.

    Uncontrolled stream

    Controlled stream

    Mixer

    XT

    FT

    FT Property measurement

    XC Property controller

    Flowratemeasurement

    k

    Flowratemeasurement

    FC

    Flowratecontroller

    Multiplier

    Outflow to downstream operations

    Setpoint

    Control valve

    Uncontrolled stream

    Controlled stream

    Mixer

    XT

    FT

    FT Property measurement

    XC Property controller

    Flowratemeasurement

    k

    Flowratemeasurement

    FC

    Flowratecontroller

    Multiplier

    Outflow to downstream operations

    Setpoint

    Control valve

    Figure B4. Ratio control for mixing two streams to obtain some specific property for the mixed stream. The property controller XC manipulates the multiplication factor, and thereby also the ratio between the two streams.

    8

  • 9

    B.2.d. Cascade Control Cascade control is used in cases where an intermediate measurement can give an

    indication of what will happen with the more important primary measurement being further downstream (see Figure B5). Cascade control also was used in Figure B4, since the property controller (via the multiplier) manipulates the setpoint to the flow controller instead of the valve position itself. In Figure B4, the flow controller will counteract disturbances in the upstream pressure and correct for a possibly nonlinear valve characteristic.

    Outer feedback controller

    Outer process

    Manipulated variable

    Primary setpoint

    Inner disturbances

    Process output

    Primary measurement

    _

    Inner process

    Inner feedback controller_

    Outer disturbancesIntermediate

    setpoint

    Intermediate measurement

    Outer feedback controller

    Outer process

    Manipulated variable

    Primary setpoint

    Inner disturbances

    Process output

    Primary measurement

    _

    Inner process

    Inner feedback controller_

    Outer disturbancesIntermediate

    setpoint

    Intermediate measurement

    Figure B5. Cascaded control loops. The objective of the inner feedback controller is to cause the intermediate measurement to track the intermediate setpoint while suppressing the effect of disturbances entering the inner control loop. The objective of the outer feedback controller is to cause the primary measurement to track the primary setpoint, which treats the setpoint for the inner controller as its manipulated variable, while suppressing the effect of disturbances entering the outer control loop.

    In general, there may be more than two loops in cascade. For instance, a valve positioner can get its setpoint from a flow controller, which in turn gets its setpoint from a level controller (i.e., three loops in cascade). For cascade control to make sense, the inner loops must be significantly faster than the outer loops since the intermediate process measurements are of little interest. If the inner loops do not provide for faster disturbance suppression of at least some disturbances, then the inner loops are not that useful. Fast inner loops also make the tuning of the outer loops simpler, since then the outer loops can be designed with the assumption that the inner loops are able to follow their setpoints. B.2.e Auctioneering Control

    Auctioneering control is a control structure where the worst of a set of measurements is selected for active control, that is, the measurement that places the highest bid is used in the control system. This type of control structure is particularly common in some chemical reactors with exothermal reactions, where the process fluid flows through tubes filled with solid catalyst. If the temperature becomes too high, the catalyst will be damaged or destroyed, therefore the tubes are cooled by a cooling medium on the outside. On the other hand, if the temperature is too low, the reactions will be too slow. Thus temperature control is very important. However, the temperature will vary along the length of the reactor tubes, and the position with the highest temperature will vary with operating conditions. Therefore several temperature measurements

    9

  • 10

    along the reactor length are used, and the value of the highest temperature is chosen as the controlled variable. This arrangement is illustrated in Figure B6.

    A better approach may appear to be to use all of the temperature measurements as inputs to an estimator that estimates the maximum temperature. Such an estimator could estimate the maximum temperature when the maximum does not occur at the position of a temperature measurement, and could also be made more robust to measurement malfunction (if properly designed). However, this type of chemical reactor is normally highly nonlinear, and the estimator would therefore need a nonlinear model, probably based on physical and chemical relationships. The modeling work needed could be time consuming, and it also could be difficult to ascertain that the estimator performs well in all operating regions. Thus, the auctioneering approach is more often used in practice.

    TC1

    >

    High select

    Products

    Temperature controller

    Cooling medium

    Reactants

    TT3 TT5TT4 TT6TT1 TT2

    TC1

    >

    High select

    Products

    Temperature controller

    Cooling medium

    Reactants

    TT3 TT5TT4 TT6TT1 TT2

    Figure B6. A chemical reactor with auctioneering temperature control.

    B.2.f. Split-range Control

    In split-range control, several manipulated variables are used to control one controlled variable, in such a way that when one manipulated variable saturates, the next manipulated variable takes over. In order to obtain smooth control, there is often overlap between the operating ranges of the different manipulated variables. For example, manipulated variable 1 may take value 0% at a controller output of 0%, and value 100% at controller output 60%. Similarly, manipulated variable 2 takes value 0% for controller outputs below 40%, and value 100% for controller output 100%.

    It should be clear that there can be a lot of freedom in how to design the split-range arrangement. To simplify the control design, a common industrial practice is to use this freedom to make the response in the controlled variable to changes in the controller output as linear as possible. Sections F2-F3 describe how to design split-range control systems. B.2.g. Combining Basic Control Structures

    Most of the basic control structures may be combined with each other. All the control structures are variants of feedforward or feedback control, with feedforward control normally

    10

  • 11

    combined with some form of feedback control. Feedforward and the basic feedback control structures also can be combined with multivariable controllers, for example, usually the model predictive controllers discussed in Section G are usually implemented above lower control loops in a cascade control arrangement. C. Experimental Design, Sensor Calibration, and Data Filtering

    Most control systems are designed based on models, ranging from the very simple to quite complex, so the closed-loop performance obtained by the control system depends on the accuracy of the model. Models are constructed from experimental data, so that accuracy of the model depends on the quality and quantity of data. The quality of data depends on the details of the experimental design and any preconditioning of the data, such as sensor calibration and data filtering. C.1. Experimental Design

    An experimental study should be designed to adequately cover the entire range of operations. Covering a wide range of operations enables more accurate predictions to be obtained using statistical data analysis and model building. This provides more confidence when scaling up bench-top results to the factory production scale. Data should not be collected only during best practices or around any prior assumed optimal operating conditions, since a goal of a model constructed from the data is to provide accurate predictions even during abnormal operating conditions.

    There are numerous papers and texts that describe statistical experimental design in some detail.6,7 Such procedures are valuable when used to construct accurate models with the least number of experiments. A general procedure for designing and carrying out an experimental study can be organized into 8 major steps:

    1. Clearly state the objectives of the experimental study. (a) Use any reliable information gained from books, journal papers, and previous

    experiments. (b) State any assumptions or hypotheses that will be tested during the experimental study

    (e.g., that there exists a linear relationship between two variables). 2. Draw up a preliminary experimental design.

    (a) Choose experimental materials, procedures, and equipment (e.g., solvents, mixers, actuators).

    (b) Choose variables that will be fixed during the experimental study (e.g., the volume of a sample). Choose variables that may be varied and determine the practical range of these variables.

    (c) Choose measurements and methods of measurement (i.e., sensors). Consider the precision of the measurement methods. The more measurements and measurement methods, the more reliable the results. Consider using multiple sensors for each measured variable (e.g., measuring temperature with a thermometer and a thermocouple), especially when additional sensors are cheap.

    (d) Make sure that the entire region of interest is covered (i.e., that the full variable ranges of interest are considered).

    (e) Make sure that some of the experiments are repeated. This allows the measurement noise to be quantified by calculating the variance, and helps to detect gross errors in the measurements.

    (f) Consider whether the order of the experiments should be randomized. Does randomization justify any added costs?

    11

  • 12

    (g) List possible alternative outcomes. (h) Consider the cost and time of experimentation versus the cost of reaching wrong

    conclusions. If experiments are cheap, repeating all experiments will reduce biases and increase the accuracy of the conclusions and models constructed from the experimental data.

    3. Review the design with all collaborators (e.g., team members, teaching assistant). (a) Reach an understanding as to what decisions hinge on each outcome. Keep notes. (b) Encourage collaborators to anticipate and list all experimental variables that might

    affect the results (e.g., variations in room temperature, exposure of the samples to air).

    (c) Discuss the experimental techniques in sufficient detail to discover any procedures that might lead to bias (e.g., one person reading the temperatures from a thermometer on one day or experiments, another person reading the temperature during a second day of experiments).

    4. Draw up the final experimental design. (a) Describe the experimental design in clear terms to ensure that its provisions can be

    followed without any confusion. (b) Include the methods of data analysis as part of the experimental design, ascertaining

    that the conditions necessary for the validity of the data analysis methods will be satisfied.

    5. Carry out the experimental design. (a) Record all data and any modifications to the experimental design. Make sure that all

    data are recorded correctly during the experiment. Label the data by date, run number, and other ancillary data (e.g., air temperature).

    (b) During the course of carrying out the experiment, maintain constant communication among all collaborators, so that questions arising from unforeseen experimental conditions or results may be answered using your collective knowledge. This ensures that each collaborators expertise and/or insights are brought to bear.

    (c) If unforeseen experimental conditions or results occur, modify the experimental design as necessary.

    (d) Always think about the experiments while they are being carried out. DO NOT carry out the experiments with no attention to the results being obtained. Ask the questions: Do the measurements seem to make sense? If not, why not?

    6. Analyze the data. (a) Review the data with attention to recording errors, omissions, etc. (b) Use graphics; plot the data, plot averages, plot simple graphs. (c) Apply the data analysis methods outlined in Step 4. (d) Use additional data analysis methods if required by a change in the experimental

    design (Step 5c). 7. Interpret the results.

    (a) Consider all the observed data. (b) Confine initial conclusions to strict deductions from the experimental evidence. (c) Elucidate the analysis in both graphical and numerical terms (e.g., plot relationships

    between variables, quantify accuracy of numerical results). (d) Arrive at conclusions as to the technical meaning of the results as well as their

    statistical significance.

    12

  • 13

    (e) Point out implications of the findings for application and for further work. (f) List any significant data limitations discovered during the data analysis. Relate these

    to any limitations on the experimental design that was conducted. (g) Compare the results to any related results reported in the literature.

    8. Write the report. (a) Describe the work clearly, giving background, pertinence of problem(s) being

    investigated, meaning of results. (b) Present the data and results in clear tables and graphs, and describe their possible

    future use. (c) Compare the results with the stated objectives of the experiment (Step 1). Limit

    conclusions to objective summary of the evidence. (d) If the results suggest that further experimentation is desired or necessary, outline how

    additional experiments should be carried out (repeat Step 4). This procedure for experimental design is appropriate regardless of whether the data are used to construct empirical models (that is, based only on fits to data) or first-principles models (that is, based on material, energy, and/or momentum conservation equations). Readers interested in further discussions on experimental design are referred to books devoted to the subject.6,8,9 C.2. Sensor Calibration The quality of experimental data strongly depends on the quantity and quality of the measurement data. Usually many of the important variables cannot be directly measured, but can be indirectly measured. For example, directly measuring solution concentrations is rarely possible but there are infrared or ultraviolet spectroscopy probes that can measure spectra, and there may be a mapping from the spectra to the solution concentrations. Such calibration curves (also called soft sensors or inferential models) are constructed from sensor data collected for known samples, which then can be applied to unknown samples to obtain an indirect measurement of the variables of interest. Most calibration curves are linear functions of the sensor signals, that is, a linear model relates a variable to predict, y, to the n sensor signals ai:

    1

    n

    i ii

    y a e a e y e =

    = + = + = +

    E

    (C1)

    where a is the row vector of sensor signals, is a column vector of calibration parameters, and e is measurement noise typically assumed to be zero-mean and independent. For N known samples the variables can be stacked into vectors and matrices

    1 1 1

    N N N

    y a eY A

    y a e

    = = + = + # # # (C2)

    where the superscript refers to the sample number. If the variance of each measurement noise is equal for all measurements, then the calibration parameters should minimize the sum of squared deviations between the calibration model, ,y a= and the predicted variables, y,

    2 T T

    1min min min ( ) ( )

    N

    jj

    E E E Y A Y A = = = (C3)

    13

  • 14

    where the superscript T is the matrix transpose. The calibration parameters can be computed analytically:

    T 1 T [ ]A A A Y A Y = =

    ,

    (C4)

    where is the pseudo-inverse of A. If the matrix A is square then this can be simplified to AT 1 T 1 T 1 T 1( ) ( )A A A Y A A A Y A Y = = = (C5)

    using the expressions (AB) 1 1 1B A = 1A A I , = , and AI A= . (C6)

    If the covariance matrix of the measurement noise cov{E} = V, then the best estimate of the parameters is6

    T 1 1 T 1( )A V A A V Y = . (C7) As an example, consider a distillation column in which the concentration of a

    hydrocarbon in the distillate is a product quality variable of importance that can be indirectly measured using an infrared sensor probe inserted into a pipe. It is observed that the signal from the infrared sensor varies with temperature, so a thermocouple is located next to the sensor so the effects of temperature on the calibration can be taken into account. Two absorbance peaks are observed in the infrared spectra, at 2000 cm-1 and 3000 cm-1, when the sensor probe is inserted into 10 samples of known hydrocarbon concentration. Then the predicted variable y is the hydrocarbon concentration, the vector of sensor signals is

    11

    12T

    3

    4

    absorbance at 2000 cmabsorbance at 3000 cm

    temperature1

    aa

    aaa

    = =

    (C8)

    and the calibration model is written in terms of the sensor signals as 4

    11

    11

    2 3

    hydrocarbon concentration (absorbance at 2000 cm )

    (absorbance at 3000 cm ) (temperature)

    i ii

    y a a 4

    =

    = = = =+ +

    +

    0

    (C9)

    Note that the 1 as the last element of (C8) resulted in the inclusion of a constant bias term, 1, in the calibration model (C9). The stochastic fluctuations in the sensor signals can be estimated by measuring the same sample many times; let the variances of the sensor signals be written as 1, , 4, then

    21

    22

    23

    24

    0 0 00 00 0 00 0 0

    V

    =

    (C10)

    The known hydrocarbon concentrations of the 10 samples are stacked to give

    14

  • 15

    1

    10

    yY

    y

    = # (C11)

    and the 10 sets of sensor signals would be stacked to give 1 1 1 11 2 3 42 2 2 21 2 3 4

    10 10 10 101 2 3 4

    a a a aa a a a

    A

    a a a a

    = # # # # (C12)

    where the superscript refers to the sample number. Then the best calibration parameters are given by (C7).

    While the above method, known as weighted least squares, can produce good calibration models when the number of calibration parameters is low, it performs poorly when the number of calibration parameters is high, due to high correlations between the sensor signals. There are many numerical algorithms for constructing correlations when such correlations occur, which go by names such as principal component regression and partial least squares. Such algorithms are referred to as chemometrics (for chemistry measurement), for which many textbooks and software packages are available.10,11

    In some cases the relationship between the sensor signals and the predicted variables is nonlinear, in which case the minimization

    ( ) ( )T2 T 11

    min min min ( ) ( )jn

    jE E E Y Y V Y Y

    == = (C3)

    is solved numerically (see Section E1 for more information on nonlinear optimization). C.3. Filtering Sensor signals nearly always contain short-time fluctuations. This means that the measured quantity will show fluctuations that are much more rapid than the actual process is varying. This section describes how to smooth out the signals from the sensors, so that it more closely represents the actual variables being measured. This filtering step is often performed before the data are used for modeling and process control. C.3.a Exponential Filtering A filter smooths fluctuations in noisy signals and can be implemented by processes, digitally in computers, or in analog instrumentation. As an example of filtering by a process, placing a surge tank between an unsteady process stream and the unit it feeds will smooth out fluctuations in the feed (see Figure C1). An analog filter may consist of an RC electrical circuit, which contains a capacitance (C) and a resistance (R) to flow of current, just like the tank (capacitance) with a valve (resistance) at the outlet. A common digital implementation is called an exponential filter, which is described by the ordinary differential equation (ODE):

    ( ) ( ) ( )Fdy t y t x t

    dt + = (C13)

    where x(t) is the raw unprocessed measurement, y(t) is the filtered output, t is time, and F is the time constant of the filter which has the same units of time as t. Computers operate on digital signals, with the derivative in this ODE typically approximated by a backward difference:

    15

  • 16

    1 1( ) ( )n n n ny t y t y ydydt t t

    = = (C14) where t is the time between data points sampled at times t0, t1, , tn. Inserting (C14) into (C13) and rearranging gives:

    1(1 )n n ny ax a y = + (C15)

    where = 1/[1 + (F/t)], and the filtered output is initialized by y0 = y(0) = x(0). This exponential filter is also called a first-order filter. The order of the filter is the number of derivatives required to describe the filter when written as an ODE, which is one for the ODE (C13). This definition of order applies to processes, controllers, or closed-loop systems.

    Reactor (for example)

    flow

    time

    Surge tank

    flow

    time

    Reactor (for example)

    flow

    time

    Surge tank

    flow

    time

    Figure C1. A surge tank filters concentration and flow fluctuations.

    The filter constant, , contains the time constant F of the hypothetical first-order process that is being used as a filter. The filter constant can range from 0 to 1, with = 1 equivalent to no filtering, and with smaller positive values providing strong filtering. For = 0, the present measured value is not even used in the output, as the time constant of the filter is infinite, which corresponds to an infinite amount of filtering. In practice the filter constant is selected so that does not significantly change overall shape of the measured data, but reduces noise as much as possible. This is a tradeoff between small values of (near 0), which bias the filtered signal y, and large values of (near 1), which provide inadequate filtering of noise in y. C.3.b Double Exponential Filtering Placing two exponential filters in series produces a double exponential filter:

    1( ) ( ) ( )F

    dy t y t x tdt

    + = (C16)

    16

  • 17

    2( ) ( ) ( )F

    dz t z t y tdt

    + = (C17) where x(t) is the raw unprocessed measurement, y(t) is the filtered output from one exponential filter, and z(t) is the filtered output of the double exponential filter. The time constants F1 and F2 in the double exponential filter are not required to be the same, but are usually the same in practice. The double exponential filter provides better attenuation of high frequency noise than does the exponential filter. The digital implementation of this filter is:

    1 1(1 )n n 1ny x y = + (C18)

    2 2(1 )n nz y z 1n = + (C19)

    where 1 = 1/[1 + (F1/t)] and 2 = 1/[1 +2

    2n

    (F2/t)]. For F1 = F2 this can be written as 2

    12(1 ) (1 )n n nz x z z = + (C20) Note that xn1 and xn2 do not appear in this equation. For both the exponential filter and the double exponential filter, decreasing the filter constant (increasing the time constant of the filter) gives a smoother output, at the cost of having a more sluggish response. The choice of a filter constant is a design decision; ideally, a large enough value will be chosen to dampen out high frequency noise, without significantly altering the measured process dynamics. Below are the first several computations performed by single and double exponential filters on a raw signal x(t) with = 0.5.

    t x(t) Exponential Filtered y(t) Double Exponential Filtered y(t) 0 5 1 6 .5(6) + (1.5)5 = 5.5 2 4 .5(4) + (1.5)5.5 = 4.75 (.5) (4) + 2(1.5)6 (1.5) (5) = 5.75 2 23 4 .5(4) + (1.5)4.75 = 4.375 (.5) (4) + 2(1.5)5.75 (1.5) (6) = 5.25 2 24 5 .5(5) + (1.5)4.375 = 4.6875 (.5) (5) + 2(1.5)5.25 (1.5) (5.75) = 5.0625 2 2

    D. Dynamic Modeling This section discusses the development of first-principles process models, that is, models

    constructed from material, energy, and momentum balances. The balances can be written in terms of a general conservation equation: accumulation in out generation consumption= + (D1) where the terms are usually expressed in terms of rates. Since the dynamics are critically important for controlling the process, these balance equations should include the accumulation term. A steady-state balance should only be used when it is known without a doubt that the accumulation term is negligible.

    As an example of a conservation equation, the general energy balance is:

    rate of accumulation of energy rate of input of energy= rate of output of energy (D2) rate of generation of energy+ rate of expenditure of energy via work

    17

  • 18

    A typical method of generating energy is via chemical reaction. A typical method of energy input is that associated with the enthalpy of a flowing inlet stream.

    The material balance can be written in terms of the number of moles of a particular species, the mass of a particular species, the total mass, or the number of particles (e.g., atoms, molecules, crystals). For example, the mole balance for species A is

    rate of accumulation

    rate of input of moles of of moles of

    AA

    = rate of output of moles of A (D3) rate of generation of moles of A+ rate of consumption of moles of A The input and output of moles of species A are associated with the inlet and outlet streams; the rates of generation and consumption of moles of species A are associated with chemical reactions. The total mass balance for a system in which there are no nuclear reactions is:

    (D4) rate of accumulation

    rate of input of total mass rate of output of total massof total mass

    = The rates of generation and consumption of total mass are zero.

    As an example, consider the mass and energy balances for the liquid in an electrically heated well-mixed tank with level h and volumetric inlet flows or Fi and Fo. Assuming that the tank is perfectly mixed and that the liquid density of the inflow and outflows are equal, the total mass balance is

    ( )( ) ( ) ( )c id oA h t F t F tdt = (D5) accumulation = in out where Ac is the cross-sectional area of the tank, and is the liquid density. Assuming that the density and cross-sectional area are constants gives

    ( ) ( ) ( )c idh tA F t F

    dt= o t . (D6)

    With the assumptions of perfect mixing, equal liquid densities of the inflow and outflow streams, and negligible work due to mixing, the total energy balance is

    ( )( ) ( )( )

    ( ) ( ( ) ) ( ) ( ) ( ( ) )

    ( ) ( ( ) )

    c v ref ref i p i ref ref

    o p ref ref

    d A h t C T t T U Q t F t C T t T Hdt

    F t C T t T H

    + = + + +

    (D7)

    accumulation = in + in out where T is the temperature, is the heat rate applied through the electric heater, Cv is the constant-volume heat capacity on a per-mass basis, Cp is the constant-pressure heat capacity on a per-mass basis, Tref is the reference temperature, Uref is the reference internal energy on a per-mass basis, and Href is the reference enthalpy on a per-mass basis. This equation assumes that the heat capacities are constant over the range of temperature of interest.

    Q

    18

  • 19

    Many more examples on the writing of dynamic material and energy balances are given in textbooks on process controls,12,13,14 chemical reaction engineering,15 and transport phenomena.16 It is common in simulation and control software to write these models in state-space form:

    ( ) ( ( ), ( ))

    ( ) ( ( ), ( ))

    dx t f x t u tdty t g x t u t

    ==

    (D8)

    where y, u, and x are the vectors of model outputs, model inputs, and states, respectively, and f and g are algebraic functions. It is common in the design of control systems to replace the algebraic functions f and g by Taylor series expansions

    ( ) ( ) ( )

    ( ) ( ) ( )

    dx t Ax t Bu tdty t Cx t Du t

    = += +

    (D9)

    where y, u, and x are the vectors of model outputs, model inputs, and states, respectively, and A, B, C, and D are matrices of compatible dimensions. The linear model (D9) is convenient for determining stability, that is, whether the model outputs are bounded for any bounded inputs. In particular, the linear model (D9) is stable if and only if the real parts of all of the eigenvalues of A are negative.

    As an example, consider the well-mixed tank but with no electric heating. Then the sole conservation equation is (D6) which can be written as

    N( )

    ( )( ) 1 1 1 1( ) ( ) 0 ( )( )

    ( ) ( ) 1 ( ) 0 ( ) ( ) ( )

    ii o

    oc c c cAB u t

    F tdx t F t F t x tF tdt A A A A

    y t x t x t u t Cx t Du t

    = = +

    = = + = + (D9)

    where the model output is equal to the state which is the height of the tank, y = x = h, and the two flowrates are the model inputs collected into the vector u. Note that D = 0, which is true for nearly all models of industrial processes. The eigenvalue of A is 0, so the linear model (D9) is unstable any constant value for either model input ui results in the model output increasing or decreasing without bound. Many multivariable control systems use a discrete-time representation for (D9), in which the values of the states and model outputs are computed only at discrete sampling instances. The simplest method to derive such a discrete-time representation is to replace the derivative by its forward difference approximation:

    ( )1 ( ) ( ) ( ) ( )( ) ( ) ( )

    x t t x t Ax t Bu tty t Cx t Du t

    + = += +

    (D10)

    where t is the sampling interval, that is, the time between sampling instances. This can be rearranged to give:

    ( ) ( ) ( ) ( ) ( ) ( ) ( )( ) ( ) ( )

    x t t x t tAx t tBu t I tA x t tBu ty t Cx t Du t

    + = + + = + + = + (D11)

    or

    19

  • 20

    ( ) ( ) (( ) ( ) ( )

    )x t t Ax t Bu ty t Cx t Du t

    + = += + (D12)

    The linear discrete-time model (D12) is stable if and only if the magnitude of all eigenvalues of is less than 1. A

    E. Parameter Estimation While some model parameters are known and directly measured rather easily (e.g., mass,

    density), other parameters require estimation from experimental data. For example, kinetic parameters associated with chemical reactions usually are identified from experimental data because the kinetics computed from molecular theories are not sufficiently accurate. This section describes how to estimate parameters from dynamic data, and to quantify the accuracy of the parameters so it can be determined whether enough experimental data have been collected to obtain sufficiently accurate model parameters. E.1 Formulation of Parameter Estimation as an Optimization

    Parameter estimation is the process of fitting the simulation outputs to experimental data to estimate the unknown parameters. Typically the parameters are estimated by minimizing a weighted sum of squared errors between the model predictions and the measured variables:

    2

    1 1min ( ( ))

    m dN N

    ij ij iji j

    w y y = = (E1) where is the vector of parameters, ijy and ijy are the measurement and model prediction of the measured variable at the thi thj sampling instance, is a weighting factor, is number of measured variables, and is the number of sampling instances. To compute the best estimates of the parameters, each in (E1) should be set equal to the inverse of the

    measurement error variance

    ijw mN

    dN

    ijw2i , where i is the standard deviation for the error in the

    measurement.

    thi17 This selection of weights has a lower weighting on the measurements that are

    noisier. The optimization (E1) is more general than that used for sensor calibration (D3), since (E1) can be applied to experimental data from dynamic processes and the model in (E1) can be nonlinear in the parameters. When the model ijy is linear in the parameters then (E1) can be solved analytically in a similar manner as for (D3). That is, stack the ijy and ijy into vectors

    ijY y =

    #

    #; (E2)

    ijY y A = =

    #

    #. (E3)

    Then (E1) can be written as

    20

  • 21

    ( ) ( ) ( ) (T Tmin ( ) ( )Y Y W Y Y Y A W Y A ) = , (E4) where wij is the (i,j) element of the matrix W. The solution to this minimization is given by (C7) with V replaced by W1.

    The optimization (E1) is generalized to multiple experimental data sets by including an additional summation in the objective function.17 When the model is nonlinear in the parameters, then the optimization (E1) usually cannot be solved analytically, and hence numerical methods for optimization are applied; commercial software for doing these calculations include Matlab,18 IMSL,19 or FFSQP.20

    E.2. Quantifying the Accuracy of the Parameters The accuracy of the model parameters can be quantified using multivariate statistics. Due

    to the stochastic fluctuations associated with measurements, the parameter estimates are also stochastic variables with probability distributions. An approximate confidence region for the parameters can be obtained by linearizing the model near the vicinity of the estimate:17

    ( ) ( ) ( ) ( )jj j Fy y + ,

    , (E5)

    where is the vector of model predictions at the T1[ ,, ]mj j N jy y y,= thj sampling instance, is the vector of best parameter estimates, and is the jF mN N p sensitivity matrix given by

    jjy

    F

    =

    (E6)

    The sensitivity matrices can be calculated using finite differences or by integrating the sensitivity equations along with the model equations.

    jF21 It is normally acceptable to assume that

    the measurement errors are normally distributed and independent of each other, that is, the measurement error covariance matrix V is diagonal with the diagonal entries, 2ii iV = . Then the parameter covariance matrix V for the linearized problem is given by

    (E7) 1 11

    dNTj j

    jV F V

    =

    = FThe approximate 100(1 )% confidence region is the hyperellipsoid defined by T 1 2( ) ( ) (

    pNV ) (E8)

    where 2 is the chi-squared distribution which is reported in introductory books on statistics.8 This confidence ellipsoid generalizes the notion of a confidence interval used for single parameters to multiple parameters. The eigenvectors of 1V

    give the direction and the eigenvalues give the length of the axes of the hyperellipsoid. Because it is impossible to visualize the hyperellipsoid for more than three dimensions, in these cases confidence intervals are often reported: * *1 / 2 , 1 / 2 ,( ) ( )i d p ii i i d p it N N V t N N V + i

    ) p

    (E9)

    where

    is the t statistic for 1 / 2 ( d pt N N dN N degrees of freedom and iiV , is the ( element of )i i,V . Note that these confidence intervals on each model parameter are not as good of a

    21

  • 22

    quantification of the accuracy of the model parameters as the original confidence hyperellipsoid (E8). E.3 Chemical Reactor Example

    Consider a reactor for which the reactant A forms the product B ( A B ) with kinetic rate law,

    E RTAr ke C

    / = A , (E10) where is the molar concentration of species AC A , is temperature, T R is the ideal gas constant, k is pre-exponential factor, E is the activation energy, and rA is the net rate of generation of A. Assume that the experiments are carried out in a well-mixed batch reactor with initial concentration , and that the volume remains constant throughout the reaction. A thermocouple and an infrared sensor are inserted into the reactor to measure the temperature and reactant concentration, respectively (Section C2 describes how to relate infrared spectra to concentration). Assume that the concentration of A and the temperature can be measured once a minute during the experiments, the total time for one batch run is one hour, and the temperature measurement is twice as accurate as the concentration measurement (in terms of error variance). The goal is to estimate the pre-exponential factor k and the activation energy E from the experimental data from one batch run.

    0AC

    Since the measured variables are T and , AC 2mN = . The measurements are taken every minute for sixty minutes

    0

    1

    60

    0 min1 min

    60 min

    tt

    t

    ==

    =# (E11)

    so . The error variances of the measurements are related by: 60dN = 2 2 2

    AT C = / . (E12)

    The parameter vector is

    kE

    = . (E13) The weighting factors are 21 21 Aj T jw w

    21 C = / ; = / . (E14) The measurement and model prediction for the measured variables are

    1 1

    2 2

    ;j j jj

    j A j Aj j

    y T Tyy C Cy, ,

    = ; == ; =

    (E15)

    Assume the tank is well-mixed, then the mole balance on is A

    ( )A Ad C V r Vdt

    = (E16) accumulation = net generation consumption

    22

  • 23

    Since the volume V is constant,

    E RTA AdC ke Cdt

    /= (E17)

    0

    ( )

    0

    A

    A

    C t E RT tAC

    A

    dC ke dtC

    /= (E18) ( )

    00

    lnt E RT tA

    A

    C k e dtC

    / =

    (E19)

    (E20) 0( )

    0A A

    t E RT tk e dtC C e

    /=

    (E21) , 0( )

    0( )j

    A j A j A

    t E RT tk e dtC C t C e

    /= =

    (E22) ( )jT T t= j

    22 j

    Inserting into (E1) gives

    (E23) 2 60

    2

    , 1 1min ( )ij ij ijk E i j

    w y y= =

    602

    1 1 2 21, 1

    min ( ) ( )j j j jjk E jw y w yy y

    = + (E24)

    Hence the best-fit parameters k* and E* are solutions to the minimization

    ( )

    0

    260 2

    2 2, 1

    1 1min ( )t j E RT t

    A

    k e dt

    j j A j Aok E j T C

    T T t C C e / , =

    + (E25) which can be solved numerically. To compute the confidence intervals, first note that

    ( )0

    **

    *,

    0

    ( )( )( )

    ( )t j E RT t

    jjj k e dt

    A jA

    T tTy

    C C e

    /

    = =

    (E26)

    Hence the sensitivity matrices are

    1 2

    * , * , ,

    *1 2

    j j

    j jj

    A j A j A j

    T Ty T

    FC C C

    = = = = = =

    (E27)

    Since the temperature is not a function of the parameters and ( )T t k E (it was specified by the person who designed the batch experiment),

    [0 0jT = ] ; (E28)

    and

    23

  • 24

    , ,

    01

    ( )

    00

    ( )0

    ( )0

    j

    j j

    A j A j

    A

    t E RT t

    A

    t E RT t

    t E RT t

    k e dt

    k e dt

    C CC ek k

    e dC e

    /

    /

    /

    = = t =

    (E29)

    , , ( )

    002

    ( )

    0

    ( )0

    1( )( )

    j j

    j

    tA j A j E RT t

    A

    t E RT tA j

    t E RT tk e dtC C k eC eE E

    C t k e dtRT t

    /

    /

    / dt = = =

    (E30)

    Substituting these equations into (E27) gives

    ( ) ( )0 0

    0 0( )

    ( )j jt tE RT t E RT tj A jF C t ke dt e d

    RT t / /

    =

    t. (E31)

    The error variance matrix is

    22

    122

    2

    0000

    A

    T

    C

    V

    = = . (E32)

    Inserting these expressions into (E7) and simplifying the algebra gives the parameter covariance matrix:

    ( )2 60 0

    1 ( )2 0 0( )1

    0

    ( ) 11 ( )( )

    j

    j j

    j

    A

    t E RT t

    t tA j E RT t E RT tt E RT tjC

    e dtC t kV e dtk R T te dtR T t

    /

    / /=

    ( )e dt / =

    (E33)

    and the confidence region and intervals are given by (E8) and (E9). The parameter estimates and confidence region for this example was not a function of the

    noise in the thermocouple readings because those temperature measurements were not used. If the temperature profile was not known, but had to be constructed from the temperature measurements, then could be estimated by filtering the temperature measurements, or by fitting a smooth function to the temperature measurements. The resulting parameter estimates and confidence region would be a function of the temperature measurements, and the temperature noise level.

    ( )T t( )T t

    F. Feedback Control Design Feedback controllers are usually implemented in digital form, which means that the

    controller input signals are at discrete time instances and the controller output signals are at discrete time instances. The time interval between sampling instances is known as the sampling time. A good rule-of-thumb is to select the sampling time equal to 1/10 to 1/20 of the fastest time constant of the process that is of interest for control. Some heuristics for the order in which feedback control loops are closed were summarized in Section B. Many analytical methods are available for selecting which manipulated variables to pair with which controlled variables (called the pairing problem),22,23,24 based on steady-state or dynamic models between the

    24

  • 25

    process inputs and process outputs. A commonly used method for pairing variables is using the relative gain array whose elements are defined by:12,13,14

    ij ij ijP H = (F1) where Pij is the steady-state gain between the i th plant output and j th manipulated variable:

    iij

    j

    yPu

    = (F2) and

    1 T( )H P= (F3) The pairing rules are:

    (1) For ij 0, do not pair the j th manipulated variable with the i th plant output, (2) ij 1 indicates that it is good to pair the j th manipulated variable with the i th plant

    output, (3) Either ij < 0.6 or ij > 2 indicates that it is bad to pair the j th manipulated variable

    with the i th plant output. If no pairing satisfies all three rules, then redesign the process or implement a full multivariable controller such as a model predictive controller. As an example, a model for a fluid catalytic cracking unit has the steady-state gain matrix25,26

    2.7 0.1051.85 0.085

    P =

    (F4)

    where the manipulated variables are the flowrates of regenerated catalyst to the reactor and air to the regenerator, and the controlled variables are the riser exit and regenerator cyclone temperatures. Then the relative gain matrix is

    1 T 0.2006 4.3658 0.5416 0.4584( )0.2478 6.3717 0.4584 0.5416

    H P = = = (F5) Pairing rule (3) is violated for either pairing, indicating that multivariable control would be preferred over using multiple single-loop feedback controllers. If two single-loop controllers were implemented, then it would be better to pair the regenerated catalyst flowrate to the riser exit temperature and the air flowrate to the regenerator cyclone temperature, since that pairing is closest to satisfying pairing rule (2). F.1. Proportional-Integral-Derivative (PID) Control Proportional-integral-derivative (PID) controllers constitute a significance proportion of the control systems implemented for most refining and petrochemical facilities. The simplest type of feedback controllers is the Proportional (P) controller, ( ) (0) ( )cu t u K e t= + , (F6) where u is the manipulated variable (controller output), the control error e is the difference between the setpoint yref and measured variable ym, and Kc is the controller gain which is a tuning parameter. Small values of the controller gain lead to offset between the setpoint and measured variable and sluggish closed-loop response to disturbances and setpoint changes. Larger controller gains lead to small offset and fast closed-loop response. For hydrocarbon

    25

  • 26

    processes, very large controller gains result in large oscillations in the measured variable, or instabilities. A common tuning approach is to first set the controller gain fairly small, and then increase its value by factors of 2 until some overshoot is observed in the closed-loop response to a step change in setpoint. The offset between the setpoint and measured variable obtained by a P controller is non-zero for most processes, irrespective of controller gain, and a common closed-loop specification is that the offset resulting from constant changes in the setpoint and disturbances approach zero. This motivates the use of a Proportional-Integral (PI) controller:

    0

    1( ) (0) ( ) ( )t

    cI

    u t u K e t e t dt = + + , (F7)

    where I is an additional tuning parameter known as the integral time constant. It can be shown, under mild conditions on the process, to produce zero offset to constant changes in the setpoint and disturbances. Basically, any offset (nonzero e) causes the integral in (F7) to grow, which increases the manipulated variable u until the offset is removed. For most hydrocarbon processes too small of an integral time constant results in closed-loop oscillations. A large integral time constant reduces the effect of the integral action. A popular tuning rule for PI controllers is to set the integral time constant equal to the slowest time constant of the process, and then vary the controller gain until a small amount of overshoot is observed in the closed-loop response to a step change in setpoint. The slowest time constant of the process can be estimated as the time it takes for the process output to reach 63% of the difference between its initial and final values for a step change in the manipulated variable. PI controllers are the most common of PID controllers used in the refining and petrochemical industries. There are numerous variations of implementation of PID controllers, with a common time-domain expression for a PID controller being

    0

    d d( ) (0) ( ) ( )d d

    t

    F c DI

    u eu t u K e t e t dtt t

    + = + + +

    1 , (F8)

    where D is the derivative time constant and F is a filter time constant. The purpose of the derivative term is to enable the controller to anticipate changes in the control error e, so that the control action is larger if the control error e is increasing with time. Usually the derivative time constant D is set somewhere between 0 and a quarter of the integral time constant I. A common heuristic tuning rule is to set the derivative time constant to zero unless the best tuning achieved by a PI controller is too sluggish to satisfy the closed-loop performance specifications, in which case set D = 0.25I. The purpose of the filter time constant F is to reduce the effect of measurement noise on controller output, arising from the use of a derivative of the control error in the controller. Typically the filter time constant is set between 8 and 20 times the derivative time constant, and for hydrocarbon processes this usually results in controller outputs that do not have too much stochastic fluctuations resulting from the measurement noise. A weakness of the PID controller in (F8) is that the derivative of the error signal becomes very large when there is a step in the setpoint, which results in a large rapid change in the controller output referred to as derivative kick.27 Derivative kick can be avoided by replacing the derivative of the error with the derivative of the measured variable ym to give ref me y y=

    0

    dd 1( ) (0) ( ) ( )d d

    tmF c D

    I

    yu u t u K e t e t dtt t

    + = + + . (F9)

    26

  • 27

    By approximating the integral by a summation and the derivatives by a first-order backward difference, and rearranging, the digital form of the control algorithm is obtained:

    , , 10 111 1 1

    nm n m ncF

    n n n DkF F F I

    y yu Kt tu u et t t t

    =

    / = + + ++ / + / + / ke , (F10) where is the sampling time, is the value of the manipulated variable which is held constant between times and

    1n nt t t = nunt 1nt + , and ,m ny and are the measured and error variables at

    time . ne

    nt Many methods for tuning PID controllers have been developed over the years, including Ziegler-Nichols, Cohen Coon, BLT tuning, Internal Model Control, and direct synthesis.12,13,14,27 Some of these tuning rules produce controller parameters that are very sensitive to disturbances or model uncertainties, whereas there are sets of other tuning rules that give similar closed-loop performance. A tuning rule applied in the refining and petrochemical industries that allows a tradeoff between closed-loop performance and robustness to model uncertainties is the Internal Model Control (IMC) method. Consider a stable process well-approximated by a first-order model with time delay, which is very common in hydrocarbon processes. Such models have three parameters: the time delaythe steady-state gain K, and the time constant . The time delay is the time it takes for a step change in the manipulated variable to begin to affect the process output, the steady-state gain is the difference between the initial and final values of the process output divided by the magnitude of this step change, and the time constant is the time it takes for the process output to reach 63% of the way to its final value. The IMC PID controller parameters are28

    22 ( )

    2

    2

    2( )

    c

    I

    D

    F

    KK

    += += + /= += +

    (F11)

    where is a tuning parameter that defines a tradeoff between the closed-loop speed of response and the robustness of the closed-loop system to measurement noise and inaccuracy in the model. For larger values of the tuning parameter, is approximately the time constant of the closed-loop system. Tables of PID tuning rules for other process models are available,29 including rules designed to suppress the effects of both output and load disturbances on the closed-loop performance.30,31

    F.2. Antiwindup, Bumpless Transfer, and Split-range Control Industrial control systems must account for the discrete process changes such as occur

    during the startup and shutdown of any refining or petrochemical facility, hard limits on actuator movements, switching from manual to automatic control, and switching between control systems designed for different operating conditions. Providing fast and smooth transitions during discrete process changes is of high industrial importance to ensure safe operating conditions. Many a plant explosion occurred during the startup procedure shortly before or after a discrete transition.

    27

  • 28

    The simplest form of discrete transition occurs when a controller output saturates. Reset windup is said to occur when the controller continues to integrate the error signal during saturation, causing large overshoots and oscillations. Discrete process changes also occur during split-range control, in which different manipulated variables become active in different operating regimes. Split-range control is useful when more than one manipulated variable is required to span the whole range of setpoints. Controllers that provide smooth transitions during discrete process changes are said to provide bumpless transfer.

    One method to provide bumpless transfer involves the use of model predictive control, which is described in Section G. A simple method to provide bumpless transfer that is applied in single-loop feedback control systems is to implement the velocity form for the controller (equation (F10) is an example of a controller said to be in position form). To derive the velocity form for (F10), write (F10) for the 1n sampling instance and subtract to give:

    ( ) , , 1 , 21 1 2 1 21 1 m n m n m ncFn n n n n n D nF Fy y yKt tu u u u e e e

    t t t

    +/ = + + ++ / + / I . (F7) The main advantage of implementing the controller in this form is that it will not integrate the controller error when the manipulated variable reaches a constraint (for example, 0 or 100% Power). For this reason, the controller will also perform better during transitions between different operating conditions, that is, will provide bumpless transfer. F.3. Split-range Control Example

    Precise control of the temperature T of a sample containing a thin polymer film was required to provide accurate measurements of diffusion coefficients.32,33 The manipulated variable was the power to a heating tape which surrounds the polymer sample. Heat sinks allowed the temperature of the sample to be reduced quickly. For temperatures below , the heat sink was distilled water. For higher temperatures the heat sink was gaseous nitrogen. The advantage of the gaseous nitrogen heat sink over the liquid water sink was that it allowed a wide range of temperatures to be covered by only manipulating the heating power. The distilled water sink provided a more stable response for temperatures under .

    o30 C

    o30 CThe heat sinks were at room temperature, which was ~ with slow variations up to For each heat sink, temperature responses to step changes in heating power were taken at

    a variety of operating conditions along the desired temperature trajectory in order to estimate the importance of nonlinearity. The process responses were linear for each heat sink, which were well modeled as first-order-plus-time-delay with model parameters

    o21 Co1 C.

    1 1 11.0; 9.5; 2.4;K = = = (F8) for the gaseous nitrogen heat sink ( ) and o30 CT > 2 2 20.068; 1.7; 1.4;K = = = (F9) for the liquid water heat sink ( ), where the time constants o30 CT < i and time delays i were in units of minutes and the process gains were in units of /%Power. The heating power was constrained between 0 and 100%. At steady state, the sample was at room temperature when the heating power was turned off.

    iKo C

    The goal of the closed-loop system was to smoothly ramp the temperature from stable operations at 120 to 25 (see Figure F1a). For reproducible collection of diffusion data, the oC oC

    28

  • 29

    temperature had to stay within of the setpoint 70 minutes before and 50 minutes after the ramp, and within 1.5 o throughout the ramp. The control algorithm was required to provide bumpless transfer between the radically different process behaviors (F13)-(F14) that results when the temperature crosses 30 , while satisfying the constraints on heating power.

    o0.5 CC

    oC

    0 200 400 600 80020

    40

    60

    80

    100

    120

    Time (minutes)

    Tem

    pera

    ture

    (Cen

    tigrad

    e)

    (a)0 200 400 600 800

    20

    40

    60

    80

    100

    120

    140

    Time (minutes)

    Tem

    pera

    ture

    (Cen

    tigrad

    e)(b)

    0 200 400 600 8000

    20

    40

    60

    80

    100

    Time (minutes)

    % p

    ower

    (c)0 200 400 600 800

    1.5

    1

    0.5

    0

    0.5

    1

    Time (minutes)

    Tem

    pera

    ture

    (Cen

    tigrad

    e)

    (d) Figure F1. (a) Setpoint; (b) closed-loop temperature tracking (-) and transition line between heat sinks (--); (c) power output from the nitrogen (--) and water (-) heat sinks; (d) difference between setpoint and controlled variable.

    y

    ym

    p2k2

    k1 p1

    _S

    eyref

    d

    ++

    y

    ym

    p2k2

    k1 p1

    _S

    eyref

    d

    ++

    Figure F2. Block diagram. The setpoint signal is refy , the error signal is , the measured temperature is

    e

    my , and the effect of the disturbances on the temperature is d. The selector S switches between the controllers and depending on the value of the measured temperature. 1k 2k

    29

  • 30

    The sampling time was selected as 0 1t = . minute which is within 1/10 to 1/20 of the fastest time constant, 2 1.7. = This split-range control problem was solved by implementing the PID controller (F12) in velocity form, using the IMC tuning rules (F11), switching between the two sets of model parameters (F13) and (F14) depending on whether the temperature was above or below 30 (see Figure 2). The IMC tuning parameter was selected to be oC 1 0 = . minute to give fast uniform closed-loop response throughout the temperature ramp. The closed-loop temperature response to programmed step and ramp trajectories is shown in Figure 1bd, with the controller output shown in Figure 1c. This demonstrates that two digital IMC-based PID controllers implemented in velocity form that switch during transitions between operating regimes satisfied all of the closed-loop specifications for this problem. G. Model Predictive Control

    Most advanced controllers being implemented in the refining and petrochemical industries today are Model Predictive Control (MPC) algorithms,34,35 of which there are many variants including RMPC (Honeywells implementation), and DMC (dynamic matrix control). These algorithms share the common trait of using an explicitly formulated process model to predict the future and then compute the future control trajectory that optimizes a performance objective based on the model predictions (see Figure G1). One reason for the popularity of MPC is its ability to directly account for constraints in the manipulated, state, and controlled variables.36 For linear processes the optimization is in the form of a linear program (LP) or quadratic program (QP), which must be solved at each sampling instance, with the constraints written directly as constraints in the LP/QP.37 After the value for the control move at the current sampling instance is implemented, new measurements are collected and the control calculation is repeated. These steps update the control move calculations to take into account the latest measurement information. This section describes a typical modern formulation for a model predictive controller, followed by a discussion of some technical issues and an example.

    Prediction horizon

    k+1 k+npk+2k

    past future

    Setpoint

    Manipulated variables

    u(k)

    Projected outputs

    y

    y(k+1)

    Control horizon

    k+nu

    Prediction horizon

    k+1 k+npk+2k

    past future

    Setpoint

    Manipulated variables

    u(k)

    Projected outputs

    y

    y(k+1)

    Control horizon

    k+nu

    Figure G1. A simplified model predictive control scheme.

    30

  • 31

    G.1 MPC Formulation Recall the linear discrete-time state-space model (D12)

    1k k kx Ax Bu+ = + k ky Cx= (G1) where uk, yk, and xk are the vectors of controller outputs, controlled variables, and states at timestep k and the matrices A, B, and C are assumed to be controllable and observable. The subscript k + 1 refers to the sampling instance one sampling interval after sampling instance k. Note that for discrete-time models used in control, there is normally no direct feedthrough term, that is, the measurement ky does not depend on the input at time k , but it does depend on the input at time through the state 1k kx . The reason for the absence of direct feedthrough is that normally the output is measured at time before the new input at time is computed and implemented.

    k k

    The state x , input u , and measurement in (G1) should be interpreted as deviation variables. This means that they represent the deviations from some consistent set of variables

    y

    { L L L}x u y, , around which the model is obtained. To illustrate the notion of deviation variables, if Ly represents a temperature of 330 K, a physical measurement of 331 K would correspond to the

    deviation variable 1y = K. The model (G1) is typically the result of identification experiments performed around the values { }L L Lx u y, , or the result of linearizing and discretizing a nonlinear first-principles model around the value { }L L Lx u y, , . For a stable process, the set { }L L Lx u y, , will typically represent a steady state often the steady state that defines the desired process operating point.

    A typical optimization problem in MPC takes the form

    (G2) { }1 T T, ,

    0

    T

    0,..., 1 min ( ) ( ) ( ) ( )

    ( ) ( )

    n

    i ref i i ref i i ref i i ref ii

    n ref n n ref n

    ii n

    u x x Q x x u u R u u

    x x S x x

    , ,

    =

    , ,

    = +

    +

    T

    i

    subject to constraints

    0 givenx

    1i ix Ax Bu+ = + i iy Cx= (G3)

    for 0 1L i UU u U i n j

    for 1L i UY Hx Y i n + where i is the time index, n is the control horizon. In the objective function (G2), both the deviation of the states ix from some desired reference trajectory ref ix , and the deviation of the inputs from some desired trajectory iu ref iu , are penalized. These reference trajectories, which may be constant or vary with time, are provided to the model predictive controller by a process operator or a higher level control system. The constraints on the achievable manipulated variables or acceptable states are usually not dependent on the reference trajectories, and

    31

  • 32

    therefore these reference trajectories do not appear in the constraint equations (G3). Usually, the state constraints represent constraints on the process measurements (that is, H = C), but constraints on other combinations of states are also possible (including constraints on combinations of inputs and states). Also, it may be desired to place constraints on the rate of change of the inputs, giving additional constraints of the form 1L i iU u u . The output constraints in (G3) are enforced over an extended horizon of length . A sufficiently large value for

    UUn j+

    j ensures that the constraints will be feasible on an infinite horizon if they are feasible up to the horizon .n j+ 38 For the output constraints in (G3) to be well defined, how the inputs should behave in the interval iu 1n i n j + should also be specified. Typical choices for this time interval are either i refu u i,= or ( ) ( )i ref i i ref iu u K x x, , = where the matrix K is designed to stabilize the closed-loop system. For the latter choice, the input constraints should be included in the problem formulation for the time interval 1n i n j + . These input constraints then effectively become an additional set of state constraints over that period.

    The symmetric matrices , R, and S are design parameters that weight the relative importance of the three terms in the objective function (G2). The state penalty matrix is positive semidefinite, R is a positive-definite matrix that penalizes the magnitude of the controller outputs during the control horizon, and S is a positive-definite matrix that penalizes the magnitude of the states at the end of the control horizon. A good way to specify S is as the sol