Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Note: This article contains text and two graphics from the reference [1] listed at the end.
Kinematics
Forward Kinematics
Given the joint angles and the links geometry, compute the orientation of the end effector relative to the
base frame.
Inverse Kinematics
Given the position and orientation of the end effector relative to the base frame compute all possible
sets of joint angles and link geometries which could be used to attain the given position and orientation
of the end effector.
2R Planar Manipulator
Figure 1: Elbow up (a) and Elbow down (b) configuration of a 2R planar manipulator
Forward Kinematics
x = l 1 cos 1 l 2 cos12
y = l 1 sin 1 l 2sin 12
Inverse Kinematics
x 2 y 2 = l 21 cos2 1 l 22 cos2 1 2 2l 1 l 2 cos 1 cos 12
l 21 sin 2 1 l 22 sin 2 1 2 2 l 1 l 2 sin 1 sin 1 2
= l 12 l 22 2 l 1 l 2 [cos 1 cos12 sin 1 sin 12 ]
Next we use the following equalities:
sin x y = sin x cos y cos x sin y
cos x y = cos x cos y sin x sin y
Therefore
x 2 y 2 = l 21 l 22 2 l 1 l 2 [ cos 1 cos 1 cos 2 sin 1 sin 2 sin 1 sin 1 cos 2cos 1 sin 2 ]
= l 12 l 22 2 l 1 l 2 [cos2 1 cos 2 sin 2 2 cos 2 ]
= l 12 l 22 2 l 1 l 2 cos 2
and
x 2 y 2l 21 l 22
cos 2 =
2 l1 l2
From here we could get the angle directly using the arccose function but this function is very inaccurate
for small angles. The typical way to avoid this inaccuracy is to convert further until we can use the
atan2 function.
cos 2 2sin 2 2 = 1
sin 2 = 1cos2 2
The two solutions correspond to the 'elbow up' and 'elbow down' configurations as shown in figure 1 a)
and b).
Finally we get:
2 = atan2sin 2, cos 2 =
atan2 1cos 2 2 ,cos 2 =
x 2 y 2 l 12l 22 2 x 2 y 2l 21l 22
atan2 1
,
2 l1 l 2
2l 1 l 2
For solving 1 we rewrite the original nonlinear equations using a change of variables as follows (see
figure 2):
x = l 1 cos 1 l 2 cos1 2
y = l 1 sin 1 l 2 sin 1 2
x = k 1 cos 1 k 2 sin 1
y = k 1 sin 1 k 2 cos 1
where
k 1 = l 1 l 2 cos 2
k 2 = l 2 sin 2
Figure 2 (taken from [1])
or
x
= cos cos 1 sin sin 1
r
y
= cos sin 1 sin cos 1
r
or
x
= cos 1
r
y
= sin 1
r
y y
, = atan2 y , x
r r
1 = atan2 y , xatan2 k 2, k 1
where
k 1 = l 1 l 2 cos 2
k 2 = l 2 sin 2
Notes
Switching to another choice of sign in the solution for 2 above will change the sign of k 2
and thus will affect 1 .
If x = y = 0 then the solution becomes undefined. In this case 1 is arbitrary. Note that this is
only possible if both links have the same length and can fold back onto each other.
References