29
Rigid body Rotation Mangal Kothari [email protected] Associate Professor Department of Aerospace Engineering Indian Institute of Technology, Kanpur

Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Rigid body Rotation

Mangal Kothari

[email protected]

Associate Professor

Department of Aerospace Engineering

Indian Institute of Technology, Kanpur

Page 2: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Rotation of Reference Frame

Page 3: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Rotation of Reference Frame

Page 4: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Euler Angles

• Need way to describe attitude of aircraft

• Common approach: Euler angles

• Pro: Intuitive

• Con: Mathematical singularity

– Quaternions are alternative for overcoming singularity

Page 5: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Vehicle-1 Frame

Page 6: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Vehicle-2 Frame

Page 7: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Body Frame

Page 8: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Inertial Frame to Body Frame Transformation

Page 9: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Translational Kinematics

Page 10: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Rotational Kinematics

Inverting gives

Page 11: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

State Equations

Six of the 12 state equations for the UAV come from the kinematic

equations relating positions and velocities:

The remaining six equations will come from applying Newton’s 2nd law

to the translational and rotational motion of the aircraft.

Page 12: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Differentiation of a Vector

Page 13: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Attitude Representation

• 3 Degrees of Freedom

• The most general representation is Rotation matrices

- 9 elements

- cumbersome to use

• Most commonly used representation: Euler angles

-Intuitive Physical interpretation

-Minimalistic representation :

3 parameters for 3 DOF

-But exhibit a phenomenon known as Gimble Lock

Page 14: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation
Page 15: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

What does it imply mathematically?

But Euler angles do

not form an

orthogonal vector.

The Euler rates are

also not orthogonal.

At pitch 900 the

matrix becomes

singular.

Consider a 3-2-1 rotation

Note: The singularity occurs in all Euler angle rotation sequences for the middle rotation

Page 16: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Quaternions

• 4 component extended complex number

• Consists of scalar and vector part

• These are mathematical objects. Can also be used to represent rotations.

- Recall: what does multiplying any complex number by 𝑒𝑖θ does? It rotates the vector by θ!

• Remove singularity at the cost of one more parameter. The main reason they started being used for satellites. Now used extensively for small Aerial vehicles, aerospace robotics, VTOLs, etc.

• Simpler to compose

• Some denote it as (w,x,y,z) with w being the scalar part.

Representation No. of Parameters

Rotation Matrix 9

Euler Angles 3

Quaternions 4

Page 17: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Quaternion Algebra

Have their own definition of operations

Illustration with a right hand rule:

Can be used to define

quaternion product

Page 18: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Properties similar to complex numbers

• Norm:

• Conjugate:

• Inverse:

• Product is non-commutative:

• Product is associative:

Recall

Page 19: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Rotation using Quaternions

• Exercise:

Unit modulus quaternions:

Axis-angle representation

Euler's Rotation Theorem

Any rotation or sequence of rotations of a rigid body or coordinate

system about a fixed point is equivalent to a single rotation by a given

angle θ about a fixed axis (called Euler axis) that runs through the

fixed point.

• Rotation operator:

4 parameters to represent 3 degrees of freedom Must satisfy a constraint

Page 20: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Conventions• In loose terms, Rotation is a directional and relative quantity with a magnitude

(but remember rotation is not a vector!)• Need to first set the rules: Left or right handed?

Rotating frames (passive) or rotating vectors (active)?Direction of operation (in passive case)

Page 21: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Conventions

• Hamilton Notation Order: if go towards left: local to global

• Implications

Local perturbations are compounded to right (post-multiplied)

Global perturbations are compounded to left (pre-multiplied)

• Suppose 1st rotation is given by and 2nd by

if 2nd rotation is defined relatively:

if 2nd rotation is defined globally:

• Similar to Rotation Matrices! - Recall: for a 321 rotation sequence, rotation matrix for

conversion from local to Earth frame is:

What if rotations were defined always with respect to original axis?

(check for yourself!)

Page 22: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

X

Z

Y

X

Z

Y

X

Y

Z

X

Z

Z

’’

Y

’’X

’’

X

Z

Y

X

’’

Z

’’

Y

’’

Y1st

rotation

2nd rotation

Case a

Case b

2nd rotation

Relative

Rotation

Global

Rotation

Page 23: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Derivative

By First Principles

Equivalent

formulas

If the change from

previous attitude to current

attitude is defined locally,

the change in attitude

is post-multiplied.

For small angles

Page 24: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Quaternions vs Euler Angles

• No singularity vs Gimbal lock

• Computationally less expensive: no trigonometric function evaluation

• No discontinuity in representation like Euler angles

Less intuitive

Dual Covering

Unit modulus constraint

Page 25: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Rotation matrix

Rigid Body Dynamics

Page 26: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Conversion between Quaternions and Euler angles

Page 27: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Quaternions to Euler angles:

Exercise: Try yourself!

Page 28: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Euler angles to Quaternions:

Quaternions corresponding

to the three rotations are

given by

Since the rotations are

relative, we post-multiply

the rotations.

For a 1-2-3 Euler

rotation:

Page 29: Rigid body Rotation - GitHub Pages · 2019-04-08 · Rotation using Quaternions • Exercise: Unit modulus quaternions: Axis-angle representation Euler's Rotation Theorem Any rotation

Questions ???