GithubHelp home page GithubHelp logo

arduino-kalmanfilter's People

Contributors

nhatuan84 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

koson cmb87

arduino-kalmanfilter's Issues

How to find R and Q?

Hi nhatuan84

I am following your example to read data from an accelerometer (AccX, AccY, and AccZ) of three axes. It is an ICM20948 TDK 9-axes MEMS sensor. As it points out in one of the blogs you mentioned, the difficult part is to find good values for Q and R. I have followed your choice of 100.0f for R[0][0] and 0.01f for Q[0][0] but the estimated value is too slow to respond to the meausred value. The criteria is that the estimated curve should follow variation of noisy accelerometer data and it still can reject noise.

By various blind trials I have got the following setup which seems to work.

  m_kf.init(stateNum, measureNum, &A[0][0], &P[0][0], &Q[0][0], &H[0][0], &R[0][0], &xp[0], &xc[0]);
  m_kf.zeros();
  A[0][0] = 1.0f;
  H[0][0] = 1.0f;
  Q[0][0] = 0.2f;  //by blind trial
  R[0][0] = 50.0f; //by blind trial
  P[0][0] = 1.0f;

  xc[0] = read_register()/8.192; //Reading data from ICM20948 returns raw data from 16-bit register in milli-G with a resolution of 8192LSB/g = 8.192LSB/mg.

Screenshots below show the results :

image

image

image

My question is, besides blind trials like what I did, is there any way to find R and Q?

Thank you for sharing the code and library.

John

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.