Browse By

A Hidden Challenger in 3D Rotations

A Hidden Challenger in 3D Rotations

by Sonit Sahoo

    Gimbal lock is a phenomenon that occurs when representing rotations in the third dimension, especially when using Euler angles, your classic (X,Y,Z). Although the term seems important, gimbal lock’s implications surround us everyday such as in our smartphones, in video games, when using robotics, or in aerospace.

Figure 1

3 Gimbals for Yaw, Pitch, and Roll

Gimbal Spinning on Yaw, Pitch, and Roll Axes

Source: Wikimedia Commons

    To understand what gimbal lock is, you will need to know what a gimbal is. A gimbal is a ring that allows an object to rotate in a specific axis. In three-dimensional spaces, you need three nested gimbals to allow full rotation in all axes, referred to as XYZ, or, in rotation terms, roll, pitch, and yaw respectively. This system is often represented as Euler angles, which describe a rotation as a sequence of angular movements on all axes.

    Gimbal lock occurs when two of these three axes become aligned, reducing the degrees of freedom by one to two. As a result of this, the system loses its ability to independently rotate on one axis, leading to constraints in movement or unintended behavior. For instance, in space-faring vehicles, gimbal lock can prevent it from being oriented carefully, which could potentially jeopardize a mission.

Figure 2

Example of gimbal lock where the red and green axes have aligned

Aligned AxesSource: MathsPoetry

While gimbal lock seems like a trivial problem, it affects everyday things.

  1. Modern smartphones use gyroscopes to detect their positions in 3D space for screen rotation and augmented reality.
  2. 3D animation software as well as video games often use Euler angles for character or camera movement. Gimbal lock can cause sudden, unnatural movement.
  3. Robots, such as drones or multi-axis arms rely on precise motor control for rotations.
  4. Flying craft rely on gyroscopes to gain information such as altitude. Gimbal lock, if left unattended, can result in loss of navigation data.

Figure 3

3 axis robotic arm that utilizes rotations to move to any point in the 3D space surrounding it

Two 3-Axis Robot Arms

Source: KUKA Roboter GmbH

    The cause of a gimbal lock lies in the representation of a rotation. When two gimbal axes align (when the angle between them is plus-minus 90 degrees), a degree of rotational freedom is lost. At this point, the system can not be distinguished between different rotations, leading to a lack of control. This is due to Euler angles being non-unique at certain points, known as a “coordinate singularity”.

To counter these issues, various solutions have been created:

  1. Quaternions are a method of representing rotations using 4 values, W, X, Y and Z. It does not require sequential rotations, thus being unable to have gimbal lock. They are widely used in modern computer graphics, robotics, and aerospace systems.
  2. Alternative representations such as rotation matrices or vectors can be used while avoiding singularities.
  3. Gimbal lock can be crudely avoided by simply preventing the range of motion of rotation so that it can never be plus-minus 90 degrees.

 

Figure 4

A visualization of how positioning using a quaternion functions

Visualization of Quaternion

Source: Cmglee

    Gimbal lock may seem to be just a technical problem, but its impact reaches beyond specialized fields into the daily realm. From gaming and smartphones to robotics and aerospace, addressing gimbal lock ensures the reliability and accuracy of systems we rely on. Through the use of innovations like quaternions and alternative rotational models, engineers and developers can mitigate this hidden challenge.

 

References and Sources:

Xsens Knowledge base. (n.d.). https://base.movella.com/s/article/Understanding-Gimbal-Lock-and-how-to-prevent-it?language=en_US

Gimbal Lock | Paul Neale. (n.d.). https://paulneale.com/gimbal-lock/

Jackdevs. (2019, May 25). Quaternions & Gimbal Lock. Jackminnet. https://jackmin.home.blog/2019/05/25/quaternions-gimbal-lock/

Shehata, O. (2021, December 15). How to fix gimbal lock in N-Dimensions – Omar Shehata – Medium. Medium. https://omar-shehata.medium.com/how-to-fix-gimbal-lock-in-n-dimensions-f2f7baec2b5e

Leave a Reply

Your email address will not be published. Required fields are marked *