You are on page 1of 10

LQG

(Linear Quadratic gaussian)

Eduardo F. Camacho

Outline

◼ Kalman filter
◼ LQG
◼ Steady-state

2
Classical Definition

Kalman (1963):

A linear system is observable if and only if


for some T>0 and for all initial states x0 ,the
knowledge of A, C, and the zero input
response from 0 to T suffices to determine x0

Rudolf E. Kalman

◼ Kalman's ideas on filtering were initially met with vast


skepticism, so much so that he was forced to do the first
publication of his results in mechanical engineering,
rather than in electrical engineering or systems
engineering.
◼ Kalman had more success in presenting his ideas,
however, while visiting Stanley F. Schmidt at the NASA
Ames Research Center in 1960. This led to the use of
Kalman filters during the Apollo program, and
furthermore, in the NASA Space Shuttle, in
Navy submarines, and in unmanned aerospace vehicles
and weapons, such as cruise missiles

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

Kalman filter algorithm

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

LQR gain Kalman Filter

15

LQG = LQR+Kalman filter

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

LQG algorithm matlab (2)

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

You might also like