Вы находитесь на странице: 1из 43

FAB30703

Universiti Kuala Lumpur Malaysia France Institute

Spatial Transformations - 1

Originally prepared by: Prof Engr Dr Ishkandar Baharin


Head of Campus & Dean
UniKL MFI
Manipulators
Universiti Kuala Lumpur Malaysia France Institute

• Robot arms, industrial robot


– Rigid bodies (links) connected
by joints
– Joints: revolute or prismatic
– Drive: electric or hydraulic
– End-effector (tool) mounted
on a flange or plate secured
to the wrist joint of robot
Manipulators
Robot Configuration:
Universiti Kuala Lumpur Malaysia France Institute

Cartesian: PPP Cylindrical: RPP Spherical: RRP

Hand coordinate:

SCARA: RRP n: normal vector; s: sliding vector;


Articulated: RRR (Selective Compliance a: approach vector, normal to the
Assembly Robot Arm)
tool mounting plate
Manipulators
Universiti Kuala Lumpur Malaysia France Institute

• Motion Control Methods


– Point to point control
• a sequence of discrete points
• spot welding, pick-and-place, loading & unloading
– Continuous path control
• follow a prescribed path, controlled-path motion
• Spray painting, Arc welding, Gluing
Manipulators
Universiti Kuala Lumpur Malaysia France Institute

• Robot Specifications
– Number of Axes
• Major axes, (1-3) => Position the wrist
• Minor axes, (4-6) => Orient the tool
• Redundant, (7-n) => reaching around
obstacles, avoiding undesirable
configuration
– Degree of Freedom (DOF)
– Workspace
– Payload (load capacity)
– Precision vs. Repeatability Which one is more important?
What is Kinematics
Universiti Kuala Lumpur Malaysia France Institute

• Forward kinematics
z

Given joint variables


q = (q1 , q2 , q3 , q4 , q5 , q6 , L qn )
y

x
Y = ( x, y, z , O, A, T )

End-effector position and orientation, -Formula?


What is Kinematics
Universiti Kuala Lumpur Malaysia France Institute

• Inverse kinematics
End effector position z
and orientation
( x, y, z , O, A, T )
y

q = (q1 , q2 , q3 , q4 , q5 , q6 , L qn ) x

Joint variables -Formula?


Example 1
Universiti Kuala Lumpur Malaysia France Institute

Forward kinematics
y0
x1 = l cos θ y1
x1
y1 = l sin θ
l

Inverse kinematics θ
x0
θ = cos ( x1 / l )
−1
Preliminary
Universiti Kuala Lumpur Malaysia France Institute

• Robot Reference Frames


– World frame
– Joint frame
z
– Tool frame y
z x
y T P

W
x
R
Preliminary
Universiti Kuala Lumpur Malaysia France Institute

• Coordinate Transformation
– Reference coordinate frame
OXYZ z
– Body-attached frame O’uvw P
Point represented in OXYZ:
y
Pxyz = [ p x , p y , p z ]
T
w
r v
Pxyz = p x i x + p y jy + p z k z
Point represented in O’uvw:
x
r O, O’
u
Puvw = pu i u + pv jv + pw k w
Two frames coincide ==> pu = p x pv = p y pw = p z
Preliminary
Properties: Dot Product
Universiti Kuala Lumpur Malaysia France Institute

Let x and y be arbitrary vectors in R and θ be


3

the angle from x to y , then


x ⋅ y = x y cos θ
Properties of orthonormal coordinate frame
• Mutually perpendicular • Unit vectors
v v v
i ⋅ j =0 | i |= 1
v v v
i ⋅k = 0 | j |= 1
v v v
k⋅ j =0 | k |= 1
Preliminary
Universiti Kuala Lumpur Malaysia France Institute

• Coordinate Transformation
– Rotation only z
P
r
Pxyz = p x i x + p y jy + p z k z
r y
Puvw = pu i u + pv jv + pw k w w v
u
Pxyz = RPuvw x
How to relate the coordinate in these two frames?
The answer is in the R matrix

