-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calibration? #3
Comments
Because no procedure for calibration of the hardware is given in the datasheet, there is no calibration implemented. What this module does lack is an implementation of the self test procedure (7.12 of the datasheet). |
I'm not asking how to calibrate it. This Arduino sketch explains how to do that http://wired.chillibasket.com/2015/01/calibrating-mpu6050/ I'm asking how to enter the 6 offsets (three for the accelerometer and three for the gyroscope). These are registers on the device: MPU6050_RA_XA_OFFS_H If you don't enter these, the values read from the device will be useless. |
While developing this module I used the MPU-6050 Register Map and Descriptions file (Document number: RM-MPU-6000A-00, release date: 4.2, Release date: 2013-08-19) which does not include information about the offset registers. Because of this, there is currently no option to use these registers in this module, since I only just learned about their existence (thanks to you because you pointed this out). |
I've decided that because for most applications calibrating the MPU-6050 is not necessary, since the factory calibration will be precise enough, that I won't add support for these calibration features. If you want to add these features to this project, you're welcome to do so. EDIT (2023-04-27): I think it would be a useful feature to add, but I currently don't have working MPU6050 chips to test any code. If anybody is interested to add this via a PR, it would be really welcome :) |
@m-rtijn I am not sure if I am doing something wrong, but I get bias of 16 d/s on the X gyro data. that makes it pretty much unusable without calibration. Would be great to understand what is the way to overcome this, right now I have done a wrapper that adjusts for errors |
@byapparov The Arduino-MPU6050 library (linked from the official site) does basically what you do: the |
It seems that there also exists a Linux kernel module that implements interfacing with the MPU6050, that code can also be used as inspiration: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/iio/imu/inv_mpu6050?h=v6.3 It can even be used directly I think. You can follow for example the steps here: https://petermolnar.net/article/linux-i2c-iio-collectd/#detecting-i2c-devices (just ignore the part about using the USB i2c adapter, since the Raspberry Pi has i2c built-in). |
How do you enter the offsets acquired during calibration? Otherwise, the values read from the device are raw and meaningless.
The text was updated successfully, but these errors were encountered: