3.5.5 · D4Guidance, Navigation & Control (GNC)

Exercises — Gimbal lock — problem with Euler angles at θ = ±90°

2,491 words11 min readBack to topic

This is the self-test companion to the parent topic. Work each problem before opening its solution. Difficulty climbs from L1 (do you recognise it?) to L5 (can you build new results with it?).

Everything here uses the ZYX / yaw–pitch–roll convention from the parent note: with yaw (about ), pitch (about the new ), roll (about the newest ), and the shorthand .


Level 1 — Recognition

L1.1 — Spot the singular angle

Problem. In the ZYX convention, at which value(s) of the pitch angle does gimbal lock occur? Which two of the three angles () become redundant there?

Recall Solution

WHAT: We recall the defining configuration. WHY: Gimbal lock is the pitch value that swings the roll axis onto the yaw axis. The middle rotation tilts the last () axis relative to the first () axis. It fully overlaps them when the tilt is a quarter turn: or . Answer: . The yaw and roll become redundant (they combine into one effective angle); pitch is still meaningful.

L1.2 — Name the diverging terms

Problem. The Euler-rate map contains functions of that blow up at lock. Which functions, and what value do they approach at ?

Recall Solution

WHAT: Read the kinematic matrix from the parent note. WHY: The entries feeding and carry the singular functions. The dangerous terms are and . As , , so both . Answer: and .


Level 2 — Application

L2.1 — Rate blow-up, numerically

Problem. With , body rate , and , compute at . Then compute it at . By what factor did it grow?

Recall Solution

WHAT: Plug into the yaw-rate row of the kinematic map. WHY: We want to feel how fast the coordinate rate diverges near lock. The relevant row is . With : , so At : , so . At : , so . Answer: then ; a 10× jump for a 10× closer approach to . A finite demands an exploding .

L2.2 — Which combination survives?

Problem. At you set . Give another pair producing the identical orientation .

Recall Solution

WHAT: Use the collapse rule " depends only on at ." WHY: Any pair with the same difference yields the same matrix. Here . Pick any with difference , e.g. or . Answer: e.g. — same as .


Level 3 — Analysis

L3.1 — Derive the collapse for

Problem. The parent note states that at the matrix depends only on . Show by direct multiplication that at it depends only on .

Recall Solution

