GithubHelp home page GithubHelp logo

tkjelectronics / example-sketch-for-imu-including-kalman-filter Goto Github PK

View Code? Open in Web Editor NEW
477.0 477.0 285.0 6.84 MB

Software for "Guide to gyro and accelerometer with Arduino including Kalman filtering"

Processing 29.42% Arduino 45.26% Objective-C 25.32%

example-sketch-for-imu-including-kalman-filter's People

Contributors

lauszus avatar

Stargazers

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

Watchers

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

example-sketch-for-imu-including-kalman-filter's Issues

About x,y displacement

I'd wonder wether this MPU-6050 with kalman filter can be apply on calculating the displacement of x, y?
Since I'm working on a project need to build a system that can calculate the current 2-D displacement with MPU-6050, and then do some application of tracking object.

F matrix kalman filter

Can you explain why do you use F matrix as you wrote in your website? i'm trying to study your kalman filter and i think i feel a gap of information when i come across your F transition matrix.

Thank you :)

i2cWrite failed: 2

I have an Arduino Mega and a MPU 6050 HMC5883L
I used example
MPU6050_HMC5883L

connection VCC---3.3v
GND---GND
SCL---- SCL 20
SDA---SDA 21
i don´t know why it is on the serial monitor always become the message
i2cWrite failed: 2

'TWBR' was not declared in this scope (example MPU6050)

Hi mates,

I'm a noob using Arduino.I haveve connected the pins correctrly and installed the library. I have tried the example code (MPU6050) but I can't get it to compile, the error that show me is:
'TWBR' was not declared in this scope

imagen

And if I declare it the TWBR as a double or other type (or delete it) the program compiles but the serial monitor and the serial ploter appears empty, in blank.

Someone could help me please?

Changes on using a 9dof from adafruit

Hey

I'm trying to detect the pose of an object using the 9dof from adafruit, could you please suggest me the required changes?

Also are the advantages of using a 9dof over a 6dof for pose detection?

Thank you

using optionally different IMUs instead?

hello,
how would it be possible to use your kalman libs optionally with different IMUs, e.g. precalculated data from a CMPS10/11?
I can retrieve the data and also calculate all the actual fp (double) gyro angles and accelerometer data, so I only have to pass them to your Kalman, no extra i2c readings needed, no i2c.h lib included, and despensing with all the specific 6050 stuff.
In other words:
a native IMU Kalman lib, just to pass the precalculated angles (0.0-359.9 degrees) and xyz accelerations (m/s² by int16_t or fp) to, and an example code how to do this.
Is there such an example code already available?

No need to wait after Wire.requestFrom() and no .beginTransmission() or .endTransmission needed.

The Wire.beginTransmission() and Wire.endTransmission() are only used when writing data, they should not be used with Wire.requestFrom().

When the Wire.requestFrom() returns, the I2C transaction has completely finished and the received data is waiting in a buffer in the Wire library. There is no need to wait for something.

In the file "Example-Sketch-for-IMU-including-Kalman-filter/IMU/ITG3205_ADXL345/ITG3205_ADXL345.ino", in the function i2cRead(), the Wire.requestFrom() is encapsulated by Wire.beginTransmission() and Wire.endTransmission. Those Wire.beginTransmission() and Wire.endTransmission() can be removed.

In the files "Example-Sketch-for-IMU-including-Kalman-filter/IMU/MPU6050/I2C.ino" and "Example-Sketch-for-IMU-including-Kalman-filter/IMU/MPU6050_HMC5883L/I2C.ino", in the function "i2cRead()", there is a while-loop with a counter and micros(), but there is nothing to wait for.
If you want, you could check if the number of received bytes is the same as the number of requested bytes.

  Wire.requestFrom(IMUAddress, nbytes, (uint8_t)true); // Send a repeated start and then release the bus after reading
  if (Wire.available() != nbytes) {
    return 5; // This error value is not already taken by endTransmission
  }
  for (uint8_t i = 0; i < nbytes; i++) {
    data[i] = Wire.read();
  }
  return 0; // Success
}

Reading raw values

Seems that your code doesn't use DMP of the MPU-6050. So, are you using raw values of the MPU ?

wrong data , when mpu accelerated in y or z ditrction

hi
thanks to you for this library
i print complementary and kalman output , and as you mentioned in code the initial roll and pitch come from accelerometer data

double roll = atan2(accY, accZ) * RAD_TO_DEG;
double pitch = atan(-accX / sqrt(accY * accY + accZ * accZ)) * RAD_TO_DEG;

here is the problem , of course it's final effect in complementary filter is just 7% but when i accelerate my board for example in y direction , my roll show 10 deg and as acceleration become more the roll number shows bigger number .
and of course it affects my kalman filter output.
is this a normal behavior or this is my bad implementation ??

thanks in advance
MA

Connections

How do I connect the gy-521 on my arduino uno? I can't find it in the code?

Thanks!

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.