Place function for observer gain L
30 views (last 30 days)
Show older comments
I tried to construct a simple observer and here is my code.
clc
clear
%%Initializing
A =[-1 0; 1 0];
B = [0.9; 0];
C =[0 0.5];
D = 0;
L=place(A',C',[-10 -15])';
eig(A-L*C)
eig(A)
x=[-1;1]; % initial state
xhat=[0;0]; % initial estimate
XX=x;
XXhat=xhat;
T=40;
UU=ones(1,T); % input signal
for k=1:T,
u=UU(k);
y(k)=C*x+D*u;
yhat(k)=C*xhat+D*u;
x=A*x+B*u;
error(k+1)=(y(k)-yhat(k));
xhat=A*xhat+B*u+L*(y(k)-yhat(k));
XX=[XX,x];
XXhat=[XXhat,xhat];
end
figure
plot(1:T,yhat);
hold on
plot(1:T,y);
hold off
figure
plot(error);
And I got really confused. In theory i should assign poles on the far left plane in s domain but when i assign poles at [-10 -15] the observer didn't work. However, if assign poles less than 1 the observer works. Does anyone know whats going on?
1 Comment
Jeroen
on 9 May 2016
If your model is discrete the poles should lie in the unit circle (between -1 and 1) to make the system stable. If the model is continuous the poles must be less than zero, for the system to be stable.
Answers (1)
Kiran Khunte
on 2 Jul 2018
The value of poles should be inside the unit circle to let your esitmate to reach zero as k increases. As you see the poles are the eigen values of matrix 'A-L*C' which is the multiplying factor for err(k). i.e. err(k+1) = (([A-L*C])^k)*err(k). So to make err(k+1) tends to zero you will need eigen values of matrix [A-L*C] as small as possible.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!