Skip to content

Calibration? #3

Description

@chrisspen

How do you enter the offsets acquired during calibration? Otherwise, the values read from the device are raw and meaningless.

Activity

  1. m-rtijn commented on Jul 11, 2016

    @m-rtijn
    Owner

    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).

  2. chrisspen commented on Jul 11, 2016

    @chrisspen
    Author

    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
    MPU6050_RA_YA_OFFS_H
    MPU6050_RA_ZA_OFFS_H
    MPU6050_RA_XG_OFFS_USRH
    MPU6050_RA_YG_OFFS_USRH
    MPU6050_RA_ZG_OFFS_USRH

    If you don't enter these, the values read from the device will be useless.

  3. m-rtijn commented on Jul 11, 2016

    @m-rtijn
    Owner

    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).

  4. m-rtijn commented on Aug 16, 2016

    @m-rtijn
    Owner

    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 :)

  5. byapparov commented on Jan 9, 2021

    @byapparov

    @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

  6. Artoria2e5 commented on Apr 27, 2023

    @Artoria2e5

    @byapparov The Arduino-MPU6050 library (linked from the official site) does basically what you do: the readNormalizeGyro() function subtracts a fixed offset and performs thresholding, both set from calibration at program start calibrateGyro(). It has not been updated for the new registers, so that could be why.

  7. m-rtijn commented on Apr 27, 2023

    @m-rtijn
    Owner

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions