39
1 Effective Implementation of optimal operation using Self-optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

Embed Size (px)

Citation preview

Page 1: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

1

Effective Implementation of optimal operation using Self-optimizing control

Sigurd Skogestad

Institutt for kjemisk prosessteknologi

NTNU, Trondheim

Page 2: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

2

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.).

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

Page 3: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

3

Plantwide control design procedure

I Top Down • Step 1: Define operational objectives (optimal operation)

– Cost function J (to be minimized)

– Operational constraints

• Step 2: Identify degrees of freedom (MVs) and optimize for

expected disturbances

• Step 3: Select primary controlled variables c=y1 (CVs)

• Step 4: Where set the production rate? (Inventory control)

II Bottom Up

• Step 5: Regulatory / stabilizing control (PID layer)

– What more to control (y2; local CVs)?

– Pairing of inputs and outputs

• Step 6: Supervisory control (MPC layer)

• Step 7: Real-time optimization (Do we need it?)

y1

y2

Process

MVs

Page 4: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

4

y1s

MPC

PID

y2s

RTO

u (valves)

Process control: Implementation of optimal operation

Page 5: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

5

Outline

• Implementation of optimal operation

• Paradigm 1: On-line optimizing control (including RTO)

• Paradigm 2: "Self-optimizing" control schemes– Precomputed (off-line) solution

• Examples

• Control of optimal measurement combinations– Nullspace method

– Exact local method

• Summary/Conclusions

Page 6: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

6

Optimal operation

• A typical dynamic optimization problem

• Implementation: “Open-loop” solutions not robust to disturbances or model errors

• Want to introduce feedback

Page 7: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

7

Implementation of optimal operation

• Paradigm 1: On-line optimizing control where measurements are used to update model and states– Process control: Steady-state “real-time optimization” (RTO)

• Update model and states: “data reconciliation”

• Paradigm 2: “Self-optimizing” control scheme found by exploiting properties of the solution – Most common in practice, but ad hoc

Page 8: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

8

Implementation: Paradigm 1

• Paradigm 1: Online optimizing control

• Measurements are primarily used to update the model

• The optimization problem is resolved online to compute new inputs.

• Example: Conventional MPC, RTO (real-time optimization)

• This is the “obvious” approach (for someone who does not know control)

Page 9: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

9

Example paradigm 1: On-line optimizing control of Marathon runner

• Even getting a reasonable model requires > 10 PhD’s … and the model has to be fitted to each individual….

• Clearly impractical!

Page 10: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

10

Implementation: Paradigm 2

• Paradigm 2: Precomputed solutions based on off-line optimization

• Find properties of the solution suited for simple and robust on-line implementation

• Most common in practice, but ad hoc

• Proposed method: Do this is in a systematic manner.

– Turn optimization into feedback problem.

– Find regions of active constraints and in each region:1. Control active constraints

2. Control “self-optimizing ” variables for the remaining unconstrained degrees of freedom

• “inherent optimal operation”

Page 11: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

11

Example: Runner

• One degree of freedom (u): Power

• Cost to be minimized

J = T – Constraints

– u ≤ umax

– Follow track

– Fitness (body model)

• Optimal operation: Minimize J with respect to u(t)

• ISSUE: How implement optimal operation?

Page 12: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

12

Solution 2 – Feedback(Self-optimizing control)

– What should we control?

Optimal operation - Runner

Page 13: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

13

Self-optimizing control: Sprinter (100m)

• 1. Optimal operation of Sprinter, J=T– Active constraint control:

• Maximum speed (”no thinking required”)

Optimal operation - Runner

Page 14: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

14

• Optimal operation of Marathon runner, J=T• Any self-optimizing variable c (to control at

constant setpoint)?• c1 = distance to leader of race

• c2 = speed

• c3 = heart rate

• c4 = level of lactate in muscles

Optimal operation - Runner

Self-optimizing control: Marathon (40 km)

Page 15: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

15

Implementation paradigm 2: Feedback control of Marathon runner

c = heart rate

Simplest case:select one measurement

• Simple and robust implementation• Disturbances are indirectly handled by keeping a constant heart rate• May have infrequent adjustment of setpoint (heart rate)

measurements

Page 16: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

16

Implementation (in practice): Local feedback control!

“Self-optimizing control:” Constant setpoints for c gives acceptable loss

y

FeedforwardOptimizing controlLocal feedback: Control c (CV)

