Dynamics03 - Rotation Matrices
Dynamics03 - Rotation Matrices
frames
Lecture #03
Summary: Right-hand-rule
𝒙𝒙 𝒙𝒙
Going from 𝒙𝒙 to 𝒚𝒚 you find 𝒛𝒛
𝒛𝒛
𝒙𝒙
Order and direction of rotations
• Importance of the order of rotations
• Space-fixed rotations
• Body-fixed rotations
Order and direction of rotations
Order and direction of rotations
Example System
𝜔𝜔
shaft
disc
clevis
𝛽𝛽
Ω
Subject overview
𝑑𝑑𝒑𝒑 𝑑𝑑 𝑔𝑔 𝐺𝐺 𝑑𝑑
� 𝑭𝑭 = 𝒑𝒑̇ = = 𝐈𝐈 𝑚𝑚𝒗𝒗
= −�
𝐺𝐺 = 𝜌𝜌𝑃𝑃 𝑟𝑟𝑥𝑥 𝑟𝑟𝑚𝑚 𝒓𝒓̇ 𝐺𝐺
𝑦𝑦 𝑑𝑑𝑑𝑑 � 𝜌𝜌𝑃𝑃 𝑟𝑟𝑥𝑥2𝑔𝑔 + 𝑟𝑟𝑧𝑧2𝑔𝑔 𝑑𝑑𝑑𝑑 − � 𝜌𝜌𝑃𝑃 𝑟𝑟𝑦𝑦𝑔𝑔 𝑟𝑟𝑧𝑧𝑔𝑔 𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑
𝑔𝑔 𝑔𝑔
𝑉𝑉 𝑉𝑉 𝑉𝑉
𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑 𝑉𝑉 𝑉𝑉
Why rotation matrices?
Because we need a systematic way to represent orientations of
objects and coordinate systems in a 3D world.
Rotation matrices
Because we need a
convenient tool to
transform between {𝑟𝑟}
representations of vectors
{𝑡𝑡}
in different coordinate
systems (frames).
Notation 𝑂𝑂
{r} is the
{t} is the
Notation
The rotation matrix
from the
to the is
{𝑟𝑟}
denoted:
𝑡𝑡 𝐑𝐑 {𝑡𝑡}
𝑟𝑟
𝑡𝑡 𝑡𝑡 𝑟𝑟
𝑟𝑟⃗𝑂𝑂𝑂𝑂 = 𝑟𝑟𝐑𝐑 𝑟𝑟⃗𝑂𝑂𝑂𝑂
Assume that the vector from the origin of the to the origin of the
𝑂𝑂𝑟𝑟 is known in the robot frame as:
𝑥𝑥𝑜𝑜
𝑟𝑟
𝒓𝒓𝑂𝑂𝑟𝑟 𝑂𝑂𝑡𝑡 = 𝑦𝑦𝑜𝑜
𝑧𝑧𝑜𝑜
Introductory example
Find the vector from the origin of the to point 𝑃𝑃 given that
the rotation matrix from the to the is:
Answer:
𝑃𝑃 𝑎𝑎 𝑏𝑏 𝑐𝑐 𝑥𝑥𝑃𝑃,𝑡𝑡 𝑥𝑥𝑜𝑜
It is known that: 𝑟𝑟𝑡𝑡𝐑𝐑= 𝑑𝑑 𝑒𝑒 𝑓𝑓 , 𝑡𝑡
𝒓𝒓𝑂𝑂𝑡𝑡𝑃𝑃 = 𝑦𝑦𝑃𝑃,𝑡𝑡 , 𝑟𝑟𝒓𝒓𝑂𝑂𝑟𝑟 𝑂𝑂𝑡𝑡 = 𝑦𝑦𝑜𝑜
𝑂𝑂𝑡𝑡 𝑔𝑔 ℎ 𝑖𝑖 𝑧𝑧𝑃𝑃,𝑡𝑡 𝑧𝑧𝑜𝑜
Therefore:
𝑟𝑟
𝒓𝒓𝑂𝑂𝑟𝑟 𝑃𝑃 = 𝑟𝑟𝒓𝒓𝑂𝑂𝑟𝑟 𝑂𝑂𝑡𝑡 + 𝑟𝑟𝒓𝒓𝑂𝑂𝑡𝑡𝑃𝑃
𝑟𝑟
𝒓𝒓𝑂𝑂𝑟𝑟 𝑃𝑃 = 𝑟𝑟𝒓𝒓𝑂𝑂𝑟𝑟 𝑂𝑂𝑡𝑡 + 𝑟𝑟𝑡𝑡𝐑𝐑 𝑡𝑡𝒓𝒓𝑂𝑂𝑡𝑡𝑃𝑃
𝑂𝑂𝑟𝑟
𝑥𝑥𝑜𝑜 𝑎𝑎 𝑏𝑏 𝑐𝑐 𝑥𝑥𝑃𝑃,𝑡𝑡
𝑟𝑟
𝒓𝒓𝑂𝑂𝑟𝑟 𝑃𝑃 = 𝑦𝑦𝑜𝑜 + 𝑑𝑑 𝑒𝑒 𝑓𝑓 𝑦𝑦𝑃𝑃,𝑡𝑡 = ⋯
𝑧𝑧𝑜𝑜 𝑔𝑔 ℎ 𝑖𝑖 𝑧𝑧𝑃𝑃,𝑡𝑡
Finding a rotation matrix – a general approach 2D
𝑦𝑦�𝑎𝑎 𝑦𝑦�𝑏𝑏 𝑦𝑦�𝑏𝑏 𝑦𝑦�𝑎𝑎
𝑣𝑣𝑦𝑦𝑎𝑎 𝜃𝜃
𝑥𝑥�𝑏𝑏 𝑥𝑥�𝑏𝑏
𝒗𝒗 𝑣𝑣𝑦𝑦𝑏𝑏 𝒗𝒗 𝑣𝑣𝑥𝑥𝑏𝑏
𝑥𝑥�𝑎𝑎 𝜃𝜃 𝑥𝑥�𝑎𝑎
𝑣𝑣𝑥𝑥𝑎𝑎
𝑏𝑏
𝑣𝑣𝑥𝑥𝑎𝑎 𝑣𝑣𝑥𝑥𝑏𝑏 𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑏𝑏 𝑏𝑏𝑥𝑥�𝑏𝑏 + 𝑣𝑣𝑦𝑦𝑏𝑏 𝑏𝑏𝑦𝑦�𝑏𝑏
𝑏𝑏
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑦𝑦𝑎𝑎 𝑣𝑣⃗ = 𝑣𝑣𝑦𝑦𝑏𝑏
0 0 1 cos 𝜃𝜃
𝑏𝑏
𝑥𝑥�𝑏𝑏 = 0 → 𝑎𝑎𝑥𝑥�𝑏𝑏 = sin 𝜃𝜃
𝑏𝑏
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑎𝑎 𝑎𝑎𝑥𝑥̂𝑎𝑎 + 𝑣𝑣𝑦𝑦𝑎𝑎 𝑎𝑎𝑦𝑦𝑎𝑎̂ 𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑏𝑏 𝑏𝑏𝑥𝑥�𝑏𝑏 + 𝑣𝑣𝑦𝑦𝑏𝑏 𝑏𝑏𝑦𝑦�𝑏𝑏 0 0
1 0 1 0 0 −sin 𝜃𝜃
𝑏𝑏
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑎𝑎 0 + 𝑣𝑣𝑦𝑦𝑎𝑎 1 𝑏𝑏
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑏𝑏 0 + 𝑣𝑣𝑦𝑦𝑏𝑏 1 𝑦𝑦�𝑏𝑏 = 1 → 𝑎𝑎𝑦𝑦�𝑏𝑏 = cos 𝜃𝜃
0 0 0 0 0 0
Finding a rotation matrix – a general approach 2D
𝑦𝑦�𝑎𝑎 𝑦𝑦�𝑏𝑏 𝑦𝑦�𝑏𝑏 𝑦𝑦�𝑎𝑎
𝑣𝑣𝑦𝑦𝑎𝑎 𝜃𝜃
𝑥𝑥�𝑏𝑏 𝑥𝑥�𝑏𝑏
𝒗𝒗 𝑣𝑣𝑦𝑦𝑏𝑏 𝒗𝒗 𝑣𝑣𝑥𝑥𝑏𝑏
𝑥𝑥�𝑎𝑎 𝜃𝜃 𝑥𝑥�𝑎𝑎
𝑣𝑣𝑥𝑥𝑎𝑎
𝑏𝑏
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑏𝑏 𝑏𝑏𝑥𝑥�𝑏𝑏 + 𝑣𝑣𝑦𝑦𝑏𝑏 𝑏𝑏𝑦𝑦�𝑏𝑏
𝑏𝑏
𝑣𝑣𝑥𝑥𝑎𝑎 𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑏𝑏 𝑏𝑏𝑥𝑥�𝑏𝑏 + 𝑣𝑣𝑦𝑦𝑏𝑏 𝑏𝑏𝑦𝑦�𝑏𝑏
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑦𝑦𝑎𝑎
0 𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑏𝑏 𝑎𝑎𝑥𝑥�𝑏𝑏 + 𝑣𝑣𝑦𝑦𝑏𝑏 𝑎𝑎𝑦𝑦�𝑏𝑏 1 cos 𝜃𝜃
𝑏𝑏
𝑥𝑥�𝑏𝑏 = 0 → 𝑎𝑎𝑥𝑥�𝑏𝑏 = sin 𝜃𝜃
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑎𝑎 𝑎𝑎𝑥𝑥̂𝑎𝑎 + 𝑣𝑣𝑦𝑦𝑎𝑎 𝑎𝑎𝑦𝑦𝑎𝑎̂ cos 𝜃𝜃 −sin 𝜃𝜃 0 0
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑏𝑏 sin 𝜃𝜃 + 𝑣𝑣𝑦𝑦𝑏𝑏 cos 𝜃𝜃
1 0 0 −sin 𝜃𝜃
0 0 𝑏𝑏
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑎𝑎 0 + 𝑣𝑣𝑦𝑦𝑎𝑎 1 𝑦𝑦�𝑏𝑏 = 1 → 𝑎𝑎𝑦𝑦�𝑏𝑏 = cos 𝜃𝜃
0 0 0 0
Finding a rotation matrix – a general approach 2D
𝑦𝑦�𝑎𝑎
Comparing the results
𝑣𝑣𝑥𝑥𝑎𝑎
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑦𝑦𝑎𝑎 𝑣𝑣𝑦𝑦𝑎𝑎
0 𝒗𝒗
𝑣𝑣𝑥𝑥𝑎𝑎 𝑥𝑥�𝑎𝑎
cos 𝜃𝜃 −sin 𝜃𝜃
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑏𝑏 sin 𝜃𝜃 + 𝑣𝑣𝑦𝑦𝑏𝑏 cos 𝜃𝜃 𝑦𝑦�𝑎𝑎
𝑦𝑦�𝑏𝑏
0 0 𝑦𝑦�𝑏𝑏
+ 𝜃𝜃 𝑥𝑥�𝑏𝑏
Write it in matrix form 𝑥𝑥�𝑏𝑏
𝑣𝑣𝑥𝑥𝑎𝑎 cos 𝜃𝜃 − sin 𝜃𝜃 0 𝑣𝑣𝑥𝑥𝑏𝑏 𝑣𝑣𝑦𝑦𝑏𝑏 𝒗𝒗 𝑣𝑣𝑥𝑥𝑏𝑏
𝑎𝑎 𝜃𝜃 𝑥𝑥�𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑦𝑦𝑎𝑎 = sin 𝜃𝜃 cos 𝜃𝜃 0 𝑣𝑣𝑦𝑦𝑏𝑏
0 0 0 1 0
𝑎𝑎
𝑣𝑣⃗ = 𝑎𝑎𝑏𝑏𝐑𝐑 𝑏𝑏𝑣𝑣⃗
Finding a rotation matrix – a general approach
Steps to constructing a general rotation matrix:
1.Representing a general vector in frame {𝑎𝑎}
2.Representing a general vector in frame {𝑏𝑏}
3.Representing the axes of frame {𝑏𝑏} in frame {𝑎𝑎}
4.Substituting the result from step 3. into step 2.
5.Comparing the result of step 4. to step 1.
6.Extracting the rotation matrix from the resulting equation.
Finding a rotation matrix – a general approach 2D
𝑦𝑦�𝑎𝑎 𝑦𝑦�𝑏𝑏 𝑦𝑦�𝑎𝑎
Reminder scalar product:
𝑣𝑣𝑦𝑦𝑎𝑎 �𝑎𝑎
𝑣𝑣⃗ · 𝒙𝒙 𝑣𝑣⃗ �𝑎𝑎 cos 𝛼𝛼
𝒙𝒙 𝜃𝜃
𝛽𝛽 𝒗𝒗 𝑥𝑥�𝑏𝑏
𝑎𝑎
𝛼𝛼 �𝑎𝑎 =
𝑣𝑣⃗ = 𝑣𝑣⃗ · 𝒚𝒚 𝑣𝑣⃗ �𝑎𝑎 cos 𝛽𝛽
𝒙𝒙
𝑥𝑥�𝑎𝑎 𝑣𝑣⃗ · 𝒛𝒛� 𝑎𝑎 𝑣𝑣⃗ �𝑎𝑎 cos 𝛾𝛾
𝒙𝒙 𝜃𝜃 𝑥𝑥�𝑎𝑎
𝑣𝑣𝑥𝑥𝑎𝑎
𝜋𝜋
𝛼𝛼 + 𝛽𝛽 = ∴ cos 𝛽𝛽 = sin 𝛼𝛼 𝑏𝑏
𝑣𝑣𝑥𝑥𝑎𝑎 2 𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑏𝑏 𝑏𝑏𝑥𝑥�𝑏𝑏 + 𝑣𝑣𝑦𝑦𝑏𝑏 𝑏𝑏𝑦𝑦�𝑏𝑏
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑦𝑦𝑎𝑎
0 �𝑎𝑎
𝑥𝑥�𝑏𝑏 · 𝒙𝒙 cos 𝜃𝜃 1 cos 𝜃𝜃
𝑎𝑎 𝑏𝑏
�𝑎𝑎 = sin 𝜃𝜃
𝑥𝑥�𝑏𝑏 = 𝑥𝑥�𝑏𝑏 · 𝒚𝒚 𝑥𝑥�𝑏𝑏 = 0 → 𝑎𝑎𝑥𝑥�𝑏𝑏 = sin 𝜃𝜃
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑎𝑎 𝑎𝑎𝑥𝑥�𝑎𝑎 + 𝑣𝑣𝑦𝑦𝑎𝑎 𝑎𝑎𝑦𝑦�𝑎𝑎 𝑥𝑥�𝑏𝑏 · 𝒛𝒛� 𝑎𝑎 0 0 0
1 0 0 −sin 𝜃𝜃
𝑏𝑏
𝑎𝑎
𝑣𝑣⃗ = 𝑣𝑣𝑥𝑥𝑎𝑎 0 + 𝑣𝑣𝑦𝑦𝑎𝑎 1 𝑦𝑦�𝑏𝑏 = 1 → 𝑎𝑎𝑦𝑦�𝑏𝑏 = cos 𝜃𝜃
0 0 0 0
Finding a rotation matrix – a general approach
Steps to constructing a general rotation matrix:
1.Representing a general vector in frame {𝑎𝑎}
2.Representing a general vector in frame {𝑏𝑏}
3.Representing the axes of frame {𝑏𝑏} in frame {𝑎𝑎}
4.Substituting the result from step 3. into step 2.
5.Comparing the result of step 4. to step 1.
6.Extracting the rotation matrix from the resulting equation.
Finding a rotation matrix – 3D general approach
𝒙𝒙𝑏𝑏
Finding a rotation matrix – 3D general approach
𝒚𝒚𝑎𝑎 0 �𝑏𝑏 · 𝒙𝒙
𝒚𝒚 �𝑎𝑎
𝑏𝑏
�𝑏𝑏 = 1 → 𝑎𝑎𝒚𝒚𝑏𝑏 = 𝒚𝒚
𝒚𝒚 �𝑏𝑏 · 𝒚𝒚
�𝑎𝑎
0 �𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝒚𝒚
𝒙𝒙𝑎𝑎
𝒙𝒙𝑏𝑏 0 �𝑎𝑎
𝒛𝒛� 𝑏𝑏 · 𝒙𝒙
𝑏𝑏 𝑎𝑎
𝒛𝒛� 𝑏𝑏 = 0 → �𝑎𝑎
𝒛𝒛𝑏𝑏 = 𝒛𝒛� 𝑏𝑏 · 𝒚𝒚
1 𝒛𝒛� 𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
Finding a rotation matrix – 3D general approach
Step 4: Substituting the result from step 3. into step 2. 𝒛𝒛𝑏𝑏 𝒛𝒛𝑎𝑎
Step 2 𝒚𝒚𝑏𝑏
𝑥𝑥𝑏𝑏 𝒚𝒚𝑎𝑎
𝑏𝑏 𝒗𝒗
𝒗𝒗 = 𝑦𝑦𝑏𝑏 = 𝑥𝑥𝑏𝑏 𝑏𝑏𝒙𝒙
�𝑏𝑏 + 𝑦𝑦𝑏𝑏 𝑏𝑏𝒚𝒚
�𝑏𝑏 + 𝑧𝑧𝑏𝑏 𝑏𝑏𝒛𝒛� 𝑏𝑏 𝒙𝒙𝑎𝑎
𝒙𝒙𝑏𝑏
𝑧𝑧𝑏𝑏
Step 3
1 �𝑏𝑏 · 𝒙𝒙
𝒙𝒙 �𝑎𝑎
𝑎𝑎 𝑎𝑎 𝑎𝑎 𝑎𝑎 𝑏𝑏
�𝑏𝑏 = 0 → 𝑎𝑎𝒙𝒙𝑏𝑏 = 𝒙𝒙
𝒗𝒗 = 𝑥𝑥𝑏𝑏 � �
𝒙𝒙𝑏𝑏 + 𝑦𝑦𝑏𝑏 𝒚𝒚𝑏𝑏 + 𝑧𝑧𝑏𝑏 𝒛𝒛� 𝑏𝑏 𝒙𝒙 �𝑎𝑎
�𝑏𝑏 · 𝒚𝒚
0 �𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝒙𝒙
�𝑏𝑏 · 𝒙𝒙
𝒙𝒙 �𝑎𝑎 �𝑏𝑏 · 𝒙𝒙
𝒚𝒚 �𝑎𝑎 �𝑎𝑎
𝒛𝒛� 𝑏𝑏 · 𝒙𝒙 𝑏𝑏
0 �𝑏𝑏 · 𝒙𝒙
𝒚𝒚 �𝑎𝑎
�𝑏𝑏 = 1 → 𝑎𝑎𝒚𝒚𝑏𝑏 = 𝒚𝒚
𝒚𝒚 �𝑎𝑎
�𝑏𝑏 · 𝒚𝒚
𝑎𝑎
𝒗𝒗 = 𝑥𝑥𝑏𝑏 �𝑏𝑏 · 𝒚𝒚
𝒙𝒙 �𝑏𝑏 · 𝒚𝒚
�𝑎𝑎 + 𝑦𝑦𝑏𝑏 𝒚𝒚 �𝑎𝑎 + 𝑧𝑧𝑏𝑏 �𝑎𝑎
𝒛𝒛� 𝑏𝑏 · 𝒚𝒚 0 �𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝒚𝒚
�𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝒙𝒙 �𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝒚𝒚 𝒛𝒛� 𝑏𝑏 · 𝒛𝒛� 𝑎𝑎 �𝑎𝑎
𝒛𝒛� 𝑏𝑏 · 𝒙𝒙
0
𝑏𝑏 𝑎𝑎
𝒛𝒛� 𝑏𝑏 = 0 → �𝑎𝑎
𝒛𝒛𝑏𝑏 = 𝒛𝒛� 𝑏𝑏 · 𝒚𝒚
1 𝒛𝒛� 𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
Finding a rotation matrix – 3D general approach
𝑥𝑥𝑎𝑎 �𝑏𝑏 · 𝒙𝒙
𝒙𝒙 �𝑎𝑎 �𝑏𝑏 · 𝒙𝒙
𝒚𝒚 �𝑎𝑎 �𝑎𝑎
𝒛𝒛� 𝑏𝑏 · 𝒙𝒙 𝑥𝑥𝑏𝑏
𝑎𝑎 𝑦𝑦𝑏𝑏 = 𝑎𝑎𝑏𝑏𝐑𝐑 𝑏𝑏𝒗𝒗
𝒗𝒗 = 𝑦𝑦𝑎𝑎 = 𝒙𝒙�𝑏𝑏 · 𝒚𝒚�𝑎𝑎 �𝑏𝑏 · 𝒚𝒚
𝒚𝒚 �𝑎𝑎 �𝑎𝑎
𝒛𝒛� 𝑏𝑏 · 𝒚𝒚
𝑧𝑧𝑎𝑎 �𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝒙𝒙 �𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝒚𝒚 𝒛𝒛� 𝑏𝑏 · 𝒛𝒛� 𝑎𝑎 𝑧𝑧𝑏𝑏
�𝑏𝑏 · 𝒙𝒙
𝒙𝒙 �𝑎𝑎 �𝑏𝑏 · 𝒙𝒙
𝒚𝒚 �𝑎𝑎 �𝑎𝑎
𝒛𝒛� 𝑏𝑏 · 𝒙𝒙
𝑎𝑎 �𝑏𝑏 · 𝒚𝒚
�𝑎𝑎 �𝑏𝑏 · 𝒚𝒚
�𝑎𝑎 �𝑎𝑎
𝑏𝑏 𝐑𝐑 = 𝒙𝒙 𝒚𝒚 𝒛𝒛� 𝑏𝑏 · 𝒚𝒚
�𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝒙𝒙 �𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝒚𝒚 𝒛𝒛� 𝑏𝑏 · 𝒛𝒛� 𝑎𝑎
𝑎𝑎 𝑎𝑎 𝑎𝑎 𝑎𝑎
𝑏𝑏 𝐑𝐑 = �𝑏𝑏
𝒙𝒙 �𝑏𝑏
𝒚𝒚 𝒛𝒛� 𝑏𝑏
𝒙𝒙𝑏𝑏
Negative rotation about the 𝒙𝒙𝑎𝑎 axis of frame {𝑎𝑎}: 𝒛𝒛𝑎𝑎 𝒛𝒛𝑏𝑏
𝒙𝒙𝑏𝑏
Negative rotation about the 𝒙𝒙𝑎𝑎 axis of frame {𝑎𝑎}: 𝒛𝒛𝑎𝑎 𝒛𝒛𝑏𝑏
𝒚𝒚𝑏𝑏
Positive rotation about the 𝒛𝒛𝑎𝑎 axis of frame {𝑎𝑎}:
𝜃𝜃 𝒚𝒚𝑎𝑎
𝒙𝒙𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝜃𝜃
𝑎𝑎
𝑏𝑏𝐑𝐑 =
𝒙𝒙𝑏𝑏 · 𝒚𝒚𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒚𝒚𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒚𝒚𝑎𝑎 𝒙𝒙𝑎𝑎
𝒙𝒙𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒙𝒙𝑏𝑏
𝒙𝒙 − 𝒚𝒚 plain
Negative rotation about the 𝒛𝒛𝑎𝑎 axis of frame {𝑎𝑎}: 𝒛𝒛𝑎𝑎 𝒛𝒛𝑏𝑏
𝒚𝒚𝑏𝑏
Positive rotation about the 𝒛𝒛𝑎𝑎 axis of frame {𝑎𝑎}:
𝜃𝜃 𝒚𝒚𝑎𝑎
𝒙𝒙𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒙𝒙𝑎𝑎 cos 𝜃𝜃 − sin 𝜃𝜃 0 𝜃𝜃
𝑎𝑎
𝑏𝑏𝐑𝐑 =
𝒙𝒙𝑏𝑏 · 𝒚𝒚𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒚𝒚𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒚𝒚𝑎𝑎 = sin 𝜃𝜃 cos 𝜃𝜃 0 𝒙𝒙𝑎𝑎
𝒙𝒙𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒙𝒙𝑏𝑏
0 0 1
𝒙𝒙 − 𝒚𝒚 plain
Negative rotation about the 𝒛𝒛𝑎𝑎 axis of frame {𝑎𝑎}: 𝒛𝒛𝑎𝑎 𝒛𝒛𝑏𝑏
Remark: 𝛼𝛼, 𝛽𝛽 and −𝛾𝛾 in this example are called X-Y-Z Euler angles. A ball joint
Properties of rotation matrices
• Can help in defining an axis/direction in space in a neat way:
1 0 0 cos 𝛽𝛽 0 sin 𝛽𝛽 cos 𝛾𝛾 sin 𝛾𝛾 0
0 0 1 0
3𝐑𝐑 = 0 cos 𝛼𝛼 − sin 𝛼𝛼 − sin 𝛾𝛾 cos 𝛾𝛾 0
0 sin 𝛼𝛼 cos 𝛼𝛼 − sin 𝛽𝛽 0 cos 𝛽𝛽 0 0 1
Remark: 𝛼𝛼, 𝛽𝛽 and −𝛾𝛾 in this example are called X-Y-Z Euler angles. A ball joint
Properties of rotation matrices
Rx = [1 0 0 ; 0 c1 -s1 ; 0 s1 c1];
Rx*Ry*Rz_n
Rotation Matrices
examples
Example 1
0
Given: 𝑎𝑎𝒗𝒗 = 3 , 𝜃𝜃
2
Find: 𝑏𝑏𝒗𝒗 𝒗𝒗
𝒛𝒛𝑏𝑏
𝒛𝒛𝑎𝑎
𝒚𝒚𝑎𝑎
𝜃𝜃
𝜃𝜃
𝒚𝒚𝑏𝑏
Example 1 – constructing the matrix
General expression:
𝒙𝒙𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒙𝒙𝑎𝑎
𝑎𝑎
𝑏𝑏𝐑𝐑 =
𝒙𝒙𝑏𝑏 · 𝒚𝒚𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒚𝒚𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒚𝒚𝑎𝑎
𝒙𝒙𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒗𝒗
𝒛𝒛𝑏𝑏
𝒛𝒛𝑎𝑎
𝒚𝒚𝑎𝑎
𝜃𝜃
𝜃𝜃
𝒚𝒚𝑏𝑏
Example 1
0
𝑎𝑎
Given: 𝒗𝒗 = 3 , 𝜃𝜃 = 30°
2
𝑏𝑏
Find: 𝒗𝒗
Answer:
We can identify negative rotation about 𝒙𝒙𝑎𝑎 . This gives us:
1 0 0 𝒗𝒗
𝑎𝑎
𝒃𝒃𝐑𝐑 = 0 cos 𝜃𝜃 sin 𝜃𝜃
0 −sin 𝜃𝜃 cos 𝜃𝜃
𝒛𝒛𝑏𝑏
But we need the transposed matrix 𝑎𝑎𝑏𝑏𝐑𝐑: 𝒛𝒛𝑎𝑎
1 0 0 𝒚𝒚𝑎𝑎
𝑏𝑏𝐑𝐑 =
0 cos 𝜃𝜃 − sin 𝜃𝜃 𝜃𝜃
𝑎𝑎
0 sin 𝜃𝜃 cos 𝜃𝜃 𝜃𝜃
𝒚𝒚𝑏𝑏
Therefore:
0 0
𝑏𝑏 𝑏𝑏 𝑎𝑎
𝒗𝒗 = 𝑎𝑎𝐑𝐑 𝒗𝒗 = 3 cos 𝜃𝜃 − 2 sin 𝜃𝜃 = 1.5981
3 sin 𝜃𝜃 + 2 cos 𝜃𝜃 3.2321
Example 2
Exercise:
𝒙𝒙𝑏𝑏
Find the rotation matrix 𝑎𝑎𝑏𝑏𝐑𝐑 𝒛𝒛𝑎𝑎
𝒛𝒛𝒃𝒃 𝒙𝒙𝒂𝒂
Example 3
Exercise:
𝒚𝒚1
𝒙𝒙2
𝛼𝛼 𝒙𝒙1
Summary:
Rotation matrices
Create rotation matrices by projecting the unit vectors of one frame {b} on to the
other one {a}
𝒙𝒙𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒙𝒙𝑎𝑎
𝑎𝑎 𝒙𝒙 · 𝒚𝒚 𝒚𝒚 · 𝒚𝒚 𝒛𝒛 · 𝒚𝒚 𝑎𝑎 𝑎𝑎 𝑎𝑎 𝑎𝑎
𝑏𝑏 𝐑𝐑 = 𝑏𝑏 𝑎𝑎 𝑏𝑏 𝑎𝑎 𝑏𝑏 𝑎𝑎 or 𝑏𝑏 𝐑𝐑 = 𝒙𝒙 𝑏𝑏 𝒚𝒚 𝑏𝑏 𝒛𝒛𝑏𝑏
𝒙𝒙𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒛𝒛𝑎𝑎
Positive rotation about the 𝒙𝒙𝑎𝑎 axis of frame {𝑎𝑎}:
1 0 0
𝑎𝑎
𝑏𝑏𝐑𝐑 = 0 cos 𝜃𝜃 − sin 𝜃𝜃
0 sin 𝜃𝜃 cos 𝜃𝜃
Orthonormality: transpose = inverse: 𝑎𝑎𝑏𝑏𝐑𝐑 = 𝑎𝑎𝑏𝑏𝐑𝐑−1 = 𝑎𝑎𝑏𝑏𝐑𝐑𝑇𝑇
Orthonormality implies: 𝑎𝑎𝑏𝑏𝐑𝐑 ⋅ 𝑎𝑎𝑏𝑏𝐑𝐑𝑇𝑇 = 𝑎𝑎𝑏𝑏𝐑𝐑 ⋅ 𝑎𝑎𝑏𝑏𝐑𝐑 = 𝐈𝐈
Cascading rotations is easy: 𝑑𝑑𝑎𝑎𝐑𝐑 = 𝑎𝑎𝑏𝑏𝐑𝐑 𝑏𝑏𝑐𝑐𝐑𝐑 𝑑𝑑𝑐𝑐𝐑𝐑
The order of the rotation is very important.
Example 4
𝜔𝜔
The rotor and shaft are mounted in a
clevis which can rotate about the z- shaft
𝛽𝛽
Ω
Example 4
The rotor and shaft are mounted in a clevis which can 𝜔𝜔
rotate about the z-axis with angular velocity Ω. The
shaft
rotor has an angular velocity 𝜔𝜔.
Top view clevis
disc
𝛽𝛽
𝒛𝒛𝟎𝟎 𝑦𝑦0
𝜃𝜃
𝑥𝑥0
Example 4
The rotor and shaft are mounted in a clevis which can 𝜔𝜔
𝒛𝒛1
rotate about the z-axis with angular velocity Ω. The
shaft
rotor has an angular velocity 𝜔𝜔.
Top view clevis
disc
𝛽𝛽
Ω
𝒚𝒚1
𝒙𝒙1
𝒛𝒛𝟎𝟎 𝑦𝑦0
𝜃𝜃
𝑥𝑥0
Example 4
Top view General expression
𝒙𝒙𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒙𝒙𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒙𝒙𝑎𝑎
𝑎𝑎
𝑏𝑏 𝐑𝐑 =
𝒙𝒙𝑏𝑏 · 𝒚𝒚𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒚𝒚𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒚𝒚𝑎𝑎
𝜃𝜃 𝒙𝒙𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒚𝒚𝑏𝑏 · 𝒛𝒛𝑎𝑎 𝒛𝒛𝑏𝑏 · 𝒛𝒛𝑎𝑎
𝑦𝑦0
𝒛𝒛𝟎𝟎
𝜃𝜃
We want 01𝐑𝐑
𝒛𝒛𝟏𝟏
𝑥𝑥0
cos 𝜃𝜃 −sin 𝜃𝜃 0
𝟎𝟎
𝟏𝟏𝐑𝐑 = sin 𝜃𝜃 cos 𝜃𝜃 0
Let’s write the rotation matrix 01𝐑𝐑 0 0 1
Example 4
𝜔𝜔
Top view
Adding frame {2} 𝑧𝑧2 shaft
disc
clevis
𝛽𝛽
𝒙𝒙𝟐𝟐 𝑦𝑦1
Meriam, Kraige, Bolton, chap. 7 problems
𝒙𝒙𝟏𝟏
𝑦𝑦0
𝜃𝜃 Top
𝑥𝑥0 view
Example 4
Adding frame {2} We want 12𝐑𝐑:
Side view 𝒙𝒙2 · 𝒙𝒙1 𝒚𝒚2 · 𝒙𝒙1 𝒛𝒛2 · 𝒙𝒙1
1
2𝐑𝐑 =
𝒙𝒙2 · 𝒚𝒚1 𝒚𝒚2 · 𝒚𝒚1 𝒛𝒛2 · 𝒚𝒚1
𝑧𝑧1
𝑧𝑧2 𝒙𝒙2 · 𝒛𝒛1 𝒚𝒚2 · 𝒛𝒛1 𝒛𝒛2 · 𝒛𝒛1
𝛽𝛽
𝒙𝒙𝟐𝟐
𝛽𝛽
𝑦𝑦1 1 0 0
1 cos 𝛽𝛽 − sin 𝛽𝛽
𝒙𝒙𝟏𝟏 2𝐑𝐑 = 0
0 sin 𝛽𝛽 cos 𝛽𝛽
𝜔𝜔
𝑧𝑧2 shaft
Example 4
disc
clevis
Adding frame {3}
Top Side
view view
𝑧𝑧3
𝑧𝑧2 𝜔𝜔
𝒛𝒛1
Example 4 shaft 𝑦𝑦3
𝑥𝑥3 𝑦𝑦2
Adding frame {3} clevis 𝑥𝑥2
disc
𝑧𝑧1
𝒚𝒚𝟐𝟐 𝑧𝑧2
𝒚𝒚𝟑𝟑 𝑦𝑦0 𝛽𝛽
𝑦𝑦1
𝜃𝜃 Top Side
𝑥𝑥0 view view
Example 4
We want 23𝐑𝐑:
Adding frame {3} 𝒙𝒙3 · 𝒙𝒙2 𝒚𝒚3 · 𝒙𝒙2 𝒛𝒛3 · 𝒙𝒙2
Side view rotor 2
3𝐑𝐑 =
𝒙𝒙3 · 𝒚𝒚2 𝒚𝒚3 · 𝒚𝒚2 𝒛𝒛3 · 𝒚𝒚2
𝑧𝑧2 𝒙𝒙3 · 𝒛𝒛2 𝒚𝒚3 · 𝒛𝒛2 𝒛𝒛3 · 𝒛𝒛2
𝛾𝛾
𝛾𝛾 cos 𝛾𝛾 0 −sin 𝛾𝛾
𝑥𝑥2
2
3𝐑𝐑 =
0 1 0
sin 𝛾𝛾 0 cos 𝛾𝛾
𝒚𝒚𝟐𝟐
𝒚𝒚𝟑𝟑
𝑧𝑧3
𝑧𝑧2 𝜔𝜔
𝒛𝒛1
Example 4 shaft 𝑦𝑦3
0 𝑥𝑥3 𝑦𝑦2
Find 3𝐑𝐑: clevis 𝑥𝑥2
disc
0
3𝐑𝐑 = 𝟎𝟎1𝐑𝐑 12𝐑𝐑 23𝐑𝐑 𝛽𝛽
Ω
cos 𝜃𝜃 −sin 𝜃𝜃 0 1 0 0 𝒚𝒚1
0
cos 𝜃𝜃 0 0 cos 𝛽𝛽 − sin 𝛽𝛽 𝒙𝒙1
3𝐑𝐑 = sin 𝜃𝜃
0 0 1 0 sin 𝛽𝛽 cos 𝛽𝛽
cos 𝛾𝛾 0 −sin 𝛾𝛾
0 1 0
Meriam, Kraige, Bolton, chap. 7 problems
sin 𝛾𝛾 0 cos 𝛾𝛾
𝑧𝑧1
𝑧𝑧2
0
3𝐑𝐑 =
𝑦𝑦0 𝛽𝛽
𝑦𝑦1
𝜃𝜃 Top Side
𝑥𝑥0 view view
𝑧𝑧3
𝑧𝑧2 𝜔𝜔
𝒛𝒛1
Example 4 shaft 𝑦𝑦3
0 𝑥𝑥3 𝑦𝑦2
Find 3𝐑𝐑: clevis 𝑥𝑥2
disc
0 𝟎𝟎 1 2
3 𝐑𝐑 = 1𝐑𝐑 2𝐑𝐑 3𝐑𝐑 𝛽𝛽
cos 𝜃𝜃 −sin 𝜃𝜃 0 1 0 0
0
3𝐑𝐑 = sin 𝜃𝜃 cos 𝜃𝜃 0 0 cos 𝛽𝛽 − sin 𝛽𝛽 Ω
𝒚𝒚1
0 0 1 0 sin 𝛽𝛽 cos 𝛽𝛽 𝒙𝒙1
cos 𝛾𝛾 0 −sin 𝛾𝛾
0 1 0 Meriam, Kraige, Bolton, chap. 7 problems
sin 𝛾𝛾 0 cos 𝛾𝛾
0
3𝐑𝐑 =