Adaptive Control • Automatic adjustment of controller settings to compensate for unanticipated changes in the process or the environment (“self-tuning” controller) --- uncertainties ---nonlinearities --- time-varying parameters Offers significant benefits for difficult control problems 1 Examples-process changes • Catalyst behavior • Heat exchanger fouling • Startup, shutdown • Large frequent disturbances (grade or quality changes flow rate) • Ambient conditions Programmed Adaption— If process changes are known, measurable, or can be anticipated, use this information to adjust controller settings accordingly, -- store different settings for different conditions 2 Figure: Closed-loop Process Response Before Retuning (dashed line) and After Retuning (solid line) 3 ๐ Controller gain = ๐ค๐พ๐ ๐ Reset = ๐๐ผ ๐ค ๐ Derivative = ๐๐ท ๐ค 0 ≤ ๐ค ≤ 1, f=full scale Ziegler-Nichols: ๐พ๐ ๐พ๐ = ๐ ๐๐ผ = 3.33θ ๐ 4 Could use periodic step tests to identify dynamics E.g. ๐พ๐ ๐ −๐๐ ๐บ๐ ๐ = 1 + ๐๐ Then update controller using Cohen-Coon settings ๐ 1๐ ๐พ๐ ๐พ๐ = 1 + ๐ 3๐ ๐ 30 + 3 ๐ ๐ ๐๐ผ = 9 + 20 ๐ ๐ 5 6 Rule of Thumb: (stability theory) If process gain, ๐พ๐ , varies, the controller gain, ๐พ๐ , should be adjusted in a inverse manner so that the product ๐พ๐ ๐พ๐ remains constant. Example: PH control • Ref: Shinskey, Process Control Systems (197: pp. 132-135) ๐๐ป = −log[๐ป+ ] ๐ป + = g-ions/l (normality) • Titration curves for strong acids and strong bases: 7 pH ๐ด๐๐๐ ๐๐๐๐ค × 103 ๐ผ๐๐๐๐ก ๐๐๐๐ค Process gain = slope of curve (extremely variable) Control at pH= 7 ? 8 9 10 • Commercial Adaptive Controllers(not in DCS) (1) Leeds and Northrup (2) Toshiba (3) ASEA (self-tuning regulator or min variance) (4) Foxboro(expert system) (5) SATT/Fisher Controls(autotuner) 11 L+N Controller (Cont. Eng. Aug, 1981) Based on not overshoot exponential approach to set point (no offset) ๐ถ ๐ = 1 1+๐๐ ๐ = If ๐บ๐ ๐ = ๐บ๐ ๐บ๐ 1+๐บ๐ ๐บ๐ (๐บ๐ ๐บ๐ is unknown) ๐พ๐ ๐1 ๐ +1 ๐2 ๐ +1 Then ๐บ๐ ๐ = 1 ๐ถ ๐ ๐บ๐ ๐ 1−๐ถ ๐ = 1 ๐1 ๐2 ๐ ๐พ๐ ๐๐ + ๐1 +๐2 ๐๐ + 1 ๐๐ ๐ (D) (P) (I) If overshoot occurs ๏ model error๏ re-model, re-tune (analogous to Dahlin digital controller) (Use discrete PID, second order difference equation) 12 13 14 Many Different Possibilities DESIGN ๐ฆ๐ ๐๐ก REGULATOR Design Methods: ๏ Minimum variance ๏ LQG ๏ Pole-placement ๏ Phase and gain margins ESTIMATOR ๐ข PROCESS ๐ฆ Estimation Methods: ๏ Stochastic approximation ๏ Recursive least squares ๏ Extended least squares ๏ Multi-stage least squares ๏ Instrumental variance ๏ Recursive maximum likelihood 15 QUESTION: How can we use on-line information about ๐ to help control the plant? (1) Simple idea -use ๐ ๐ก as if it were ๐0 Certainty Equivalence Other Ideas (2) Reduce size of control signals since we know ๐ ๐ก is in error. CAUTION (3) Add extra signals to help learn about ๐0 PROBING 16 ๐ข ๐ก ๐ ๐ก A special class of nonlinear control ๐ฆ ๐ก Plant Parameter Estimator Linear Stochastic Nonlinear ๐ ๐ก Control law Synthesis Nonlinear ๐ฝ ๐ก Feedback Set point ๐ฆ ∗ ๐ก Time Varying 17 • Classification of Adaptive Control Techniques (1) explicit – model parameters estimated explicitly; Indirect – control law obtained via model; (2) implicit – model parameters imbedded in control law; Direct – control law estimated directly; • Adaptive Control Algorithms (1) On-line parameter estimation; (2) Adaptive Control design methods based on (a) quadratic cost functions (b) pole placement (c) stability theory (3) Miscellaneous methods 18 On-line Parameter Estimation • Continuous ๐๐ฆ ๐ + ๐ฆ = ๐พ๐ ๐ข ๐๐ก Nonlinear regression to find ๐พ๐ , ๐ • Non-sequential • Discrete ๐ฆ๐ = ๐1 ๐ฆ๐−1 + ๐1 ๐ข๐−1 Linear regression to find ๐1 , ๐1 More suited to computer control and monitoring • Sequential Long time horizon One point at a time Batch On-line Off-line Continuous updating 19 • Linear difference equation model ๐ฆ ๐ก + ๐1 ๐ฆ ๐ก − 1 + โฏ + ๐๐ ๐ฆ ๐ก − ๐ = ๐0 ๐ข ๐ก − ๐ + ๐1 ๐ข ๐ก − ๐ − 1 + โฏ + ๐๐ ๐ข ๐ก − ๐ − ๐ + ๐0 ๐ ๐ก + ๐1 ๐ ๐ก − 1 + โฏ + ๐๐ ๐ ๐ก − ๐ + ๐ ๐ก ๐ด ๐ง −1 ๐ฆ ๐ก = ๐ต ๐ง −1 ๐ข ๐ก − ๐ + ๐ถ ๐ง −1 ๐ ๐ก • Models for adaptive control usually linear and low order (n=2 or 3) -- n too large ๏ too many parameters; -- n too small ๏ inadequate description of dynamics Select time delay (k) so that k=2 or 3 Fractional time-delay causes non-minimum phase model (discrete) Affected by sampling time Non-minimum phase ๏ appears min phase 20 • Closed loop estimation – least squares solution is not unique for constant feedback gain. Parameter estimates can be found if (1) feedback control law is time-varying (2) separate perturbation signal is employed Ex. ๐ฆ ๐ก = ๐๐ฆ ๐ก − 1 + ๐๐ข ๐ก − 1 + ๐ ๐ก (1) Feedback control (constant gain) ๐ข = ๐พ0 ๐ − ๐ฆ Set ๐ = 0 ๐ข + ๐พ0 ๐ฆ = 0, ๐ข ๐ก − 1 + ๐พ0 ๐ฆ ๐ก − 1 = 0 (2) Mult. (2) by ๐ผ ; add to Eq. (1) ๐ฆ ๐ก = ๐ + ๐ผ๐พ0 ๐ฆ ๐ก − 1 + ๐ + ๐ผ ๐ข ๐ก − 1 + ๐ ๐ก Non-unique parameter estimates yield min ๐2 ๐ก 21 Application to Digital (models and control) (linear discrete model) ๐ฆ ๐ก = ๐1 ๐ฆ ๐ก − 1 + ๐2 ๐ฆ ๐ก − 2 + โฏ + ๐๐ ๐ฆ ๐ก − ๐ + ๐0 ๐ข ๐ก − ๐ + ๐1 ๐ข ๐ก − ๐ − 1 + ๐2 ๐ข ๐ก − ๐ − 2 + โฏ + ๐๐ ๐ข ๐ก − ๐ − ๐ + ๐ ๐ : time delay; ๐ฆ : output; ๐ข : input ; ๐ : disturbance ๐ฆ ๐ = Φ๐ ๐ก − 1 ๐ ๐ก − 1 ๐ฆ ๐ก−1 ๐ฆ ๐ก−2 โฎ ๐ฆ ๐ก−๐ Φ๐ ๐ก − 1 = ๐ข ๐ก − 1 − ๐ ๐ข ๐ก−2−๐ โฎ ๐ข ๐ก−๐−๐ 1 ๐1 ๐2 โฎ ๐๐ , ๐ ๐ก − 1 = ๐1 ๐2 โฎ ๐๐ ๐ 22 Least Squares Parameter Estimation ๐ฆ ๐ก = Ψ๐ ๐ก − 1 ๐ ๐ก − 1 + ๐ ๐ก Where Ψ๐ ๐ก − 1 = ๐ฆ ๐ก − 1 ,๐ฆ ๐ก − 2 ,…,๐ข ๐ก − ๐ ,๐ข ๐ก − ๐ − 1 ,…,๐ข ๐ก − ๐ − ๐ − 1 ,1 ๐ ๐ ๐ก − 1 = ๐1 , ๐2 , … , ๐๐ , ๐1 , ๐2 , … , ๐๐ , ๐ ๐ ๐ก = ๐ ๐ก − 1 + ๐ ๐ก ๐ ๐ก − 1 ๐ฆ ๐ก − ๐๐ ๐ก − 1 ๐๐ ๐ก − 1 ๐ก ๐๐ ๐ − 1 ๐ ๐ − ๐ฆ ๐ min ๐ (“least squares”) 2 ๐=1 ๐ ๐ ๐ − 1 ๐ ๐ is the predicted value of ๐ฆ 23 ๐ ๐ก =๐ ๐ก−1 − ๐ ๐ก − 1 ๐ ๐ก − 1 ๐๐ ๐ก − 1 ๐ ๐ก − 1 ๐ ๐ก − 1 + 1 −1 ๐ ๐ ๐ก−1 ๐ ๐ก 24 • Numerical accuracy problems -- P can become indefinite (round-off) -- use square-root filtering ๐ ๐ก = ๐ ๐ก ๐ ๐ ๐ก or other decomposition(S(t) upper triangular matrix) ๐ ๐ก generally becomes smaller over time (insensitive to new measurements) ๐ may actually be time-varying • Implementation of Parameter Estimation Algorithms -- Covariance resetting -- variable forgetting factor -- use of perturbation signal 25 • Enhance sensitivity of least squares estimation algorithms with forgetting factor ๐ก ๐ฝ ๐ ๐ก ๐๐ก−๐ ๐ ๐ ๐ − 1 ๐ ๐ − ๐ฆ ๐ = 2 ๐=1 ๐ ๐ก 1 = [๐ ๐ก − 1 ๐ − ๐ ๐ก − 1 ๐ ๐ก − 1 ๐๐ ๐ก − 1 ๐ ๐ก − 1 ๐ ๐ก − 1 + ๐ −1 ๐ ๐ ๐ก 26 27 28 ๐ 0.999 0.99 0.95 ๐ 2000 200 40 ๐๐ 0.135 0.134 0.129 For ๐๐ ~0.1, 2 ๐≈ 1−๐ Parameter estimate Faster convergence, but more sensitive to noise 29 • Covariance Resetting/Forgetting Factor ๐ < ๐. ๐ Sensitive to parameter changes (noise causes parameter drift) P can become excessively large (estimator windup) ๐ซ≠๐ add D when ๐ฆ − ๐ฆ exceeds limit or when ๐ก๐ ๐ becomes too small Constant ๐, ๐ท is usually unsatisfactory 30 • Alternative method – “a priori” covariance matrix ๐ ๐ก ๐ก−1 =๐ ๐ก−1 +๐ท ๐ ๐ก 1 = [๐ ๐ก ๐ก − 1 ๐ − ๐ ๐ก ๐ก − 1 ๐ ๐ก − 1 ๐๐ ๐ก − 1 ๐ ๐ก ๐ก − 1 ๐ ๐ก − 1 + ๐ −1 ๐ ๐ ๐ก 31 32 33 • One solution: Perturbation signal added to process input (via set pt) • Large signal: good parameter estimates but large errors in process output • Small signal: opposite effects • Vogel (UT) 1. Set ๐ = 1.0; 2. Use D (added when ๐ก๐ ๐ becomes small) 3. Use PRBS perturbation signal (only when estimation error is large and P is not small), vary PRBS amplitude with size of elements of P (proportional amplitude) +1 PRBS –19 intervals −1 4. ๐ 0 = 104 ๐ผ 5 filter parameters estimates ๐๐ ๐ = ๐๐๐ ๐ − 1 + 1 − ๐ ๐ ๐ (๐๐ used by controller) 34 35 • Model Diagnostics Reject spurious model parameters. Check (1) model gain (high, low limits) (2) poles (3) modify large parameter changes (delimiter) • Other Modifications: (1) instrumental variable method (colored vs. white noise) (2) extended least squares (noise model) In RLS, parameter estimates are biased because ๐ ๐ก is correlated with ๐ฆ ๐ก . IV uses variable transformation (linear) to yield uncorrelated residuals. In (2), apply RLS as if all ๐ ๐ก are known (don’t really know ๐ ๐ก if parameter estimates are erroneous) 36 • Pole Placement Controller (Regulator): Model and Controller ๐ด ๐ง −1 ๐ฆ ๐ก = ๐ต ๐ง −1 ๐ข ๐ก + ๐ถ ๐ง −1 ๐ ๐ก ๐น ๐ง −1 ๐ข ๐ก = ๐ป ๐ง −1 ๐ฆ๐ ๐ก − ๐บ ๐ง −1 ๐ฆ ๐ก where ๐น ๐ง −1 = 1 + ๐1 ๐ง −1 + โฏ + ๐๐ ๐ง −๐ ๐บ ๐ง −1 = ๐0 + ๐1 ๐ง −1 + โฏ + ๐๐ ๐ง −๐ ๐ป ๐ง −1 = โ0 + โ1 ๐ง −1 + โฏ + โ๐ ๐ง −๐ • Closed-loop Transfer Function ๐ฆ ๐น๐ถ = ๐ ๐ด๐น + ๐บ๐ต๐ง −๐ Select ๐น, ๐บ to give desired closed-loop poles ๐ ๐ง −1 ๐ฆ ๐ก ๐น ๐ง −1 = ๐ ๐ก ๐ ๐ง −1 = 1 + ๐ก1 ๐ง −1 + โฏ + ๐ก๐ ๐ง −๐ ๐ด๐น + ๐บ๐ต๐ง −๐ = ๐๐ถ (1) 37 • Example ๐ต๐ง −๐ ๐ด ๐ถ 1 − 0.9๐ง −1 ๐ฆ ๐ก = 0.5๐ง −2 ๐ข ๐ก + 1 + 0.7๐ง −1 ๐ ๐ก Let ๐ = 1 − 0.5๐ง −1 , (1) becomes 1 − 0.9๐ง −1 1 + ๐1 ๐ง −1 + ๐2 ๐ง −2 … + 0.5๐ง −2 ๐0 + ๐1 ๐ง −1 + โฏ = 1 − 0.5๐ง −1 1 + 0.7๐ง −1 ๐1 = 1.1, ๐0 = 1.28, all other ๐๐ , ๐๐ =0 1 + 1.1๐ง −1 ๐ข ๐ก = −1.28๐ฆ ๐ก ๐ข ๐ก = −1.1๐ข ๐ก − 1 − 1.28๐ฆ ๐ก Modify to obtain integral action 38 • Pole placement controller (Servo) ๐ฆ ๐ป๐ต๐ง −๐ ๐ต๐ ๐ง −๐ = = −๐ ๐ฆ๐ ๐ด๐น + ๐บ๐ต๐ง ๐ด๐ Place poles/cancel zeros (avoid direct inversion of process model) • Design Rationale: (1) Open-loop zeros which are not desired as closed-loop zeros must appear in ๐น. (2) Open-loop zeros which are not desired as controller poles in F must appear in ๐ต๐ . (example: zeros outside unit circle) (3) Specify ๐ฆ | ๐ฆ๐ ๐ง=1 = 1 (integral action, closed-loop gain = 1) 39 (1) and (2) may require spectral factorization Two special cases avoid this step. (a) all process zeros are cancelled (Dahlin’s Controller) (b) no process zeros are cancelled (Vogel-Edgar) These are both explicit algorithms (pole placement difficult to formulate as implicit algorithm) • Numerical Example ๐ −๐๐ ๐บ๐ ๐ = Δ๐ก = 1 3๐ + 1 5๐ + 1 Discrete Model: 1 − 1.5353๐ง −1 + 0.58665๐ง −2 ๐ฆ ๐ก = 0.027970 + 0.023415๐ง −1 ๐ง −๐ ๐ข ๐ก + ๐ ๐ก + ๐ ๐ = 1 (๐ = 2); ๐ = 5 (๐ =6); ๐ ๐ก : Gaussian noise with zero mean and ๐ = 0.01 40 • Simulation Conditions Time Events 0 Start with ๐ = 0 50 Set point change from 0 to 1 100 Load (d) change from 0 to 0.2 150 Process gain change from 1 to 2 41 • Controller ๐บ๐๐ธ = 1 − ๐ −Δ๐ก ๐๐ 1 + ๐1 ๐ง −1 + ๐2 ๐ง −2 + โฏ + ๐๐ ๐ง −๐ ๐ −Δ๐ก ๐๐ 1 + ๐ ๐ง −1 + โฏ + ๐ ๐ง −๐ ๐ง −๐ 1 − ๐ −Δ๐ก ๐๐ ๐ง −1 1 ๐ ๐=1 ๐๐ − 1 − ๐ • ๐: minimum expected dead time • Process model 1 + ๐1 ๐ง −1 + ๐2 ๐ง −2 + โฏ + ๐๐ ๐ง −๐ ๐ง −๐ ๐บ ๐ง = 1 + ๐1 ๐ง −1 + ๐2 ๐ง −2 + โฏ + ๐๐ ๐ง −๐ Features: (1) Variable dead time compensation (2) # parameters to be estimated depends on range of dead time (3) handles non-minimum phase systems, also poorly damped zeroes (4) includes integral action (5) on-line tuning parameter ("response time", ๐๐ ) 42 Figure: Flow Chart for the Parameter Estimation Algorithm 43 • Flow Chart for Adaptive Controller/Dead (Time compensator) 44 45 • User-specified Parameters (1) Δ๐ก (Δ๐ก ≈ 0.2๐, dominant time constant) (2) model order n=1 or 2. (n=2 does not work well for 1st order) (3) K- minimum dead time based on operating experience (4) initial parameter estimates (a) open loop test (b) Conventional control, closed loop test (5) high/low gain limits (based on operating experience) (6) ๐๐ (select as ~0.5๐) 46 47 48 49 50 51 Figure 7 Process Diagram for Control of Condenser Outlet Temperature (Distillation Column Provides the Disturbance) Column: MeOH –H2O 8 Seive trays; Thermo siphon re-boiler; constant pressure 52 53 54 55 56