Home › Forums › Forums › Technical Support for BerryIMU › BerryIMU Transform
Tagged: transform rotation position
- This topic has 4 replies, 2 voices, and was last updated 3 years, 2 months ago by Tannz0rz.
- AuthorPosts
- March 12, 2020 at 11:38 am #15408Tannz0rzParticipant
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.
https://github.com/Tannz0rz/BerryIMU_Transform
Thank you ahead of time!
Tannz0rz
March 12, 2020 at 12:22 pm #15409Mark WilliamsKeymasterHi, 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 --OzzMaker.com --
March 12, 2020 at 1:33 pm #15414Tannz0rzParticipantYes, 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.
March 13, 2020 at 6:21 am #15442Tannz0rzParticipantI updated my repository with changes made in the endeavor of fixing the idle value problem:
- Changed from single to double precision in my final transform calculations.
- Parameterized enableIMU, allowing users to select the scale for gyro, accel, and mag.
- Added readGYR_SI, readACC_SI, readMAG_SI which returns the readings in SI units with double precision.
- 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 https://github.com/sparkfun/SparkFun_LSM9DS1_Arduino_Library/blob/master/examples/LSM9DS1_Interrupts/LSM9DS1_Interrupts.ino
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?
March 13, 2020 at 1:19 pm #15450Tannz0rzParticipantOkay, problem solved! I implemented two methods “calculateGyroBias_SI” and “calculateAccelBias_SI” that are computed once on initialization and subtracted from subsequent readings.
- AuthorPosts
- You must be logged in to reply to this topic.