tkjelectronics / example-sketch-for-imu-including-kalman-filter Goto Github PK
View Code? Open in Web Editor NEWSoftware for "Guide to gyro and accelerometer with Arduino including Kalman filtering"
Software for "Guide to gyro and accelerometer with Arduino including Kalman filtering"
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.
there is a problem with MPU6050_HMC5883L code , where at 90 degree the result just 60 degree. how to fix it? how i calibrate hmc5883l? help me, thank's
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 :)
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
I have doubt In
https://github.com/TKJElectronics/Example-Sketch-for-IMU-including-Kalman-filter/blob/master/IMU/MPU6050/MPU6050.ino
Have you used a kalman filtter for accelerometer??
because I think you have used only kalman for gyrocope not for accelerometer??
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
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?
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
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?
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
}
Seems that your code doesn't use DMP of the MPU-6050. So, are you using raw values of the MPU ?
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
How do I connect the gy-521 on my arduino uno? I can't find it in the code?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.