Pxyz = RPuvw
Preliminary
• Basic Rotation
Universiti Kuala Lumpur Malaysia France Institute

– p x , p y , and p z represent the projections of P


onto OX, OY, OZ axes, respectively

– Since P = pu i u + pv jv + pw k w

p x = i x ⋅ P = i x ⋅ i u pu + i x ⋅ jv pv + i x ⋅ k w pw
p y = jy ⋅ P = jy ⋅ i u pu + jy ⋅ jv pv + jy ⋅ k w pw

p z = k z ⋅ P = k z ⋅ i u pu + k z ⋅ jv pv + k z ⋅ k w pw
Preliminary
• Basic Rotation Matrix
Universiti Kuala Lumpur Malaysia France Institute

⎡ px ⎤ ⎡ i x ⋅ i u i x ⋅ jv i x ⋅ k w ⎤ ⎡ pu ⎤
⎢ p ⎥ = ⎢ j ⋅i j y ⋅ jv ⎥ ⎢
j y ⋅ k w ⎥ ⎢ pv ⎥ ⎥
⎢ y⎥ ⎢ y u
⎢⎣ p z ⎥⎦ ⎢⎣k z ⋅ i u k z ⋅ jv k z ⋅ k w ⎥⎦ ⎢⎣ pw ⎥⎦
– Rotation about x-axis with θ
z
w
⎡1 0 0 ⎤ P v

Rot ( x,θ ) = ⎢0 Cθ ⎥
− Sθ ⎥
θ
⎢⎣0 Sθ Cθ ⎥⎦ y
u
x
Preliminary
Universiti Kuala Lumpur Malaysia France Institute

• Is it True?
– Rotation about x axis with θ
⎡ p x ⎤ ⎡1 0 0 ⎤ ⎡ pu ⎤
⎢ p ⎥ = ⎢0 cos θ ⎥ ⎢
− sin θ ⎥ ⎢ pv ⎥ ⎥
⎢ y⎥ ⎢ z
⎢⎣ p z ⎥⎦ ⎢⎣0 sin θ cos θ ⎥⎦ ⎢⎣ pw ⎥⎦ w
P v
p x = pu
θ
p y = pv cos θ − pw sin θ
y
p z = pv sin θ + pw cos θ u
x
Basic Rotation Matrices
– Rotation about x-axis (yaw) θ with
Universiti Kuala Lumpur Malaysia France Institute

⎡1 0 0 ⎤
Rot ( x,θ ) = ⎢⎢0 Cθ − Sθ ⎥⎥
⎢⎣0 Sθ Cθ ⎥⎦
– Rotation about y-axis (pitch) θ with
⎡ Cθ 0 Sθ ⎤
Rot ( y, θ ) = ⎢⎢ 0 1 0 ⎥⎥
⎢⎣− Sθ 0 Cθ ⎥⎦

– Rotation about z-axis (roll) θ with


⎡Cθ − Sθ 0⎤
Pxyz = RPuvw Rot ( z , θ ) = ⎢⎢ Sθ Cθ 0⎥⎥
⎢⎣ 0 0 1⎥⎦
Preliminary
• Basic Rotation Matrix
Universiti Kuala Lumpur Malaysia France Institute

⎡ i x ⋅ i u i x ⋅ jv i x ⋅ k w ⎤
R = ⎢⎢ jy ⋅ i u jy ⋅ jv jy ⋅ k w ⎥⎥ Pxyz = RPuvw
⎢⎣k z ⋅ i u k z ⋅ jv k z ⋅ k w ⎥⎦
– Obtain the coordinate of Puvw from the coordinate
of Pxyz Dot products are commutative!

⎡ pu ⎤ ⎡ i u ⋅ i x i u ⋅ jy i u ⋅ k z ⎤ ⎡ px ⎤
⎢ p ⎥ = ⎢ j ⋅i jv ⋅ j y

