Autonomous Landing
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Owners
          • Signed-in users
          • Everyone
          Owners Signed-in users Everyone
        • Write
          • Owners
          • Signed-in users
          • Everyone
          Owners Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Write
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Understanding Kalman Filters MATLAB YouTube Playlist: [Link](https://www.youtube.com/playlist?list=PLn8PRpmsu08pzi6EMiYnR-076Mh-q3tWr) ## Why Use Kalman Filters? A Kalman filter is an optimal estimation algorithm for the Gaussian Linear case. Examples: 1. *Estimate a system state when it can not be measured directly* ![](https://i.imgur.com/dA8vDr1.png =400x200 ) We need to monitor the internal temp of a combustion chamber, but the sensor can not be placed inside the chamber, so its placed on a cooler surface. Here, a Kalman filter can be used to find the best estimate of the internal temperature from an indirect measurement. Extracting information about `what we can't measure` from `what we can`. 2. *Estimate state of the system by combining measurements from different sources that may be subject to noise* ![](https://i.imgur.com/tn1sRLx.png =400x200 ) In a tunnel its difficult to estimate the position through GPS. IMU readings can be used instead(for acceleration). Position can be obtained by double integrating this, but its prone to drift due to small errors. For better position estimate, IMU measurement along with odometer readings can be used. Thus the sensors for measuring the relative position of the car give fast updates but are prone to drift. GPS gives absolute location but gets updated less frequently and may be noisy. ![](https://i.imgur.com/jO80Psq.png =400x200 ) Kalman filter can be used to fuse these three measurements to find the optimal estimate of the exact position of the car. Summary: ![](https://i.imgur.com/HascOCZ.png =400x200 ) ## State Observers State observation helps you estimate something that you can't see or measure directly. Notation: anything with a 'hat' [$\hat{x}$] is an estimated state. Let's consider the example where we need to measure the internal temperature of the jet engine. The two temperatures are $T_{ext}$ and $T_{int}$. The temp $T_{in}$ will tell us how to regulate fuel flow($w_{fuel}$) to the rocket. But we have access to only $T_{ext}$. ![](https://i.imgur.com/Wp8PgGY.png =400x200 ) We can derive the mathematical model of the real system. $w_{fuel}$ as i/p to the mathematical model will give the o/p $\hat{T}_{ext}$. We have all the governing equations, so we can calculate the internal state of the system $\hat{T}_{int}$. This doesn't solve the problem as the mathematical model is only an approximation of the real system and is subject to uncertainities. Perfect model(no uncertainity), same initial conditions for model and real system -> measurement and estimated values will match. But in real life, the two values of external temp. don't match. So a state estimator is used to estimate the internal states. State estimator working: * Goal is to match estimated external temperature with measured external temperature. * If these two are equal, the model will converge to the real system. Thus $\hat{T}_{int}$ will converge to its true value. * Thus, eliminate difference between $T_{ext}$ and $\hat{T}_{ext}$ so that $T_{in}$ converges to $\hat{T}_{int}$ We need a feedback control system, where we try to control the error b/w measured and estimated external temp. at zero using a controller K. ![](https://i.imgur.com/KU8r6is.png) * Can't directly measure $T_{in}$, but know $w_{fuel}$ * Run this through mathematical model to get $\hat{T}_{ext}$. * Use this along with $T_{ext}$ to estimate $\hat{T}_{int}$. State Observer Mathematically: input: $u$ output: $y$ states to be estimated: $x$ ![](https://i.imgur.com/5ufOPRo.png ) ![](https://i.imgur.com/1ODXUj6.png =400x300 ) Even without KC term from the feedback loop we would have a decaying exponential function for the error. Significance of the feedback loop is that we can control decay rate of error by selecting appropriate K. ![](https://i.imgur.com/nA2YvZG.png =400x200 ) Optimal way of choosing controller gain K? -> through Kalman filters ## Optimal State Estimator ![](https://i.imgur.com/H4MHvGY.png =400x200 ) Example where the car with smallest error variance and an average final position closest to 1 km wins. (Zero bias + Minimum variance) ![](https://i.imgur.com/RE6kttb.png ) * Team 1 would lose due to biased avg final position altough it has small variance. * Team 2 would lose, even though its avg final position is on finish line, it has high variance. * Team 3 wins, smallest variance and avg final position on finish line. We cant rely purely on GPS readings since they can be noisy. Can estimate the car's position using a Kalman Filter. The system: input: throttle($u_k$) output: car's position($y_k$) Such system would have multiple states, but here its simplified where input to the car is velocity. Car's position is the only state for this system. ![](https://i.imgur.com/AKQWx6M.png) y should be known as accurately as possible. But, the GPS readings are noisy. This measurement noise is shown by $v$, a random variable. The process noise( represents effects of the wind, changes in car's velocity) shown by $w$. ![](https://i.imgur.com/D7uZrCI.png) These random variables don't follow a pattern, but probablity theory can be used to determine their avg properties. $v$ is assumed to be drawn from a gaussian distribution with zero mean and covariance R i.e. $v \sim N(0,R)$. Similary, $w \sim N(0,Q)$ ![](https://i.imgur.com/AGr3QmQ.png) Measurement is noisy and thus is not accurate position of the car. We can run the input through a car model to estimate the position. Not perfect estimate as x is uncertain due to w. Kalman filter combines the measurement and the prediction to find optimal estimate of the car's position in the presence of process and measurement noise. Working principle of Kalman Filter with probablity density functions. At time k-1, the actual car position can be around $\hat{x}_{k-1}$. True position can be around the mean. At the next time step, larger variance so more uncertainity(pothole or wheels slipped etc). Another source for car's position comes from measurement where variance represents noise. ![](https://i.imgur.com/nrrBD8Y.png) The optimal way to estimate the car's position is by combining measurement and prediction. Done by multiplying these two probablity functions together. The product is a gaussian function with a smaller variance and its mean gives an optimal estimate of the car's position. This is the basic idea behind Kalman Filters. ## Optimal State Estimator Algorithm Set of equations needed to implement Kalman Filter Algorithm: Example: Same as previous video. Optimal estimate is found by multiplying the prediction and measurement probablity functions together, scaling the result and computing the mean of the resulting probablity density function. Multiplication of these two PDFs relates to the discrete filter equation, which is similar to the state observer equation. ![](https://i.imgur.com/d0DCGDE.png) Kalman Filter is a type of State observer ddesigned for stochastic systems, while state observer is for deterministic system. $\hat{x}_k = A\hat{x}_{k-1} + Bu_k + K_k(y_k - C(A\hat{x}_{k-1} + Bu_k))$ Here $A\hat{x}_{k-1} + Bu_k$ predicts the current state $\hat{x}_k$ by using state estimate from previous time step and current input. ![](https://i.imgur.com/zhmxraA.png) These two state estimates are different. Predicted state estimate is shown by, $\hat{x}_{k}^-$ (called A Priori Estimate) as its calculated before the current measurement is taken. The equation is thus reduced to: $\hat{x}_k = \hat{x}_{k}^- + K_k(y_k - C\hat{x}_{k}^-)$ ![](https://i.imgur.com/cA4Q1cF.png) The second part of the equation uses measurement and incorporates it into prediction to update the a priori estimate. The result is called A Posteriori Estimate. The equations for a Kalman Filter are: ![](https://i.imgur.com/rtH6DZV.png) The Kalman Filter is a two step process 1. Prediction: System model is used to calculate the 'a priori state estimate' and the error covariance P. For the single state system, P is the variance of the a priori estimate and can be said to be a measure of uncertainity in the estimated state. It is due to process noise![](https://i.imgur.com/MDqD0O1.png) 2. The second step of the algorithm uses the a priori estimates from prediction step and updates them to find a posteriori estimates and error covariance. The Kalman gain $K_k$ is calculated such that the a posteriori covariance is minimized. ![](https://i.imgur.com/KNW2ogB.png) The Kalman gain determines how heavily the measurement and the a priori estimate contributes to the calculation of $\hat{x}_k$. Depends on measurement noise and error in a priori estimate. Illustration for two extreme cases: * Measurement covariance is zero![](https://i.imgur.com/sROL0pQ.png) * A prior error covariance is close to zero![](https://i.imgur.com/sfON6gu.png) If we have two measurements, we will multiply three probablity density functions to find optimal estimate ![](https://i.imgur.com/0TiQNs8.png) ## Nonlinear State Estimators Kalman filters are defined for linear systems. Following are the equation for a non-linear system. There can be systems where the noise is not additive. In a general system, the state transition function 'f' ot the measurement function 'g' or both can be non-linear ![](https://i.imgur.com/9xAzHn4.png) Here we use non-linear state estimators instead of Kalman filters. Problem with using Kalman filter for state estimation of a nonlinear system: Kalman filter assumes gaussian distribution. After linear transformation distribution maintains its gaussian property. ![](https://i.imgur.com/56zT9HQ.png) But for non-linear transformation the result may not be gaussian and so Kalman filter algorithm may not converge.![](https://i.imgur.com/o0HjXTJ.png) **Extended Kalman Filters(EKF):** Here a extended kalman filter can be used which linearizes the non-linear function about the mean of current state estimate. At each time step, perform linearization locally and use the resulting Jacobian matrices in prediction and to update states. ![](https://i.imgur.com/B3V1xjz.png) Drawbacks of EKF:![](https://i.imgur.com/1I6mnQQ.png) **Unscented Kalman Filters(UKF):** Instead of approximating the nonlinear function like EKF, it approximates the probablity distribution. UKF selects a minimal set of sample points(sigma pts) such that their mean and covariance is same as their distribution. Each sigma pt is put through the nonlinear system model. Mean and Covariance of nonlinearly transformed pts is calculated and an empirical gaussian distribution is computed. ![](https://i.imgur.com/aVYZjpy.png) **Particle Filter(PF):** It approximates any arbitray distribution ie not limited to gaussian distribution. Number of particles(similar to sigma pts) is much larger than UKF![](https://i.imgur.com/MXlFjnn.png) Summary: ![](https://i.imgur.com/hnbcGyh.png) Note- The [video description](https://www.youtube.com/watch?v=Vefia3JMeHE&list=PLn8PRpmsu08pzi6EMiYnR-076Mh-q3tWr&index=5) contains useful additional resources.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully