Skip to content

Kalman Filters are used for state estimation in control systems. This repository includes an implementation of the algorithm in Python and also a Jupyter Notebook for testing in real data for altitude estimation of a quadrotor

License

Notifications You must be signed in to change notification settings

SpPap/Kalman-Filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d7af0ff · Jul 1, 2024

History

4 Commits
Nov 27, 2023
Nov 27, 2023
Jul 1, 2024
Nov 27, 2023

Repository files navigation

Kalman Filter

Kalman Filters are used for state estimation in control systems when noisy measurements are present. This repository includes an implementation of the algorithm in Python and also a Jupyter Notebook for testing in real data for altitude estimation of a quadrotor. The algorithm was applied in the quad using a sensor-fusion technique by blending the measurements from the barometric pressure sensor and the accelerometer to provide altitude (relative height of the quad) estimation.

Kalman Algorithm

Initialization

  1. Start

  2. Initialize the state estimate: x ^ 0 | 0 and the error covariance estimate: P 0 | 0

Prediction Step

  1. Predict the state for the next time step:
    x ^ k | k 1 = A k x ^ k 1 | k 1 + B k u k

  2. Predict the error covariance for the next time step:
    P k | k 1 = A k P k 1 | k 1 A k T + Q k

Correct Step

  1. Compute the Kalman Gain:
    K k = P k | k 1 H k T ( H k P k | k 1 H k T + R k ) 1

  2. Update the state estimate:
    x ^ k | k = x ^ k | k 1 + K k ( z k H k x ^ k | k 1 )

  3. Update the error covariance estimate:
    P k | k = ( I K k H k ) P k | k 1

    Go to 2

The matrices and vectors in the above equations are defined as follows:

  • A k : State transition matrix for time step k
  • B k : Input control matrix for time step k
  • u k : Control input at time step k
  • Q k : Process noise covariance matrix at time step k
  • H k : Measurement matrix at time step k
  • R k : Measurement noise covariance matrix at time step k
  • z k : Measurement vector at time step k
  • I : Identity matrix

About

Kalman Filters are used for state estimation in control systems. This repository includes an implementation of the algorithm in Python and also a Jupyter Notebook for testing in real data for altitude estimation of a quadrotor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published