Robotics Lec03
Robotics Lec03
Robotics
Chapter 3
Forward and Inverse Kinematics
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
2. Convention
• A n-DOF manipulator will have n joints (either revolute or prismatic) and
n+1 links (since each joint connects two links)
– We assume that each joint only has one DOF. Although this may seem like
it does not include things like spherical or universal joints, we can think of
multi-DOF joints as a combination of 1DOF joints with zero length between
them
– The o0 frame is the inertial frame
– on is the tool frame
– Joint i connects links i-1 and i
– The oi is connected to link i
• Joint variables, qi
if joint i is revolute
qi = i
d i if joint i is prismatic
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
2. Convention
• We said that a homogeneous transformation allowed us to express the
position and orientation of oj with respect to oi
– what we want is 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
– Now we can define the transformation oj to oi as:
Ai +1 Ai + 2 ... A j −i A j if i j
T ji = I if i = j
( )
T j
i −1
if j i
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
2. 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= = Tn = A1(q1 )A2 (q2 ) An (qn )
0
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
• But we said any rigid body needs 6 parameters to describe its position
and orientation
– Three angles (Euler angles, for example) and a 3x1 position vector
– So how can there be just 4 DH parameters?...
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
positive convention:
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
1: two-link planar manipulator
• 2DOF: need to assign three coordinate frames
1. Choose z0 axis (axis of rotation for joint 1, base frame)
2. Choose z1 axis (axis of rotation for joint 2)
3. Choose z2 axis (tool frame)
• This is arbitrary for this case since we have described no wrist/gripper
• Instead, define z2 as parallel to z1 and z0 (for consistency)
4. Choose xi axes
• All zi’s are parallel
• Therefore choose xi to intersect oi-1
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
1: two-link planar manipulator
• Now define DH parameters
– First, define the constant parameters ai, i
– Second, define the variable parameters i, di
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
0 0 0 1 0 0 0 1 0 0 1 0
0 0 0 1
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
2: three-link cylindrical robot
• 3DOF: need to assign four coordinate frames
1. Choose z0 axis (axis of rotation for joint 1, base frame)
2. Choose z1 axis (axis of translation for joint 2)
3. Choose z2 axis (axis of translation for joint 3)
4. Choose z3 axis (tool frame)
• This is again arbitrary for this case since we have described no wrist/gripper
• Instead, define z3 as parallel to z2
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
2: three-link cylindrical robot
• Now define DH parameters link ai i di i
– First, define the constant parameters ai, i
1 0 0 d1 1
– Second, define the variable parameters i, di
2 0 -90 d2 0
c1 − s1 0 0 1 0 0 0 1 0 0 0 3 0 0 d3 0
s c1 0 0 0 0 1 0 0 1 0 0
A1 = 1 , A2 = , A3 =
0 0 1 d1 0 − 1 0 d2 0 0 1 d3
0 0 0 1 0 0 0 1 0 0 0 1
c1 0 − s1 − s1d 3
s 0 c1 c1d 3
T3 = A1A2 A3 =
0 1
0 − 1 0 d1 + d 2
0 0 0 1
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
3: spherical wrist
• 3DOF: need to assign four coordinate frames
– yaw, pitch, roll (4, 5, 6) all intersecting at one point o (wrist center)
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
3: spherical wrist
• Now define DH parameters link ai i di i
– First, define the constant parameters ai, i
4 0 -90 0 4
– Second, define the variable parameters i, di
5 0 90 0 5
c 4 0 − s4 0 c5 0 − s5 0 c6 − s6 0 0 6 0 0 d6 6
s 0 c4 0 s 0 c5 0 s c6 0 0
A1 = 4 , A2 = 5 , A3 = 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 4c5c 6 − s4s6 − c 4c 5 s6 − s 4c 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
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
4: cylindrical robot with spherical wrist
• 6DOF: need to assign seven coordinate frames
– But we already did this for the previous two examples, so we can fill in the
table of DH parameters:
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
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
4: cylindrical robot with spherical wrist
• Note that z3 (axis for joint 4) is collinear with z2 (axis for joint 3), thus we
can make the following combination:
r11 r12 r13 dx r11 = c1c 4c5c 6 − c1s4s6 + s1s5c 6
r r r23 d y r21 = s1c 4c5c 6 − s1s4s6 − c1s5c 6
T6 = T3 T6 = 21 22
0 0 3
r31 = −s4c5c 6 − c 4s6
r31 r32 r33 dz
r12 = −c1c 4c5s6 − c1s4c 6 − s1s5c 6
0 0 0 1
r22 = −s1c 4c5s6 − s1s4s6 + c1s5c 6
r32 = s4c5c 6 − c 4c 6
r13 = c1c 4s5 − s1c5
r23 = s1c 4s5 + c1c5
r33 = −s4s5
d x = c1c 4s5d 6 − s1c5d 6 − s1d 3
d y = s1c 4s5d 6 + c1c5d 6 + c1d 3
d z = −s4s5d 6 + d1 + d 2
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
5: the Stanford manipulator
• 6DOF: need to assign seven coordinate frames:
1. Choose z0 axis (axis of rotation for joint 1, base frame)
2. Choose z1-z5 axes (axes of rotation/translation for joints 2-6)
3. Choose xi axes
4. Choose tool frame
5. Fill in table of DH parameters:
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
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
5: the Stanford manipulator
• Now determine the individual homogeneous transformations:
c1 0 − s1 0 c 2 0 s2 0 1 0 0 0
s 0 c1 0 s 0 − c20 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 − s 4 0 c5 0 s5 0 c 6 − s6 0 0
s 0 c 4 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
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
5: the Stanford manipulator
• Finally, combine to give the complete description of the forward
kinematics:
r11 = c1c 2 (c 4c5c 6 − s4s6 ) − s2s5c 6 − d 2 (s4c5c 6 + c 4s6 )
r21 = s1c 2 (c 4c5c 6 − s4s6 ) − s2s5c 6 + c1 (s4c5c6 + c 4s6 )
r31 = −s2 (c 4c5c 6 − s4s6 ) − c 2s5c 6
r12 = c1− c 2 (c 4c5s6 + s4c 6 ) + s2s5s6 − s1(− s4c5s6 + c 4c 6 )
r11 r12 r13 dx r22 = −s1− c 2 (c 4c5s6 − s4c 6 ) − s2s5s6 + c1 (− s4c5s6 + c 4s6 )
r d y
r r23 r32 = s2 (c 4c5s6 + s4c6 ) + c 2s5s6
T6 = A1 A6 = 21 22
0
r31 r32 r33 dz r13 = c1 (c 2c 4s5 + s2c5 ) − s1s4s5
0 0 0 1 r23 = s1 (c 2c 4s5 + s2c5 ) + c1s4s5
r33 = −s2c 4s5 + c 2c5
d x = c1s2d 3 − s1d 2 + d 6 (c1c 2c 4s5 + c1c5s2 − s1s4s5 )
d y = s1s2d 3 + c1d 2 + d 6 (c1s4s5 + c 2c 4s1s5 + c5s1s2 )
d z = c 2d 3 + d 6 (c 2c5 − c 4s2s5 )
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
6: the SCARA manipulator
• 4DOF: need to assign five coordinate frames:
1. Choose z0 axis (axis of rotation for joint 1, base frame)
2. Choose z1-z3 axes (axes of rotation/translation for joints 2-4)
3. Choose xi axes
4. Choose tool frame
5. Fill in table of DH parameters:
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
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
8. Examples
6: the SCARA manipulator
• Now determine the individual homogeneous transformations:
0 0 − 1 − d3 − d 4
0 0 0 1
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
*excluding ground
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
2 − 2 + 2L 2
= cos −1 2 + tan −1 L2
−
L −
2 (L1 − ) + L2 1 2
2 2
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
• Find the values of joint parameters that will put the tool frame at a
desired position and orientation (within the workspace)
– Given H:
R o
H= SE (3 )
0 1
• Use the position of the wrist center to determine the first three joint
angles…
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
xc o x − d 6 r13
y = o − d r
c y 6 23
zc oz − d 6 r33
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
• Since [xc yc zc]T are determined from the first three joint angles, our
forward kinematics expression now allows us to solve for the first three
joint angles decoupled from the final three.
– Thus we now have R30
– Note that:
R = R30R63
( )
R63 = R30
−1
( )T
R = R30 R
− atan2(− y , x ) y 0
y
− atan − y 0, x 0
x
atan2(y , x ) = atan y y 0, x 0
x
y 0, x = 0
2
undefined y = 0, x = 0
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
1. To solve for 1, project the arm onto the x0, y0 plane
1 = atan2(xc , y c )
= atan2 xc + y c − d 2 , d
2 2
= atan2 − xc + y c − d 2 ,−d
2 2
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
s = zc − d1
xc + y c − d 2 + (zc − d1 ) − a2 − a3
2 2 2 2 2
cos 3 = D
2a2a3
(
3 = atan2 D, 1 − D 2 )
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
• Thus there are two solutions for the pair (2, 3)
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
s = zc − d1
d3 = r 2 + s 2
= xc + y c + (zc − d1 )
2 2 2
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
Next class…
• Now that we can solve for the position of the wrist center (given
kinematic decoupling), we can use the desired orientation of the end
effector to solve for the last three joint angles
– Finding a set of Euler angles corresponding to a desired rotation matrix R
– We want the final three joint angles that give the orientation of the tool
frame with respect to o3 (i.e. R63)
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
− s5 c 6 s5 c 6 c5 c5d 6
0 0 0 1
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
c5 = r33 , s5 = 1 − r33
2
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
1. Find q1, q2, q3 such that the position of the wrist center is:
0
inverse position
oco = o − d 6R 0 kinematics
1
• For the DH parameters below, we can derive R30 from the forward
kinematics: c1c 23 − c1s23 s1
R30 = s1c 23 − s1s23 − c1
s23 c 23 0
• We know that R63 is given as follows:
c 4c5c 6 − s4s6 − c 4c 5s6 − s 4c 6 c 4 s5
R63 = s4c5c 6 + c 4s6 − s 4c 5 s6 + c 4c 6 s4s5
− s5c 6 s5 c 6 c5
• Euler angle solutions can be applied. Taking the third column of (R30)TR
c 4s5 = c1c23 r13 + s1c 23 r23 + s23 r33
s4s5 = −c1s23 r13 − s1s23 r23 + c23 r33
c5 = s1r13 − c1r23
• Finally, we can solve for the two remaining angles as follows:
4 = atan2(c1c23r13 + s1c23r23 + s23r33 ,−c1s23r13 − s1s23r23 + c23r33 )
6 = atan2(− s1r11 + c1r21, s1r12 − c1r22 )
• For the singular configuration (5 = 0), we can only find 4 + 6 thus it is
common to arbitrarily set 4 and solve for 6
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
link ai i di i
1 0 90 d1 1
2 a2 0 0 2
3 a3 0 0 3
4 0 -90 0 4
5 0 0 0 5
6 0 0 d6 3
• we are given H = T60 such that: ox r11 r12 r13
o = oy , R = r21 r22 r23
oz r31 r32 r33
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
zc oz − d 6 r33
(
3 = atan2 D, 1 − D 2 )
• Where d is the shoulder offset (if any) and D is given by:
xc + y c − d 2 + (zc − d1 ) − a2 − a3
2 2 2 2 2
D=
2a2a3
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
4 = atan2(c1c23 r13 + s1c23 r23 + s23 r33 ,−c1s23r13 − s1s23 r23 + c23 r33 )
5 = atan2 s1r13 − c1r23 , 1 − (s1r13 − c1r23 )
2
6 = atan2(− s1r11 + c1r21, s1r12 − c1r22 )
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
R o
• We are given T40: T40 =
0 1
c12c 4 + s12s4 s12c 4 − c12s4 0 a1c1 + a2c12
s c − c s − c12c 4 − s12s4 0 a1s1 + a2s12
= 12 4 12 4
0 0 − 1 − d3 − d 4
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
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
• Thus, given the form of T40, R must have the following form:
c − s 0
R = s c 0
0 0 1
c2 =
2a1a2
• This gives two solutions for 2: 2 = atan2 c2 , 1 − c2 2
• Once 2 is known, we can solve for 1:
1 = atan2(ox , oy ) - atan2(a1 + a2c2 , a2s2 )
• 4 is now give as: 4 = 1 + 2 − atan2(r11, r12 )
• Finally, it is trivial to see that d3 = oz + d4
Ecole Nationale des sciences Appliquées de Fès
Département Génie Industriel
• Paden-Kahan subproblems
– An attempt to create a generalized formulation for solving inverse
kinematics based (again) upon some common configurations
– This typically involves rotating vectors about moving axes and projecting the
rotations onto orthogonal planes to solve for rotation angles
– See Murray, Li, Sastry, pp. 99-107