Robotics1 24.01.24
Robotics1 24.01.24
Exercise 1
Consider a sequence of three rotations by the angles α, β, and γ around the fixed axes ZXY.
• Provide in symbolic form the rotation matrix R(α, β, γ) representing the obtained final orientation.
• Solve the inverse problem in closed form for a generic R ∈ SO(3), including also singular situations.
• Compute all numerical solutions {α, β, γ} of the inverse problem (and check the results!) when
√ √ √
5 2 2 3
8 −
√ 8 4
√ √
R= 2 2 3
. (1)
4 4 2
√ √
6 3 6 1
−
8 8 4
• Express the orientation (1) with respect to the frame defined by a sequence of two rotations around the
fixed axes ZX obtained using one pair {α, β} from the solution angles of the above inverse problem.
Exercise 2
The Yaskawa Motoman GP7 shown in Fig. 1 and in the accompanying Extra Sheet is a 6R robot ma-
nipulator with a spherical wrist and some offsets. The six joints are also labeled by the manufacturer (in
sequence): S, L, U, R, B, T. Define a set of Denavit-Hartenberg (D-H) frames and compute the corre-
sponding table of parameters. The D-H frame RF0 should be placed on the floor at the robot base, while
the origin O6 of RF6 is at the center of the end-effector flange and axis z 6 is in the approach direction.
Draw the frames on the Extra Sheet, using the side, front, and top views (for better clarity, draw on each
view only those DH axes that lie in the associated plane). Provide the numerical values of the constant
parameters and the values of the joint variables q in the configuration shown in the sheet. Compute then
numerically the position of O6 in this configuration, as well as in the configuration q = 0.
1
Exercise 3
For which values of θ2 in the interval (−π, π] has this equation real solutions in terms of the angle θ1 ?
sin θ1 + 2 cos(θ1 + θ2 ) = 2 (2)
Exercise 4
The kinematics of a 3R spatial robot is defined through the D-H parameters in Tab. 1.
i αi ai di θi
2 0 a2 > 0 0 q2
3 π/2 a3 > 0 0 q3
Exercise 5
Consider a 3R planar robot with links lengths li > 0 (i = 1, 2, 3) and D-H joint variables q1 q2 , and q3 .
For the task vector r = (p, α) = (px , py , α) ∈ R3 , with p being the position of the end-effector and α its
orientation angle with respect to the 0 x axis, the following desired task trajectory r d (t) is assigned:
px,d (t) = x0 + R cos αd (t)
py,d (t) = y0 + R sin αd (t) (3)
αd (t) = ω t,
with R > 0, ω > 0, and t ∈ [0, ∞).
• Determine the analytic expressions of the associated desired joint trajectory q d (t), and of its velocity
q̇ d (t) and acceleration q̈ d (t).
• Using the data l1 = l2 = l3 = 1 [m], x0 = y0 = 1 [m], R = 0.5 m, and ω = 2π rad/s, determine the
numerical values of q d (t̄), q̇ d (t̄), and q̈ d (t̄) at time t̄ = 0.25 s.
• Check that the obtained results are consistent with those of the desired task trajectory r d (t) and of its
first and second derivatives at the same time instant.
Exercise 6
• Define a trajectory q(t) for a robot joint that should start at rest from qi at a given time ti and arrive
at time tf in qf with a final velocity vf 6= 0. All the symbolic values are here generic.
• For a motion time T = tf − ti , find vmax = maxt∈[ti ,tf ] |q̇(t)|, i.e., the maximum absolute value of the
joint velocity, and the instant of time t∗ ∈ [ti , tf ] at which this value is attained.
• Compute the value of vmax (in [rad/s]) and the instant t∗ (in [s]) for the following set of data: ti = 1.5 s,
tf = 2 s, qi = π/2 rad, qf = π rad, vf = −4 rad/s.
2
Solution
January 24, 2024
Exercise 1
The orientation obtained with three rotations around the sequence of fixed axes ZXY with angles α, β,
and γ is given by
Given a matrix R ∈ SO(3), with elements denoted by Rij , the inverse problem for this RPY-type sequence
of angles is solved in closed form as follows. The second angle is obtained comparing the elements of the
second row in (4) with those in R:
q
β +,− = ATAN2 −R23 , ± R21 2 2
+ R22 (5)
2 2
If R21 + R22 = cos2 β 6= 0, we are in the regular case (two solution triples). The remaining angles are then
found as
α+ = ATAN2 {R21 , R22 } , γ + = ATAN2 {R13 , R33 } , (6)
when the + sign (cos β > 0) has been chosen in (5), and as
when the − sign (cos β < 0) has been chosen in (5). From eqs. (5)–(7), the two solution triples are
{α+ , β + , γ + } and {α− , β − , γ − }.
In the singular case, R21 = R22 = cos β = 0, one has the identity1
cα cγ ± sα sγ ±cα sγ − sα cγ 0 cos(α ∓ γ) − sin(α ∓ γ) 0 R11 R12 0
0 0 −sβ = 0 0 −sβ = 0 0 ∓1 .
±sα cγ − cα sγ sα sγ ± cα cγ 0 ± sin(α ∓ γ) ± cos(α ∓ γ) 0 R31 R32 0
If R23 = −1, then it is β = π/2 and one can solve only for the difference α − γ = ATAN2 {−R12 , R11 }. If
instead R23 = 1, then it is β = −π/2 and one can solve only for the sum α + γ = ATAN2 {−R12 , R11 }.
Considering the rotation matrix R in (1), it is easy to see that we are in the regular case (with cβ = 0.5).
Thus, the two solution triples are
and
{α− , β − , γ − } = {−2.3562, −2.0944, 2.0944} = {−3π/4, −2π/3, 2π/3} [rad]. (9)
When inserted in (4) as a check, both solutions return as expected the given R.
The orientation obtained with two rotations by some angles α and β around the sequence of fixed axes ZX
is given by RZX = Rx (β)Rz (α). The expression of a generic orientation R with respect to such rotated
1 Use of the ∓ signs: take always either the upper sign or the lower sign in all terms.
3
frame2 is given then by ZXR = RZX T
R. For the matrix in (1), using the elementary rotation matrices
in (4) and the values (α , β ) from (8) and, respectively, (α− , β − ) from (9) gives
+ +
0.5625 0.8125 −0.1531 −0.3125 −0.5625 0.7655
ZX + ZX −
R = −0.6875 0.5625 0.4593 and R = 0.9375 −0.3125 0.1531 .
0.4593 −0.1531 0.8750 0.1531 0.7655 0.6250
Exercise 2
Views of a possible assignment of D-H frames for the 6R Yaskawa robot of Fig. 1 are shown in Fig. 2.
𝑥% 𝑥" 𝑥!
𝑥$ 𝑥#
𝑧" 𝑧!
𝑦$ 𝑧% 𝑦#
𝑦&
𝑥&
𝑧'
𝑥'
𝑦#
𝑧$ 𝑧# 𝑧% 𝑧&
𝑧" 𝑧$
𝑧! 𝑧! 𝑦% 𝑦&
𝑦"
Figure 2: Side, front, and top views of the D-H frame assignment for the Yaskawa robot of Fig. 1.
2 As usual, when no left superscript is present in a vector or matrix, the default is that this quantity is expressed
4
The corresponding D-H parameters are reported in Tab. 2. Note that the parameter d1 is computed from
the data sheet as follows d1 = 877 − (445 + 40 + 62) = 330 mm.
i αi ai di θi
3 (U) π/2 a3 = 40 0 q3 = 0
5 (B) π/2 0 0 q5 = 0
6 (T) 0 0 d6 = 80 q6 = 0
Table 2: Table of D-H parameters corresponding to the frames of Fig. 2 for the Yaskawa robot (angles are
in [rad], lengths in [mm]). The numerical values of q refer to the configuration shown in the Extra Sheet.
The numerical values in the last column in the table correspond to the robot configuration q s shown in
Fig. 2. In this configuration, the position of the origin O6 (as well as the orientation of the D-H frame 6
— which was not requested) are computed through the direct kinematics of the robot as
560 0 0 1
0 0
p6 (q s ) = 0 [mm], R6 (q s ) = 0 −1 0 .
815 1 0 0
Similarly, in q = 0 we have
525 1 0 0
0 0
p6 (0) = 0 [mm], R6 (0) = 0 −1 0 .
−190 0 0 −1
Exercise 3
5
For instance, when θ2 = 0, eq. (2) becomes
sin θ1 + 2 cos θ1 = 2,
On the other hand, eq. (2) has a single solution when sin θ2 = 0.25. In particular, for θ2 = 0.2526, the
equation becomes
0.5 sin θ1 + 1.9365 cos θ1 = 2,
and has the single solution
θ1 = 0.2499 rad;
similarly, for θ2 = π − 0.2526, the equation becomes
Exercise 4
From Tab. 1, we compute the D-H homogeneous transformation matrices of this 3R spatial robot:
c1 0 s1 a1 c1 c2 −s2 0 a2 c2 c3 0 s3 a3 c3
s 0 −c a1 s1 1 s2 c2 0 a2 s2 2 s3 0 −c3 a3 s3
0 1 1
A1 (q1 ) = , A2 (q2 ) = , A3 (q3 ) = .
0 1 0 d1 0 0 1 0 0 1 0 0
0 0 0 1 0 0 0 1 0 0 0 1
From these, being the end-effector position coincident with the origin O3 of frame 3, we obtain all the
quantities needed for computing the geometric Jacobian J g (q) as
!
z 0 × p03 z 1 × p13 z 2 × p23
J L (q)
J g (q) = = , (14)
J A (q) z0 z1 z2
with all quantities being expressed by default in frame 0. For better clarity, we will insert left superscripts
in the following. We have
0 s1 s1
0 0 1
z 0 = 0 , z 1 = R1 (q1 )z 0 = −c1 , z 2 = R1 (q1 ) R2 (q2 )z 0 = −c1 , (15)
1 0 0
a1 c1
0
0 p01 (q) 0 a1 s1
p01,h (q) = = 0A1 (q1 ) =
d1 ,
1 1
1
a1 c1 + a2 c1 c2
0
0 p02 (q) 0 a1 s1 + a2 s1 c2
p02,h (q) = = 0A1 (q1 ) 1A2 (q2 ) =
d1 + a2 s2 ,
1 1
1
6
c1 (a1 + a2 c2 + a3 c23 )
0
0 p03 (q) 0 s1 (a1 + a2 c2 + a3 c23 )
p03,h (q) = = 0A1 (q1 ) 1A2 (q2 ) 2A3 (q3 ) =
d1 + a2 s2 + a3 s23 .
(16)
1 1
1
From these, we get
c1 (a2 c2 + a3 c23 ) a3 c1 c23
0 0 0 0 0 0
p13 (q) = p03 (q) − p01 (q) = s1 (a2 c2 + a3 c23 ) , p23 (q) = p03 (q) − p02 (q) = a3 s1 c23 .
a2 s2 + a3 s23 a3 s23
Indeed, this matrix could have been equivalently obtained by analytic differentiation as J L (q) = ∂p03 /∂q.
Moreover, from (15)
0 s1 s1
J A (q) = 0 −c1 −c1 . (18)
1 0 0
Thus, matrix J L (q) in (17) is singular when s3 = 0 (q3 = 0 or π) and/or when a1 + a2 c2 + a3 c23 = 0. In
view of the expressions in (16), the latter corresponds to p03,x = p03,y = 0, namely to a situation in which
the origin O3 of frame 3 is placed on the axis z 0 of the first joint.
On the other hand, matrix J A (q) in (18) is always singular, with constant rank ρ = 2. Being ω = J A (q)q̇,
all feasible directions at q for the angular velocity ω of the third (last) D-H frame belong to the subspace
0 s1
R {J A (q)} = span 0 , −c1 .
1 0
T
Finally, the position 3 pD = 0 0 D of a fixed point in the third D-H frame is a (constant) vector
from the origin O3 to this point. To compute the vector 0 pD starting from the origin O0 of the base frame
and ending at the same point, and expressed in the 0-th frame, we resort to homogeneous transformations:
c1 (a1 + a2 c2 + a3 c23 + D s23 )
0 3
pD (q) pD s1 (a1 + a2 c2 + a3 c23 + D s23 )
0
pD,h (q) = = 0A1 (q1 ) 1A2 (q2 ) 2A3 (q3 ) = . (19)
1 1 d1 + a2 s2 + a3 s23 − D c23
1
Using the kinematic data of the robot at q = (0, π/2, 0) [rad] and D = 0.52 m, we obtain
0.04 0.56
0 0
p03 = 0 and pD = 0 [m].
0.815 0.815
7
The velocity of the point defined in (19) is easily obtained by time differentiation
∂ 0 pD
v D = 0 ṗD (q) = q̇ = J D (q) q̇
∂q
−s1 (a1 + a2 c2 + a3 c23 + D s23 ) −c1 (a2 s2 + a3 s23 + D c23 )
−a3 c1 s23 + D c23
Exercise 5
In the first place, we have to solve the inverse kinematics problem for this 3R planar robot, repeatedly and
parametrically with respect to the desired trajectory r d (t) = (px,d (t), py,d (t), αd (t)). This is a standard
problem at each instant of time t (dropped for compactness in the following).
The direct task kinematics is
px l1 c1 + l2 c12 + l3 c123
r = py = l1 s1 + l2 s12 + l3 s123 = f (q). (21)
α q1 + q2 + q3
Setting r = r d in (21) and using the third equation in the first two, one has
! !
l1 c1 + l2 c12 px,d − l3 cαd
= , (22)
l1 s1 + l2 s12 py,d − l3 sαd
with the shorthand notations c1 = cos q1 , c12 = cos (q1 + q2 ), cαd = cos αd — similarly for the sines. By
squaring and summing the two equations in (22), we get
p2x,d + p2y,d + l32 − 2l3 (px,d cαd + py,d sαd ) − l12 − l22 q
c2,d = , s2,d = 1 − c22,d , (23)
2l1 l2
where only the + sign has been considered for s2,d (similar developments hold for the choice s2,d < 0).
Thus,
q2,d = ATAN2 {s2,d , c2,d } . (24)
This corresponds to an ‘elbow down’ solution for the first two joints. Using the expressions in (23), eq. (22)
is expanded as a linear system in the remaining unknowns c1 and s1 :
! ! !
l1 + l2 c2,d −l2 s2,d c1 px,d − l3 cαd
= . (25)
l2 s2,d l1 + l2 c2,d s1 py,d − l3 sαd
Unless the determinant of the coefficient matrix in (25) is zero, namely excluding when l12 +l22 +2l1 l2 c2,d = 0
(which happens if and only if l1 = l2 and c2,d = −π, being the determinant always positive otherwise), one
can solve for
c1,d = (l1 + l2 c2,d )(px,d − l3 cαd ) + l2 s2,d (py,d − l3 sαd )
(26)
s1,d = (l1 + l2 c2,d )(py,d − l3 sαd ) − l2 s2,d (px,d − l3 cαd ),
and then
q1,d = ATAN2 {s1,d , c1,d } . (27)
8
Finally,
q3,d = αd − (q1,d + q2,d ). (28)
The analytic expressions of the components of the desired joint trajectory q d (t) at any instant of time are
obtained from eqs. (23)–(24), (26)–(27) and (28), by plugging the desired task trajectory values from (3).
Moving to the differential level, the task Jacobian associated to (21) is
−(l1 s1 + l2 s12 + l3 s123 ) −(l2 s12 + l3 s123 ) −l3 s123
∂f
J (q) = = l1 c1 + l2 c12 + l3 c123 l2 c12 + l3 c123 l3 c123 . (29)
∂q
1 1 1
Therefore, the joint velocity q̇ d (t) along the desired task trajectory is computed as
−ωR sin ωt
q̇ d (t) = J −1 (q d (t)) ṙ d (t), with ṙ d (t) = ωR cos ωt , (30)
ω
where the Jacobian (29) is first evaluated at q d (t) and then inverted numerically, provided it is away from
its singularities (det J (q) = l1 l2 sin q2 = 0).
Similarly, at the acceleration level one has
ω 2 R cos ωt
q̈ d (t) = J −1 (q d (t)) r̈ d (t) − J̇ (q d (t)) q̇ d (t) , with r̈ d (t) = − ω 2 R sin ωt , (31)
0
where the term
l1 c1 q̇1 +l2 c12 (q̇1 +q̇2 )+l3 c123 (q̇1 +q̇2 +q̇3 ) l2 c12 (q̇1 +q̇2 )+l3 c123 (q̇1 +q̇2 +q̇3 ) l3 c123 (q̇1 +q̇2 +q̇3 )
J̇ (q) q̇ = − q̇
l1 s1 q̇1 +l2 s12 (q̇1 +q̇2 )+l3 s123 (q̇1 +q̇2 +q̇3 ) l2 s12 (q̇1 +q̇2 )+l3 s123 (q̇1 +q̇2 +q̇3 ) l3 s123 (q̇1 +q̇2 +q̇3 )
0 0 0
l1 c1 q̇12 2 2
+ l2 c12 (q̇1 + q̇2 ) + l3 c123 (q̇1 + q̇2 + q̇3 )
= − l1 s1 q̇12 + l2 s12 (q̇1 + q̇2 )2 + l3 s123 (q̇1 + q̇2 + q̇3 )2
0
is evaluated using q d (t), as well as q̇ d (t) from (30).
𝒒(𝑡̅)
𝒒(0)
Figure 3: The 3R planar robot executing the desired task trajectory at t = t̄ = 0.25 s (in blue) and in the
initial configuration q d (0) (in orange).
9
With the problem data, being for the desired task trajectory at t = t̄ = 0.25 s
1 −π 0
r d (t̄) = 1.5 [m,m,rad], ṙ d (t̄) = 0 [m/s,m/s,rad/s], r̈ d (t̄) = −2π 2 [m/s2 ,m/s2 ,rad/s2 ],
π/2 2π 0
Figure 3 shows the robot configuration q d (t̄) at the chosen time along the desired circular path, together
with the initial (elbow down) configuration q d (0) = (0.1296, 1.9552, −2.0847) [rad].
Exercise 6
The desired trajectory is found by solving a ‘rest-to-move’ interpolation problem between two configurations
assigned at two given time instants. A cubic polynomial of the form q(t) = c0 + c1 t + c2 t2 + c3 t3 has enough
free coefficients to satisfy all boundary conditions at the initial and final time. As customary, however, it
is more convenient to use a normalized time
t − ti t − ti
τ = = , with τ ∈ [0, 1] when t ∈ [ti , tf ],
tf − ti T
and define the cubic as
q(τ ) = qi + ∆q aτ 2 + bτ 3 ,
∆q = qf − qi , (32)
which already satisfies the boundary conditions at the initial time τ = 0 (t = ti ) on position and (zero)
velocity. Imposing the other two boundary conditions on the normalized cubic polynomial (32)
! ! !
q(tf ) = qf 1 1 a 1
⇒ = ,
q̇(tf ) = vf 2 3 b vf T /∆q
10
— at the trajectory midpoint). The velocity associated to the zero acceleration condition is found by
substituting τ ∗ from (36) in (34), obtaining
2
vf T
3−
∆q ∗ vf T vf T ∗ ∆q ∆q
q̇(τ ∗ ) = τ (6 − 2 ) − (6 − 3 )τ = . (37)
T ∆q ∆q T vf T
6−3
∆q
As a result, the maximum absolute velocity will be
Note that the actual time instant of maximum velocity will be t∗ = ti + τ ∗ T ∈ [ti , tf ].
With the data of the problem, one has T = tf − ti = 2 − 1.5 = 0.5 s, ∆q = qf − qi = π − π/2 = π/2 rad,
and vf = −4 rad/s. Being vf /∆q < 0, the above analysis applies and we obtain
The resulting cubic trajectory is shown in Fig. 4, together with the associated velocity and acceleration.
Note the asymmetric profiles with respect to the middle instant of the motion trajectory, as well as the
slight overshoot in position close to the final instant.
position velocity acceleration
3.4 6 60
3.2 5
40
3 4
2.8 3 20
d 2q/dt 2 [rad/s 2]
2.6 2
0
dq/dt [rad/s]
q [rad]
2.4 1
-20
2.2 0
2 -1 -40
1.8 -2
-60
1.6 -3
1.4 -4 -80
1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2
t [s] t [s] t [s]
Figure 4: The planned cubic trajectory for the given data (position, velocity, and acceleration).
∗∗∗∗∗
11