WHAT: Set and multiply . WHY: We test the other singular pitch directly, rather than trusting symmetry blindly. First, . Multiplying out (same procedure as the parent's case) gives

WHAT IT LOOKS LIKE: every nonzero off-column entry is a function of the single combination . Answer: Increasing by and decreasing by leaves unchanged ⇒ effective DOF is . Confirmed.

L3.2 — Why becomes

Problem. Explain geometrically why the surviving combination flips sign between and .

Figure — Gimbal lock — problem with Euler angles at θ = ±90°
Recall Solution

WHAT: Compare where the roll axis lands after of pitch. WHY: The sign of the combination is set by whether the roll axis lands parallel or anti-parallel to the yaw axis. WHAT IT LOOKS LIKE: In the figure, pitching tips the body -axis to point along , so a yaw and a roll of equal size add up as co-rotations about the same directed axis — but yaw is applied before the tilt and roll after, and the intervening flip reverses one sense, leaving the difference . Pitching tips the -axis to point along (anti-parallel), reversing that intervening sense again, so now the sum survives. Answer: The middle tilt sends the roll axis to ; the sign of that landing direction flips the relative sense of the two remaining rotations, turning into .


Level 4 — Synthesis

L4.1 — Locate the singularity via the Jacobian determinant

Problem. The Euler-rate matrix maps body rates to . Its inverse (mapping Euler rates to body rates) has determinant . Use this to argue that the singularities of the forward map are exactly , and nowhere else.

Recall Solution

WHAT: Relate singularity of a map to the vanishing of a determinant. WHY (which tool and why this one): A linear map loses invertibility ⇔ its matrix has zero determinant. This is the algebraic detector of "a direction got squashed to nothing" — exactly the DOF loss we're chasing. We use the determinant because it is a single scalar whose zeros pin down all singular configurations at once. Since , the forward map blows up precisely where . Over the pitch range used for a chart, only at . WHAT IT LOOKS LIKE: the determinant is a smooth cosine bump, at (perfectly invertible) and pinching to at the two poles. Answer: Singularities of the forward Euler-rate map are exactly ; the map is well-conditioned only away from those poles, worst near them.

Figure — Gimbal lock — problem with Euler angles at θ = ±90°

L4.2 — Build a "gimbal-lock detector"

Problem. You are given a rotation matrix and told it came from ZYX Euler angles. From the parent's general ZYX matrix, the pitch is recovered as (row 3, column 1). Explain how to detect that you are at or near lock directly from , and what goes wrong in extracting there.

Recall Solution

WHAT: Read off the single entry that encodes pitch. WHY: In the general ZYX matrix the entry equals , isolating pitch from the other two angles. Lock is . So flag lock when is within a tolerance of , e.g. (that's within of a pole). WHY it breaks: the usual formulas and read entries that have collapsed to zero at lock (see the parent's matrix: ). You get — undefined. Only the combination is recoverable, from the surviving entries . Answer: Detect lock by ; near lock, split the ambiguity by convention (e.g. set and solve ), because only is uniquely defined.


Level 5 — Mastery

L5.1 — Prove quaternions have no such singularity

Problem. A unit quaternion with maps to a rotation matrix with all entries polynomial in (no divisions). Argue that this representation has no orientation where a degree of freedom is lost, and identify its only redundancy.

Recall Solution

WHAT: Contrast the algebraic form of the quaternion→ map with the Euler map. WHY (which tool and why): Singularities of a coordinate map appear as divisions by a vanishing quantity or a rank-dropping Jacobian. So we inspect the map's formula for any denominator that can hit zero. The rotation from a unit quaternion is, e.g. for the first row, pure polynomials, no , no denominator anywhere. There is no value of on the unit sphere that makes an entry blow up. The redundancy: and give the identical (both rows contain products like , , and squares, all invariant under flipping every sign). This is a two-to-one cover — but it never loses a direction: the map's Jacobian stays full rank everywhere on . WHAT IT LOOKS LIKE: picture wrapping smoothly and doubly over the rotation group with no pinch points — versus the Euler chart, which pinches shut at the two poles. Answer: No singular orientation (no lost DOF); the only quirk is the harmless sign ambiguity . See Quaternions and Singularities of coordinate charts.

L5.2 — The unavoidable-singularity theorem (conceptual)

Problem. It is a topological fact that no set of three angles (a 3-parameter chart) can cover the rotation group smoothly everywhere. Given this, is it possible to design a "better Euler-like set" of three angles that has no gimbal lock anywhere? What is the actual escape?

Recall Solution

WHAT: Apply the "hairy sphere"-style obstruction: is not globally chartable by 3 parameters without a singularity. WHY: has a curved global topology (it is ); any single 3-angle chart is like a flat map of the round Earth — it must tear or pinch somewhere. You can move the singularity (a different axis order puts lock at a different pitch) but never delete it. The escape: Don't insist on a 3-parameter chart. Use a 4-parameter, one-constraint representation (quaternions: 4 numbers, ) or the -number rotation matrix ( with 6 constraints). Extra parameters buy you a smooth global description at the cost of a redundancy — but redundancy lost DOF. Answer: No — every 3-angle set has a lock somewhere; the fix is to leave the "three-angle" family entirely for internal computation (quaternions / rotation matrices), converting to Euler angles only for human display, exactly as the parent note's engineer's fix prescribes. See Rotation matrices SO(3) and Attitude determination and control.


Flashcards

At what pitch does ZYX gimbal lock occur, and which angles fuse?
; yaw and roll fuse into one effective angle.
Near , a body rate gives what (with )?
About , since .
What is for the Euler-rate map, and why does it locate lock?
; it vanishes exactly at , the only singular pitches.
Why do quaternions have no gimbal lock?
Their rotation map is polynomial (no ), full-rank Jacobian everywhere; only redundancy is .
Can any 3-angle chart cover singularity-free?
No — topology forbids it; you can move lock but not delete it. Use 4-parameter quaternions instead.

Connections

  • Euler angles — the representation exercised here
  • Quaternions — the singularity-free fix proven in L5
  • Rotation matrices SO(3) — the group being parametrised
  • Angular velocity kinematics — source of the rate blow-up (L2, L4)
  • Attitude determination and control — where these traps bite in GNC
  • Singularities of coordinate charts — the topological obstruction behind L5
  • Apollo Guidance Computer — the historic system that had to design around lock