Empirical Modeling
●
●
●
●
Model Fitting, Curve fitting
Perturb the input then measure output of system
(Step, pseudo-random binary sequence, sum of sinusoids)
Choose model structure (This is the art and most critical
step)
We'll use ARMA (Auto regressive, Moving Average)
(z n+a 1 z n−1+...+a n)Y (z)=(b1 z n−d +b 2 z n−1−d +...+b n−d −1 z 0)U (z)
y k +a 1 y k−1+...+a n y k−n=b1 u k−d +b 2 u k−d −1+...+b n−d −1 u k−n
Formulation
n
n−1
n−d
n−1−d
0
(z +a 1 z +...+a n)Y (z)=(b1 z +b 2 z
+...+b n−d −1 z )U (z)
y k +a 1 y k−1+...+a n y k−n=b1 u k−d +b 2 u k−d −1+...+b n−d −1 u k−n
Have 2n-d+1 unknowns
ϕn−1=[ y n−1 ... y 0 u n−d ... u 0 ] θ=[−a 1 ... −a n b1 ... b n−d +1]T
y n=ϕn−1 θ+ϵn
y n+1=ϕn θ+ϵn+1
y n+2=ϕn+1 θ+ϵn+2
⋮
y n+l =ϕn+l−1 θ+ϵn+l
As many equations as one wants, require a minimum of
l+1=2n-d+1 but since we will have noise much better
to use more
Formulation (continued)
●
Take previous equations and stack in matrix
Y n+l−1=Φ n+l−2 θ+Ε n+l−1
[ ] [ ]
yn
Y n+l−1= y n+1
⋮
y n+l−1
●
●
ϕn−1
Φn+l−2= ϕn
⋮
ϕn+l−2
Ignore noise and multiply on right by inverse of Φ
Generally want more equations than unknowns so Φ
rectangular
Least Squares Minimization
l−1
min ∑ ( y
θ
k=0
−ϕn+k−1 θ) = min ∣Y n+l−1−Φ n+l−2 θ∣
2
2
n+k
θ
= min (Y n+l−1−Φn+l−2 θ)T (Y n+l−1−Φ n+l−2 θ)
Note:scalar
Take derivative wrt θ and set equal to 0 (Tensor Analysis)
θ
0=( Φ
T
n+l−2
T
(Y n+l−1−Φn+l−2 θ))+((Y n+l−1−Φn+l−2 θ) Φn+l−2)
T
0=(Φ
θ) 2
T
T
n+l−2 n+l−1
n+l−2
n+l−2
T
−1 T
n+l−2
n+l−2
n+l−2 n+l−1
T
n+l−2
n+l−2
Y
−Φ
Φ
θ=(Φ
Φ
) Φ
Y
Φ
) to be invertible matrix
Requires (Φ
Called persistence of excitation condition
Dimensions Φ l x 2n-d+1 with l>2n-d+1
With y, u constants rank would be 1.
Empirical Modeling (cont.)
●
If u is composed of n sinusoids (unless ε is especially
nasty) will ensure φ is persistently excited.
●
Pseudo random binary sequence guarantees P.E.
●
Issues with Modeling
–
Accurate only at point measurements made
Different model every time done as a result of
noise
– How to choose n and d
●
Controller design for State-Space
Chapter 12
●
Nothing in Chapters 8,9,10 or 11
ẋ= A x+Bu
y=C x
let u=−K x+α r
then closed−loop system becomes
ẋ=(A−BK ) x+α B r
y=C x
●
Assume system in phase variable or control
canonical form
[
] []
0
0
I n−1
⋮
A=
B= ⋮
0
0
−a 0 ... −a n−1
1
●
Characteristic equation det(sI-A)=sn+an-1sn-1+ ... + a0
u=-Kx+r, let K =[ ā0−a 0 ā1−a 1 ... ā n−1−a n−1 ]
0
n−1, n
−BK =
−ā0+a 0 −ā1+a 1 ...−ā n−1+a n−1
[
[
0
I n−1
⋮
A−BK =
0
− ā0 ... −ā n−1
n
]
]
with char. equation det(SI −A+BK )=s + a
̄ n−1 s
n−1
+. . .+ ā0
i.e. I can choose K to give me any desired closed loop
eigenvalues. System remains in control canonical
form. Called pole placement controller.
●
Note – In control canonical form the C matrix is
the coefficients of numerator. With feedback C
stays the same and the system remains in
control canonical form so numerator of transfer
function is unchaged, i.e. the zeros are not
changed. This is a property of all single input,
single output controllers, the zeros can't be
moved, can only be canceled.
Example
●
[
] []
0 1
0
0
Given
ẋ= 0 0
1 x+ 0 u
0 −4 −5
1
y=[100 20 0] x
design a controller to get system to have closed loop
poles @ -5.4±7.2j, -5.1, i.e 9.5% overshoot with
Ts=7.4s.
●
Desired C. E. s3+15.9s2+136.08s+413.1
●
Existing C.E. s3+5s2+4s+0
●
u=-Kx+αr, K=[413.1-0 136.08-4 15.95-5]
K=[413.1 132.08 10.95])
Example continued
●
Closed loop Transfer Function
(20s+100)α
T ( s)= 3
2
s +15.95s +136.08s+413.1
100 α
T (0)=
413.1
If we wish y(t) →r(t), then T(0)=1 or α=4.131.
●
●
Note as 4.131 is proportional to plant DC gain
any error in knowledge of this is directly
relfected in closed loop DC gain, i.e sensitivity
of 1.
In classical control, sensitivity reduced by
controller gain i.e. Sensitivity = 1/K
Problems
●
●
Approach requires knowledge of states and system in
control canonical form. Knowledge of states requires
them to be physically meaningful. Control canonical
form states are seldom meaningful.
i.e. I can have one or the other but not both.
Assume I have states, but system not in control
canonical form.
Assume there exists similarity transformation P such
that PAP-1, PB is in control canonical form, i.e z=Px
−1
−1
ż=PAP z+PBz , y=CP z
then u=-Kz = -KPx achieves desired closed loop poles
for K =[ ā0−a 0 ā1−a 1 ... ā n−1−a n−1 ]
● How to find P
●
Similarity Transform P for Control
Canonical Form
●
Let C=[B AB A2B ... An-1B] – Controllability Matrix
●
Controllability Matrix for Control Canonical form
C=[PB PAP-1PB PAP-1PAP-1PB ... PAn-1B]=PC
●
P=CC-1 if C-1 exists
●
Say system is controllable if C-1 exists, i.e det C≠0
●
●
●
System is controllable if all eigenvalues can be placed
arbitrarily through feedback control
System is controllable if there exists u(t) to move system
from any initial state to any final state in arbitrarily small time
If system is not controllable then there exists eigenvalues
that cannot be changed via feedback
Similarity Transform P for Control
Canonical Form
●
Let C=[B AB A2B ... An-1B] – Controllability Matrix
●
Controllability Matrix for Control Canonical form
C=[PB PAP-1PB PAP-1PAP-1PB ... PAn-1B]=PC
●
P=CC-1 if C-1 exists
●
Say system is controllable iff C-1 exists, i.e det C≠0
●
●
●
System is controllable if all eigenvalues can be placed
arbitrarily through feedback control
System is controllable if there exists u(t) to move system
from any initial state to any final state in arbitrarily small time
If system is not controllable then there exists eigenvalues
that cannot be changed via feedback
C Controllability Matrix for Control
[
Canonical form
] []
0
0
I n−1
⋮
A=
B= ⋮
0
0
−a 0 ... −a n−1
1
[
⋮
1
0
0
1
−a n−1
⋮ ⋮
⋰
C= 0
2
−a n−1
1
−a n−2+a n−1
1 −a n−1 −a n−2+a 2n−1
⋮
[
a1
a2
C- 1= ⋮
a n−1
1
a2
a3
⋮ ⋰
1
0
]
a n−1 1
1 0
0 ⋮
⋮ 0
0 0
]
Controllability
●
There exists a transformation matrix P that transforms
the system to the following form
[ ]
[]
Ac A x
PAP =
0 Au
−1
[ ]
Bc
PB=
0
x̄ = x c then x˙u= Au x u
xu
P-1 given by any complete set of l.i. Columns of the
controllability matrix and additional vectors such that
the matrix is non-singular
Controllability Example
Is the following system controllable
−1 0
ẋ=
x+ 1 u
0 −1
1
No
1 −1
C=[ B AB]=
, ρ(C)=1
1 −1
● Rank less than 2, not controllable
x1
let z=
, ż= −1 0 + 1 u
0 −1
0
x 1−x 2
●
[
] []
[ ]
[ ] [ ][]
z˙2=−z 2 or z 2 (t )=x 1−x 2=e−t ( x 1 (0)−x 2 (0))
regardless of u
●
To find inverse transformation matrix take l.i col of C
plus any other vector that is l.i
1 0
−1
P =
=P
1 −1
[
]
Control Design Example 2
●
For A=[-1 3 2;2 -3 1;4 1 -1];B=[1 -2 1]'; design feedback controller to place
eigenvalues at {-1,-2,-3}
%generate polynomial with coefficients of desire characteristic equation
dce=poly([-1 -2 -3]);dce=dce(end:-1:1) % more convenient to have coefficient of s^n
last
% existing Characteristic equation
ce=poly(eig(A)); ce=ce(end:-1:1) % move convenient to have coefficient of s^n last
K=dce(1:end-1)-ce(1:end-1); %leave out monic coefficient
a0=ce(1); a1=ce(2);a2=ce(3);
Kb=K*inv([a1 a2 1; a2 1 0; 1 0 0])*inv([B A*B A^2*B])
% Kb = 5.3425
4.0959
3.8493
%alternatively
Kb=K*inv([ce(2:end)' [ce(3:end)';0] [ce(end);0;0]])*inv(ctrb(A,B))
eig(A-B*Kb)'
%ans= -3.0000 -2.0000 -1.0000