Introducing Euler Angles
A common requirement when modelling a dynamics system is the tracking of a bodies orientation. A common way to express orientation is through the use of Euler Angles; a sequence of 3 rotations, starting from some base inertial frame to the moving body. These are also commonly intrinsic, meaning that each sequential rotation is about the previous rotated co-ordinate system, rather than the inertial co-ordinate system. These rotation angles are denoted as:
- Roll - ϕ - about any X axis
- Pitch - θ - about any Y axis
- Yaw - ψ - about any Z axis
There are 12 different variations of Euler Angles which differ in the axes in which each of these sequential rotations take place. For example, it would be equally valid to:
-
Yaw about inertial Z axis, Pitch about intermediate Y' axis, Roll about intermediate X'' axis
-
Roll about inertial X axis, Pitch about intermediate Y' axis, Yaw about intermediate Z'' axis
The choice of which variation to use to model a system is often determined by one of the following:
- Chosen for you by a piece of software you are using
- Chosen to match human intuitions about a system
- Chosen to match a standard set of engineering conventions
These 12 variations are generally broken into 2 groups; Euler Angles and Tait-Bryan Angles.
Euler Angles always take the form A−B−A′, where the first and last rotation are about the same axes, except one is in the base inertial frame, and one is the 2nd intermediate axes.
Tait-Bryan Angles always take the form A−B−C where there are no repeats in the use of axes.
The only difference for this post is that each set of Euler Angles must be expressed in a slightly different form to account for the choice of which axes are being rotated around, whereas each set of Tait-Bryan Angles can be expressed in the same form.
Expressing Angular Velocity
There is also a common requirement to express the angular velocity of a system, not in terms of the rates of change of these Euler-Angles, but as a body-fixed angular velocity. This might be because you are considering kinetic energies or because you are using an IMU to track motion.
The conversion between body-fixed angular velocities and Euler-Angle rates involves a fair ammount of linear-algebra. Many places on the web provide a conversion that an engineer can refer to, but it often it is only expressed for 1 of the 12 variations of Euler-Angles. In this post I have attempted to provide a comprehensive list, automated using symbolic math.
Euler Angle Conversions
x-y-x / Roll-Pitch-Roll'
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡cos(θ)sin(θ)sin(ϕ′)cos(ϕ′)sin(θ)0cos(ϕ′)−sin(ϕ′)100⎦⎥⎤⋅⎣⎢⎡ϕ˙θ˙ϕ˙′⎦⎥⎤
⎣⎢⎡ϕ˙θ˙ϕ˙′⎦⎥⎤=⎣⎢⎡001sin(ϕ′)/sin(θ)cos(ϕ′)−sin(ϕ′)/tan(θ)cos(ϕ′)/sin(θ)−sin(ϕ′)−cos(phi′)/tan(θ)⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
x-z-x / Roll-Yaw-Roll'
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡cos(ψ)−cos(ϕ′)sin(ψ)sin(ϕ′)sin(ψ)0sin(ϕ′)cos(ϕ′)100⎦⎥⎤⋅⎣⎢⎡ϕ˙ψ˙ϕ˙′⎦⎥⎤
⎣⎢⎡ϕ˙ψ˙ϕ˙′⎦⎥⎤=⎣⎢⎡01−cos(ϕ′)/sin(ψ)sin(ϕ′)cos(ϕ′)/tan(ψ)sin(ϕ′)/sin(ψ)cos(ϕ′)−sin(ϕ′)/tan(ψ)⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
y-x-y / Pitch-Roll-Pitch'
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡sin(θ′)sin(ϕ)cos(ϕ)−cos(θ′)sin(ϕ)cos(θ′)0sin(θ′)010⎦⎥⎤⋅⎣⎢⎡θ˙ϕ˙θ˙′⎦⎥⎤
⎣⎢⎡θ˙ϕ˙θ˙′⎦⎥⎤=⎣⎢⎡sin(θ′)/sin(ϕ)cos(θ′)−sin(θ′)/tan(ϕ)001−cos(θ′)/sin(ϕ)sin(θ′)cos(θ′)/tan(ϕ)⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
y-z-y / Pitch-Yaw-Pitch'
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡cos(θ′)sin(ψ)cos(ψ)sin(θ′)sin(ψ)−sin(θ′)0cos(θ′)010⎦⎥⎤⋅⎣⎢⎡θ˙ψ˙θ˙′⎦⎥⎤
⎣⎢⎡θ˙ψ˙θ˙′⎦⎥⎤=⎣⎢⎡cos(θ′)/sin(ψ)−sin(θ′)−cos(θ′)cos(ψ)/sin(ψ)001sin(θ′)/sin(ψ)cos(θ′)−cos(ψ)sin(θ′)/sin(ψ)⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
z-x-z / Yaw-Roll-Yaw'
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡sin(ϕ)sin(ψ′)cos(ψ′)sin(ϕ)cos(ϕ)cos(ψ′)−sin(ψ′)0001⎦⎥⎤⋅⎣⎢⎡ψ˙ϕ˙ψ˙′⎦⎥⎤
⎣⎢⎡ψ˙ϕ˙ψ˙′⎦⎥⎤=⎣⎢⎡sin(ψ′)/sin(ϕ)cos(ψ′)−cos(ϕ)sin(ψ′)/sin(ϕ)cos(ψ′)/sin(ϕ)−sin(ψ′)−cos(ϕ)cos(ψ′)/sin(ϕ)001⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
z-y-z / Yaw-Pitch-Yaw'
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡cos(ψ′)sin(θ)sin(θ)sin(ψ′)cos(θ)sin(ψ′)cos(ψ′)0001⎦⎥⎤⋅⎣⎢⎡ψ˙θ˙ψ˙′⎦⎥⎤
⎣⎢⎡ψ˙θ˙ψ˙′⎦⎥⎤=⎣⎢⎡cos(ψ′)/sin(θ)sin(ψ′)cos(θ)cos(ψ′)/sin(θ)sin(ψ′)/sin(θ)cos(ψ′)−cos(θ)sin(ψ′)/sin(θ)001⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
Tait-Bryan Angle Conversions
x-y-z / Roll-Pitch-Yaw
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡cos(θ)cos(ψ)−cos(θ)sin(ψ)sin(θ)sin(ψ)cos(ψ)0001⎦⎥⎤⋅⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤
⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤=⎣⎢⎡cos(ψ)/cos(θ)sin(ψ)−cos(ψ)sin(θ)/cos(θ)−sin(ψ)/cos(θ)cos(ψ)sin(θ)sin(ψ)/cos(θ)001⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
x-z-y / Roll-Yaw-Pitch
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡cos(θ)cos(ψ)−sin(ψ)cos(ψ)sin(θ)010−sin(θ)0cos(θ)⎦⎥⎤⋅⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤
⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤=⎣⎢⎡cos(θ)/cos(ψ)cos(θ)tan(ψ)−sin(θ)010sin(θ)/cos(ψ)sin(θ)tan(ψ)cos(θ)⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
y-x-z / Pitch-Roll-Yaw
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡cos(ψ)−sin(ψ)0cos(ϕ)sin(ψ)cos(ϕ)cos(ψ)−sin(ϕ)001⎦⎥⎤⋅⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤
⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤=⎣⎢⎡cos(ψ)sin(ψ)/cos(ϕ)tan(ϕ)sin(ψ)−sin(ψ)cos(ψ)/cos(ϕ)cos(ψ)tan(ϕ)001⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
y-z-x / Pitch-Yaw-Roll
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡100sin(ψ)cos(ϕ)cos(ψ)−cos(ψ)sin(ϕ)0sin(ϕ)cos(ϕ)⎦⎥⎤⋅⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤
⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤=⎣⎢⎡00−cos(ϕ)tan(ψ)cos(ϕ)/cos(ψ)sin(ϕ)sin(ϕ)tan(ψ)−sin(ϕ)/cos(ψ)cos(ϕ)⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
z-x-y / Yaw-Roll-Pitch
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡cos(θ)0sin(θ)010−cos(ϕ)sin(θ)sin(ϕ)cos(θ)cos(ϕ)⎦⎥⎤⋅⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤
⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤=⎣⎢⎡cos(θ)sin(θ)tan(ϕ)−sin(θ)/cos(ϕ)010sin(θ)−cos(θ)tan(ϕ)cos(θ)/cos(ϕ)⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤
z-y-x / Yaw-Pitch-Roll
⎣⎢⎡ωxωyωz⎦⎥⎤=⎣⎢⎡1000cos(ϕ)−sin(ϕ)−sin(θ)cos(θ)sin(ϕ)cos(θ)cos(ϕ)⎦⎥⎤⋅⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤
⎣⎢⎡ϕ˙θ˙ψ˙⎦⎥⎤=⎣⎢⎡00tan(θ)sin(ϕ)cos(ϕ)sin(ϕ)/cos(θ)cos(ϕ)tan(θ)−sin(ϕ)cos(ϕ)/cos(θ)⎦⎥⎤⋅⎣⎢⎡ωxωyωz⎦⎥⎤