Kalman-Filter - uni-hamburg.de€¦ · Kalman-Filter - History Kalman-Filter History I Named after...

22
Universit¨ at Hamburg MIN-Fakult¨ at Fachbereich Informatik Kalman-Filter Kalman-Filter Peter W¨ uppen Universit¨ at Hamburg Fakult¨ at f¨ ur Mathematik, Informatik und Naturwissenschaften Fachbereich Informatik Technische Aspekte Multimodaler Systeme 16. November 2014 5wueppen 1

Transcript of Kalman-Filter - uni-hamburg.de€¦ · Kalman-Filter - History Kalman-Filter History I Named after...

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Kalman-Filter

    Kalman-Filter

    Peter Wüppen

    Universität HamburgFakultät für Mathematik, Informatik und NaturwissenschaftenFachbereich Informatik

    Technische Aspekte Multimodaler Systeme

    16. November 2014

    5wueppen 1

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Kalman-Filter

    Table of Contents

    1. Motivation

    2. Kalman-FilterHistoryGeneral principle

    3. Example applicationUnderlying system dynamicsInitializationResults

    4. Extended Kalman-Filter

    5. Conclusion

    5wueppen 2

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Motivation Kalman-Filter

    Dealing with inaccuracy

    I Sensor output in dynamic processes often comes with noise

    I Relying on the exact values often creates a fairly inaccuratedescription

    I Tools needed to appropriately deal with noise and extractuseful data from sensors

    5wueppen 3

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Motivation Kalman-Filter

    What is the Kalman-Filter?

    I Tool to control dynamic processes

    I Creates estimates of a system’s state based on previousestimates and sensor data

    I Wide range of applicationsI Tracking objectsI NavigationI EconomicsI Localization (Robotics)

    5wueppen 4

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Kalman-Filter - History Kalman-Filter

    History

    I Named after Rudolf Emil Kálmán, co-inventor

    I First described in 1958

    I Found one of its first applications in the Apollo program

    I Still commonly used for all kinds of navigational tasks

    5wueppen 5

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Kalman-Filter - General principle Kalman-Filter

    Requirements

    For the most effective usage of the Kalman-Filter the followingrequirements have to be satisfied:

    I Measurements of the system are available at a constant rate

    I The error of the measurements follow a gaussian 0-meandistribution

    I An accurate model of the process is available

    The basic Kalman Filter is limited to linear dependencies betweenstate variables for transitions and measurement.

    5wueppen 6

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Kalman-Filter - General principle Kalman-Filter

    General principle

    I Recursive AlgorithmI Two phases per observation

    I Time Update (Predict)I Create a priori estimate of system state based on prior estimation,

    control input and system dynamicsI Create a priori estimate of the error covariance matrix

    I Measurement Update (Correct)I Compute the Kalman gain, i.e. how strongly the new measurement

    is factored in for the final estimationI Create a posteriori estimate of system state based on a priori

    estimation, Kalman gain and measurementI Update the state error convariance matrix, i.e. the confidence in

    the new estimation

    5wueppen 7

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Kalman-Filter - General principle Kalman-Filter

    From [WB95]

    5wueppen 8

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Kalman-Filter - General principle Kalman-Filter

    Definition

    x̂− : A priori estimated statex̂ : A posteriori estimated stateA : State transition matrixB : Control matrixu : Control inputP− : State error covariance matrixQ : Process error covariance matrixK : Kalman gainH : Measurement matrixR : Measurement error covariance matrixz : Measurement values

    5wueppen 9

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Example application - Underlying system dynamics Kalman-Filter

    Example application

    I We observe the firing of a cannonball at a 45◦ angle

    I Four measurement values: Velocities and positions (x & y)

    I Measurements are subject to errors (gaussian white noise)

    I Goal: Precise estimation of the trajectory of the cannonball

    5wueppen 10

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Example application - Underlying system dynamics Kalman-Filter

    Underlying system dynamics

    We obviously know how the laws of physics will affect thecannonball during its flight:

    Definition

    xn = xn−1 + Vxn−1 ∗ ∆tVxn = Vxn−1yn = yn−1 + Vyn−1 − 12g∆t

    2

    Vyn = Vyn−1 − g∆t

    5wueppen 11

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Example application - Underlying system dynamics Kalman-Filter

    State transition matrix

    Based on these assumptions, we can model the transition matrixA, control Matrix B and control input vector u as follows:

    A =

    1 ∆t 0 00 1 0 00 0 1 ∆t0 0 0 1

    B =

    0 0 0 00 0 0 00 0 −12∆t

    2 00 0 0 −∆t

    ; u =

    00gg

    5wueppen 12

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Example application - Initialization Kalman-Filter

    Initilization

    We initialize the first state estimate with the starting configurationof the system:

    x̂0 =

    0

    100cos(π4 )500

    100sin(π4 )

    Note that the initial estimate for y is way off to demonstrate howfast the filter adjusts it.

    5wueppen 13

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Example application - Initialization Kalman-Filter

    Initilization

    The initial state and process error covariance matrices P and Q areset as:

    P =

    1 0 0 00 1 0 00 0 1 00 0 0 1

    ;Q =

    0 0 0 00 0 0 00 0 0 00 0 0 0

    5wueppen 14

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Example application - Initialization Kalman-Filter

    Initilization

    Since our measurement is in actual units, the measurement matrixH is the identity matrix. We assume a certain amount ofmeasurement noise by initializing R as follows:

    H =

    1 0 0 00 1 0 00 0 1 00 0 0 1

    ;R =

    0.2 0 0 00 0.2 0 00 0 0.2 00 0 0 0.2

    5wueppen 15

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Example application - Initialization Kalman-Filter

    Prediction

    A new state can now be predicted by

    x̂n = Ax̂n−1 + Bu

    and the estimated covariance matrix follows as

    P−n = APn−1AT + Q

    5wueppen 16

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Example application - Initialization Kalman-Filter

    Correction

    After calculating the optimal Kalman gain, the final estimates forthe state and covariance follow in the second phase:

    Kn = P−n H

    T (HP−n HT + R)−1

    x̂n = x̂−n + Kn(zn − Hx̂−n )

    Pn = (1 − KnH)P−k

    5wueppen 17

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Example application - Results Kalman-Filter

    Result

    From [cze]

    5wueppen 18

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Extended Kalman-Filter Kalman-Filter

    Extended Kalman-Filter

    I Problem with the regular Kalman-Filter: many system ormeasurement processes are not linear

    I The extended Kalman-Filter adresses this problem

    I State transition function instead of matrix

    I Not an optimal estimator like the linear version, but oftenreasonable performance

    I Standard for navigation systems and GPS

    5wueppen 19

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Conclusion Kalman-Filter

    Conclusion

    I The Kalman-Filter is a a powerful estimator for dynamicdiscrete-time systems with process and/or measurement noise

    I Provides optimal estimations in the linear case and often goodones in the non-linear case

    I Requires a very exact model of the system dynamics to workwell

    5wueppen 20

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Conclusion Kalman-Filter

    Thank you for your attention!

    5wueppen 21

  • Universität Hamburg

    MIN-FakultätFachbereich Informatik

    Conclusion Kalman-Filter

    Bibliography

    [cze] http://http://greg.czerniak.info/guides/kalman1/.Accessed: 2015-11-12.

    [GA93] Mohinder S. Grewal and Angus P. Andrews.Kalman Filtering: Theory and Practice.Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1993.

    [WB95] Greg Welch and Gary Bishop.An introduction to the kalman filter.Technical report, Chapel Hill, NC, USA, 1995.

    5wueppen 22

    http://http://greg.czerniak.info/guides/kalman1/http://http://greg.czerniak.info/guides/kalman1/

    MotivationKalman-FilterHistoryGeneral principle

    Example applicationUnderlying system dynamicsInitializationResults

    Extended Kalman-FilterConclusion