For a home robotics project I just bought a BerryIMU to connect it to my Raspberry Pi. After hooking it up I ran the provided Python code to read out some values while moving it around.
If I keep the IMU (more or less) straight and in Northern direction I get the following line of output:
ACCX Angle 0.60
ACCY Angle 4.58
GRYX Angle -125.14
GYRY Angle 114.15
GYRZ Angle 93.74
CFangleX Angle -0.26
CFangleY Angle 4.45
HEADING 1.02
tiltCompensatedHeading 3.73
kalmanX 0.48
kalmanY 4.43
I am most interested in the compass (in 360 degrees), and how much it tilts right/left and front/back.
As far as I understand, the tiltCompensatedHeading
tells me that it points 3.73 degrees right of the magnetic north. And I think kalmanX
and kalmanY
should give me the tilting of the IMU to the left/right (X) and to the front/back (Y) (compensated by a Kalman filter for smoothening).
So I played around with it and saw what the numbers did. In the images below I look slightly down on it. I hope the description on it explains how you see it.
From what you see here the X and Y degrees independently behave as I would expect them to. But what I don't understand is why "the other one" is always between 90 and 130. So if I tilt it 90 degrees forward I would expect
X ≈ 0
Y ≈ 90
similarly, if I tilt it 90 degrees backward, I would expect
X ≈ 0
Y ≈ -90
Instead X
is around 100
for both of them and I really don't understand why it's not around 0
.
Does anybody see the logic in this? What am I missing?