Observer gain matrix calculations give warning when replicated with Matlab

45 次查看(过去 30 天)
Hi,
I am trying to replicate on Matlab an exercise on the book Modern Control Engineering of Ogata Chapter 10.7.
When using the state space values of the book I can calculate the observer gain matrix Ke. When calculating the state space values on Matlab using the tf2ss, I am getting a warning for the observer gain matrix Ke.
The transfer function, desired closed loop poles and desired observer poles are below.
Gp=tf(1, [1 0 1 0])
Gp = 1 ------- s^3 + s Continuous-time transfer function.
s1=-1+i; %Desired closed loop poles
s2=-1-i; %Desired closed loop poles
s3=-8; %Desired closed loop poles
s4=-4; %Desired observer poles
s5=-4; %Desired observer poles
J=[s1 s2 s3];
L=[s4 s5];
On the book, the state space matrix A, B, C, D is given as below. The same values I find when I manually calculate the state space matrix.
A=[0 1 0; 0 0 1; 0 -1 0]
A = 3×3
0 1 0 0 0 1 0 -1 0
B=[0; 0; 1]
B = 3×1
0 0 1
C=[1 0 0]
C = 1×3
1 0 0
Aaa=[0]
Aaa = 0
Aab=[1 0]
Aab = 1×2
1 0
Aba=[0; 0]
Aba = 2×1
0 0
Abb=[0 1; -1 0]
Abb = 2×2
0 1 -1 0
Ba=[0]
Ba = 0
Bb=[0; 1];
K=acker(A,B,J)
K = 1×3
16 17 10
Ke=acker(Abb',Aab',L')'
Ke = 2×1
8 15
When calculating the state space values using the tf2ss, I get for observer gain matrix Ke a wanring “Warning: Matrix is singular to working precision” and the ouput is Ke=[Nan; Inf].
[num den] = tfdata(Gp, 'v');
[A B C D]=tf2ss(num,den)
A = 3×3
0 -1 0 1 0 0 0 1 0
B = 3×1
1 0 0
C = 1×3
0 0 1
D = 0
Aaa=[0]
Aaa = 0
Aab=[-1 0]
Aab = 1×2
-1 0
Aba=[1; 0]
Aba = 2×1
1 0
Abb=[0 0; 1 0]
Abb = 2×2
0 0 1 0
Ba=[1]
Ba = 1
Bb=[0; 0];
K=acker(A,B,J)
K = 1×3
10 17 16
Ke=acker(Abb',Aab',L')'
Warning: Matrix is singular to working precision.
Ke = 2×1
NaN Inf
The difference on two methods are the state space values A, B, C , D which also make different values Aaa, Aab, Aba Abb.
Any idea why I get warning when trying to calculate the observer gain matrix Ke.

回答(1 个)

Paul
Paul 2023-11-26
Hi NGiannis,
Here's the plant model and desired pole locations
Gp=tf(1, [1 0 1 0]);
s1=-1+i; %Desired closed loop poles
s2=-1-i; %Desired closed loop poles
s3=-8; %Desired closed loop poles
s4=-4; %Desired observer poles
s5=-4; %Desired observer poles
J=[s1 s2 s3];
L=[s4 s5];
State space realization via tf2ss
[num den] = tfdata(Gp, 'v');
[A B C D]=tf2ss(num,den);
Parttion for reduced order observer:
Aaa = A(1,1);
Aab = A(1,2:3);
Aba = A(2:3,1);
Abb = A(2:3,2:3);
Ke=acker(Abb',Aab',L')'
Warning: Matrix is singular to working precision.
Ke = 2×1
NaN -Inf
The problem arises because Abb and Aab are not an observable pair; the observability matrix is clearly not full rank because the second column is all zeros.
obsv(Abb,Aab)
ans = 2×2
-1 0 0 0
I believe that this approach assumes that the first state is available for feedback via the output, but in this realization it's the third state that is the output
C
C = 1×3
0 0 1
Compare to the C matrix in your original formulation where C(1) = 1.

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by