BerryIMU Transform

Forums Technical Support for BerryIMU BerryIMU Transform

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #15408

    Hello Ozzmaker team, I had just purchased your board with intent to track world-space rotation and position. I've created an example project that does exactly this and as far as I can discern the calculations ought be correct, but even while not rotating the gyroscope still reads small non-zero (~0.01rad/sec) changes that effect the transform's actual rotation. Please review my example below and advise on how to remedy the rendered inaccuracies.

    Thank you ahead of time!


    Mark Williams

    Hi, i have had a look through your code and i am not familiar with the libraries you are using, so i am not sure how much help i can provide.

    it looks like you are running  the loop at 100ms.  does it get better if you run it faster?  E.g. 10ms

    Mark --


    Yes, the results are all the same. For example, raw gyro readings scaled by the sensitivity values (while the board is not rotating) look like (in radians per second):

    GYRO { -0.0354302, -0.118508, -0.0109956 }
    GYRO { -0.0342085, -0.129503, -0.00855211 }
    GYRO { -0.0427606, -0.128282, -0.013439 }
    GYRO { -0.031765, -0.120951, -0.0109956 }
    GYRO { -0.0354302, -0.123395, -0.00977384 }
    GYRO { -0.0354302, -0.12706, -0.0122173 }
    GYRO { -0.0354302, -0.125838, -0.0122173 }
    GYRO { -0.0329867, -0.123395, -0.0122173 }
    GYRO { -0.0305433, -0.120951, -0.0109956 }
    GYRO { -0.0403171, -0.122173, -0.00977384 }

    Should I perhaps try to find a mean value for each and clip the values below it to zero? The only issue with this is that the Y values seem to hover around -0.12 rad/sec (-6 deg/sec), and that is a lot of precision lost.

    • This reply was modified 4 months, 3 weeks ago by Tannz0rz.

    I updated my repository with changes made in the endeavor of fixing the idle value problem:

    1. Changed from single to double precision in my final transform calculations.
    2. Parameterized enableIMU, allowing users to select the scale for gyro, accel, and mag.
    3. Added readGYR_SI, readACC_SI, readMAG_SI which returns the readings in SI units with double precision.
    4. Switched from large to small scale (for greater precision): 2000dps to 245dps and 16G to 2G.

    I have noticed that compared to other LSM9DS1 boards, namely SparkFun's, a lot of the library functionality is missing, namely the use of interrupts. Using interrupts would be helpful as it would notify me when values above a threshold are available. Please refer to

    But using interrupts would not necessarily remedy the fact that my idle values are what I would assume to be abnormally high, could you perhaps share what gyro readings you get while the board is idle?

    • This reply was modified 4 months, 3 weeks ago by Tannz0rz.

    Okay, problem solved! I implemented two methods "calculateGyroBias_SI" and "calculateAccelBias_SI" that are computed once on initialization and subtracted from subsequent readings.

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

Blip, blop, bloop...