jv ⋅ k z ⎥ ⎢⎢ p y ⎥⎥ Puvw = QPxyz
⎢ v⎥ ⎢ v x
⎢⎣ pw ⎥⎦ ⎢⎣k w ⋅ i x k w ⋅ jy k w ⋅ k z ⎥⎦ ⎢⎣ p z ⎥⎦
Q = R −1 = RT
QR = R T R = R −1 R = I 3 <== 3X3 identity matrix
Example 2
• A point auvw = (4,3,2) is attached to a rotating frame,
Universiti Kuala Lumpur Malaysia France Institute

the frame rotates 60 degree about the OZ axis of


the reference frame. Find the coordinates of the
point relative to the reference frame after the
rotation.
a xyz = Rot ( z ,60)auvw
⎡ 0.5 − 0.866 0⎤ ⎡4⎤ ⎡− 0.598⎤
= ⎢⎢0.866 0.5 0⎥⎥ ⎢⎢3⎥⎥ = ⎢⎢ 4.964 ⎥⎥
⎢⎣ 0 0 1⎥⎦ ⎢⎣2⎥⎦ ⎢⎣ 2 ⎥⎦
Example 3
• A point a xyz = (4,3,2) is the coordinate w.r.t. the
Universiti Kuala Lumpur Malaysia France Institute

reference coordinate system, find the


corresponding point a uvw w.r.t. the rotated
OU-V-W coordinate system if it has been
rotated 60 degree about OZ axis.

auvw = Rot ( z ,60)T a xyz


⎡ 0.5 0.866 0⎤ ⎡4⎤ ⎡ 4.598 ⎤
= ⎢⎢− 0.866 0.5 0⎥⎥ ⎢⎢3⎥⎥ = ⎢⎢− 1.964⎥⎥
⎢⎣ 0 0 1⎥⎦ ⎢⎣2⎥⎦ ⎢⎣ 2 ⎥⎦
Composite Rotation Matrix
Universiti Kuala Lumpur Malaysia France Institute

• A sequence of finite rotations


– matrix multiplications do not commute
– rules:
• if rotating coordinate O-U-V-W is rotating about
principal axis of OXYZ frame, then Pre-multiply
the previous (resultant) rotation matrix with an
appropriate basic rotation matrix
• if rotating coordinate OUVW is rotating about its
own principal axes, then post-multiply the
previous (resultant) rotation matrix with an
appropriate basic rotation matrix
Example 4
Universiti Kuala Lumpur Malaysia France Institute

• Find the rotation matrix for the following


operations:
R = Rot ( y, φ ) I 3 Rot ( w,θ ) Rot (u , α )
Rotation φ about OY axis
⎡ Cφ 0 Sφ ⎤ ⎡Cθ − Sθ 0⎤ ⎡1 0 0 ⎤
Rotation θ about OW axis = ⎢⎢ 0 1 0 ⎥⎥ ⎢⎢ Sθ Cθ 0⎥⎥ ⎢⎢0 Cα − Sα ⎥⎥
Rotation α about OU axis ⎢⎣- Sφ 0 Cφ ⎥⎦ ⎢⎣ 0 0 1⎥⎦ ⎢⎣0 Sα Cα ⎥⎦
⎡ CφCθ SφSα − CφSθCα CφSθSα + SφCα ⎤
= ⎢⎢ Sθ CθCα − CθSα ⎥

Answer... ⎢⎣− SφCθ SφSθCα + CφSα CφCα − SφSθSα ⎥⎦

Pre-multiply if rotate about the OXYZ axes


Post-multiply if rotate about the OUVW axes
Coordinate Transformations
• position vector of P
Universiti Kuala Lumpur Malaysia France Institute

in {B} is transformed
to position vector of P
in {A}

• description of {B} as
seen from an observer
in {A}

Rotation of {B} with respect to {A}

Translation of the origin of {B} with respect to origin of {A}


Coordinate Transformations
• Two Special Cases
Universiti Kuala Lumpur Malaysia France Institute

r = RB r + r
A P A B P A o'

