Scarica Data Driven Control System Design (POLIMI) - Parte 1 e più Appunti in PDF di Controllo avanzato e multivariabile solo su Docsity!
Introductory Example^ :^ simplest^ possible^ system
X(t+^ 1) =^ ay(t) +^ u(t)^1 st order linear system
I
-u(t) Vt^ =^ water^ volume^ at^ time^ +
ult) = incoming flow^ of^ water in time^ period
L
p(t) = outgoing flow^ of^ water^ (leak)
vo leak ,
p(t)
p(t) =^ xVt^ linear^ simplified model
a [0, 1]
Vt + 1 =^ Vt^ + u(t) - p(t) =^ Vt^ + u(t) - cVt = (1 - x)Vt + u(t)
X (t) = Vt^ =^ State (observable)
a =^1 -^2
x(t +^ 1)^ =^ ax(t) +^ u(t) : S
Objective :^ to^ regulate the^ volume^ of^ the^ water^ in^ the^ tank
Control objective : track u(t) :
given
set point , using ult) and
looking
at (1)
u(t) =^ control action , input
< (t)^ =^ observable output, state
Best result without being anticipative
X(t + (^) 1) =^ u(t) ·^ intrinsic one (^) step-delay
S
u(t) =^ - ay(t) +^ r(t) (^) Optimal (^) policy , optimal control I (^) y(t+ 1) = ax(t) + u(t)
X (t+ + y =^ r(t) + t
zx(z) =^ ax(z) + u(z) +(z)(z - a) = u(z)
=a plan 1
x(t+^ 1) =^ u(t)
z - a p (^) U & En zai as
au
-x(t+ 1) - ay(t) =^ u = r(t) - ay(t)
↑ (t + 1) =^ r(t)
perfect tracking.^ I^ step^ delay
Let's now introduce^ UNCERTAINTY : perfect knowledge is not^ realistic.
a could be^ completely unknown^ , a EIR^ ,^ or^ partially known^ a^ trange]
x(t+ 1) = ax(t) + u(t)
partial knowledge ac[x,^ B]
5) X(t +^ 1) =^ ax(t) + u(t) controlled system
S C :^ u(t) =^ - ay(t) +^ r(t) a^ = guess of^ a^ X(t+) =^ (a^ - a)x(t) (^) + R(t)
N a + a
optimal control^ policy a^ nominal^ controller^ -^ implemented for^ a^ guessed value^ for^ a^ only
· (^) Robustess issue : (^) performance are deteriorating when^ ta
If r(t) = u (steady state)
S
y(t+ 1) =^ ax(t) + u(t) A controller is said to be
u(t) =^ - ay(t) + (^) r(t) robust (^) wot a (^) family of systems S^ When^ it^ achieves At (^) steady state (^) : x(t+) = * = X (t) (^) satisfactory performance
for all systems SE , S
- = r ay +i^ - *^ = 1 + (^) (a - a) overshoot (^) or i = -ay + r^ undershoot ta p (^) + U &
-n "zai
as Underestimating a : (^) (asa) (^) Overestimating a : (^) (a > a) -----^ ----^ less^ than^30 more than^30
- : Uncertainty is^ an^ omni-present (^) ingredient of^ control. Uncertainty arises^ robustness^ problems^ ,^ while^ we'd^ like^
to secure the control requirements
irrespective of^ the^ value^ taken^ by uncertainty parameters.
The nominal controller is not
enough to^ ensure^ robustness. In this^ case the control (^) goal is the (^) perfect (^) tracking of^ rit)^ steady state and the^ uncertain
element is a - Nominal optimal controller not robust
2) Use^ an ADAPTIVE CONTROLLER :
We (^) can have robustness even when the control
specifications are^ strict^ :^ we^ can^ ask^ for^ a
specific (^) setting time^ +^ zero^ asymptotic error This result^ is achieved (^) by (^) lifting the class of controllers (^) among which we are (^) selecting the
best one. The adaptation is a means to select
a suitable controller , and it^ introduces a
non-linearity
in the controller
r(t) controller
X(t) V fast response 13 time steps)
u ⑮a^ Y^ V^ perfect (^) tracking Ensure robustness for^ high (^) performing design goals (^) -anderstanding how, is the
I perfect steady-state tracking and fast^ response focus^ of the^ course
simultantanously)
5) :^ x(t+^ 1) =^ ax(t) + u(t)
S(t+^ 1) =^ S(t)^ +^ X(t)2^ (s^.^ )^ State^ highly non^ linear
I & & A S
.^ c^.^ a^ ++ =^ at +^ SH+)"x(t)(x(t+^ 1) - u(+^ )^ -^ a+ x(t)] (2)^ equations
u(t) =^ -^ a+ X(t)^ +^ r(t)^ output equation
S(0) =^5 ,o =^ a^ Initial^ conditions
Let's understand^ how these^ equations quarantee the^ above properties
1) s(t+^ 1) = s(t) +^ X(t)2^ =^ x(t)^ +^ s(t)
S(t) =^ X(t^ -^ 1)^ +^ s(t^ -^ 1)
s(t +^ 1) =^ y(t)^ +^ x(t^ -^12 +^ s(t- 1)
s(t -^ 1)^ =^ x(t - 2)2 +^ s(t - 2)
S(t + 1)^ =^ x(t)2^ +^ y(t - 1) +^ x(t-^ 2)^ +^ s(t - 2)
... proceding iteratively we^ reach^ the^ initial^ condition
S (^) t
S(t + 1) =^ +(t)^ +^ x(t-^ 1)^ + +(t -^ 2)^ +.... +^ x(1) + x(0)^ +^ S(0) =^5 +
Ex(i) t
s(t+^ 1) =^5 + [ix(i)
i = 0
2)+ + 1 =^ at + (^) S(t + (^) 1) (^) x(t)(X(t+ (^) 1) - u(t) -^ a^ + (^) X(t)] a (^) + + 1 = s(t + (^) 1) (^) "(x(t)(x(t+ (^) 1) - u(t)) -^ a (^) + + -(t) (^) + a+ s(t + (^) 1)) ++ = S(t + (^) 1) (^) "(x(t)(x(t+ (^) 1) - u(t)) +^ a^ + (^) (s(t+^ 1) - x(t))))
(1.^ )^ S(t +^ ) =^ S(t)^ +^ y(t)^ -^ s(t+^ 1) -^ y(t))^ =^ s(t)
++ = S(t + (^) 1) (^) "(x(t)(x(t+ (^) 1) - u(t)) + a (^) + (^) s(t)) at =^ s(t)" (x(t - 1)(x(t) - u(t - 1)) +^ at^ - 1S(t- 1)) & at + 1 =^ S(t+ 1) " (^) (y(t)(x(t+ (^) 1) - u(t)) + s(t)s(t)" (x(t - 1)(x(t) - u(t - 1) +^ at^ - 1s(t- 1)]] at (^) + 1 = (^) S(t+ (^) 1)"(x(t)(x(t+ (^) 1) - u(t)) + (^) x(t - 1)(x(t) - u(t - 1)) + at - 1S(t- 1))
... proceding iteratively we^ reach^ the^ initial^ condition
Sa
at + 1 = S(t+ (^) 1)"(x(t)(x(t+ (^) 1) - u(t)) + x(t - 1)(x(t) - u(t - 1) + (^) .... + (^) x(0)(X(1) - u(0)) +^50 %o] t att = (^) S(t + 1)" (^) (S + [x(i)(x(i
- (^) 1) - u(i))] S(t + 1 = (^5) + x(i) i =^0 t t+ 1 = Sa^ +[x(i)(x(i + 1) - u(i)) S t
5 + [ix(i)
i = 0 equations^ of^ A^.^ C.
u(t) =^ -^ a+ x(t) +^ r(t)
S :^ X(t + (^) 1) =^ ax(t) + u(t)
-(t+^ 1) - u(t) =^ ax(t) Linear Regression Model to
estimate a (^) given y(t) =^ ay(t)
y(t) =^ x(t+^ 1)^ -^ u(t)
x(t) =^ y(t - 1)
y(t) =^ ay(t^ -^ 1)
t
Variation of
++ 1 =
Sa
+(Pi^
Last square Formula
5 + (^) y(i - 1)
y(i - 1) I is a variation because of
i =^0
the additive^ terms Sa ands
GENERAL PRINCIPLES OF DDCSD" are valid for self-tuning , VRFT, reinforcement learning
System,^ S^ = any portion of^ reality that^ generates a^ relationship^ among some^ quantities,
that can be dependent or independent.
Quantities are ment in a high level of obstraction , they can be variables, constants, functions
of other quantities
INDIPENDENT QUANTITIES : those^ to^ be^ given for^ the^ DEPENDENT QUANTITIES to^ be^ determined
inputs state^ , output
v -SW^ usually^ we^ operate^ with systems not^ completely known
Examples
E
X(t+ 1) = ty(t) + e(t)^ Indipendent quantities : elt) , yo
X (0) =^ Xo Dependent quantities : X (t) , y(t)
y(t) =^ X(t)
Example 2
constant parameter
S X ( +^ + (^) 1) =^ ay(t) +^ u(t) (^) Indipendent (^) quantities : ult) (^) , a (^) , bit)
time-varying
y (0) =^1 Dependent (^) quantities :^ X (t) (^) , (^) y(t) parameters
y(t) =^ b(t)^ -^ X(t)^ variables
Example 3
S y(t) =^ f(u(t))^ Indipendent quantities :^ ult)^ , f()
X(t+^ 1) = x(t)y(t) Dependent quantities :^ X(t) , y(t)
X (0) = u(0)
Dependent quantities can^ be^ classified^ as^ :
· observable · (^) Not observable
Indipendent quantities can^ be^ classified^ as^ :
· Tunable (^) :
degrees of^ freedom^ to^ operate with/control^ inputs)
·
Exogenous
· known (^) : user has
knowledge of^ the^ specific^ value
· uncertain: (^) possible values taken
by these^ quantities^ has^ a^ numerosity^ -
S is^ callad^ UNCERTAIN^ whenever^ is^ subject to^ a^ quantity that^ is^ uncertain
Uncertain. S +^ 'robust' control problem
To decide the value of the tunable quantities based on the observation of^ the observable
dependent quantities so^ that^ the^ dependent^ quantities behaviour^ meets^ some^ design
goals , irrespective^ of^ the^ value^ taken^ by the^ indipendent^ uncertain^ quantities
The (^) tuning of^ the^ tunable (^) quantities is (^) performed via a (^) policy - controller
S =^ represent an instance^ of^ the^ system for^ a given value^ of^ all the^ uncertain quantities
· Se3-class of $ for different instances of uncertain quantities
I possible realisations of the system)
· dieC ~ class of admissible POLICIEs
, reduced^ in^ order^ to^ find^ a^ solution
2 = linear controllers = PID controllers
A controller C is a choice of the tunable quantities based on the observation of
the observable^ dependent (^) quantities so^ as to^ meet some (^) specifications about the behaviour of the (^) dependent quantities, irrespective of the value taken (^) by the uncertain quantities.^ = Any control^ problem is^ a^ robust
We want to find a controller such that an index of performance JK . S) sk USEI
· JIC
, S)^ =^ INDEX^ OF^ PERFORMANCE^ -behaviour^ of^ dependent^ quantities when^ S^ is
operating (^) according to^ G
.max
leigt
5(C , S)^ =^ -K^ i
↑ linear ·
Isteady-state performance^ O^
tracking error
liner system errort level
i
controller
· settling time
Control Problem (^) : find (^) GE2 :^ J(CS)sh Vise]
control goals are achieved for all
the values taleen (^) by uncertain (^) quantities Two situations may arise :
1) There^ are^ techniques that^ allows^ you to^ find^ a^ solution^ to^ c^.^ P^.
The control problem has a solution in e
Acce :^ 51ssk ViseS
no need^ for^ adaptive or^ data^ driven^ control
However to^ be in case 1 :
· uncertainty is^ not^ too^ big : Linear (^) frequency domain controller is oh for additive uncertainty,not for (^) parametric (^) uncertainty · design goals are^ not^ too^ strict linear (^) robust control is o for (^) parametric (^) uncertainty but conservative (low response)
The tuner introduces a further loop > the adaptive controller is the composition of the basic controller C + tuner,
this is^ what generates e'
This is a way to achieve robustness effectively and at a very general level
A common misinterpretation of adaptive control
Y (^) Adaptation and data driven CSD (^) is called (^) by (^) t-varying system
X Adaptation means adaptation through time , it helps with t-variability ofS
V (^) Robustness is what (^) calls for (^) adaptation (^) (uncertainty) S (^) time-varying but^ not uncertain -^ no need for (^) adaptation
Example (introductory example)
S : x(t + 1) = a(t) +(t) + u(t)
alt) =^0. 9 + (^0). 05 sin (^) (wt) alt) : (^) time-varying but (^) perfectly known
u(t) =^ - a(t)x(t) +^ r(t)^ optimal nominal^ controller achieves the
goal without^ the^ need^ for^ adaptation
↓ invariant ,S : there are many more control techniques to address robust problems
Situation 1 : possible
/ uncertainty
situation 2 : possible
Situation (^1) : almast (^) empty - that's (^) why the (^) misinterpretation t-variantis : uncertainty/ about^ the^ adaptive control
& situation
2 :^ almost^ always the^ case
HIGH LEVEL TAXONOMY OF ADAPTIVE OR^ DATA DRIVEN^ CSD · on-line us (^) off-line schemes 2 feature classification · indirect (^) vs direct schemes (^3) comp
lementary features
- Tharectene anning Q-learning I Tre controles a
OFF-LINE (^) SCHEMES Tuner (^) changes Conce (^) , after (^) gathering information (^) on S (^) on a (^) long enough time interval
simplest example :
t = N ⑧^ ·^ identification^ + control^ design ⑨
TUNER beside on identified model
L r (^) I U w
y G^ S
· other example : VRFT
S &^ N
1. S' must not be subject to t-variability
(^2). Until^ t^ =^ N (^) , S is (^) operated with a (^) possibly poor (^) performing controller / also (^) open-loop)
- (^) thus must not be (^) a (^) problem We (^) can use offline schemes when : · the uncertainties
affecting s are^ time^ invariant
· the system S can be connected to a poor controller
up to^ t=^ N^ leven^ an^ open loop^ controller) without
causing issues
ON LINE SCHEME
Tuner continuosly changes theCbased^ on the^ gathered information , at every +
TUNER L r (^) I U^ w
y G G S
N L
1. Also suitable for -varying S
C . Useful to^ achieve the designed performance quickly
(for S that needs high-performing control)
We can use online schemes when^ :
· S is affected by time
varying uncertanties^ (information^ collected^ in^ the^ past^ becomes^ non-informative^ for^ the
current (^) uncertainty) · we need high performance^ since^ the^ very (^) beginning There exist schemes in between^ online^ and offline^ ones :
Off-line on-line
I I^111111 I (^) I
· periodic adaptation
· event-driven adaptation (trigger-activated tuning)
i
DUAL ADAPTIVE (^) SCHEMES S TUNER S (^) ID S A ↑ r
y C
U
S
w N
In Adaptive Control schemes there is always a trade-off between
· Primal effect (Exploitation) : the behaviour of S
depending
on the^ choice^ of^ the^ tunable
u, directly related to our control goal , related to the control specification
· Secondary effect^ (EXPLORATION)^ : the (^) impact of the (^) input u on the model's^ (excitation of (^) 5) : &
the more the system is excited the better the model s
Exploitation and^ Exploration
=x (^) ploitation is^ the^ choice^ of^ u^ so^ as to^ force^ the (^) response of^ s to^ meet the^ control (^) goal , while (^) exploration
so as to^ reveal the unknown dynamics part of S.
·
Opposing control^ goals^ :
explotation keeps as^ steady as^ possible , while^ to^ achieve^ a^ high quality model^ we^ want^ to
excitate S as much as possible
· (^) Interwined :
input impacts ons^ but^ also's^ impacts on^ the^ quality of^ the^ input (the^ betters^ , the^ better^ the
control (^) action)
non tuned^ on the actual S
An (^) adaptive scheme (^) automatically determine (^) a trade-off (^) between (^) exploitation and (^) exploration
Optimal trade-off^ is^ not^ obvious^ at^ all
Pure (^) exploration discards the control (^) goals , while in (^) pure exploitation we rely
too much in present
operating conditions^ ,
that do not reveal the dynamics of s , therefore the beaviour is not optimal
when the
operating
condition changes.
self (^) tuning achieves a trade off^ , good enough but^ not^ optimal for^ sure Dual (^) AdaptiveControl /-aims (^) at the (^) optimal tradeoff (^) (too (^) complicated) Coptimal non^ linear^ control)
To difficult for practical implementation
Let's consider (^) a reference (^) signal as follows (^) : N r(t) · suppose that (^) the (^) system is at (^) rest at (^) the
beginning
so no and^ yo
> t^ ·^ we^ don't^ have^ any knowledge of^ the^ system
·
Self-tuning -CEPy^ over^ exploitation^ ,^ trade^ off^ is^ not^ optimal
N
poor model^ r(t)
enough to^ the^ poor model^ is^ trusted^ (CEP)
track (^0) poor model slows^ up, it takes time
No exploration
u
to adjust ult) and track rit)
G
self
tuning algorithms^
(CEP) are^ close^ to^ pure exploitation.
· Dual adaptation control : A more optimal
strategies
&
poor model^ not^ The^ optimal trade-off^ between^ exploration
trusted ↑
and exploitation is to^ difficult to obtain ,
so it is only achieved herristically
se &
exploration anyway so^ as
to improve the behaviour later
· over
exploration
X
the performance are
completely compromised Mi &^ at^ the^ beginning ROBUST ADAPTIVE^ CONTROL
s not completed trusted . U(t) is decided
according
for an estimation of S-5"model mismatch
to reduce^ over-exploitation of^ CEP
In (^) general CEP Is (^) good enough for (^) a (^) large number of (^) problems
4) corresponds to the uncertain system , the integral is the index to evaluate and the known realisations
of f(x) correspond to the measurement of the observable quantities
· f(x) = S
· ((f(x)dx =^ 5(,^ s)^
= 5(s)
no decision- The problem is just
here (^) to evaluate (^) J(S)
Y 1, f(x1)
:
· Xi , f(xi) : data = measurement of the
I XN (^) , f(xv)
: observable quantities
We solve the problem using both^ indirect^ and direct approaches :
Indirect approach
data - model for f(x)-f(x) < function
fitting
f(x) (^) = 80 + 01x + 02x2 (^) +... + ONXN 2 f(x) = minil^
Last Squares
Identification Algorithm
(xf(x)dx evaluation^ of^ (y +(x)dx On
average
(x f(x)ax^
- (x +(x)dx^ = 0(a (^) N) goal mismatch
dth^ root of^ N
error remains (^) big for^ ·^ curse^ of^ dimensionality
large N^ When^ d^ is high
vary bad^ rate^ of^ convergence
Direct approach
-(s) = ( f(x)dx^ = 1(f(x)) +^ -^ u(x)^ Irrespective^ of X (^) d! law of^
large
numbers & #(f(x)]-1[if(xi) =^ 5(s)^ - (y
f(x)dx -
yEf(xi)
0)i))
Ni = 3
Time
average empirical^ mean^ is^ an
= Integral estimator (^) of (^) IE(f(x)]
f(xi) (^) -^ Even^ if^ f(x) is^ very complex (f(x)dx lives^ in^ IR^ and^ its i)
estimation is a simple problem
SELF TUNING indirect^ approach
S
ID [
A Indirect^ + CEP
r(t)
- (s)u(t) "S (^) - y(t) L self (^) tuning elements : · (^) Suncertain (^) system - pror knowledge ID (^) identification (^) algorithm (chosen
according
to the (^) available (^) knowledge of (^) 5)
: Cee basic controller /chosen
according
to the available (^) knowledge of^ 5) self (^) tuning : (^) the (^) un certain (^) system S : we (^) are (^) going to consider linear (^110) systems with unknown (^) parameters (^) (possibly time (^) varying)
affected by a white^ noise as^ additive disturbance
input u(t)
3 scolar -S^ =^ siso (^) system
output y(t)
- : (^) y(t) = ai(t)y(t- 1) + (^) a2(t) (^) y(t - 2) +... + (^) an(t)y(t - n) + (^) regression over the
past values^ of^ the^ output^ +
- (^) bo(t)u(t - d) + (^) bi(t)u(t- d - 1) +... + bm(t)u(t - d - m) +^ regression over the
past values^ of^ the^ input
+ e(t)
n,m : order of the (^) system e(t) ~^ WN(o^ , x)^ additive^ disturbane^ d^ :^ intrinsic^ delay between^ input
and output , d
The (^) setup we consider (^) is when (^) Sis linear, (^) possibly t-varying stochastic (^) system when the^ disturbance is a WN : (^) t-varying ARX (^) system
Where bolt)^ fo Xt and ds1 strictly proper
↓ is the actual (^) delay between (^) input and (^) output Vt
We have^ to^ choose^ the class^ of^ models^ for^ S^ : lamong witch^ we^ search^ the^ best^ description of^ 5)
We know that. S Is ARX^ so we^ consider the^ ARX^ model class Let's define^ the (^) generic model (^) in the class ARX as : (^) (same order as (n (^) , m (^) , d^ known)) M(0) : (^) y(t) = any(t - 1) +... + (^) any(t- n) + bou(t^ - d) +... + bmu(t - d-m) +^ z(t)
3(t) vwN(0^ , 02)
· O = [a1,
..., ando be,...,^ bmb^ parameter vector
· y(t-1) = [y(t-1) ...
y(t-^ n)u(t-^ d)u(t-^ d^ -^ 1)^ ...^ u(t^ -^ d-^ m)]^ regression vecter M(0) :^ y(t) =^ o
+ y(t- 1) +
z(t) =^ yt-^1
0 +^ =(t)
We want to findo so as to obtain the^ best description of S :
As identification (^) algorithm we can use the PREDICTOR ERROR MINIMIZATION (^) (PEM) (^) , which (^) is based on solid^ principles and fits^ very well ARX model (^) (last (^) squares) PEM : the better the (^) output prediction (^) capability , the better the model Self (^) tuning is an online (^) adaptive scheme -^ the controller (^) is (^) changed at (^) every time instant (^) , so the model
Identified at every time instant I must be representative of S^ for one time instant only , because at the
next (^) time instant (^) everything is (^) changed
from stochastic model to prediction models :
M18) -^ MO) We have :^ y(t - 1) = [y(t - 1), ..., (^) y(t-^ n)^ , u(t-^ d)...., n(t -^ d^ -^ m)]T M(0) :^ y(t) =^ y(t^ -1)^ o^ +^ z(t) = o^ T^ y(t- 1) +^ z(t)
We want^ to^ predict y(t) at^ time^ +-1^ :
M(0) :^ y(t) =^ y(t^ - 1)^8 +(t) unpredictable at^ -1^ (whitness)
predictable at^ time^ +-1^ because^
U
function of y(t-1) , y(t- 2) , ... and Wit-1) , ult-2) , ... )
that (^) are observable at -1 (^) = MO)^ ri
Y
M(0) : y(tt- (^1) , 0) =^ YHt-1) e = OT y(t- 1) MODEL IN (^) PREDICTION FORM
prediction of^ y(t) linear
given info^ up^ to^ +-
The Idea is that I can compare : y(i) and y(ili-1 , 01)
observed prediction computed
output based^ on^ observed^ data
up to^ time^ i N
5N(0)
=[lyli)^
- glili-1 , 01) magnitude of^ prediction^ error^ at^ i Empirical variance^ of^ prediction errors^ +^ indicators^ of^ prediction capabilities^ of^ M(0) PEM :^ Best (^) model-minimizing IN(0) =
argin
SN) - argminyligiliooptima pen moda
8 +^ y(i - 1)
Last Squares =^ PEM when MO) is ARY
N Er =
argmin
SN(0) =argmin lyli) -^ oli)^ quadratic i and^ postese
First order conditions are
enough
to detect minima
y(i)i1) = 0
equation whose^ solutions^ are^ minimis^ a
N (^) system of linear (^) equations (^1) (i)il LS^ minimal^ equations
(^) MYli173/i-1)" is^ invertible^ (non (^) singular)
= 7! solution
vity(i
- 1)]^3 - 1y(i) LAST SQUARES FORMULA · (^) Issue =
singularity can^ very^
well occur in
self-tuning and (^) in (^) general in (^) adaptive control User (^) is not (^) designing the identification (^) experiment (^) , rather the (^) experiment is dectated (^) by
the scheme itself
control scheme : objective is to keep Sas steady as possible but in this case the
experiment is^ not^ informative^ and^ singularity can^ very well^ show^ up
S
ID [ A
r(t)
- (s)u(t) "S (^) - (^) y(t) L