SlideShare une entreprise Scribd logo
1  sur  78
Kalman Filters basics Tim Mazumdar BR Karthikeyan
The immortal one Hungarian-born U.S. scientist and professor Rudolf Emil Kalman (born 1930) is widely  regarded as the creator of modern control theory and system theory. His research reshaped  the field of control engineering. His most widely known accomplishment is his development  of the Kalman filter, a mathematical method now widely used in of EE, ME and Communication.  He was born in  Budapest, Hungary, on May 19, 1930, the son of an electrical engineer.  He immigrated to the United States in 1943,  and studied  EE at MIT.  Kalman received his BSEE, MIT 1953  and his MSEE  in 1954,. He got his PhD(1957)  under John R. Ragazinni  at Columbia. The original paper on Kalman filtering was entitled “A  New Approach to Linear Filtering and Prediction Problems,” ASME—Transactions March 1960.
In Dedication to the man who taught K filtering Professor Uday B. Desai  –respected academic, Professor at IIT, Bombay Father of Orthogonal Filters, the Desai-Weinert Smoother, the Robust Recursive Least Squares algorithm and about 100 other major innovations B Tech , IIT B- 1969-1974 PhD Johns Hopkins University – 1979. Currently Director IIT, Hyderabad
Objective ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Objectives ,[object Object],[object Object],Apollo 11 Sextant
Definitions ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Principle of Orthogonality ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Elaboration of orthogonality  ,[object Object],In estimation the error is minimal is x- a1z is orthogonal to z. Perpendicular to the  observations – as shown in the diagram below.
Controllability and Observability ,[object Object],[object Object],[object Object]
Kailath’s original 1970 definition of innovations process ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive nature of the Kalman Filter ,[object Object],[object Object]
What made the Kalman filter so celebrated in Media Kalman’s original work was funded by Air Force Office of Scientific Research (AFOSR)  as it related to space vehicles. The AFOSR sponsored the research done at RIAS by  Kalman and Bucy. Kalman and Bucy's work revolutionized the field of estimation and  had an enormous impact on the design and development of precise navigation systems.  The Kalman filter was a major breakthrough in guidance technology. In fact the original  paper is the 25 th  most quoted Paper in all of EE. It was the basis of the Apollo Guidance  system and it enabled the first moon landing. It was the core of a memo written by  Donald Fraser in 1965 for Apollo Guidance systems “ Recursive filtering applied to system identification” and used by James Potter . It is  debatable whether the moon landings were possible  without the Kalman Filter. Stanley F. Schmidt had a key role in the proselytizing  NASA  on the K filter. Smith convinced his colleagues to study and use the K filter for the Apollo missions.  He also wrote the first code. The Kalman filter solved two problems that  NASA wanted to solve . DATA FUSION PROBLEM – where RADAR data is combined With inertial navigation sensor data.  DATA REJECTION PROBLEM – data outliers Need to be rejected for the spacecraft to continue in its proper trajectory.
STRUCTURE OF THE GOVERNING KALMAN FILTER EQUATIONS STATE EQUATION STATE NOISE MEASUREMENT  EQUATION MEASUREMENT NOISE
KALMAN FILTER IN TERMS OF PROBABILITY, STATISTICS, AND RANDOM PROCESS UP ARROW: TIME INDEPENDENT;  DOWN ARROW: TIME DEPENDENT; RIGHT ARROW: DIRECT PROBLEM;  LEFT ARROW: INVERSE PROBLEM. STATISTICS PROBABILITY SEQUENTIAL STATISTICAL ANALYSIS OF RANDOM PROCESS IS THE KALMAN FILTER RANDOM PROCESS
THE WAY KALMAN FILTER WORKS THE KALMAN FILTER DOES MANY THINGS AND CAN BE INTERPRETED IN MANY WAYS AS SHOWN IN THE NEXT SET OF SLIDES  STATE EQUATION (IMPROVED  QUAL + QUAN) STATE NOISE (EFFECT IS SUPRESSED) MEASUREMENT  EQUATION (IMPROVED  QUAL + QUAN) MEASUREMENT NOISE
MANY THINGS WHICH KALMAN FILTER DOES-1 (FROM AIAA-2000-4319) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MANY THINGS WHICH KALMAN FILTER DOES-2 (FROM AIAA-2000-4319) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DEFINITION OF KALMAN FILTER ,[object Object],[object Object]
Mathematics of  the Kalman filter- Bishop’s approach
Bishop and Welch - Kalman The state variable model for the Kalman filter. Insert equations 9 through 13 here : The first task during the measurement update is to compute the Kalman gain,  The next step is to actually measure the process to obtain , and then to generate an  a posteriori  state estimate by incorporating the measurement as in (12).  The final step is to obtain an  a posteriori  error covariance estimate via (1.13). The difference between the Kalman and Weiner filters is that the Kalman filter is recursive And at each time step the Kalman gain is computed.
Complete update of Kalman filter Each step require solving 5 equations. Nevertheless in modern day processors  It is possible to solve the K filter equations either in SW as embedded code or in HW.  There have been K filters designed for Systolic array based computation one of which we  Will review in this session. Sorenson 1971- the quantity zk –Hxk is known in Kalman filtering as “residual”.
One way of looking at a single cycle of computation ,[object Object],[object Object],[object Object]
Some Process related definitions ,[object Object],[object Object],[object Object]
3 types of Estimation ,[object Object],[object Object],[object Object],[object Object]
Setting up the plant >> A = [ 1.1269 -0.4940 0.1129; 1 0 0 ; 0 1 0 ]; >> A A = 1.1269  -0.4940  0.1129 1.0000  0  0 0  1.0000  0 >> B = [ -0.3832; 0.5919; 0.5191]; >> C = [ 1 0 0]; >> Bp = B'; >> Bp Bp = -0.3832  0.5919  0.5191 >>  Plant = ss(A,[B B],C,0,-1,'inputname',{'u' 'w'}, 'outputname‘’,'y1‘,’y2’}); Q = 1; R = 1; [kalmf,L,P,K] = kalman(Plant,Q,R); >> K K = 0.3798 0.0817 -0.2570 K is really the Kalman gain
One we find the Kalman gain The inputs  are process noise and output observations the outputs are state estimates x(n) and the estimate of the next observation.   kalmf u yv ye Xhat(n) Compute the first output of the  kalmf  function kalmf = kalmf(1,:); Kalmf
Kalman filter outputs a =  x1_e  x2_e  x3_e x1_e  0.7683  -0.494  0.1129 x2_e  0.6202  0  0 x3_e  -0.081732  1  0 b =  u  y x1_e  -0.3832  0.3586 x2_e  0.5919  0.3798 x3_e  0.5191  0.08173 c =  x1_e  x2_e  x3_e y_e  0.6202  0  0 d =  u  y y_e  0  0.3798
Beginnings- Discrete time State variable model
Discrete Kalman filter Time update equations
Discrete Kalman filter Time update equations
When does Kalman gain converge quickly? The Kalman gain converges quickly when both the process noise  covariance and error noise covariance are constant. (Q and R are  Constant) One approach is to run the n filter off-line to estimate the degree of  perturbation due to Q and R and arrive at an estimate of the Kalman gain . This is known as Grewal’s method(1993) When does the word recursive imply? Recursive implies  does not imply all previous  observations are stored and required to be processed  every time a new data sample is received.  This non requirement of storage  Implies that the K filter  requires computation than a Weiner filter
What are the 3 underlying assumptions of  the K filter ,[object Object],[object Object],[object Object],[object Object]
Whiteness
Continued 3.  the assumption of Gaussian nature of noise  - When a number of non-Gaussian RVs are added the result tends to Gaussian in the limit when the number of RVs tends to infinity. This is known as the strong form of the Central Limit theorem.  While “whiteness” of measurement noise and process noise has to do with the PSD of noise , Gaussian nature implies the PDF  of noise assumes a bell shaped curve for the range of amplitudes.  Gaussian nature is independent of whiteness in fact it imposes and additional constraint on the noise. . Gaussian nature makes the mathematics more tractable as Gaussian PDF implies the first and second order conditional densities completely determine the observation and process noise.
What is the Riccati equation  ,[object Object],[object Object],[object Object]
The Discrete Algebraic Riccati equation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Development  of the Kalman Filter equations ,[object Object],Next we need to define the Q and R matrices which are co variances of  the process Noise and the measurement noise.
Expressions for Process noise and Measurement noise Process noise  is the  noise term added to the state estimation equation and  Measurement noise is the noise term added to the output equation. Where the Hermitian conjugate of the noise vector really boils down to a simple  Transpose. ,[object Object],[object Object],[object Object]
The all important P matrix or error covariance matrix For each n , xhat(n-1|n-1) and P(n-1|n-1) are available. When a new  observation y(n) occurs the new estimate for the state vector must be  Computed and also the error covariance matrix P(n|n-1) is “propagated” To P(n|n). The evolution of the state vector follows the state variable model
Equations related a-priori and a-posteriori error
Step 2 : Incorporation of new measurement
Expression for updated estimate The next big conceptual jump the uncorrelated nature of the process noise And the measurement noise. E(v(n)w(n))= 0 ;E(v(n)x(n))= AE(v(n)E(x(n))+E(v(n)w(n))=0 This implies v(n) and x(n) are uncorrelated.
Error covariance matrix propagation Now we take the derivative of the error covariance matrix wrt. Kalman Gain
Final Expression for optimal gain
Closure: Plugging the optimal gain into error covariance For the final expression we plug the optimal Kalman gain value Into the error propagation covariance equation
Time and measurement updates for the continuous time Kalman filter The continuous time model of a linear stochastic system can be expressed as  Follows.
Matlab Examples
This example directly applies K equations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
This example directly applies K equations ,[object Object],[object Object],[object Object]
This example directly applies K equations ,[object Object],[object Object]
Curves for 1-D Kalman Filter
Another simple K filter for position
Kalman demo 1  duration=5;  dt=0.2; [pos,posmeas,poshat]= kalman_demo1(duration,dt); Kalman_demo1 function is available from the instructor
A 4x4 Kalman filter example This example includes a 4x4 estimator for a movement of a point in 2 –dimensional Plane starting from (10,10) . Consider a particle moving in the plane at constant velocity subject  to random perturbations in its trajectory. The new position (x1, x2) is the old position plus the  velocity (dx1, dx2) plus noise w.  [ x1(t) ] = [1 0 1 0] [ x1(t-1) ] + [ wx1 ] [ x2(t) ] [0 1 0 1] [ x2(t-1) ] +[ wx2 ] [ dx1(t) ] [0 0 1 0] [ dx1(t-1) ] +[ wdx1 ] [ dx2(t) ] [0 0 0 1] [ dx2(t-1) ]+ [ wdx2 ]  We assume we only observe the position of the particle.  [ y1(t) ] = [1 0 0 0] [ x1(t) ] + [ vx1 ] [ y2(t) ] [0 1 0 0] [ x2(t) ]+ [ vx2 ]  [ dx1(t) ]  [ dx2(t) ] Plant = ss(A,[B B],C,0,-1,'inputname',{'u' 'w'}, 'outputname‘’,'y1‘,’y2’}); [x,y] = sample_lds(F, H, Q, R, initx, T); [xfilt, Vfilt, VVfilt, loglik] = kalman_filter(y, F, H, Q, R, initx, initV);
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Kalman Filter “Covariance” Demo2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
“ Simon” the 3 rd  Kalman example ,[object Object],[object Object],[object Object],[object Object],[object Object]
Building the F, H, G matrices T =.0.1sec; F= H = [ 1  0];  A = [ 1 0.1; 0 1]; B = [ 0.005; 0.1]; C = [ 1 0]; Xinit = [0;0];x = Xinit; xhat= Xinit; % Initital state estimate R = measnoise^2; % R matrix Sw = accelnoise^2*[ 1 0 ; 0 1]; % Q matrix P = Sw; % Defintion Position vector and Poistion estimated vectors pos = []; poshat = []; posmeas= []; vel = []; velhat = []; duration = 10;
Kalman Position Tracker ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Tracking error at two values of process noise This example is run for two different values of Process noise . The difference between The two estimates is telling. The second estimate of the position is much closer to the  noisy measurement.
What are the key issues in implementation Verhaegen and Van Dooren proved in a legendary paper that the effectiveness of the  K filter is dependent on the numerical accuracy with which the error covariance  Matrix Or the P(n|n-1) matrix is represented. Loss of symmetry of the error Covariance matrix leads to seriosu issues with the implementation of the K. Filter.  Numerical stability is exacerbated by due to the fact that the Riccatti  Equation solution can get into trouble due to roundoff errors and the eignevalues  Of the error covariance matrix can lead to a blowout of its condition number that is The ratio of the largest and smallest eignevalues. There many approaches to making the K filter more stable. No suprisingly one  Approach – the Potter-Stern approach where P is not propagated but its Cholesky Transpose. P = CC’  Where C is propagated. Other approaches that have been tried is the QR decomposition and Bierman and  Kailaths approaches. The most well known approach is called  Square – root filters Which are reformulated K filters with better numerical stability
Equations to explain stability
A second way to write the propagated K filter error ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Comparison of continuous time  and discrete time Kalman filter equations
How do we relate the A.. F matrices? The best way is to use first order approximations to arrive at the difference from the  Differential equations. The steps are not shown here but the final expressions are ,
Computational complexity of the  Kalman filter ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exactly what was Kalman’s contribution ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DKF and EKF ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3 dimensional position tracking -an example
Full Form of A Matrix
How the matrix elements are derived
How the matrix elements are derived- Y axis This gives the second row of the A Matrix
Row 4 of the A matrix
Kalman filter for a second order system
Restructuring the DKF equations for HW implementation Reduces number of matrix multiplications by a quarter
THANKS
On Linear prediction for  communications Mazumdar and Kadambi
 