1. Translation only
– Axes of {B} and {A} are
parallel A
RB = 1

2. Rotation only
– Origins of {B} and {A}
are coincident
r =0
A o'
Homogeneous Representation
• Coordinate transformation from {B} to {A}
Universiti Kuala Lumpur Malaysia France Institute

r = RB B r P + Ar o '
A P A

⎡ A r P ⎤ ⎡ A RB ⎤
A o'
r ⎡ r ⎤
B P

⎢ ⎥=⎢ ⎥⎢ ⎥
⎣ 1 ⎦ ⎣ 01×3 1 ⎦⎣ 1 ⎦
• Homogeneous transformation matrix
⎡ RB r ⎤ ⎡ R3×3 P3×1 ⎤
A A o' Rotation

TB = ⎢ ⎥=⎢
A matrix

⎣ 01×3 1 ⎦ ⎣ 0 1 ⎦ Position
vector
Scaling
Homogeneous Transformation
• Special cases
Universiti Kuala Lumpur Malaysia France Institute

1. Translation
⎡ I 3×3 r ⎤
A o'
A
TB = ⎢ ⎥
⎣01×3 1 ⎦

2. Rotation

⎡ A
RB 03×1 ⎤
A
TB = ⎢ ⎥
⎣ 01×3 1 ⎦
Example 5
• Translation along Z-axis with h:
Universiti Kuala Lumpur Malaysia France Institute

⎡1 0 0 0⎤ ⎡ x ⎤ ⎡1 0 0 0 ⎤ ⎡ pu ⎤ ⎡ pu ⎤
⎢0 1 0 0 ⎥⎥ ⎢ y ⎥ ⎢0 1 0 0 ⎥⎥ ⎢⎢ pv ⎥⎥ ⎢⎢ pv ⎥⎥
Trans ( z , h) = ⎢ ⎢ ⎥=⎢ =
⎢0 0 1 h⎥ ⎢ z ⎥ ⎢0 ⎥
0 1 h pw ⎢ ⎥ ⎢ pw + h ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣0 0 0 1⎦ ⎣ 1 ⎦ ⎣0 0 0 1⎦ ⎣ 1 ⎦ ⎣ 1 ⎦
z z P
P
w y
y
w v
v
x O, O’
u x
h
O, O’
u
Example 6
• Rotation about the X-axis by
Universiti Kuala Lumpur Malaysia France Institute

⎡1 0 0 0⎤ ⎡ x ⎤ ⎡1 0 0 0⎤ ⎡ pu ⎤
⎢0 Cθ 0⎥⎥ ⎢ y ⎥ ⎢ 0 Cθ
− Sθ − Sθ 0⎥⎥ ⎢⎢ pv ⎥⎥
Rot ( x, θ ) = ⎢ ⎢ ⎥=⎢
⎢ 0 Sθ Cθ 0⎥ ⎢ z ⎥ ⎢0 Sθ Cθ 0⎥ ⎢ p w ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥
⎣0 0 0 1⎦ ⎣ 1 ⎦ ⎣0 0 0 1⎦ ⎣ 1 ⎦
z
w
P v

y
u
x
Homogeneous Transformation
Universiti Kuala Lumpur Malaysia France Institute

• Composite Homogeneous Transformation


Matrix
• Rules:
– Transformation (rotation/translation) w.r.t
(X,Y,Z) (OLD FRAME), using pre-
multiplication
– Transformation (rotation/translation) w.r.t
(U,V,W) (NEW FRAME), using post-
multiplication
Example 7
Universiti Kuala Lumpur Malaysia France Institute

• Find the homogeneous transformation matrix


(T) for the following operations:
Rotation α about OX axis
Translation of a along OX axis
Translation of d along OZ axis
T = Tz ,θ Tz ,d Tx ,aTx ,α I 4×4
Rotation of θ about OZ axis
Pre-Multiply

