Professional Documents
Culture Documents
CPC L11 LQG PDF
CPC L11 LQG PDF
Eduardo F. Camacho
Outline
◼ Kalman filter
◼ LQG
◼ Steady-state
2
Classical Definition
Kalman (1963):
Rudolf E. Kalman
4
Rudolf E. Kalman
2008 National Medal of
Science to Dr. Rudolf E. Kalman
for his fundamental
contributions to modern system
theory, which provided rigorous
mathematical tools for
engineering, [econometrics],
and statistics, and in particular
for his invention of the Kalman
filter, which was critical to
achieving the Moon landings
and creating the Global
Positioning System and which
has facilitated the use of
computers in control and
communications technology.
Formulation
6
Notation
Kalman filter
8
Correction
10
Kalman filter algorithm (matlab)
for k=1:Nsim-1
xe(:,k+1)=A*x(:,k)+B*u(k);
x(:,k+1)=A*x(:,k)+B*u(k)+randn(2,1)*0.01; %
covarianza=0.0001
P=A*P*A'+W;
y(k+1)=C*x(:,k+1)+rand*0.01;
Kk(:,k+1)=P*C'*inv(C*P*C'+V);
xe(:,k+1)=xe(:,k+1)+Kk(:,k+1)*(y(k+1)-
C*xe(:,k+1));
e(:,k+1)=xe(:,k+1)-x(:,k+1);
P=(eye(2)-Kk(:,k+1)*C)*P;
%P=(eye(2)-K(:,k+1)*C)*P*(eye(2)-
K(:,k+1)*C)'+K(:,k+1)*V*K(:,k+1)';
end
11
12
12
13
13
14
14
LQG = LQR+Kalman filter
u y
Process
^
X
15
16
LQG algorithm matlab (1)
for t=Nsim:-1:1
Pt=Q+A'*Pt1*A-A'*Pt1*B*inv(R+B'*Pt1*B)*B'*Pt1*A;
c1(:,t)=Pt1(:,1);
c2(:,t)=Pt1(:,2);
K(t,:)=inv(R+B'*Pt1*B)*B'*Pt1*A;
Pt1=Pt;
end
17
for k=1:Nsim-1
u(k)=-K(k,:)*xe(:,k);
xe(:,k+1)=A*x(:,k)+B*u(k);
x(:,k+1)=A*x(:,k)+B*u(k)+randn(2,1)*0.01;
% covarianza=0.01
P=A*P*A'+W;
y(k+1)=C*x(:,k+1)+rand*0.01;
Kk(:,k+1)=P*C'*inv(C*P*C'+V);
xe(:,k+1)=xe(:,k+1)+Kk(:,k+1)*(y(k+1)-
C*xe(:,k+1));
e(:,k+1)=xe(:,k+1)-x(:,k+1);
P=(eye(2)-Kk(:,k+1)*C)*P;
%P=(eye(2)-K(:,k+1)*C)*P*(eye(2)-
K(:,k+1)*C)'+K(:,k+1)*V*K(:,k+1)';
end
18
18
19
19
20
20