d

Controlled variables c (z in book!)1. Active constraints2. “Self-optimizing” variables c

• for remaining unconstrained degrees of freedom (u)

• No or infrequent online optimization needed.

• Controlled variables c are found based on off-line analysis.

Page 17: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

19

“Magic” self-optimizing variables: How do we find them?

• Intuition: “Dominant variables” (Shinnar)

• Is there any systematic procedure?

Page 18: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

20

Optimal operation

Cost J

Controlled variable cccoptopt

JJoptopt

Unconstrained optimum

Page 19: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

21

Optimal operation

Cost J

Controlled variable cccoptopt

JJoptopt

Two problems:

• 1. Optimum moves because of disturbances d: copt(d)

• 2. Implementation error, c = copt + n

d

n

Unconstrained optimum

Page 20: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

22

Candidate controlled variables c for self-optimizing control

Intuitive

1. The optimal value of c should be insensitive to disturbances (avoid problem 1)

2. Optimum should be flat (avoid problem 2 – implementation error).

Equivalently: Value of c should be sensitive to degrees of freedom u. • “Want large gain”, |G|

• Or more generally: Maximize minimum singular value,

Unconstrained optimum

BADGoodGood

Page 21: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

23

Quantitative steady-state: Maximum gain rule

Maximum gain rule (Skogestad and Postlethwaite, 1996):Look for variables that maximize the scaled gain (Gs) (minimum singular value of the appropriately scaled steady-state gain matrix Gs from u to c)

Unconstrained optimum

Gu c

Page 22: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

24

Why is Large Gain Good?

u

J, c

Jopt

uopt

copt c-copt

Loss

Δc = G Δu

Controlled variable Δc = G Δu

Want large gain G:

Large implementation error n (in c) translates into small deviation of u from uopt(d)

- leading to lower loss

Variation of u

J(u)

Page 23: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

25

• Operational objective: Minimize cost function J(u,d)• The ideal “self-optimizing” variable is the gradient (first-order

optimality condition) (Halvorsen and Skogestad, 1997; Bonvin et al., 2001; Cao, 2003):

• Optimal setpoint = 0

• BUT: Gradient can not be measured in practice• Possible approach: Estimate gradient Ju based on measurements y

• Approach here: Look directly for c as a function of measurements y (c=Hy) without going via gradient

Ideal “Self-optimizing” variables

Unconstrained degrees of freedom:

I.J. Halvorsen and S. Skogestad, ``Optimizing control of Petlyuk distillation: Understanding the steady-state behavior'', Comp. Chem. Engng., 21, S249-S254 (1997)Ivar J. Halvorsen and Sigurd Skogestad, ``Indirect on-line optimization through setpoint control'', AIChE Annual Meeting, 16-21 Nov. 1997, Los Angeles, Paper 194h. .

Page 24: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

26

H

Page 25: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

27

H

Page 26: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

28

Optimal measurement combination

H

•Candidate measurements (y): Include also inputs u

Page 27: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

29

H

Optimal H: Problem definition

Page 28: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

30

Nullspace method

No measurement noise (ny=0)

Page 29: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

31

Amazingly simple!

Sigurd is told how easy it is to find H

Proof nullspace methodBasis: Want optimal value of c to be independent of disturbances

• Find optimal solution as a function of d: uopt(d), yopt(d)

• Linearize this relationship: yopt = F d

• Want:

• To achieve this for all values of d:

• To find a F that satisfies HF=0 we must require

• Optimal when we disregard implementation error (n)

V. Alstad and S. Skogestad, ``Null Space Method for Selecting Optimal Measurement Combinations as Controlled Variables'', Ind.Eng.Chem.Res, 46 (3), 846-853 (2007).

No measurement noise (ny=0)

Page 30: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

32

Example. Nullspace Method for Marathon runner

u = power, d = slope [degrees]

y1 = hr [beat/min], y2 = v [m/s]

F = dyopt/dd = [0.25 -0.2]’

H = [h1 h2]]

HF = 0 -> h1 f1 + h2 f2 = 0.25 h1 – 0.2 h2 = 0

Choose h1 = 1 -> h2 = 0.25/0.2 = 1.25

Conclusion: c = hr + 1.25 v

Control c = constant -> hr increases when v decreases (OK uphill!)

Page 31: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

33

( , ) ( , )opt optL J u d J u d

