Kalman Filters Maqsood BIG PICTURE: CPS Unknown execution times - - PowerPoint PPT Presentation

kalman filters
SMART_READER_LITE
LIVE PREVIEW

Kalman Filters Maqsood BIG PICTURE: CPS Unknown execution times - - PowerPoint PPT Presentation

Kalman Filters Maqsood BIG PICTURE: CPS Unknown execution times Packet losses Unknown delays Uncontrollable scheduling SENSORS ACTUATORS Sensor Noise MODEL Physical noise Imperfect actuation Parts failures Model Uncertainties


slide-1
SLIDE 1

Kalman Filters

Maqsood

slide-2
SLIDE 2

BIG PICTURE: CPS

SENSORS ACTUATORS “Essentially, all models are wrong, but some are useful.” “Everything is an approximation” “A CPS system is only as good as the Sensors”

Parts failures Imperfect actuation Unknown delays Packet losses Uncontrollable scheduling Physical noise Unknown execution times Sensor Noise

MODEL

Model Uncertainties

slide-3
SLIDE 3

Background Knowledge

  • Measurement is a random variable, described by the Probability Density Function (PDF).
  • Measurements mean is the Expected Value of the random variable.
  • Offset between the measurements mean and the true value is the measurements accuracy (or

bias or measurement error).

  • The dispersion of the distribution is known as precision or (measurement noise or measurement

uncertainty).

Mean Variance Measurements- Gaussian Gaussian PDF

slide-4
SLIDE 4

Accuracy & Precision

slide-5
SLIDE 5

Kalman Filters

What is a Kalman Filter:

  • A Kalman filter is an optimal estimator – i.e. infers parameters of interest

from indirect, inaccurate and uncertain observations. It is recursive so that new measurements can be processed as they arrive.

Optimal in what sense:

  • If Noise is Gaussian: the Kalman filter minimizes the mean square error of the

estimated parameters.

  • If Noise is NOT Gaussian: Kalman filter is still the best linear estimator. Non-

linear estimators may be better.

  • Gauss-Markov Theorem – Optimal among all Linear, Unbiased Estimators
  • Rao–Blackwell theorem – Optimal among Non-linear Estimators with Gaussian Noise
slide-6
SLIDE 6

Kalman Filters…

An Estimator: Optimal under Linear or Gaussian and is On-Line. Why is Kalman Filtering so popular:

  • Good results in practice due to optimality and structure.
  • Convenient form for online real time processing.
  • Easy to formulate and implement given a basic understanding.
  • Measurement equations need not be inverted.

Why use the word “Filter”

  • The process of finding the “best estimate” from noisy data amounts to

“filtering out” the noise.

  • Kalman filter doesn’t just clean up the data measurements, but also projects

them onto the state estimate.

slide-7
SLIDE 7

Kalman Filter: Smoothing, Filtering, Prediction

  • Additional Reading and Acknowledgements:
  • https://www.kalmanfilter.net/
  • https://www.mathworks.com/videos/series/understanding-kalman-filters.html
  • http://web.mit.edu/kirtley/kirtley/binlustuff/literature/control/Kalman%20filter.pdf
  • Real-time optimal estimation is desired when new data Arrives
  • Smoothing (Take advantage of noise reduction)
  • Filtering
  • Prediction (extrapolate based on model)
  • Applications: controllers, tracking, etc.
slide-8
SLIDE 8

Kalman Filter: Mechanism

  • Required: 1. System Model and 2. Observations.
  • Model may be uncertain, Measurements may be Noisy
  • Prediction-correction framework: Optimal combination of system

model and observations

slide-9
SLIDE 9
slide-10
SLIDE 10

Intuition: State Observer: Estimating state of a Rocket

https://www.mathworks.com/videos/series/understanding-kalman-filters.html

slide-11
SLIDE 11

Kalman Filter Stochastic Processes

𝑨𝑙 = 𝐼𝑦𝑙 + 𝑤 Ƹ 𝑨𝑙 = 𝐼 ො 𝑦𝑙

slide-12
SLIDE 12

𝑨𝑙 = 𝐼𝑦𝑙 + 𝑤

slide-13
SLIDE 13
  • Measurement of a single point z1
  • Variance s1

2 (uncertainty s1)

  • Best estimate of true position
  • Uncertainty in best estimate

ො 𝑦1 = 𝑨1 ො 𝜏1

2 = 𝜏1 2

Simple Example: Data Acquisition Intuition

  • Second measurement z2, variance s2

2

  • Best estimate of true position?

z1 z2

  • Second measurement z2, variance s2

2

  • Best estimate of true position: weighted

average

  • Uncertainty in best estimate

ො 𝑦2 = 1 𝜏1

2 𝑨1 + 1

𝜏2

2 𝑨2

1 𝜏1

2 + 1

𝜏2

2

= ො 𝑦1 + 𝜏1

2

𝜏1

2 + 𝜏2 2 𝑨2 − ො

𝑦1 ො 𝜏2

2 =

1 1 ො 𝜏1

2 + 1

𝜏2

2

Minimum Variance Estimator

slide-14
SLIDE 14

State Space Representation

  • For “standard” Kalman filtering, everything must be linear

