Adaptive control 2

advertisement
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
Download