Practical plantwide process control Part 1 Sigurd Skogestad, NTNU Thailand, April 2014 1 Part 1 (3h): Plantwide control Introduction to plantwide control (what should we really control?) Part 1.1 Introduction. – – – Objective: Put controllers on flow sheet (make P&ID) Two main objectives for control: Longer-term economics (CV1) and shorter-term stability (CV2) Regulatory (basic) and supervisory (advanced) control layer Part 1.2 Optimal operation (economics) – – Active constraints Selection of economic controlled variables (CV1). Self-optimizing variables. Part 1.3 -Inventory (level) control structure – – Location of throughput manipulator Consistency and radiating rule Part 1.4 Structure of regulatory control layer (PID) – – Selection of controlled variables (CV2) and pairing with manipulated variables (MV2) Main rule: Control drifting variables and "pair close" Summary: Sigurd’s rules for plantwide control 2 Part 1.1 Introduction – Objective: Put controllers on flow sheet (make P&ID) – Two main objectives for control: Longer-term economics (CV1) and shorter-term stability (CV2) – Regulatory (basic) and supervisory (advanced) control layer 3 Why control? • Operation Actual value(dynamic) Steady-state (average) time 4 In practice never steady-state: • Feed changes • Startup “Disturbances” (d’s) • Operator changes • Failures • ….. - Control is needed to reduce the effect of disturbances - 30% of investment costs are typically for instrumentation and control Countermeasures to disturbances (I) I. Eliminate/Reduce the disturbance (a) Design process so it is insensitive to disturbances • Example: Use buffertank to dampen disturbances Tin inflow (b) outflow Detect and remove source of disturbances • • 5 ∞ Tout “Statistical process control” Example: Detect and eliminate variations in feed composition Countermeasures to disturbances (II) II. Process control Do something (usually manipulate valve) to counteract the effect of the disturbances (a) Manual control: Need operator (b) Automatic control: Need measurement + automatic valve + computer Goals automatic control: • Smaller variations • more consistent quality • More optimal • Smaller losses (environment) • Lower costs • More production Industry: Still large potential for improvements! 6 Classification of variables d u input (MV) Process (shower) y output (CV) Independent variables (“the cause”): (a) Inputs (MV, u): Variables we can adjust (valves) (b) Disturbances (DV, d): Variables outside our control Dependent (output) variables (“the effect or result”): (c) (d) 7 Primary outputs (CVs, y1): Variables we want to keep at a given setpoint Secondary outputs (y2): Extra measurements that we may use to improve control Inputs for control (MVs) • Usually: Inputs (MVs) are valves. – Physical input is valve position (z), but we often simplify and say that flow (q) is input 3 p Valve equation: q[m =s] = Cv f (z) ¢ p=½ 8 Idealized view of control (“PhD control”) d, ys = y-ys Control: Use inputs (MVs, u) to counteract the effect of the disturbances (DVs, d) such that the outputs (CV=y) are kept close to their setpoints (ys) 9 Practice: Tennessee Eastman challenge problem (Downs, 1991) (“PID control”) 10 Where place TC PC LC CC x SRC ?? Notation feedback controllers (P&ID) T (measured CV) Ts (setpoint CV) TC MV (could be valve) 2nd letter: C: controller I: indicator (measurement) T: transmitter (measurement) 11 1st letter: Controlled variable (CV) = What we are trying to control (keep constant) T: temperature F: flow L: level P: pressure DP: differential pressure (Δp) A: Analyzer (composition) C: composition X: quality (composition) H: enthalpy/energy Example: Level control Inflow (d) Hs H LC Outflow (u) CLASSIFICATION OF VARIABLES: 12 INPUT (u): OUTFLOW (Input for control!) OUTPUT (y): LEVEL DISTURBANCE (d): INFLOW How we design a control system for a complete chemical plant? • How do we get from PID control to PhD control? • • • • 13 Where do we start? What should we control? and why? etc. etc. Plantwide control = Control structure design • Not the tuning and behavior of each control loop, • But rather the control philosophy of the overall plant with emphasis on the structural decisions: – – – – Selection of controlled variables (“outputs”) Selection of manipulated variables (“inputs”) Selection of (extra) measurements Selection of control configuration (structure of overall controller that interconnects the controlled, manipulated and measured variables) – Selection of controller type (LQG, H-infinity, PID, decoupler, MPC etc.). • That is: Control structure design includes all the decisions we need make to get from ``PID control’’ to “PhD” control 14 Previous work on plantwide control: • Page Buckley (1964) - Chapter on “Overall process control” (still industrial practice) • Greg Shinskey (1967) – process control systems • Alan Foss (1973) - control system structure • Bill Luyben et al. (1975- ) – case studies ; “snowball effect” • George Stephanopoulos and Manfred Morari (1980) – synthesis of control structures for chemical processes • Ruel Shinnar (1981- ) - “dominant variables” • Jim Downs (1991) - Tennessee Eastman challenge problem • Larsson and Skogestad (2000): Review of plantwide control 15 Main objectives control system 1. Implementation of acceptable (near-optimal) operation 2. Stable operation ARE THESE OBJECTIVES CONFLICTING? • Usually NOT – Different time scales • – Stabilization doesn’t “use up” any degrees of freedom • • 16 Stabilization fast time scale Reference value (setpoint) available for layer above But it “uses up” part of the time window (frequency range) Part 1.2 Optimal operation (economics) Example of systems we want to operate optimally • Process plant – minimize J=economic cost • Runner – minimize J=time • «Green» process plant – Minimize J=environmental impact (with given economic cost) • General multiobjective: – Min J (scalar cost, often $) – Subject to satisfying constraints (environment, resources) 17 Process operation: Hierarchical structure Manager Process engineer Operator/RTO Operator/”Advanced control”/MPC PID-control 20 u = valves Translate optimal operation into simple control objectives: What should we control? CV1 = c ? (economics) CV2 = ? (stabilization) 21 Part 1.2 Optimal operation (economics) • Goal: Select economic controlled variables (CV1) – Active constraints – Self-optimizing variables 22 Outline • Skogestad procedure for control structure design I Top Down • Step S1: Define operational objective (cost) and constraints • Step S2: Identify degrees of freedom and optimize operation for disturbances • Step S3: Implementation of optimal operation – What to control ? (primary CV’s) (self-optimizing control) • Step S4: Where set the production rate? (Inventory control) II Bottom Up • Step S5: Regulatory control: What more to control (secondary CV’s) ? • Step S6: Supervisory control • Step S7: Real-time optimization 23 Step S1. Define optimal operation (economics) • What are we going to use our degrees of freedom (u=MVs) for? • Typical cost function*: J = cost feed + cost energy – value products • • 24 *No need to include fixed costs (capital costs, operators, maintainance) at ”our” time scale (hours) Note: J=-P where P= Operational profit Optimal operation distillation column • • Distillation at steady state with given p and F: N=2 DOFs, e.g. L and V (u) Cost to be minimized (economics) cost energy (heating+ cooling) J = - P where P= pD D + pB B – pF F – pVV value products • • 25 cost feed Constraints Purity D: For example xD, impurity · max Purity B: For example, xB, impurity · max Flow constraints: min · D, B, L etc. · max Column capacity (flooding): V · Vmax, etc. Pressure: 1) p given (d) 2) p free (u): pmin · p · pmax Feed: 1) F given (d) 2) F free (u): F · Fmax Optimal operation: Minimize J with respect to steady-state DOFs (u) Step S2. Optimize (a) Identify degrees of freedom (b) Optimize for expected disturbances • • • • 26 Need good steady-state model Time consuming! But it is offline Main goal: Identify ACTIVE CONSTRAINTSs A good engineer can often guess the active constraints Steady-state DOFs Step S2a: Degrees of freedom (DOFs) for operation NOT as simple as one may think! To find all operational (dynamic) degrees of freedom: • Count valves! (Nvalves) • “Valves” also includes adjustable compressor power, etc. Anything we can manipulate! BUT: not all these have a (steady-state) effect on the economics 27 Steady-state DOFs Steady-state degrees of freedom (DOFs) IMPORTANT! DETERMINES THE NUMBER OF VARIABLES TO CONTROL! • No. of primary CVs = No. of steady-state DOFs Methods to obtain no. of steady-state degrees of freedom (Nss): 1. Equation-counting • • Nss = no. of variables – no. of equations/specifications Very difficult in practice 2. Valve-counting (easier!) • • Nss = Nvalves – N0ss – Nspecs N0ss = variables with no steady-state effect • Inputs/MVs with no steady-state effect (e.g. extra bypass) • Outputs/CVs with no steady-state effect that need to be controlled (e.g., liquid levels) 3. Potential number for some units (useful for checking!) 4. Correct answer: Will eventually find it when we perform optimization 28 CV = controlled variable Steady-state DOFs Typical Distillation column 4 5 3 1 4 DOFs: With given feed and pressure: NEED TO IDENTIFY 2 more CV’s - Typical: Top and btm composition 6 2 29 Nvalves = 6 , N0y = 2* , NDOF,SS = 6 -2 = 4 (including feed and pressure as DOFs) *N0y : no. controlled variables (liquid levels) with no steady-state effect Steady-state DOFs Steady-state degrees of freedom (Nss): 3. Potential number for some process units • • • • • • • • • • 30 • • • • each external feedstream: 1 (feedrate) splitter: n-1 (split fractions) where n is the number of exit streams mixer: 0 compressor, turbine, pump: 1 (work/speed) adiabatic flash tank: 0* liquid phase reactor: 1 (holdup reactant) gas phase reactor: 0* heat exchanger: 1 (bypass or flow) column (e.g. distillation) excluding heat exchangers: 0* + no. of sidestreams pressure* : add 1DOF at each extra place you set pressure (using an extra valve, compressor or pump), e.g. in adiabatic flash tank, gas phase reactor or absorption column *Pressure is normally assumed to be given by the surrounding process and is then not a degree of freedom Ref: Araujo, Govatsmark and Skogestad (2007) Extension to closed cycles: Jensen and Skogestad (2009) Real number may be less, for example, if there is no bypass valve Steady-state DOFs Distillation column (with feed and pressure as DOFs) split “Potential number”, 31 Nss= 0 (column distillation) + 1 (feed) + 2*1 (heat exchangers) + 1 (split) = 4 With given feed and pressure: N’ss = 4 – 2 = 2 Step S2b: Optimize for expected disturbances • What are the optimal values for our degrees of freedom u (MVs)? J = cost feed + cost energy – value products • Minimize J with respect to u for given disturbance d (usually steady-state): minu J(u,x,d) subject to: Model equations (e,g, Hysys): Operational constraints: f(u,x,d) = 0 g(u,x,d) < 0 OFTEN VERY TIME CONSUMING – Commercial simulators (Aspen, Unisim/Hysys) are set up in “design mode” and often work poorly in “operation (rating) mode”. – Optimization methods in commercial simulators often poor • We use Matlab or even Excel “on top” 32 …. BUT A GOOD ENGINEER CAN OFTEN GUESS THE SOLUTION (active constraints) Step S3: Implementation of optimal operation • Have found the optimal way of operation. How should it be implemented? • What to control ? (primary CV’s). 1.Active constraints 2.Self-optimizing variables (for unconstrained degrees of freedom) 33 Optimal operation - Runner Optimal operation of runner – Cost to be minimized, J=T – One degree of freedom (u=power) – What should we control? 34 Optimal operation - Runner 1. Optimal operation of Sprinter – 100m. J=T – Active constraint control: • Maximum speed (”no thinking required”) • CV = power (at max) 35 Optimal operation - Runner 2. Optimal operation of Marathon runner • 40 km. J=T • What should we control? CV=? • Unconstrained optimum J=T uopt 36 u=power Optimal operation - Runner Self-optimizing control: Marathon (40 km) • Any self-optimizing variable (to control at constant setpoint)? • • • • 37 c1 = distance to leader of race c2 = speed c3 = heart rate c4 = level of lactate in muscles Optimal operation - Runner J=T Conclusion Marathon runner copt c=heart rate select one measurement c = heart rate 38 • CV = heart rate is good “self-optimizing” variable • Simple and robust implementation • Disturbances are indirectly handled by keeping a constant heart rate • May have infrequent adjustment of setpoint (cs) Selection of CV1 Expected active constraints distillation • • Both products (D,B) generally have purity specs Valuable product: Purity spec. always active – Reason: Amount of valuable product (D or B) should always be maximized • Avoid product “give-away” (“Sell water as methanol”) • Also saves energy methanol + water valuable product methanol + max. 0.5% water Control implications: 1. 2. 39 ALWAYS Control valuable product at spec. (active constraint). May overpurify (not control) cheap product cheap product (byproduct) water + max. 2% methanol Example with Quiz: Optimal operation of two distillation columns in series 40 QUIZ 1 Operation of Distillation columns in series With given F (disturbance): 4 steady-state DOFs (e.g., L and V in each column) N=41 αAB=1.33 F ~ 1.2mol/s pF=1 $/mol > 95% A pD1=1 $/mol < 4 mol/s N=41 αBC=1. 5 > 95% B pD2=2 $/mol < 2.4 mol/s > 95% C pB2=1 $/mol Cost (J) = - Profit = pF F + pV(V1+V2) – pD1D1 – pD2D2 – pB2B2 Energy price: pV=0-0.2 $/mol (varies) 41 DOF = Degree Of Freedom Ref.: M.G. Jacobsen and S. Skogestad (2011) QUIZ: What are the expected active constraints? 1. Always. 2. For low energy prices. SOLUTION QUIZ 1 Operation of Distillation columns in series With given F (disturbance): 4 steady-state DOFs (e.g., L and V in each column) N=41 αAB=1.33 F ~ 1.2mol/s pF=1 $/mol > 95% A pD1=1 $/mol N=41 αBC=1. 5 > 95% B pD2=2 $/mol 1. xB = 95% B Spec. valuable product (B): Always active! Why? “Avoid product Hm….? give-away” < 4 mol/s < 2.4 mol/s 2. Cheap energy: V1=4 mol/s, V2=2.4 mol/s > 95% C Max. column capacity constraints active! pB2=1 $/mol Why? Overpurify A & C to recover more B Cost (J) = - Profit = pF F + pV(V1+V2) – pD1D1 – pD2D2 – pB2B2 Energy price: pV=0-0.2 $/mol (varies) 42 DOF = Degree Of Freedom Ref.: M.G. Jacobsen and S. Skogestad (2011) QUIZ: What are the expected active constraints? 1. Always. 2. For low energy prices. QUIZ 2 Control of Distillation columns in series PC PC LC LC Given LC 43 Red: Basic regulatory loops LC QUIZ. Assume low energy prices (pV=0.01 $/mol). How should we control the columns? HINT: CONTROL ACTIVE CONSTRAINTS SOLUTION QUIZ 2 Control of Distillation columns in series PC PC LC LC xB 1 unconstrained DOF (L1): Use for what?? CV=? Given CC xBS=95% •Not: CV= xA in D1! (why? xA should vary with F!) •Maybe: constant L1? (CV=L1) Hm……. •Better: CV= xA in B1? Self-optimizing? HINT: CONTROL MAX V1 ACTIVE CONSTRAINTS! MAX V2 General for remaining unconstrained DOFs: LOOK FOR “SELF-OPTIMIZING” CVs = Variables we can keep constant LC WILL GET BACK TO THIS!LC 44 Red: Basic regulatory loops QUIZ. Assume low energy prices (pV=0.01 $/mol). How should we control the columns? HINT: CONTROL ACTIVE CONSTRAINTS Comment: Distillation column control in practice 1. Add stabilizing temperature loops – In this case: use reflux (L) as MV because boilup (V) may saturate – T1s and T2s then replace L1 and L2 as DOFs. 2. Replace V1=max and V2=max by dpmax-controllers (assuming max. load is limited by flooding) • See next slide 45 Comment: In practice Control of Distillation columns in series PC PC LC LC xB T1 TC T1s T2 TC T2s CC Given MAX V1 LC 46 MAX V2 LC xBS=95% CV = Active constraint More on: Active output constraints Need back-off c ≥ cconstraint J Loss Jopt Back-off c a) If constraint can be violated dynamically (only average matters) • b) Required Back-off = “measurement bias” (steady-state measurement error for c) If constraint cannot be violated dynamically (“hard constraint”) • Required Back-off = “measurement bias” + maximum dynamic control error Want tight control of hard output constraints to reduce the back-off. “Squeeze and shift”-rule 47 CV = Active constraint Hard Constraints: «SQUEEZE AND SHIFT» COST FUNCTION N Histogram LEVEL 0 / LEVEL 1 2 Sigma 1 -- Sigma 2 Sigma 2 OFF SPEC LEVEL 2 Q1 -- Q2 W2 1.5 DELTA COST (W2-W1) W1 1 Sigma 1 0.5 Rule for control of hard output constraints: • “Squeeze and shift”! • Reduce variance (“Squeeze”) and “shift” setpoint cs to reduce backoff SQUEEZE Q2 0 48 0 © Richalet 50 100 150 Q1 200 SHIFT QUALITY 250 300 350 400 450 CV = Active constraint Example. Optimal operation = max. throughput. Want tight bottleneck control to reduce backoff! Back-off = Lost production Time 49 CV = Active constraint Example back-off. xB = purity product > 95% (min.) D1 xB • D1 directly to customer (hard constraint) – – – – – • D1 to large mixing tank (soft constraint) xB ±2% Measurement error (bias): 1% Backoff = 1% Setpoint xBs= 95 + 1% = 96% (to be safe) Do not need to include control error because it averages out in tank 8 – – – – 50 Measurement error (bias): 1% Control error (variation due to poor control): 2% Backoff = 1% + 2% = 3% Setpoint xBs= 95 + 3% = 98% (to be safe) Can reduce backoff with better control (“squeeze and shift”) xB,product Unconstrained variables More on: WHAT ARE GOOD “SELFOPTIMIZING” VARIABLES? • Intuition: “Dominant variables” (Shinnar) • More precisely 1. Optimal value of CV is constant 2. CV is “sensitive” to MV (large gain) 51 Unconstrained optimum GOOD “SELF-OPTIMIZING” CV=c 1. Optimal value copt is constant (independent of disturbance d): 2. c is “sensitive” to MV=u (to reduce effect of measurement noise) Equivalently: Optimum should be flat Good 52 Good BAD Example. Control of Distillation columns. Cheap energy PC PC LC LC xB Overpurified CC xBS=95% Given MAX V1 LC MAX V2 LC Overpurified 1 unconstrained DOF (L1): What is a good CV? 53 •Not: CV= xB in D1! (why? Overpurified, so xB,opt increases with F) •Maybe: constant L1? (CV=L1) •Better: CV= xA in B1? Self-optimizing? Overpurified: To avoid loss of valuable product B More on: Optimal operation minimize J = cost feed + cost energy – value products Two main cases (modes) depending on marked conditions: Mode 1. Given feedrate Mode 2. Maximum production 54 Mode 1. Given feedrate Amount of products is then usually indirectly given and J = cost feed– value products + cost energy Often constant Optimal operation is then usually unconstrained “maximize efficiency (energy)” Control: • Operate at optimal trade-off • NOT obvious what to control • CV = Self-optimizing variable J= energy 55 copt c Mode 2. Maximum production J = cost feed + cost energy – value products • Assume feedrate is degree of freedom • Assume products much more valuable than feed • Optimal operation is then to maximize product rate Control: • Focus on tight control of bottleneck • “Obvious what to control” • CV = ACTIVE CONSTRAINT J Infeasible region 56 cmax c Case study Control structure design using self-optimizing control for economically optimal CO2 recovery* Step S1. Objective function= J = energy cost + cost (tax) of released CO2 to air 4 equality and 2 inequality constraints: 1. 2. 3. 4. 5. 6. stripper top pressure condenser temperature pump pressure of recycle amine cooler temperature CO2 recovery ≥ 80% Reboiler duty < 1393 kW (nominal +20%) Step S2. (a) 10 degrees of freedom: 8 valves + 2 pumps 4 levels without steady state effect: absorber, stripper (2), make-up tank Disturbances: flue gas flowrate, CO2 composition in flue gas + active constraints (b) Optimization using Unisim steady-state simulator. Mode I (nominal feedrate): No inequality constraints active Unconstrained degrees of freedom = 10 – 4 – 4 = 2 Step S3 (Identify CVs). 1. Control the 4 equality constraints 2. Identify 2 self-optimizing CVs (Use Exact Local method and select CV set with minimum loss) 57 *M. Panahi and S. Skogestad, ``Economically efficient operation of CO2 capturing process, Part I: Self-optimizing procedure for selecting the best controlled variables'', Chemical Engineering and Processing, 50, 247-253 (2011). Exact local method* for finding 2 self-optimizing CVs The set with the minimum worst case loss is the best 1 max. Loss= σ(M) 2 2 1/2 y -1 M=J uu (HG ) H [FWd Wny ] F=G y J -1uu J ud -G dy Juu and F, the optimal sensitivity of the measurements with respect to disturbances, are obtained numerically Δyopt. F= Δd 58 * I.J. Halvorsen, S. Skogestad, J.C. Morud and V. Alstad, ‘Optimal selection of controlled variables’ Ind. Eng. Chem. Res., 42 (14), 3273-3284 (2003) Identify 2 self-optimizing CVs 39 candidate CVs - 15 possible tray temperature in absorber - 20 possible tray temperature in stripper - CO2 recovery in absorber and CO2 content at the bottom of stripper - Recycle amine flowrate and reboiler duty Use a bidirectional branch and bound algorithm* for finding the best CVs Best self-optimizing CV set in region I: • • c1 = CO2 recovery (95.26%) c2 = Temperature tray no. 16 in stripper These CVs are not necessarily the best if new constraints are met 59 * V. Kariwala and Y. Cao. Bidirectional Branch and Bound for Controlled Variable Selection, Part II: Exact Local Method for Self-Optimizing Control, Computers & Chemical Engineering, 33(2009), 1402-1412. Proposed control structure with given nominal flue gas flowrate (mode I) 60 Mode II: large feedrates of flue gas (+30%) Feedrate flue gas (kmol/hr) Self-optimizing CVs in region I CO2 recovery % Temperature tray no. 16 °C Reboiler duty (kW) Cost (USD/ton) Optimal nominal point 219.3 95.26 106.9 1161 2.49 +5% feedrate 230.3 95.26 106.9 1222 2.49 +10% feedrate 241.2 95.26 106.9 1279 2.49 +15% feedrate 252.2 95.26 106.9 1339 2.49 +19.38%, when reboiler duty saturates 261.8 95.26 106.9 1393 (+20%) 2.50 +30% feedrate (reoptimized) 285.1 91.60 103.3 1393 2.65 region I region II max Saturation of reboiler duty; one unconstrained degree of freedom left Use Maximum gain rule to find the best CV among 37 candidates : • Temp. on tray no. 13 in the stripper: largest scaled gain, but tray 16 also OK 61 Proposed control structure with large flue gas flowrate (mode II) max 62 Switching policies CO2 plant (”supervisory control”) • Assume operating in region I (unconstrained) – with CV=CO2-recovery=95.26% • When reach maximum Q: Switch to Q=Qmax (Region II) (obvious) – CO2-recovery will then drop below 95.26% • When CO2-recovery exceeds 95.26%: Switch back to region I !!! 63 Conclusion optimal operation ALWAYS: 1. Control active constraints and control them tightly!! – Good times: Maximize throughput -> tight control of bottleneck 2. Identify “self-optimizing” CVs for remaining unconstrained degrees of freedom • Use offline analysis to find expected operating regions and prepare control system for this! – One control policy when prices are low (nominal, unconstrained optimum) – Another when prices are high (constrained optimum = bottleneck) ONLY if necessary: consider RTO on top of this 64 Part 1.3 -Inventory (level) control structure – Location of throughput manipulator – Consistency and radiating rule 65 Outline • Skogestad procedure for control structure design I Top Down • Step S1: Define operational objective (cost) and constraints • Step S2: Identify degrees of freedom and optimize operation for disturbances • Step S3: Implementation of optimal operation – What to control ? (primary CV’s) – Control Active constraints + self-optimizing variables • Step S4: Where set the production rate? (Inventory control) II Bottom Up • Step S5: Regulatory control: What more to control (secondary CV’s) ? • Step S6: Supervisory control • Step S7: Real-time optimization 66 Step S4. Where set production rate? • Very important decision that determines the structure of the rest of the inventory control system! • May also have important economic implications • Link between Top-down (economics) and Bottom-up (stabilization) parts – Inventory control is the most important part of stabilizing control • “Throughput manipulator” (TPM) = MV for controlling throughput (production rate, network flow) • Where set the production rate = Where locate the TPM? – Traditionally: At the feed – For maximum production (with small backoff): At the bottleneck 67 TPM (Throughput manipulator) • • Definition 1. TPM = MV used to control throughput (CV) Definition 2 (Aske and Skogestad, 2009). A TPM is a degree of freedom that affects the network flow and which is not directly or indirectly determined by the control of the individual units, including their inventory control. – – The TPM is the “gas pedal” of the process Value of TPM: Usually set by the operator (manual control) • – The TPM is usually a flow (or closely related to a flow), e.g. main feedrate, but not always. • • • • – parallel units or splits into alternative processing routes multiple feeds that do not need to be set in a fixed ratio If we consider only part of the plant then the TPM may be outside our control. • 68 It can be a setpoint to another control loop Reactor temperature can be a TPM, because it changes the reactor conversion, Pressure of gas product can be a TPM, because it changes the gas product flowrate Fuel cell: Load (current I) is usually the TPM Usually, only one TPM for a plant, but there can be more if there are • • – Operators are skeptical of giving up this MV to the control system (e.g. MPC) throughput is then a disturbance TPM and link to inventory control • Liquid inventory: Level control (LC) – Sometimes pressure control (PC) • • 69 Gas inventory: Pressure control (PC) Component inventory: Composition control (CC, XC, AC) Production rate set at inlet : Inventory control in direction of flow* TPM * Required to get “local-consistent” inventory control 70 Production rate set at outlet: Inventory control opposite flow* TPM * Required to get “local-consistent” inventory control 71 Production rate set inside process* TPM * Required to get “local-consistent” inventory control 72 General: “Need radiating inventory control around TPM” (Georgakis) 73 Consistency of inventory control • Consistency (required property): An inventory control system is said to be consistent if the steadystate mass balances (total, components and phases) are satisfied for any part of the process, including the individual units and the overall plant. 74 QUIZ 1 CONSISTENT? 75 Local-consistency rule Rule 1. Local-consistency requires that 1. The total inventory (mass) of any part of the process must be locally regulated by its in- or outflows, which implies that at least one flow in or out of any part of the process must depend on the inventory inside that part of the process. 2. For systems with several components, the inventory of each component of any part of the process must be locally regulated by its in- or outflows or by chemical reaction. 3. For systems with several phases, the inventory of each phase of any part of the process must be locally regulated by its in- or outflows or by phase transition. 76 Proof: Mass balances Note: Without the word “local” one gets the more general consistency rule QUIZ 1 CONSISTENT? 77 Local concistency requirement -> “Radiation rule “(Georgakis) 78 Flow split: May give extra DOF TPM TPM Split: Extra DOF (FC) 79 Flash: No extra DOF QUIZ 2 Consistent? Local-consistent? Note: Local-consistent is more strict as it implies consistent 80 QUIZ 3 Closed system: Must leave one inventory uncontrolled 81 QUIZ 4 OK? (Where is production set? TPM1 TPM2 82 NO. Two TPMs (consider overall liquid balance). Solution: Interchange LC and FC on last tank Example: Separator control Alternative TPM locations Compressor could be replaced by valve if p1>pG 83 Alt.1 Alt.3 84 Alt.2 Alt.4 Similar to original but NOT CONSISTENT (PC not direction of flow) Example: Solid oxide fuel cell xH2?? xCH4,s CC PC CH4 H2O (in ratio with CH4 feed to reduce C and CO formation) Air CH4 + H2O = CO + 3H2 CO + H2O = CO2 + H2 2H2 + O2- → 2H2O + 2eSolid oxide electrolyte O2- e- TPM = current I [A] = disturbance O2 + 4e- → 2O2- (excess O2) TC PC Ts = 1070 K (active constraint) 85 PC TC 86 LOCATION OF SENSORS • Location flow sensor (before or after valve or pump): Does not matter from consistency point of view – Locate to get best flow measurement • Before pump: Beware of cavitation • After pump: Beware of noisy measurement • Location of pressure sensor (before or after valve, pump or compressor): Important from consistency point of view 87 QUIZ 4 OK? (Where is production set? TPM1 TPM2 88 NO. Two TPMs (consider overall liquid balance). Solution: Interchange LC and FC on last tank Where should we place TPM? • • TPM = MV used to control throughput Traditionally: TPM = Main feed valve (or pump/compressor) – Gives inventory control “in direction of flow” Consider moving TPM if: 1. There is an important CV that could otherwise not be well controlled – Dynamic reasons – Special case: Max. production important: Locate TPM at process bottleneck* ! • • 2. TPM can then be used to achieve tight bottleneck control (= achieve max. production) Economics: Max. production is very favorable in “sellers marked” If placing it at the feed may yield infeasible operation (“overfeeding”) – If “snowballing” is a problem (accumulation in recycle loop), then consider placing TPM inside recycle loop BUT: Avoid a variable that may (optimally) saturate as TPM (unless it is at bottleneck) – Reason: To keep controlling CV=throughput, we would need to reconfigure (move TPM)** *Bottleneck: Last constraint to become active as we increase throughput -> TPM must be used for bottleneck control 89 **Sigurd’s general pairing rule (to reduce need for reassigning loops): “Pair MV that may (optimally) saturate with CV that may be given up” QUIZ. Distillation. OK? LV-configuration TPM 90 DB-configuration OK??? TPM 91 DB-configuration: Level control NOT consistent by itself, but can still work* if we add one (or preferably two) composition/temperature loops cc TPM cc 92 *But DB-configuration is not recommended! QUIZ * ** * Keep p ¸ pmin ** Keep valve fully open 93 94 QUIZ 95 LOCATION OF SENSORS • Location flow sensor (before or after valve or pump): Does not matter from consistency point of view – Locate to get best flow measurement • Before pump: Beware of cavitation • After pump: Beware of noise • Etc. • Location of pressure sensor (before or after valve, pump or compressor): Important from consistency point of view 96 Often optimal: Locate TPM at bottleneck! • "A bottleneck is a unit where we reach a constraints which makes further increase in throughput infeasible" • If feed is cheap and available: Located TPM at bottleneck (dynamic reasons) • If the flow for some time is not at its maximum through the bottleneck, then this loss can never be recovered. 97 Single-loop alternatives for bottleneck control Traditional: Manual control of feed rate Bottleneck. Want max flow here TPM Alt.1. Feedrate controls bottleneck flow (“long loop”…): FC Fmax TPM Alt. 2: Feedrate controls lost task (another “long loop”…): Fmax TPM Alt. 3: Reconfigure all upstream inventory loops: Fmax 98 TPM May move TPM to inside recycle loop to avoid snowballing Example: Eastman esterification process Alcohol recycle Reach max mass transfer rate: R increases sharply (“snowballing”) Ester product Alcohol + water + extractive agent (e) 99 First improvement: Located closer to bottleneck 10 0 Final improvement: Located “at” bottleneck + TPM is inside “snowballing” loop Follows Luyben’s law 1 to avoid snowballing(modified): “Avoid having all streams in a recycle system on inventory control” 10 1 Where should we place TPM? • • TPM = MV used to control throughput Traditionally: TPM = Main feed valve (or pump/compressor) – Operators like it. Gives inventory control “in direction of flow” Consider moving TPM if: 1. There is an important CV that could otherwise not be well controlled • – Special case: Max. production important: Locate TPM at process bottleneck* ! • • 2. Dynamic reasons Because max. production is very favorable in “sellers marked” TPM can then be used to achieve tight bottleneck control (= achieve max. flow) If placing it at the feed may yield infeasible operation (“overfeeding”) – If “snowballing” is a problem (accumulation in recycle loop), then consider placing TPM inside recycle loop BUT: Avoid a variable that may (optimally) saturate as TPM (unless it is at bottleneck) – Reason: To keep controlling CV=throughput, we would need to reconfigure (move TPM)** *Bottleneck: Last constraint to become active as we increase throughput -> TPM must be used for bottleneck control 10 2 **Sigurd’s general pairing rule (to reduce need for reassigning loops): “Pair MV that may (optimally) saturate with CV that may be given up” Moving TPM A purely top-down approach: Start by controlling all active constaints at max. throughput (may give moving TPM) Economic Plantwide Control Over a Wide Throughput Range: A Systematic Design Procedure Rahul Jagtap, Nitin Kaistha*and Sigurd Skogestad Step 0: Step 1: Obtain active constraint regions for the wide throughput range Pair loops for tight control of economic CVs at maximum throughput – Most important point economically – Most active constraints Step 2: Design the inventory (regulatory) control system Step 3: Design loops for ‘taking up’ additional economic CV control at lower throughputs along with appropriate throughput manipulation strategy 10 3 Warning: May get complicated, but good economically because of tight control of active constraints PC X B A FC A, B Recycle PC LC FC LC LVLRxrMAXLC HS3 CCB xBRxr C Opt FC CCD RC A+ B C B+CD 0.02% TC SP1 > SP2 > SP3 HS2 Stri ppe r V1MAX SP3 LS1 LC3 TRxrOpt TRxrMAX LS2 SP2 LC2 LC1 Colu mn FC SP1 TC 165 °C CCB V2MAX TPM for < max throughput FC LC Figure 5. Plantwide control structure for maximum throughput operation of recycle process (Case Study I) 10 4 0.98% TC D Conclusion TPM (production rate manipulator) • Think carefully about where to place it! • Difficult to undo later 10 5 Part 1.4 Structure of regulatory control layer (PID) Part 1.4 Structure of regulatory control layer (PID) – Selection of controlled variables (CV2) and pairing with manipulated variables (MV2) – Main rule: Control drifting variables and "pair close" Summary: Sigurd’s rules for plantwide control 10 6 Outline • Skogestad procedure for control structure design I Top Down • Step S1: Define operational objective (cost) and constraints • Step S2: Identify degrees of freedom and optimize operation for disturbances • Step S3: Implementation of optimal operation – What to control ? (primary CV’s) (self-optimizing control) • Step S4: Where set the production rate? (Inventory control) II Bottom Up • Step S5: Regulatory control: What more to control (secondary CV’s) ? – Distillation example • Step S6: Supervisory control • Step S7: Real-time optimization 10 7 Regulatory layer II. Bottom-up • Determine secondary controlled variables (CV2) and structure (configuration) of control system (pairing, CV2MV2) • A good control configuration is insensitive to parameter changes 10 8 Regulatory layer Step 5. Regulatory control layer • Purpose: “Stabilize” the plant using a simple control configuration (usually: local SISO PID controllers + simple cascades) • Enable manual operation (by operators) • Main structural decisions: • What more should we control? (secondary cv’s, CV2, use of extra measurements) • Pairing with manipulated variables (mv’s u2) CV1 CV2 = ? 10 9 Regulatory layer Objectives regulatory control layer 1. 2. 3. 4. 5. 6. 7. Allow for manual operation Simple decentralized (local) PID controllers that can be tuned on-line Take care of “fast” control Track setpoint changes from the layer above Local disturbance rejection Stabilization (mathematical sense) Avoid “drift” (due to disturbances) so system stays in “linear region” – 11 0 “stabilization” (practical sense) 8. Allow for “slow” control in layer above (supervisory control) 9. Make control problem easy as seen from layer above 10. Use “easy” and “robust” measurements (pressure, temperature) 11. Simple structure 12. Contribute to overall economic objective (“indirect” control) 13. Should not need to be changed during operation Regulatory layer Stabilizing control: Use inputs MV2=u2 to control “drifting” variables CV2 CV2s K u2 G CV1 Primary CV CV2 Secondary CV (control for dynamic reasons) Key decision: Choice of CV2 (controlled variable) Also important: Choice of MV2=u2 (“pairing”) Process control: Typical «drifting» variables (CV2) are • Liquid inventories (level) • Vapor inventories (pressure) • Some temperatures (reactor, distillation column profile) 11 1 Regulatory layer Degrees of freedom unchanged • No degrees of freedom lost as setpoints y2s replace inputs u2 as new degrees of freedom for control of y1 Cascade control: CV2s New DOF 11 2 K u2 G CV1 CV2 Original DOF Regulatory layer Example: Exothermic reactor (unstable) Active constraints (economics): Product composition c + level (max) • u = cooling flow (q) • CV1 = composition (c) • CV2 = temperature (T) feed CV1s CC CV2s TC CV1=c LC CV2=T u 11 3 Ls=max product cooling Regulatory layer Details Step 5 (Structure regulatory control layer) (a) What to control (CV2)? 1. Control CV2 that “stabilizes the plant” (stops drifting) 2. Select CV2 which is easy to control (favorable dynamics) • In addition, active constraints (CV1) that require tight control (small backoff) may be assigned to the regulatory layer.* 11 4 *Comment: usually not necessary with tight control of unconstrained CVs because optimum is usually relatively flat Regulatory layer “Control CV2 that stabilizes the plant (stops drifting)” In practice, control: 1. Levels (inventory liquid) 2. Pressures (inventory gas/vapor) (note: some pressures may be left floating) 3. Inventories of components that may accumulate/deplete inside plant • • • E.g., amine/water depletes in recycle loop in CO2 capture plant E.g., butanol accumulates in methanol-water distillation column E.g., inert N2 accumulates in ammonia reactor recycle 4. Reactor temperature 5. Distillation column profile (one temperature inside column) • Stripper/absorber profile does not generally need to be stabilized 11 5 Regulatory layer Details Step 5b…. (b) Identify pairings = Identify MVs (u2) to control CV2, taking into account: 11 6 • Want “local consistency” for the inventory control – Implies radiating inventory control around given flow • Avoid selecting as MVs in the regulatory layer, variables that may optimally saturate at steady-state (active constraint on some region), because this would require either – reassigning the regulatory loop (complication penalty), or – requiring back-off for the MV variable (economic penalty) • Want tight control of important active constraints (to avoid back-off) • General rule: ”pair close” (see next slide) Regulatory layer Step 5b…. Main rule: “Pair close” The response (from input to output) should be fast, large and in one direction. Avoid dead time and inverse responses! 11 7 Regulatory layer Sigurd’s pairing rule: “Pair MV that may (optimally) saturate with CV that may be given up” • Main reason: Minimizes need for reassigning loops . loop LV Ts TC TC (a) Normal: Control T using V • • • 11 8 TS (b) If V may saturate: Use L Important: Always feasible (and optimal) to give up a CV when optimal MV saturation occurs. – Proof (DOF analysis): When one MV disappears (saturates), then we have one less optimal CV. Failing to follow this rule: Need some “fix” when MV saturates to remain optimal, like – reconfiguration (logic) – backoff (loss of optimality) BUT: Rule may be in conflict with other criteria – Dynamics (“pair close” rule) – Interactions (“avoid negative steady-state RGA” rule) – If conflict: Use reconfiguration (logic) or go for multivariable constraint control (MPC which may provide “built-in” logic) Normal: Control T using V • . loop LV Ts TC TC 11 9 TS Regulatory layer Why simplified configurations? Why control layers? Why not one “big” multivariable controller? • Fundamental: Save on modelling effort • Other: – – – – – – 12 0 easy to understand easy to tune and retune insensitive to model uncertainty possible to design for failure tolerance fewer links reduced computation load Hierarchical/cascade control: Time scale separation • With a “reasonable” time scale separation between the layers (typically by a factor 5 or more in terms of closed-loop response time) we have the following advantages: 1. The stability and performance of the lower (faster) layer (involving y2) is not much influenced by the presence of the upper (slow) layers (involving y1) Reason: The frequency of the “disturbance” from the upper layer is well inside the bandwidth of the lower layers 2. With the lower (faster) layer in place, the stability and performance of the upper (slower) layers do not depend much on the specific controller settings used in the lower layers Reason: The lower layers only effect frequencies outside the bandwidth of the upper layers 12 1 Cascade control distillation ys y With flow loop + T-loop in top X C Ts T TC Ls L 12 2 X C FC z QUIZ: What are the benefits of adding a flow controller (inner cascade)? qs Extra measurement y2 = q 1. 12 3 z Counteracts nonlinearity in valve, f(z) • 2. q With fast flow control we can assume q = qs Eliminates effect of disturbances in p1 and p2 Summary: Sigurd’s plantwide control rules Rules for CV-selection: 1. Control active constraints – Purity constraint on expensive product is always active (overpurification gives loss): 2. Unconstrained degrees of freedom (if any): Control “self-optimizing” variables (c). • • The ideal variable is the gradient of J with respect to the inputs (Ju = dJ/du), which always should be zero, independent of disturbances d, but this variable is rarely available – Exception (is available!): Parallel systems (stream split, multiple feed streams/manifold) with given throughput (or given total gas flow, etc.) – Should have equal marginal costs Jiu = dJi/du, so Ju = J1u - J2u, etc. – Heat exchanger splits: equal Jächke temperatures, JT1 = (T1 – Th1)^2/(T1-T0) In practice, one prefers to control single variables, c=Hy (where y are all available measurements and H is a selection matrix), which are easy to measure and control, and which have the following properties: • Optimal value for c is almost constant (independent of disturbances): Want small magnitude of dcopt(d)/dd. • Variable c is sensitive to changes in input: Want large magnitude of gain=dc/du (this is to reduce effect of measurement error and noise). – If the economic loss with single variables is too large, then one may use measurement combinations, c=Hy (where H is a “full” matrix). 3. Unconstrained degrees of freedom: NEVER try to control a variable that reaches max or min at the optimum (in particular, never control J) – Surprisingly, this is a very common mistake, even (especially?) with control experts Rules for inventory control: 1. Use Radiation rule (PC, LC, FC ++) 2. Avoid having all flows in a recycle system on inventory control (this is a restatement of Luyben’s rule of “fixing a flow inside a recycle system” to avoid snowballing) – A special case is a closed system Rules for pairing: 1. General: “Pair close” (large gain and small effective time delay) 2. CV1: Sigurd’s pairing rule: “Pair MV that may (optimally) saturate with CV that may be given up” 3. CV2 (stabilizing loop): Avoid MV that may saturate 12 4 Part 1 (3h): Plantwide control Introduction to plantwide control (what should we really control?) Part 1.1 Introduction. – – – Objective: Put controllers on flow sheet (make P&ID) Two main objectives for control: Longer-term economics (CV1) and shorter-term stability (CV2) Regulatory (basic) and supervisory (advanced) control layer Part 1.2 Optimal operation (economics) – – Active constraints Selection of economic controlled variables (CV1). Self-optimizing variables. Part 1.3 -Inventory (level) control structure – – Location of throughput manipulator Consistency and radiating rule Part 1.4 Structure of regulatory control layer (PID) – – Selection of controlled variables (CV2) and pairing with manipulated variables (MV2) Main rule: Control drifting variables and "pair close" Summary: Sigurd’s rules for plantwide control 12 5 Plantwide control. Main references • The following paper summarizes the procedure: – S. Skogestad, ``Control structure design for complete chemical plants'', Computers and Chemical Engineering, 28 (1-2), 219-234 (2004). • There are many approaches to plantwide control as discussed in the following review paper: – T. Larsson and S. Skogestad, ``Plantwide control: A review and a new design procedure'' Modeling, Identification and Control, 21, 209-240 (2000). • The following paper updates the procedure: – S. Skogestad, ``Economic plantwide control’’, Book chapter in V. Kariwala and V.P. Rangaiah (Eds), Plant-Wide Control: Recent Developments and Applications”, Wiley (2012). • More information: http://www.nt.ntnu.no/users/skoge/plantwide 12 6 All papers available at: http://www.nt.ntnu.no/users/skoge/