Loss evaluation (with measurement noise)

1/2 1 2 21 12 2( ( ) ) ( )y

wc uuL J HG HY M Loss with c=Hym=0

due to(i) Disturbances d(ii) Measurement

noise ny

Book: Eq. (10.12)

31( , ) ( , ) ( ) ( ) ( )

2T

opt u opt opt uu optJ u d J u d J u u u u J u u

1

[ ],d n

y yuu ud d

Y FW W

F G J J G

'd

Controlled variables,c yH

ydG

cs = constant +

+

+

+

+

- K

H

yG ym

'yn

c

u

dW nW

u

J

( )opt ou d

Loss

d

optu

Proof: See handwritten notes

Page 32: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

34

1/2 1min ( )yuu FH

J HG HY1. Kariwala: Can minimize 2-norm

(Frobenius norm) instead of singular value

2. BUT still Non-convex optimization problem

(Halvorsen et al., 2003), see book p. 397

Hmin HY F

st 1/ 2yuuHG J

Improvement (Alstad et al. 2009)

Analytical solution («full» H)

-1 -1 -1 1 -11 y 1 y y y (H G ) H = (DHG ) DH = (HG ) D DH = (HG ) H

1H DH D : any non-singular matrix

Have extra degrees of freedom

Convex optimization

problem

Global solution

- Do not need Juu

- Analytical solution applies when YYT has full rank (w/ meas. noise):

Optimal H (with measurement noise)

Page 33: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

36

'd

ydG

cs = constant +

+

+

+

+

- K

H

yG y

'yn

c

u

dW nW

“Minimize” in Maximum gain rule( maximize S1 G Juu

-1/2 , G=HGy )

“Scaling” S1-1 for max.gain rule

“=0” in nullspace method (no noise)

Relationship to maximum gain rule

Page 34: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

38

Summary 1: Systematic procedure for selecting controlled variables for optimal operation1. Define economics (cost J) and operational constraints2. Identify degrees of freedom and important disturbances3. Optimize for various disturbances4. Identify active constraints regions (off-line calculations)

For each active constraint region do step 5-6:5. Identify “self-optimizing” controlled variables for remaining

unconstrained degrees of freedomA. “Brute force” loss evaluation B. Sensitive variables: “Max. gain rule” (Gain= Minimum singular value)C. Optimal linear combination of measurements, c = Hy

6. Identify switching policies between regions

Page 35: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

39

Summary 2

• Systematic approach for finding CVs, c=Hy

• Can also be used for estimation

S. Skogestad, ``Control structure design for complete chemical plants'', Computers and Chemical Engineering, 28 (1-2), 219-234 (2004).

V. Alstad and S. Skogestad, ``Null Space Method for Selecting Optimal Measurement Combinations as Controlled Variables'', Ind.Eng.Chem.Res, 46 (3), 846-853 (2007).

V. Alstad, S. Skogestad and E.S. Hori, ``Optimal measurement combinations as controlled variables'', Journal of Process Control, 19, 138-148 (2009)

Ramprasad Yelchuru, Sigurd Skogestad, Henrik Manum , MIQP formulation for Controlled Variable Selection in Self Optimizing Control IFAC symposium DYCOPS-9, Leuven, Belgium, 5-7 July 2010

Download papers: Google ”Skogestad”

Page 36: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

40

Example: CO2 refrigeration cycle

Unconstrained DOF (u)Control what? c=?

pH

Page 37: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

41

CO2 refrigeration cycle

Step 1. One (remaining) degree of freedom (u=z)

Step 2. Objective function. J = Ws (compressor work)

Step 3. Optimize operation for disturbances (d1=TC, d2=TH, d3=UA)• Optimum always unconstrained

Step 4. Implementation of optimal operation• No good single measurements (all give large losses):

– ph, Th, z, …

• Nullspace method: Need to combine nu+nd=1+3=4 measurements to have zero disturbance loss

• Simpler: Try combining two measurements. Exact local method:

– c = h1 ph + h2 Th = ph + k Th; k = -8.53 bar/K

• Nonlinear evaluation of loss: OK!

Page 38: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

42

Refrigeration cycle: Proposed control structure

Control c= “temperature-corrected high pressure”

Page 39: 1 Effective Implementation of optimal operation using Self- optimizing control Sigurd Skogestad Institutt for kjemisk prosessteknologi NTNU, Trondheim

43

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