Comments (8)
Can you post a picture of your sensor and setup?
from invensense-imu.
the Vcc pin is connected to the 5v of the arduino
the ground pin is connected to the ground of the 5v supply
SCL pin connected to A21 since i'm using Arduino mega 2560
SDA pin to A20
from invensense-imu.
Seems weird, the total acceleration is higher than it should be (i.e. around 12 m/s/s instead of 9.8 m/s/s). Also seems weird that you're not getting magnetometer data as often as I would expect. I would probably touch up the soldering, install the latest version of this library, and test while ensuring that the sensor is resting on a table.
from invensense-imu.
I thought about a potential solution: Taking few seconds when the code starts running to calculate the mean value of each sensor(on each axe) and then consider these "means" as an offset.
Then, I can simply compensate for the shift in the raw values by adding the missing values due to the offset.
However, I'm not so sure of this solution since I'm not aware if this offset is linear or not.
PS: i am using the latest version of the library.
from invensense-imu.
It's not the newest version of the library, we use a namespace and the class object isn't fully capitalized, which is different than the screenshot posted. I don't think it's the code, but helps to get on the same baseline for any troubleshooting.
You should absolutely calibrate it anyway, but my expectation would be that the value is closer to {0, 0, -9.8} at rest with the sensor z axis aligned with gravity. You could calibrate it by moving the sensor very slowly in a spherical motion and then doing a least squares estimate of the resulting data to get a bias and scale factor for each axis (exciting each axis with +g and -g enables you to get both a bias and a scale factor).
from invensense-imu.
Indeed, i was just trying to test multiple libraries, unfortunately i keep getting the same error even with this latest version.
One more thing, i've noticed another measurement error: the x-axis column and y-axis column measurements are swapped which i believe that i'm the only one getting this weird results.
Hence i think that there's something wrong either with my MPU or the camputer/ my arduino software.
from invensense-imu.
hello sir, so I bought a new MPU chip, and tried to do the soldering very carefully, this time it worked correctly.
One last thing, do you have any sort of documentation or guide to calibrate the magnetometer, I'm trying to build up a compass, and all that is left is to calibrate the magnetometer?
Thank you for your help.
from invensense-imu.
You'll want to slowly move the magnetometer so that each axis traces a sphere while recording data (this ends up being kind of a figure 8 shape that you may be familiar with from calibrating the magnetometer for phone apps or a smart watch). Then use a least squares method to find a scale factor and bias for each axis to fit the data to a sphere. That's it! You'll need to re-calibrate any time the electromagnetic environment changes.
There's also a bunch of web pages with instructions and video demos if you search for "how to calibrate a magnetometer".
from invensense-imu.
Related Issues (20)
- No such file or directory #include <cstddef> + a few more imports HOT 1
- Latest version of the library is not available in PlatformIO library registry. HOT 1
- Glitches on Gyro data HOT 8
- Unable to reach magnetometer module in mpu9250 while using Teensy4.0 HOT 1
- SPI communication with teensy 4.1 is not working HOT 18
- cstddef: No such file or directory HOT 1
- cstddef & cstdint? HOT 1
- Set SPI clock speed HOT 1
- Why inverted axis for gyro and accelerometer HOT 5
- Esp32, Arduino how do I know the correct angle of the device? HOT 1
- Incompatible with AVR architecture ? HOT 3
- Compiling IDE 2.0 and arduino nano 33 iot HOT 2
- how can i get the cstddef HOT 2
- calibration HOT 1
- status -5 HOT 4
- Can't initialize I2C/SPI bus HOT 12
- X and Y axis accelerometer readings are swapped. HOT 1
- assert failed: i2c_ll_set_bus_timing i2c_ll.h:109 (scl_high > 13) HOT 5
- Please fix 1.0.2 release HOT 5
- Compilation Error on Arduino-Esp32 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invensense-imu.