Contenu connexe

Tendances

Kalman filter - Applications in Image processing
Kalman filter - Applications in Image processingKalman filter - Applications in Image processing
Kalman filter - Applications in Image processing
Ravi Teja
 
Report kalman filtering
Report kalman filteringReport kalman filtering
Report kalman filtering
Irfan Anjum
 
Application of the Kalman Filter
Application of the Kalman FilterApplication of the Kalman Filter
Application of the Kalman Filter
Rohullah Latif
 
Multisensor data fusion in object tracking applications
Multisensor data fusion in object tracking applicationsMultisensor data fusion in object tracking applications
Multisensor data fusion in object tracking applications
Sayed Abulhasan Quadri
 

Tendances (20)

Kalman filter
Kalman filterKalman filter
Kalman filter
 
Kalman filters
Kalman filtersKalman filters
Kalman filters
 
The extended kalman filter
The extended kalman filterThe extended kalman filter
The extended kalman filter
 
Kalman Filter
 Kalman Filter    Kalman Filter
Kalman Filter
 
Kalman filter - Applications in Image processing
Kalman filter - Applications in Image processingKalman filter - Applications in Image processing
Kalman filter - Applications in Image processing
 
Kalman Filter Presentation
Kalman Filter PresentationKalman Filter Presentation
Kalman Filter Presentation
 
