Robotic Manipulators: Lecture 2
i
Department of Electrical Engineering
b
. T ale
H . A
.
Dr. H. A. Talebi
o f
Pr
July 10, 2008
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Outline
• Spatial Representation
– Position
b i
ale
– Orientation
– Frame
. T
• Rotation Matrix
H . A
o f .
Pr
• Homogenous Transformation
• Equivalent Orientation Representations
– Direction Cosines
– Euler Angles
– Angle-Axis Rotation
– Euler Parameters
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Spatial description and transformation
• Robot manipulators move parts and tools in 3D space
• Representation of parts, tools, and the mechanism (manipulator) is required
• Define coordinate systems (frame)
b i
ale
• There exist a universe (reference) coordinate system
T
• All position and orientation described wrt to reference frame
. A.
f . H
Pro
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Position & Orientation
1. position of a point
• Reference frame: An orthogonal frame comprised of three unit vectors
(x̂A, ŷA, ẑA) and origin in {O}
• Free vectors: Defined by a direction and a length
i
• Position vector: A spatial vector that locates point P to origin O of a
b
ale
reference frame
T
– Both beginning and end points of a p.v. are specified.
. A.
– Once a coordinate system is defined, any point in the universe can be
H
located with a 3 × 1 position vector
o f .
– Tagged with coordinate system it is defined within
Pr
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Position & Orientation
• A position vector can be written as
px
A
P = py
pz
b i
ale
P = pxx̂A + py ŷA + pz ẑA
.
px = AP .x̂A
T
. A
py = AP ŷA
H
o f . pz = AP ẑA
Pr
• Column vector: A set of 3 numbers px, py , pz describing a vector P wrt
frame {A}.
• Vector norm
kP k = (P.P )1/2 = ( AP T AP )1/2 = ( BP T BP )1/2 = (p2x + p2y + p2z )1/2
– Invariant of the frame
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Orientation of a body
2. Orientation of a body
• To describe the orientation of a body, we attach a coordinated frame to it
(object frame) and we provide a description of the object frame wrt the
reference frame.
b i
. T ale
H . A
o f .
Pr
• Position described by vectors; Orientation described by coordinate sys-
tem
• To described the coordinate system {B}, its unit vector of principal axes
shall be expressed in terms of the coordinate system {A}
• Unit vector of {B} expressed in {A} are AX̂B
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Orientation of a body
X̂BT X̂A cos(X̂B , X̂A) r11
A T
X̂B = X̂B ŶA = cos(X̂B , ŶA) = r21
X̂BT ẐA cos(X̂B , ẐA) r31
cos(ŶB , X̂A) r12
A
b i
ale
ŶB = cos(ŶB , ŶA) = r22
r32
T
cos(ŶB , ẐA)
A.
.
cos(ẐB , X̂A) r13
H
A
.
ẐB = cos(ẐB , ŶA) = r23
r o f cos(ẐB , ẐA) r33
• The set ( X̂ , P
A A
Ŷ , Ẑ )
B B
A
B describes the orientation of the body
• rij are called direction cosines
• We stack the 3 unit column vectors to get a 3 × 3 rotation matrix:
r11 r12 r13
A
A A A
R̂B = X̂B | ŶB | ẐB = r21 r22 r23
r31 r32 r33
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Description of a frame
• An entity called a frame encompasses two ideas by representing both posi-
tion and orientation
• The point whose position we describe is chosen as the origin of the body
attached frame
• A frame used as a description of one coordinate system relative to another.
b i
ale
• Description of a frame: A position vector and a rotation matrix
.
• {B} is described by ARB and APBORG.
T
. A
• APBORG is the vector locating the origin of {B}
H
o f .
Pr
{B} = { ARB , APBORG}
• {A} and {B} are known wrt reference frame and {C} is known wrt {A}
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Properties of Rotation Matrix
• Orthonormal:
k AX̂B k = k AŶB k = k AẐB k = 1
( AX̂BT ) AŶB = ( AŶBT ) AẐB = ( AẐBT ) AX̂B = 0
i
• Observe that the rows of rotation matrix R are the unit vectors of {A}
b
ale
expressed in {B}:
. T
B T
A
X̂A
A
H .
RB = AX̂B AŶB AẐB = BŶAT
o f . B
ẐAT
Pr {A}
Hence, BRA , description of
B
wrt {B} is the transpose of ARB , i.e.:
RA = ARB T
• The inverse of the rotation matrix is equal to its transpose: ARB −1 = ARB T
A T
X̂B
A TA
RB RB = A T A A A
ŶB X̂B ŶB ẐB = I
A
ẐB T
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Example
• det( ARB ) = 1
• Only 3 independent numbers
• Example: Principal rotation around Ẑ0
b i
. T ale
H . A
o f .
Pr
∗
cθ −sθ 0
o = sθ cθ 0
R1
0 0 1
– cθ and sθ refer to cos θ and sin θ, respectively.
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Rotation Matrix
b i
. T ale
R .A
• Example: Find o
. H
o 1
f
P given P and
Po = P cθ − P sθ
1
r
P P = P sθ + P cθ
o
o
x
y
1
1
x
x
1
1
y
y
o
Pz = 1Pz
1
cθ −sθ 0 Px
o
P = sθ cθ 0 1Py
1
0 0 1 Pz
| {z }
Rz (θ)
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Rotation Matrix
3. Uses of Rotation Matrix
• 3A Describes the orientation of frame {B} wrt frame {A}
• 3B Maps components of a vector wrt frame {B} to its components wrt
frame {A}
b i
{A} ale
A
P = ARB BP
. PT
{B}
– Assuming orientation of wrt is known
{A} .A
A
– To calculateP : components of A are projections of BP onto the
f . H
unit vector of frame
r o
– Projections: dot products, hence
P A
p = X̂ · P B B
x A
A B
py = ŶA · BP
A B
pz = ẐA · BP
– Recall that that rows of ARB are BX̂A , BŶA , and BẐA .
– Hence,
A
P = ARB BP
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Homogenous Transforms
4. Homogenous Transforms
• It describes the position and orientation of frame {B} wrt frame {A}
b i
. T ale
H . A
o f .
• APBORG locates {B}’s origin.
Pr
• {B} is rotated wrt {A} as indicated by ARB . Given BP , compute AP
• We can use previous procedure: change description of BP to an inter-
mediate frame (let’s say {C}) that has the same orientation as {A} but
whose origin is coincide with {B}:
C
P = ARB BP
• Translation between C and A can be accounted for by vector addition:
A
P = ARB BP + APBORG
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Homogenous Transforms
• View the mapping as an operator in matrix form, i.e.:
A
P = ATB BP
b i
e P
l
• To do that, we may write:
P a
. T1
A A A B
P RB
. A
BORG
=
1 0 0 0 1
f . H
• Hence, we have:
o
Pr T =A
A
RB A
PBORG
B 0 0 0 1
• Although, Homogeneous transform was introduced as a mapping, it could
be interpreted as description of frames
• The description of frame {B} relative to {A} is ATB .
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Homogenous Transforms
b i
. T ale
H . A
o f .
Pr
• Example: Find the coordinates of P in {0} given its coordinates in {1}.
The rotation matrix 0R1 and the offset 0b are known.
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Homogenous Transforms
3.46 0.707 −0.707 0
0
b = 2.00 , 0R1 = RZ (45o) = 0.707 0.707 0
0 0 0
b i
1
ale
1.4
. T
1
P = 1.4 , 0P =?
0
H . A
o f .
• Using the 4 × 4 transform, we write :
P =PTr P
0 0
1
1
0
Px 0.707 −0.707 0 3.46 1.4 3.46
0Py 0.707 0.707 0 2 1.4 3.98
0 = , =
Pz 0 0 1 0 0 0
1 0 0 0 1 1 1
= 0P (4 × 1)
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Inverse of Homogenous Transforms
b i
ale
5. Inverse of Homogenous Tr.
0
P = 0b + 0R1 1P
. T
0
H . A
P − 0b = 0R1 1P =⇒ ( 0R1)T ( 0P − 0b ) = 1P
o f .
0 T 0 T0
( R1) − R1 b
Pr
1
T0 = ( 0T1)−1 =
0 0 0 1
1
R0 − 1b
=
0 0 0 1
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Compound Transformations
b i
. T ale
6. Compound Transformations
.
TH· · ·
A
o f
0
.
P = 0 1 n−1
T P = T n 0 n
P
Pr
n n
0
Tn = 0T1 · · · n−1
Tn
• Computation
0
P = 0T1( 1T2 2P ) 32M , 24A
0
P = ( 0T1 2T1) 2P 80M , 60A
• However, the second one is better when you want to do the transforma-
tion of many vectors many times.
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Special Transformations
7. Special Transformations
i
• Translation:
b
ale
bx
. T I by
A
.
T rans(b) =
bz
H
f .
0 0 0 1
• Rotation:
Pro
0
R 0
Rot(θ) =
0
0 0 0 1
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Representation of Orientation
• By direction cosines (9 numbers, but only 3 are independent)
• By Euler Angles:
– 3 numbers are required. They correspond to the angles of 3 consecutive
principal rotations about a body fixed frame θ1 , θ2 , θ3 , γ, β, α.
• By an equivalent Angle-Axis pair:
e b i
T a l
K̂ =
– 4 numbers required. Three correspond to[K , K , K ] z . It could
.
x y
A
θ
be a unit vector. One correspond to the angle . Because, it’s a unit
H .
vector (K̂, kK̂k = 1). So, we have 1 constraint and 3 are independent.
o f .
Pr
• By Euler Parameters:
– 4 numbers required. No physical correspondence.
1
= 2 = K̂sinθ/2
3
4 = cosθ/2
– Representations are equivalent except at a finite set of orientations.
– Maps from one representation to another.
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Euler Angles
2. Euler Angles:
b i
. T ale
zH
. A
o f .
• Principle rotation on the axis.
Pr
• Principle rotation on the y1 axis.
• Principle rotation on the x2 axis.
• Assume that the final object frame is obtained by
– Rotation of frame {0} by Rotz0 (α) to get frame {1}
– Rotation of frame {1} by Roty1 (β) to get frame {2}
– Rotation of frame {2} by Rotx2 (γ) to get frame {3}
0
P = Rotz0 (α)Roty (β)Rotx(γ) 3P = 0R3 3P
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Euler Angles
cα −sα 0 cβ 0 sβ 1 0 0
0
R3 = sα cα 0 0 1 0 0 cγ −sγ
0 0 1 −sβ 0 cβ 0 sγ cγ
i
cαcβ −sαcγ + cαsβsγ sγsα + cγsβcα
b
ale
0
R3(α, β, γ) = sαcβ cαcγ + sαsβsγ −sγcα + cγsβsα
T
−sβ cβsγ cγcβ
. A .
• A relationship between direction cosines rij and the Euler angles (γ, β, α).
. =H
o f
Pr
r11 cαcβ
r12 = −sαcγ + cαsβsγ
...
• If rij are known:
2 2
r11 + r21 = cβ 2(cα2 + sα2)
p
2 2
β = Atan2(−r31, r11 + r21 )
• Results in a single solution for θ2.
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Euler Angles
• Often, we seek for single solution between −90◦ to 90◦ to have a one-to-one
mapping.
• To seek all solutions, we use Acosβ , we have two solution for β .
b i
ale
α = Atan2(r21/cβ, r11/cβ)
T
γ = Atan2(r32/cβ, r33/cβ)
. A.
• If β = ±90, c2 = 0 and α, γ cannot be found independently:
f . H
Pro β = 90◦
α = 0
γ = Atan2(r12, r22)
or
β2 = −90◦
α = 0
γ = −Atan2(r12, r22)
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Fixed Angles
• Similarity Transformation:
b i
ale
– A coordinate frame is defined by a set of basis vector
. T
– A rotation matrix (as a coordinate transformation) may be viewed as
H . A
changing basis from one frame to another
o f .
– A general linear transformation is transformed from one frame to an-
Pr
other using similarity transformation
– A is a linear transformation in frame {0} and B is the representation of
A in frame {1}, then:
B = ( 0R1)−1 A 0R1
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Fixed Angles
b i
. T al{1}e
A
• Rotation of frame {0} by Rotx0 (γ) to get frame
.
H(α)
.
• Rotation of frame
{1} Rot (β)
by to get frame {2}
{2} fRot
y0
• Rotation of frame
P ro by z0 to get frame {3}
– Each rotation takes place about an axis in fixed frame {0}
– The composition rule cannot be applied here, similarity transformation
can be used instead.
– The first rotation about a fixed axis is 0R1 = Rotx0 (γ).
– Using the similarity transformation, the second rotation about the fixed
frame {0} viewed in {1} is ( 0R1 )−1 Roty0 (β) 0R1
R2 = 0R1( 0R1)−1Roty0 (β) 0R1 = Roty0 (β)Rotx0 (γ)
0
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Fixed Angles
• similarly, for the third rotation, we get:
0
R3 = 0R2( 0R2)−1Rotz0 (α) 0R2 = Rotz0 (α)Roty0 (β)Rotx0 (γ)
i
• Hence:
R = sα cα 0 0 al
cα −sα 0
eb
cβ 0 sβ
1 0 0
. T
0
1 0 0 cγ −sγ
A
3
.
0 0 1 −sβ 0 cβ 0 sγ cγ
f . H
cαcβ −sαcγ + cαsβsγ sγsα + cγsβcα
0
r o
R (γ, β, α) = sαcβ
3
P −sβ cβsγ
cαcγ + sαsβsγ −sγcα + cγsβsα
cγcβ
– Observe that the resulting transformation is similar to the Euler Angle
transformation.
– Three rotation taken about fixed axes yield same final orientation as the
same three rotation taken in opposite order about the axes of moving
frame.
– 12 definition of Euler angles, 12 Fixed angles
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Equivalent Angle-Axis pair
3. Equivalent Angle-Axis pair
• frame {1} is obtained by rotating frame {0} around axis K̂ by θ
b i
. T ale
H . A
o f .
Pr
• Rotation matrix is:
kx2 vθ + cθ kxky vθ − kz sθ kxkz vθ + ky sθ
RK (θ) = kxky vθ + kz sθ ky2vθ + cθ ky kz vθ − kxsθ
kxkz vθ − ky sθ ky kz vθ + kxsθ kz2vθ + cθ
• where vθ = 1 − cθ, K̂ = [kx ky kz ]T .
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Equivalent Angle-Axis pair
• If rij are known:
r11 + r22 + r33 − 1
θ = Acos
i
2
b
ale
1 r32 − r23
T
K̂ = r13 − r31 (1)
. .
2sinθ r − r
A
21 12
H
(−K̂,.−θ)
f
o
• For (K̂, θ), the pair
r
results in the same rotation matrix.
θP
• For smaller rotation the axis of rotation is ill-defined ( completely undefined
for θ = 0◦ or = 180 ◦
)
• Example: K̂ = [0, 0, 1]T
cθ −sθ 0
RK (θ) = sθ cθ 0
0 0 1
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Euler Parameters
4. Euler Parameters
• Defined by & 4:
• In terms of angle-axis equivalent:
b i
T ale
1
.
θ θ
A
= 2 = K̂sin , 4 = cos
H .
3 2 2
o f .
Pr
• unit quaternion: 21 + 22 + 23 + 24 = 1
• The four quantities are not independent
• The rotation matrix is given by:
2 2
1 − 22 − 23 2(12 − 34) 2(13 + 24)
R = 2(12 + 34) 1 − 221 − 223 2(23 − 14)
2(13 − 24) 2(23 + 14) 1 − 221 − 222
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit
Quaternion:
b i
ale
• If rij are given:
1√
. T
. A
4 = 1 + r11 + r22 + r33
H
2
f .
r − r
o
1 32 23
Pr
= r13 − r31
44 r − r
21 12
• If 4 = 0 =⇒ is equal to rotation axis, = K̂ .
•First •Prev •Next •Last •Go Back •Full Screen •Close •Quit