Is it gimbal lock?

Hi all,

I'am actually working with an LSM6DSO32 captor, I use kalman filter to get roll and pitch angles. But in certain position I get strange value, suddenly my angle jump for exemple I'am in -79° in pitch and -76° in roll and if I move just a little bit my captor (1- 5°) my angles jump to -0.48 in roll and pitch approach 90°, is it gimbal lock? It's seem that this phenomenon appears only in certain configuration when roll and pitch approch to certain angle
I also try to use Madgwick ahrs and I got the same result...

Hello
Your description points to some special cases within the trigonometric functions. The tangent function tends to jump at 90°.
grafik

Ok and there is a solution to this trigonometric problems? It's really strange my roll angle jump suddenly when my pitch is close to 90 or -90°, my roll jump to -80 to 2° suddenly but I moved my captor only by 3-5° max
If I go to the opposite I don't have the problem my roll doesn't move and my pitch decrease to -86° to -10° and this is the good value...

Hello,
check your sketch.
Insert several Serial.println at POI.
Isolate the processing part and test with manual inserted values.

It is most accurate to use just the accelerometer to measure roll and pitch as described here: How_to_Use_a_Three-Axis_Accelerometer_for_Tilt_Sensing-DFRobot

No filter is needed, and the one you are using may actually be causing the problem.

You should work with DCMs or quarternions internally, only converting to roll/pitch for humans. DCMs and quarternions don't have discontinuous behaviour.

Quarternions are usually the most convenient representation for orientation as they are 4 values with 3 DoF (degrees of freedom), whereas a DCM has 9 values with 3 DoF.

An orientation is the same as a 3D rotation, note.

Whatever you do Euler angles will display discontinuity, typically between upright and inverted - its fundamental to that represenation. This is why they are hopeless for calculations.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.