Answer : ⎡Cθ − Sθ 0 0 ⎤ ⎡1 0 0 0 ⎤ ⎡1 0 0 a ⎤ ⎡1 0 0 0⎤
⎢ Sθ Cθ 0 0 ⎥⎥ ⎢⎢ 0 1 0 0 ⎥⎥ ⎢⎢ 0 1 0 0 ⎥⎥ ⎢⎢ 0 Cα − Sα 0 ⎥⎥
T =⎢
⎢ 0 0 1 0⎥ ⎢0 0 1 d ⎥ ⎢0 0 1 0 ⎥ ⎢ 0 Sα Cα 0⎥
⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥
⎣ 0 0 0 1 ⎦ ⎣0 0 0 1 ⎦ ⎣0 0 0 1 ⎦ ⎣0 0 0 1⎦
Homogeneous Representation
• A frame in space (Geometric
Universiti Kuala Lumpur Malaysia France Institute

Interpretation) P( px , p y , pz )
z
⎡ R3×3 P3×1 ⎤ a (z’)
F =⎢ ⎥
s(y’)
⎣ 0 1 ⎦ n (X’)
y
⎡ nx sx ax px ⎤
⎢n sy ay p y ⎥⎥
F=⎢ y
⎢ nz sz az pz ⎥ x
⎢ ⎥
⎣0 0 0 1⎦
Principal axis n w.r.t. the reference coordinate system
Homogeneous Transformation
Universiti Kuala Lumpur Malaysia France Institute

• Translation a
s
⎡1 0 0 d x ⎤ ⎡ nx sx ax px ⎤
z n
⎢0 1 0 d y ⎥⎥ ⎢⎢n y sy ay p y ⎥⎥
a
Fnew =⎢ × s
⎢0 0 1 d z ⎢ nz
⎥ sz az pz ⎥
⎢ ⎥ ⎢ ⎥ n
⎣0 0 0 1⎦ ⎣0 0 0 1⎦
⎡ nx sx ax px + d x ⎤ y
⎢n sy ay p y + d y ⎥⎥
=⎢ y
⎢ nz sz az pz + d z ⎥
⎢ ⎥
⎣0 0 0 1 ⎦
Fnew = Trans (d x , d y , d z ) × Fold
Homogeneous Transformation
Composite Homogeneous Transformation Matrix
Universiti Kuala Lumpur Malaysia France Institute

z1 z2 y2

y1 x2
z0 0
A1 1
A2
y0
x1

x0
?
i −1 Transformation matrix for
Ai adjacent coordinate frames

0
A2 = 0A1 1 A2 Chain product of successive
coordinate transformation matrices
Example 8
• For the figure shown below, find the 4x4 homogeneous transformation
Universiti Kuala Lumpur Malaysia France Institute

matrices i −1 Ai and 0 Ai for i=1, 2, 3, 4, 5


⎡− 1 0 0 0 ⎤
⎡ nx px ⎤
c
sx ax ⎢ 0 0 −1 e + c ⎥
⎢n p y ⎥⎥
z3 sy ay 0
A1 = ⎢ ⎥
F =⎢ y ⎢ 0 −1 0 a − d ⎥
b y3 x3 ⎢ nz sz az pz ⎥ ⎢ ⎥
z5 d ⎢ ⎥ ⎣ 0 0 0 1 ⎦
⎣0 0 0 1⎦
x5
y5 ⎡0 − 1 0 b ⎤
z4 e ⎢0 0 − 1 a − d ⎥
1
A2 = ⎢ ⎥
a x4 y4 z2 ⎢1 0 0 0 ⎥
x2 ⎢ ⎥
⎣ 0 0 0 1 ⎦
z1 x1 y2
z0
y1 ⎡0 1 0 −b ⎤
⎢− 1 0 0 e + c ⎥⎥
y0
x0 0
A2 = ⎢
Can you find the answer by observation ⎢0 0 1 0 ⎥
based on the geometric interpretation of ⎢ ⎥
⎣0 0 0 1 ⎦
homogeneous transformation matrix?
Orientation Representation
⎡ R3×3 P3×1 ⎤
Universiti Kuala Lumpur Malaysia France Institute