Av 738 - Adaptive Filtering - Kalman Filters
Av 738 - Adaptive Filtering - Kalman Filters Av 738 - Adaptive Filtering - Kalman Filters
Av 738 - Adaptive Filtering - Kalman Filters
 
Report kalman filtering
Report kalman filteringReport kalman filtering
Report kalman filtering
 
Application of adaptive linear equalizer
Application of adaptive linear equalizerApplication of adaptive linear equalizer
Application of adaptive linear equalizer
 
Kalman Filter | Statistics
Kalman Filter | StatisticsKalman Filter | Statistics
Kalman Filter | Statistics
 
Kalman filter for Beginners
Kalman filter for BeginnersKalman filter for Beginners
Kalman filter for Beginners
 
Kalman Filter and its Application
Kalman Filter and its ApplicationKalman Filter and its Application
Kalman Filter and its Application
 
kalman filtering "From Basics to unscented Kaman filter"
 kalman filtering "From Basics to unscented Kaman filter" kalman filtering "From Basics to unscented Kaman filter"
kalman filtering "From Basics to unscented Kaman filter"
 
Application of the Kalman Filter
Application of the Kalman FilterApplication of the Kalman Filter
Application of the Kalman Filter
 
Sensor Fusion Study - Ch13. Nonlinear Kalman Filtering [Ahn Min Sung]
Sensor Fusion Study - Ch13. Nonlinear Kalman Filtering [Ahn Min Sung]Sensor Fusion Study - Ch13. Nonlinear Kalman Filtering [Ahn Min Sung]
Sensor Fusion Study - Ch13. Nonlinear Kalman Filtering [Ahn Min Sung]
 