System model: 𝑦𝑙 = 𝐵𝑦𝑙−1 + 𝐶𝑣 + 𝑥

  • The matrix A is state transition matrix
  • The matrix B is input matrix
  • The vector w represents additive noise, assumed to have covariance Q

Measurement model: 𝑨𝑙 = 𝐼𝑦𝑙 + 𝑤

  • Matrix C is measurement matrix
  • The vector v is measurement noise, assumed to have covariance R
  • Best estimate of state ො

𝑦 with covariance P

Further Reading: http://web.mit.edu/kirtley/kirtley/binlustuff/literature/control/Kalman%20filter.pdf

slide-15
SLIDE 15

Prediction/Correction

  • Prediction: of new state (Ignoring input u)
  • Correction: To Account for new measurements

Kalman Gain: Weighting of process model vs. measurements

𝑦𝑙

′ = 𝐵ො

𝑦𝑙−1 𝑄𝑙

′ = 𝐵𝑄𝑙−1𝐵T + 𝑅

𝑨𝑙

′ = 𝐵𝑦𝑙 ′

𝐿𝑙 = 𝑄𝑙

′𝐼T 𝐼𝑄𝑙 ′𝐼T + 𝑆 −1

ො 𝑦𝑙 = 𝑦𝑙

′ + 𝐿𝑙 𝑨𝑙 − 𝐼 𝑦𝑙 ′

𝑄𝑙 = 𝐽 − 𝐿𝑙𝐼 𝑄

𝑙 ′

prediction of new state based on passed state predicted observation new observation new estimate of state 𝑦𝑙

𝑨𝑙

𝑨𝑙 ො 𝑦𝑙 Pk is the error covariance matrix at time k

slide-16
SLIDE 16

Kalman Filter Definition: For 1-D Case

Further Reading: https://www.kalmanfilter.net/kalman1d.html

slide-17
SLIDE 17

Kalman Filter: Systematic View

slide-18
SLIDE 18

The Kalman Gain Intuition: For 1D Case

HIGH KALMAN GAIN LOW KALMAN GAIN

slide-19
SLIDE 19

Example 1: Estimating Temperature of Liquid in Tank Numerical Example

For Further Details: https://www.kalmanfilter.net/kalman1d.html

slide-20
SLIDE 20

ITERATION ZERO

  • INITIALIZATION
  • PREDICTION

FIRST ITERATION

  • STEP 1 - MEASURE
  • STEP 2 - UPDATE
  • STEP 3 - PREDICT

SECOND ITERATION

  • STEP 1 - MEASURE
  • STEP 2 - UPDATE
  • STEP 3 - PREDICT
slide-21
SLIDE 21

Es Esti timatin ing Tem emperature of

  • f Liq

iquid in in Tank

slide-22
SLIDE 22

EXAMPLE 2: AIRPLANE CONSTANT ACCELERATION MODEL Determining The State Space Mode

Estimated State Vector Control vector State transition matrix Control Matrix

slide-23
SLIDE 23

The state extrapolation equation is: The matrix multiplication results:

slide-24
SLIDE 24

Sen Sensor Fus Fusio ion

Vector of multiple measurements

slide-25
SLIDE 25

Co Comparison: Pos

  • siti

tion-Only y vs s Pos

  • siti

tion-Velocity ty Mod

  • del

Position-Only Model [Welch & Bishop] Position-Velocity Model E.g., GPS position measurements E.g., GPS position + Odometer speed

slide-26
SLIDE 26

Ex Example le 3: 3: Pen endulum Equ quation of

  • f Moti

tion De Determin ining a a Lin Linear St State Spa Space Rep epresentati tion

For Small Angles Non-Linear Linear Dynamic Model

slide-27
SLIDE 27

Pen endulu lum Equati tion of

  • f Moti

tion

Dynamic Model Defining States System Matrices

slide-28
SLIDE 28

Who ho sa said id Li Life is s Lin Linear?

slide-29
SLIDE 29

Non-linear Estimation

Gaussian Gaussian Gaussian Non-Gaussian Kalman Filters are optimal for Linear, Gaussian Systems Extended Kalman Filter Unscented Kalman Filter

slide-30
SLIDE 30
slide-31
SLIDE 31

Gaussian Gaussian Non-Gaussian Estimation

slide-32
SLIDE 32

Comparison

slide-33
SLIDE 33

App pplic icati tions

Large Kalman filter system: Including trajectories of 24+ satellites, drift rates and phases

  • f all system clocks, and

parameters related to atmospheric propagation delays with time and location For prolonging life of wind turbines by detecting wind anomalies (wind shear, extreme gusts) utilizing an EKF for regression analysis. Forecast model. Uses an Ensemble Kalman filter which throws out bad data that would result in a poor forecast.” GPS Tracking Wind-Mill Tracking Weather forecasting

slide-34
SLIDE 34

App pplic icati tions

In VR, predictive tracking is used to forecast the position of an

  • bject and its trajectory.

Improves efficiency of ADAS and makes vehicle control operations like blind spot detection, stability and traction control, lane departure detection and automatic braking in emergency situations a lot safer and more effective Forecast model. Uses an Ensemble Kalman filter which throws out bad data that would result in a poor forecast.” GPS Tracking Advanced Driver Assistance Systems (ADAS) Weather forecasting