F =⎢ ⎥
⎣ 0 1 ⎦
• Rotation matrix representation needs 9
elements to completely describe the
orientation of a rotating rigid body.
• Any easy way?

Euler Angles Representation


Orientation Representation
• Euler Angles Representation ( φ , θ, ψ )
Universiti Kuala Lumpur Malaysia France Institute

– Many different types


– Description of Euler angle representations

Euler Angle I Euler Angle II Roll-Pitch-Yaw


Sequence φ about OZ axis φ about OZ axis ψ about OX axis
of θ about OU axis θ about OV axis θ about OY axis
Rotations ψ about OW axis ψ about OW axis φ about OZ axis
Euler Angle I, Animated
Universiti Kuala Lumpur Malaysia France Institute

w'= z

w'"= w"
φ v'"
v"
ϕ
v'
y

u'"
θ
u' =u"
x
Orientation Representation
Universiti Kuala Lumpur Malaysia France Institute

• Euler Angle I
⎛ cos φ − sin φ 0⎞ ⎛1 0 0 ⎞
⎜ ⎟ ⎜ ⎟
Rzφ = ⎜ sin φ cos φ 0 ⎟, Ru 'θ = ⎜ 0 cosθ − sin θ ⎟,
⎜ 1 ⎟⎠ ⎜ 0 sin θ cosθ ⎟⎠
⎝ 0 0 ⎝
⎛ cos ϕ − sin ϕ 0⎞
⎜ ⎟
Rw''ϕ = ⎜ sin ϕ cos ϕ 0⎟
⎜ 0 1 ⎟⎠
⎝ 0
Euler Angle I
Universiti Kuala Lumpur Malaysia France Institute

Resultant eulerian rotation matrix:

R = Rzφ Ru 'θ Rw''ϕ


⎛ cos φ cos ϕ − cos φ sin ϕ ⎞
⎜ sin ϕ sin θ ⎟
⎜ − sin φ sin ϕ cosθ − sin φ cos ϕ cosθ ⎟
⎜ ⎟
⎜ ⎟
⎜ sin φ cos ϕ − sin φ sin ϕ − cos φ sin θ ⎟
⎜ + cos φ sin ϕ cosθ + cos φ cos ϕ cosθ ⎟
⎜ ⎟
⎜ ⎟
⎜ sin ϕ sin θ cos ϕ sin θ cosθ ⎟
⎝ ⎠
Euler Angle II, Animated
Universiti Kuala Lumpur Malaysia France Institute

w'= z

w"'= w" φ

ϕ v"'
θ v' =v"
y
u"'
u"
Note the opposite u'
(clockwise) sense of the x
third rotation, φ.
Orientation Representation
Universiti Kuala Lumpur Malaysia France Institute

• Matrix with Euler Angle II


⎛ − sin φ sin ϕ − sin φ cos ϕ ⎞
⎜ cos φ sin θ ⎟
⎜ + cos φ cos ϕ cosθ − sin φ cos ϕ cosθ ⎟
⎜ ⎟
⎜ ⎟
⎜ cos φ sin ϕ cos φ cos ϕ sin ϕ sin θ ⎟
⎜ + sin φ cos ϕ cosθ − sin φ cos ϕ cosθ ⎟
⎜ ⎟
⎜ cosθ ⎟⎟
⎜ − cos ϕ sin θ sin ϕ sin θ
⎝ ⎠
Quiz: How to get this matrix ?
Orientation Representation
Universiti Kuala Lumpur Malaysia France Institute

• Description of Roll Pitch Yaw


Z

ϕ Y
θ
X

Quiz: How to get rotation matrix ?


Homework
Universiti Kuala Lumpur Malaysia France Institute

Study Chapter 2: Forward Kinematics


Practice Worked Examples

Prepare questions to ask during tutorial next week !!!


Universiti Kuala Lumpur Malaysia France Institute

xz
y
z

x
x
z
y

x
y
Thank you!

Вам также может понравиться