Kalman filter demonstration
Kalman filter demonstrationKalman filter demonstration
Kalman filter demonstration
 
Kalman filtering and it's applications
Kalman filtering and it's applicationsKalman filtering and it's applications
Kalman filtering and it's applications
 
Fun and Easy Kalman filter Tutorial - Using Pokemon Example
Fun and Easy Kalman filter Tutorial - Using Pokemon ExampleFun and Easy Kalman filter Tutorial - Using Pokemon Example
Fun and Easy Kalman filter Tutorial - Using Pokemon Example
 
Multisensor data fusion in object tracking applications
Multisensor data fusion in object tracking applicationsMultisensor data fusion in object tracking applications
Multisensor data fusion in object tracking applications
 
Lecture Notes on Adaptive Signal Processing-1.pdf
Lecture Notes on Adaptive Signal Processing-1.pdfLecture Notes on Adaptive Signal Processing-1.pdf
Lecture Notes on Adaptive Signal Processing-1.pdf
 

En vedette

Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
anusheel nahar
 
Kalman filter upload
Kalman filter uploadKalman filter upload
Kalman filter upload
Tushar Tank
 
Microchip technology kit2 tutorial
Microchip technology kit2 tutorialMicrochip technology kit2 tutorial
Microchip technology kit2 tutorial
Mauro Cunha
 
