Calibration for Berry IMU using Python Code

Home Forums Forums Technical Support for BerryIMU Calibration for Berry IMU using Python Code


Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #9018

    I’m not really sure how to use the code from github. I run the code and get the magxmin magxmax magymin magymax magzmin and magzmax values. But in the in the python-BerryIMU-gryo-accel-compass-filters folder, I don’t know where to input these values or how to go about it. There are guide for C code but I’m having trouble deciphering how to apply it in python.


    Mark Williams

    Use the code in this folder first as it is easier to understand


    Run the same calibration program (or use the values you already have)

    and paste them into this file in the section below.. put you value is where the ‘0’ values are

    ################# Compass Calibration values ############
    # Use to get calibration values
    # Calibrating the compass isnt mandatory, however a calibrated
    # compass will result in a more accurate heading values.
    magXmin = 0
    magYmin = 0
    magZmin = 0
    magXmax = 0
    magYmax = 0
    magZmax = 0
    Here is an example:
    magXmin = -1748
    magYmin = -1025
    magZmin = -1876
    magXmax = 959
    magYmax = 1651
    magZmax = 708
    Dont use the above values, these are just an example.

    Mark --


    Hi Mark,

    Following on to the calibration question –

    We are using LSM9DS1 IMU with Raspberry pi and would like to calibrate it so that when the unit is leveled the x and y angles(Kalmanx and kalmany) should read zero for physically leveled unit.

    How can we calibrate the unit as each unit has the IMU built in slightly differently (just tolerances and human assembly tiny errors),  so we need to have a function to level the unit, then add an offset to x and y to set them zero.

    Please can you assist?



    To calibrate the accelerometer and gyro, you would need specific scientific equipment that exerts known forces and can be absolute level. And even when this is done, there is little improvement as the sensors are accurate.

    The should be no need to calibrate these two sensors, once you mount the IMU… you just need to add or subtract an offset to get the range of values you want.

    Peter --

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…