Ch. 3: Forward and Inverse Kinematics: KON 318E: Introduction To Robotics 1
Ch. 3: Forward and Inverse Kinematics: KON 318E: Introduction To Robotics 1
Ch. 3: Forward and Inverse Kinematics: KON 318E: Introduction To Robotics 1
Of Control Engineering
1 R T RT d
H
• Inverse transforms: 0 1
Recap:Homogeneous Transforms
• Basic transforms:
– Three pure translation, three pure rotation
1 0 0 a 1 0 0 0
0 0 c 0
1 0 0 s
Trans x ,a Rot x ,
0 0 1 0 0 s c 0
0 0 0 1 0 0 0 1
1 0 0 0 c 0 s 0
0 0 0
1 0 b 1 0
Trans y ,b Rot y ,
0 0 1 0 s 0 c 0
0 0 0 1 0 0 0 1
1 0 0 0 c s 0 0
0 1 0 0 s c 0 0
Trans z,c Rot z,
0 0 1 c 0 0 1 0
0 0 0 1 0 0 0 1
Example
• Euler angles: we have only discussed ZYZ Euler angles. What is the set of
all possible Euler angles that can be used to represent any rotation matrix?
– XYZ, YZX, ZXY, XYX, YZY, ZXZ, XZY, YXZ, ZYX, XZX, YXY, ZYZ
– ZZY cannot be used to describe any arbitrary rotation matrix since two
consecutive rotations about the Z axis can be composed into one rotation
Example
• Compute the homogeneous transformation representing a translation of 3
units along the x-axis followed by a rotation of p/2 about the current z-axis
followed by a translation of 1 unit along the fixed y-axis
T Ty ,1Tx,3Tz ,p / 2
1 0 0 0 1 0 0 3 0 1 0 0
0 1 0 1 0 1 0 0 1 0 0 0
0 0 1 0 0 0 1 0 0 0 1 0
0 0 0 1 0 0 0 1 0 0 0 1
1 1 0 3
1 0 0 1
0 0 1 0
0 0 0 1
Convention
• A n-DOF manipulator will have n joints (either revolute or prismatic) and n+1
links (since each joint connects two links)
joint i-1 joint i
Convention
– “Frame o0” is the inertial frame
– “Frame on” is the tool frame
– “Joint i ” connects “link i-1” and “link i”
– “Frame oi” is connected to link i
• Joint variables, qi
if joint i is revolute
qi i
d i if joint i is prismatic
Convention
• A homogeneous transformation allows to express the position and orientation
of oj with respect to oi
– It is desired that the position and orientation of the tool frame with respect to the
inertial frame
– An intermediate step is to determine the transformation matrix that gives position
and orientation of oi with respect to oi-1: Ai ( Homogeneous Trans.)
zi
zi-1
Ai
yi
oi
oi-1 yi-1 xi
xi-1 Ai 1 Ai 2 ... Aj i Aj if i j
– Now we can define the transformation oj to oi as: T j if i j
i
I
T j i 1 if j i
Convention
• Finally, the position and orientation of the tool frame with respect to the
inertial frame is given by one homogeneous transformation matrix:
– For a n-DOF manipulator
Rn0 on0
H n A1 q1 A2 q 2 An q n
0 qi :Joint variables,
T
0 1
• Thus, to fully define the forward kinematics for any serial manipulator, all we
need to do is create the Ai transformations and perform matrix multiplication
Convention
• Each Homogeneous transformation matrix in Tn0 :
R i 1
o
i 1
Ai i i
0 1
i
Rj o
i
T j Ai 1 qi 1 A j qn
i j
0 1
Rii1 R jj 1 o ij 1 R ij 1 o jj 1
Question : How the coordinate frames are attached onto the links??
• The choice is not unique, but the result will always be the same
Link_i
Link_i+1
Joint_i Joint_i+1
Joint_i Joint_i+1
Zi
Link i-1
Link i+1
Link i
Zi-1
1
z0
x0 y0
KON 318E : Introduction to Robotics 17 17
İTÜ-EEF Dept. Of Control Engineering
Joint_i+1
Joint_i Zi
Link i-1
Link i+1
Link i
Zi-1
oi Common
normal
zi
zi-1 zi
oi
Joint_i
Joint_i+1
Link i-1
Link i+1
Link i
Zi-1 Zi
oi
Common xi
normal
zi
zi-1
oi
xi
Joint_i Joint_i+1
Link i-1
Link i+1
Link i
Zi-1 Zi
yi
oi
Common xi
normal
Link Parameters :
– ai : distance from intersection of zi-1 and xi to oi along xi
– i : angle from zi-1 to zi around xi i+1
zi
Z’i
Zi-1 Joint_i+1
Joint_i Zi+1
Link i Joint_i+2
zi+1
yi+1
i oi+1 xi+1
zi
ai+1
yi
ai oi xi
Joint Parameters :
– di :distance from oi-1 to intersection of zi-1 and xi along zi-1
– i : angle from xi-1 to xi around zi-1
i Joint_i+1
i+1
Link i Link i+1
Joint_i
Zi-1
xi-1
yi+1
zi+1 di+1
yi-1
di+1 i+1 xi+1
di zi
i yi
xi
(+)
D-H Table :
• Described by 4 parameters (short names):
– i : twist angle
– ai : link length
– di : joint offset
– i : joint angle
• Joint variable is di or i ( takes “*” symbol)
• Build DH Table with values for each link:
Link a d
1 L1 90o 0 1*
2 0 0 d2* 0
Link Transformations
Joint_i
Joint_i+1
zi
yi
Ai+1
Ai xi
Ti-1i+1=Ai Ai+1
KON 318E : Introduction to Robotics 38 38
İTÜ-EEF Dept. Of Control Engineering
Link Transformations
Joint_i
Joint_i+1
zi
yi
Ai xi
1 0 0 0 ci s i 0 0 1 0 0 ai 1 0 0 0
0 1 0 0 si ci 0 0 0 1 0 0 0 c i s i 0
0 0 1 di 0 0 1 0 0 0 1 0 0 s i c i 0
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
ci si c i si s i ai ci
s ci c i ci s i ai si Ai is function of i , di , i and ai
i
0 s i c i di
0 0 0 1
KON 318E : Introduction to Robotics 40 40
İTÜ-EEF Dept. Of Control Engineering
x2
y0
y1
x1
x0
link ai i di i
1 a1 0 0 1
2 a2 0 0 2
– The i terms are 0 because all zi are parallel
– Therefore only i are variable
DH Example 2:
3 revolute joints
joint 1 Shown in home position
R
Link 2
Link 1 Link 3
joint 2 joint 3
L1 L2
DH Example 2:
2 3
Z1 Z2
DH Example 2:
Z0 and Z1 are not co-planar:
Z0 x0 is the common normal
1
x1 x2 x3
x0
2 3
Z1 Z3
Z2
Z2Zand
1 and Z3Zare
2 are parallel
parallel : :
x1 is selected
x2 is selected on the common
on the common normal that
normal that
lies along lies
the alongofthe
center thecenter
link of
the link
DH Example 2:
Shown with joints in non-zero positions
Z0 x3
z3
2 3
x2
x1
1 Z2
x0
Z1
DH Example 2:
• Link lengths given
• 1 = 90o (rotate by +90o around x0 to
align Z0 and Z1)
R
Z0
L1 L2
x1 x2 x3
x0
1
Z1 Z3
Z2
DH Example 2:
Build table
R
Z0
L1 L2
1
x1 x2 x3
1 x0
2 3
Z1 Z3
Z2
Link d a
1 1* 0 90o R
2 2* 0 0 L1
3 3* 0 0 L2
KON 318E : Introduction to Robotics 51 51
İTÜ-EEF Dept. Of Control Engineering
DH Example 2:
DH Example 2:
c1 0 s1 Rc1
s 0 c1 Rs1
A1 T10 1
0 1 0 0
0 0 0 1
c 2 s 2 0 L1c 2
s c 2 0 L1s 2
A2 T21 2
0 0 1 0
0 0 0 1
c3 s 3 0 L2 c3
s c3 0 L2 s3
A3 T32 3
0 0 1 0
0 0 0 1
KON 318E : Introduction to Robotics 53 53
İTÜ-EEF Dept. Of Control Engineering
DH Example 2: x3
z0
y2 z3
y1 3
x2
y0 2
x1
1 z2
x0
z1
DH Example 2: x3
z0
y2 z3
y1 3
x2
y0 2
x1
1 z2
x0
z1
x2 axis expressed y2 axis expressed z2 axis expressed
wrt {1} wrt {1} wrt {1}
c 2 s 2 0 L1c 2
s Origin of {2}
2 c 2 0 L1s 2 w.r.t. {1}
A2 T2
1
0 0 1 0
0 0 0 1
KON 318E : Introduction to Robotics 55 55
İTÜ-EEF Dept. Of Control Engineering
DH Example 2: x3
z0
y2 z3
y1 3
x2
y0 2
x1
1 z2
x0
z1
x3 axis expressed y3 axis expressed z3 axis expressed
wrt {2} wrt {2} wrt {2}
DH Example 2:
T30 A1 A2 A3
c1 c 23 c1 s 23 s1
c1 L2 c 23 L1c 2 R
s c
1 23 s1 s 23 c1
s1 L2 c 23 L1c 2 R
s 23 c 23 0 L2 s 23 L1c 2
0 0 0 1
where
ci cos i
si sin i
c 23 cos 2 3
s 23 sin 2 3
KON 318E : Introduction to Robotics 57 57
İTÜ-EEF Dept. Of Control Engineering
c1 0 s1 s1d 3
s 0 c c d
T3 A1A2 A3
0 1 1 1 3
0 1 0 d1 d 2
0 0 0 1
c 4 0 s4 0 c5 0 s5 0 c6 s6 0 0 5 0 90 0 5
s 0 c4
0 s 0 c5
0 s c6 0 0 6 0 0 d6 6
A4 4 , A5 5 , A6 6
0 1 0 0 0 1 0 0 0 0 1 d6
0 0 0 1 0 0 0 1 0 0 0 1
c 4c5c6 s4s6 c 4 c 5 s6 s 4 c 6 c 4 s5 c 4 s5 d 6
s c c c s s 4 c 5 s6 c 4 c 6 s 4 s5 s4s5d 6
T6 A4 A5 A6 4 5 6
3 4 6
s5 c 6 s5 c 6 c5 c5d 6
0 0 0 1
c 4c5c6 s4s6 c 4 c 5 s6 s 4 c 6 c 4 s5 c 4 s5 d 6
s c c c s s 4 c 5 s6 c 4 c 6 s 4 s5 s4s5d 6
T63 A4 A5 A6 4 5 6 4 6
s5 c 6 s5 c 6 c5 c5d 6
0 0 0 1
4
5
c c c s s c c s s c c s 6
R s c c c s s c s c c s s
s c s s c
Link i i ai di i Ti i-1
1 90 0 d1 1 * T1o
2 0 0 d2* 0 T21
3 0 0 d3 3 * T32
T2_0Numeric = subs(T2_0,{theta1,d1,d2},{0,0,0})
T3_0Numeric = subs(T3_0,{theta1,theta3,d1,d2,d3},{0,0,0,0,0})
T2_0Numeric = T3_0Numeric =
1 0 0 0 1 0 0 0
0 0 -1 0 0 0 -1 0
0 1 0 0 0 1 0 0
0 0 0 1 0 0 0 1
Define Symbols:
theta1:=`θ_1`;theta3:=`θ_3`;d1:=`d_1`;d2:=`d_2` ;d3:=`d_3`:
print(`T_1^0 `=T1_0):
print(`T_2^1 `=T2_1):
print(`T_3^2 `=T3_2):
link ai i di i
1 0 0 d1 1*
2 0 -90 d2* 0
3 0 0 d3* 0
4 0 -90 0 4*
o3, o4, o5 are all at
the same point oc 5 0 90 0 5*
6 0 0 d6 6*
• Note that z3 (axis for joint 4) is collinear with z2 (axis for joint 3), thus we can
make the following combination:
link ai i di i
1 0 -90 0 1*
2 0 90 d2 2*
3 0 0 d3* 0
4 0 -90 0 4*
5 0 90 0 5*
6 0 0 d6 6*
c1 0 s1 0 c 2 0 s2 0 1 0 0 0
s 0 c1 0 s 0 c 2 0 0 1 0 0
A1 1 , A2 2 , A3
0 1 0 0 0 1 0 d2 0 0 1 d3
0 0 0 1 0 0 0 1 0 0 0 1
c 4 0 s4 0 c5 0 s5 0 c 6 s6 0 0
s 0 c4 0 s 0 c5 0 s c6 0 0
A4 4 , A5 5 , A6 6
0 1 0 0 0 1 0 0 0 0 1 d6
0 0 0 1 0 0 0 1 0 0 0 1
link ai i di i
1 a1 0 0? 1*
2 a2 180 0 2*
3 0 0 d3* 0
4 0 0 d4 4*
0 0 1 d3 d 4
0 0 0 1