ppt on embedded system
ppt on embedded systemppt on embedded system
ppt on embedded system
manish katara
 

En vedette (12)

Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
 
Kalman Filter Based GPS Receiver
Kalman Filter Based GPS ReceiverKalman Filter Based GPS Receiver
Kalman Filter Based GPS Receiver
 
Kalman filter upload
Kalman filter uploadKalman filter upload
Kalman filter upload
 
Microchip technology kit2 tutorial
Microchip technology kit2 tutorialMicrochip technology kit2 tutorial
Microchip technology kit2 tutorial
 
Microchip
MicrochipMicrochip
Microchip
 
Design the implementation of 1D Kalman Filter Encoder and Accelerometer.
Design the implementation of 1D Kalman Filter Encoder and Accelerometer.Design the implementation of 1D Kalman Filter Encoder and Accelerometer.
Design the implementation of 1D Kalman Filter Encoder and Accelerometer.
 
Embedded C
Embedded CEmbedded C
Embedded C
 
A1/1 An Introductory Lesson to German (for speakers of English)
A1/1 An Introductory Lesson to German (for speakers of English)A1/1 An Introductory Lesson to German (for speakers of English)
A1/1 An Introductory Lesson to German (for speakers of English)
 
Power Electronics
Power ElectronicsPower Electronics
Power Electronics
 
ppt on embedded system
ppt on embedded systemppt on embedded system
ppt on embedded system
 
Kalman filter implimention in mathlab
Kalman filter  implimention in mathlabKalman filter  implimention in mathlab
Kalman filter implimention in mathlab
 
Embedded System Basics
Embedded System BasicsEmbedded System Basics
Embedded System Basics
 

Similaire à Kalman Equations

Please solve all part in details Briefly answer the following questi.pdf
Please solve all part in details Briefly answer the following questi.pdfPlease solve all part in details Briefly answer the following questi.pdf
Please solve all part in details Briefly answer the following questi.pdf
AroraRajinder1
 
Maneuverable Target Tracking using Linear Kalman Filter
Maneuverable Target Tracking  using Linear Kalman FilterManeuverable Target Tracking  using Linear Kalman Filter
Maneuverable Target Tracking using Linear Kalman Filter
Annwesh Barik
 
07 image filtering of colored noise based on kalman filter
07 image filtering of colored noise based on kalman filter07 image filtering of colored noise based on kalman filter
07 image filtering of colored noise based on kalman filter
studymate
 
IFAC2008art
IFAC2008artIFAC2008art
IFAC2008art
Yuri Kim
 

Similaire à Kalman Equations (20)

2 estimators
2 estimators2 estimators
2 estimators
 
presentation.ppt
presentation.pptpresentation.ppt
presentation.ppt
 
Please solve all part in details Briefly answer the following questi.pdf
Please solve all part in details Briefly answer the following questi.pdfPlease solve all part in details Briefly answer the following questi.pdf
Please solve all part in details Briefly answer the following questi.pdf
 
Kleinbauer
KleinbauerKleinbauer
Kleinbauer
 
Av 738-Adaptive Filters - Extended Kalman Filter
Av 738-Adaptive Filters - Extended Kalman FilterAv 738-Adaptive Filters - Extended Kalman Filter
Av 738-Adaptive Filters - Extended Kalman Filter
 
Maneuverable Target Tracking using Linear Kalman Filter
Maneuverable Target Tracking  using Linear Kalman FilterManeuverable Target Tracking  using Linear Kalman Filter
Maneuverable Target Tracking using Linear Kalman Filter
 
Understanding kalman filter for soc estimation.
Understanding kalman filter for soc estimation.Understanding kalman filter for soc estimation.
Understanding kalman filter for soc estimation.
 
Refining Underwater Target Localization and Tracking Estimates
Refining Underwater Target Localization and Tracking EstimatesRefining Underwater Target Localization and Tracking Estimates
Refining Underwater Target Localization and Tracking Estimates
 
P01061112116
P01061112116P01061112116
P01061112116
 
Relative Study of Measurement Noise Covariance R and Process Noise Covariance...
Relative Study of Measurement Noise Covariance R and Process Noise Covariance...Relative Study of Measurement Noise Covariance R and Process Noise Covariance...
Relative Study of Measurement Noise Covariance R and Process Noise Covariance...
 
Kalman filter.pdf
Kalman filter.pdfKalman filter.pdf
Kalman filter.pdf
 
