# How to solve gimbal lock logically?

43 views (last 30 days)
Kang Geonhui on 23 Dec 2022
Commented: Kang Geonhui on 23 Dec 2022
Hello.
I am analyzing the three-dimensional motion data of a glenohumeral joint with MATLAB, and I think the analyzed results seem to have an error.
I am told that this kind of error is called 'gimbal lock,' but I don't know well about it as I am new to this area.
So my question is, how to logically solve this gimbal lock? Is it appropriate to remove the error data and interpolate it?
Thank you.

William Rose on 23 Dec 2022
Yes, your plot illustrates what happens when you are near "gimbal lock". Interpolation is not a good idea.
Background: From motion caputure, you obtain a 3x3 rotation matrix at each instant. The rotation matrix is always well defined. Nonetheless, the determination of flexion/extension, ab/adduction, and internal/external rotation can become problematic, as your plot shows, when the middle angle is approximately 90 degrees. Sometimes the problem can be avoided by choosing a different rotation sequence, so that the middle angle in the sequence is not near 90 degrees. Another solution is to represent rotations with helical angles. Helical angles never suffer from gimbal lock.
Consult the large literature on the subject. Start with the recommendations for analysis of shoulder joint motion of the International Society of Biomechanics, here. For better or worse, not many researchers follow the ISB recommendations for reporting shoulder joint angles. Here is an example paper (one of many) about how to avoid gimbal lock issues when analyzing shoulder motion.
Kang Geonhui on 23 Dec 2022
Thank you very much for your reply and explanation of the middle angle. I should calculate the helical angle instead of using quaternion! Have a nice day!!

William Rose on 23 Dec 2022
My lecture notes on rotation matrices are attached. Lectures 2 and 3 include discussion of helical angles.
The lecture notes of Young-Hoo Kwon are nice. Here is the top page. I recommend reading his notes on rotation matrix, here. Then see his notes on Euler and Cardan angles, here. Then see his notes on helical axis, here.
Here is another paper that might interest you: "The Appropriateness of the Helical Axis Technique and Six Available Cardan Sequences for the Representation of 3-D Lead Leg Kinematics During the Fencing Lunge", 2013, https://sciendo.com/article/10.2478/hukin-2013-0020
Kang Geonhui on 23 Dec 2022
There's a lot to study! I appreciate your providing references.

### Categories

Find more on Quaternion Math in Help Center and File Exchange

R2022a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by