Power system static state estimation using Kalman filter algorithm
Power system static state estimation using Kalman filter algorithmPower system static state estimation using Kalman filter algorithm
Power system static state estimation using Kalman filter algorithm
 
07 image filtering of colored noise based on kalman filter
07 image filtering of colored noise based on kalman filter07 image filtering of colored noise based on kalman filter
07 image filtering of colored noise based on kalman filter
 
B04402016018
B04402016018B04402016018
B04402016018
 
IFAC2008art
IFAC2008artIFAC2008art
IFAC2008art
 
Vandrongelen2018 2 kalmanfiler
Vandrongelen2018 2 kalmanfilerVandrongelen2018 2 kalmanfiler
Vandrongelen2018 2 kalmanfiler
 
A NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTER
A NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTERA NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTER
A NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTER
 
A NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTER
A NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTERA NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTER
A NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTER
 
A research on significance of kalman filter approach as applied in electrical...
A research on significance of kalman filter approach as applied in electrical...A research on significance of kalman filter approach as applied in electrical...
A research on significance of kalman filter approach as applied in electrical...
 
A NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTER
A NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTERA NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTER
A NEW METHOD OF SMALL-SIGNAL CALIBRATION BASED ON KALMAN FILTER
 

Kalman Equations

  • 1. Kalman Filters basics Tim Mazumdar BR Karthikeyan
  • 2. The immortal one Hungarian-born U.S. scientist and professor Rudolf Emil Kalman (born 1930) is widely regarded as the creator of modern control theory and system theory. His research reshaped the field of control engineering. His most widely known accomplishment is his development of the Kalman filter, a mathematical method now widely used in of EE, ME and Communication. He was born in Budapest, Hungary, on May 19, 1930, the son of an electrical engineer. He immigrated to the United States in 1943, and studied EE at MIT. Kalman received his BSEE, MIT 1953 and his MSEE in 1954,. He got his PhD(1957) under John R. Ragazinni at Columbia. The original paper on Kalman filtering was entitled “A New Approach to Linear Filtering and Prediction Problems,” ASME—Transactions March 1960.
  • 3. In Dedication to the man who taught K filtering Professor Uday B. Desai –respected academic, Professor at IIT, Bombay Father of Orthogonal Filters, the Desai-Weinert Smoother, the Robust Recursive Least Squares algorithm and about 100 other major innovations B Tech , IIT B- 1969-1974 PhD Johns Hopkins University – 1979. Currently Director IIT, Hyderabad
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. What made the Kalman filter so celebrated in Media Kalman’s original work was funded by Air Force Office of Scientific Research (AFOSR) as it related to space vehicles. The AFOSR sponsored the research done at RIAS by Kalman and Bucy. Kalman and Bucy's work revolutionized the field of estimation and had an enormous impact on the design and development of precise navigation systems. The Kalman filter was a major breakthrough in guidance technology. In fact the original paper is the 25 th most quoted Paper in all of EE. It was the basis of the Apollo Guidance system and it enabled the first moon landing. It was the core of a memo written by Donald Fraser in 1965 for Apollo Guidance systems “ Recursive filtering applied to system identification” and used by James Potter . It is debatable whether the moon landings were possible without the Kalman Filter. Stanley F. Schmidt had a key role in the proselytizing NASA on the K filter. Smith convinced his colleagues to study and use the K filter for the Apollo missions. He also wrote the first code. The Kalman filter solved two problems that NASA wanted to solve . DATA FUSION PROBLEM – where RADAR data is combined With inertial navigation sensor data. DATA REJECTION PROBLEM – data outliers Need to be rejected for the spacecraft to continue in its proper trajectory.
  • 13. STRUCTURE OF THE GOVERNING KALMAN FILTER EQUATIONS STATE EQUATION STATE NOISE MEASUREMENT EQUATION MEASUREMENT NOISE
  • 14. KALMAN FILTER IN TERMS OF PROBABILITY, STATISTICS, AND RANDOM PROCESS UP ARROW: TIME INDEPENDENT; DOWN ARROW: TIME DEPENDENT; RIGHT ARROW: DIRECT PROBLEM; LEFT ARROW: INVERSE PROBLEM. STATISTICS PROBABILITY SEQUENTIAL STATISTICAL ANALYSIS OF RANDOM PROCESS IS THE KALMAN FILTER RANDOM PROCESS
  • 15. THE WAY KALMAN FILTER WORKS THE KALMAN FILTER DOES MANY THINGS AND CAN BE INTERPRETED IN MANY WAYS AS SHOWN IN THE NEXT SET OF SLIDES STATE EQUATION (IMPROVED QUAL + QUAN) STATE NOISE (EFFECT IS SUPRESSED) MEASUREMENT EQUATION (IMPROVED QUAL + QUAN) MEASUREMENT NOISE
  • 16.
  • 17.
  • 18.
  • 19. Mathematics of the Kalman filter- Bishop’s approach
  • 20. Bishop and Welch - Kalman The state variable model for the Kalman filter. Insert equations 9 through 13 here : The first task during the measurement update is to compute the Kalman gain, The next step is to actually measure the process to obtain , and then to generate an a posteriori state estimate by incorporating the measurement as in (12). The final step is to obtain an a posteriori error covariance estimate via (1.13). The difference between the Kalman and Weiner filters is that the Kalman filter is recursive And at each time step the Kalman gain is computed.
  • 21. Complete update of Kalman filter Each step require solving 5 equations. Nevertheless in modern day processors It is possible to solve the K filter equations either in SW as embedded code or in HW. There have been K filters designed for Systolic array based computation one of which we Will review in this session. Sorenson 1971- the quantity zk –Hxk is known in Kalman filtering as “residual”.
  • 22.
  • 23.
  • 24.
  • 25. Setting up the plant >> A = [ 1.1269 -0.4940 0.1129; 1 0 0 ; 0 1 0 ]; >> A A = 1.1269 -0.4940 0.1129 1.0000 0 0 0 1.0000 0 >> B = [ -0.3832; 0.5919; 0.5191]; >> C = [ 1 0 0]; >> Bp = B'; >> Bp Bp = -0.3832 0.5919 0.5191 >> Plant = ss(A,[B B],C,0,-1,'inputname',{'u' 'w'}, 'outputname‘’,'y1‘,’y2’}); Q = 1; R = 1; [kalmf,L,P,K] = kalman(Plant,Q,R); >> K K = 0.3798 0.0817 -0.2570 K is really the Kalman gain
  • 26. One we find the Kalman gain The inputs are process noise and output observations the outputs are state estimates x(n) and the estimate of the next observation. kalmf u yv ye Xhat(n) Compute the first output of the kalmf function kalmf = kalmf(1,:); Kalmf
  • 27. Kalman filter outputs a = x1_e x2_e x3_e x1_e 0.7683 -0.494 0.1129 x2_e 0.6202 0 0 x3_e -0.081732 1 0 b = u y x1_e -0.3832 0.3586 x2_e 0.5919 0.3798 x3_e 0.5191 0.08173 c = x1_e x2_e x3_e y_e 0.6202 0 0 d = u y y_e 0 0.3798
  • 28. Beginnings- Discrete time State variable model
  • 29. Discrete Kalman filter Time update equations
  • 30. Discrete Kalman filter Time update equations
  • 31. When does Kalman gain converge quickly? The Kalman gain converges quickly when both the process noise covariance and error noise covariance are constant. (Q and R are Constant) One approach is to run the n filter off-line to estimate the degree of perturbation due to Q and R and arrive at an estimate of the Kalman gain . This is known as Grewal’s method(1993) When does the word recursive imply? Recursive implies does not imply all previous observations are stored and required to be processed every time a new data sample is received. This non requirement of storage Implies that the K filter requires computation than a Weiner filter
  • 32.
  • 34. Continued 3. the assumption of Gaussian nature of noise - When a number of non-Gaussian RVs are added the result tends to Gaussian in the limit when the number of RVs tends to infinity. This is known as the strong form of the Central Limit theorem. While “whiteness” of measurement noise and process noise has to do with the PSD of noise , Gaussian nature implies the PDF of noise assumes a bell shaped curve for the range of amplitudes. Gaussian nature is independent of whiteness in fact it imposes and additional constraint on the noise. . Gaussian nature makes the mathematics more tractable as Gaussian PDF implies the first and second order conditional densities completely determine the observation and process noise.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39. The all important P matrix or error covariance matrix For each n , xhat(n-1|n-1) and P(n-1|n-1) are available. When a new observation y(n) occurs the new estimate for the state vector must be Computed and also the error covariance matrix P(n|n-1) is “propagated” To P(n|n). The evolution of the state vector follows the state variable model
  • 40. Equations related a-priori and a-posteriori error
  • 41. Step 2 : Incorporation of new measurement
  • 42. Expression for updated estimate The next big conceptual jump the uncorrelated nature of the process noise And the measurement noise. E(v(n)w(n))= 0 ;E(v(n)x(n))= AE(v(n)E(x(n))+E(v(n)w(n))=0 This implies v(n) and x(n) are uncorrelated.
  • 43. Error covariance matrix propagation Now we take the derivative of the error covariance matrix wrt. Kalman Gain
  • 44. Final Expression for optimal gain
  • 45. Closure: Plugging the optimal gain into error covariance For the final expression we plug the optimal Kalman gain value Into the error propagation covariance equation
  • 46. Time and measurement updates for the continuous time Kalman filter The continuous time model of a linear stochastic system can be expressed as Follows.
  • 48.
  • 49.
  • 50.
  • 51. Curves for 1-D Kalman Filter
  • 52. Another simple K filter for position
  • 53. Kalman demo 1 duration=5; dt=0.2; [pos,posmeas,poshat]= kalman_demo1(duration,dt); Kalman_demo1 function is available from the instructor
  • 54. A 4x4 Kalman filter example This example includes a 4x4 estimator for a movement of a point in 2 –dimensional Plane starting from (10,10) . Consider a particle moving in the plane at constant velocity subject to random perturbations in its trajectory. The new position (x1, x2) is the old position plus the velocity (dx1, dx2) plus noise w. [ x1(t) ] = [1 0 1 0] [ x1(t-1) ] + [ wx1 ] [ x2(t) ] [0 1 0 1] [ x2(t-1) ] +[ wx2 ] [ dx1(t) ] [0 0 1 0] [ dx1(t-1) ] +[ wdx1 ] [ dx2(t) ] [0 0 0 1] [ dx2(t-1) ]+ [ wdx2 ] We assume we only observe the position of the particle. [ y1(t) ] = [1 0 0 0] [ x1(t) ] + [ vx1 ] [ y2(t) ] [0 1 0 0] [ x2(t) ]+ [ vx2 ] [ dx1(t) ] [ dx2(t) ] Plant = ss(A,[B B],C,0,-1,'inputname',{'u' 'w'}, 'outputname‘’,'y1‘,’y2’}); [x,y] = sample_lds(F, H, Q, R, initx, T); [xfilt, Vfilt, VVfilt, loglik] = kalman_filter(y, F, H, Q, R, initx, initV);
  • 55.
  • 56.
  • 57.
  • 58. Building the F, H, G matrices T =.0.1sec; F= H = [ 1 0]; A = [ 1 0.1; 0 1]; B = [ 0.005; 0.1]; C = [ 1 0]; Xinit = [0;0];x = Xinit; xhat= Xinit; % Initital state estimate R = measnoise^2; % R matrix Sw = accelnoise^2*[ 1 0 ; 0 1]; % Q matrix P = Sw; % Defintion Position vector and Poistion estimated vectors pos = []; poshat = []; posmeas= []; vel = []; velhat = []; duration = 10;
  • 59.
  • 60. Tracking error at two values of process noise This example is run for two different values of Process noise . The difference between The two estimates is telling. The second estimate of the position is much closer to the noisy measurement.
  • 61. What are the key issues in implementation Verhaegen and Van Dooren proved in a legendary paper that the effectiveness of the K filter is dependent on the numerical accuracy with which the error covariance Matrix Or the P(n|n-1) matrix is represented. Loss of symmetry of the error Covariance matrix leads to seriosu issues with the implementation of the K. Filter. Numerical stability is exacerbated by due to the fact that the Riccatti Equation solution can get into trouble due to roundoff errors and the eignevalues Of the error covariance matrix can lead to a blowout of its condition number that is The ratio of the largest and smallest eignevalues. There many approaches to making the K filter more stable. No suprisingly one Approach – the Potter-Stern approach where P is not propagated but its Cholesky Transpose. P = CC’ Where C is propagated. Other approaches that have been tried is the QR decomposition and Bierman and Kailaths approaches. The most well known approach is called Square – root filters Which are reformulated K filters with better numerical stability
  • 62. Equations to explain stability
  • 63.
  • 64. Comparison of continuous time and discrete time Kalman filter equations
  • 65. How do we relate the A.. F matrices? The best way is to use first order approximations to arrive at the difference from the Differential equations. The steps are not shown here but the final expressions are ,
  • 66.
  • 67.
  • 68.
  • 69. 3 dimensional position tracking -an example
  • 70. Full Form of A Matrix
  • 71. How the matrix elements are derived
  • 72. How the matrix elements are derived- Y axis This gives the second row of the A Matrix
  • 73. Row 4 of the A matrix
  • 74. Kalman filter for a second order system
  • 75. Restructuring the DKF equations for HW implementation Reduces number of matrix multiplications by a quarter
  • 77. On Linear prediction for communications Mazumdar and Kadambi
  • 78.  

Notes de l'éditeur

  1. After Graham 1995