Robotics1 18.01.11 PDF
Robotics1 18.01.11 PDF
The Panda by Franka Emika shown in Fig. 1 is an innovative lightweight robot intended for friendly and
safe human-robot interaction. The robot has seven revolute joints and its kinematics is characterized
by a spherical shoulder, an elbow with two offsets, and a non-spherical wrist. This combination allows
eliminating unaccessible ‘holes’ close to the robot base, thus increasing the robot workspace.
Figure 1: The 7R Panda robot by Franka Emika and two views of its workspace.
• Assign the link frames according to the Denavit-Hartenberg (DH) convention and complete the as-
sociated symbolic table of parameters, specifying also the signs of the non-zero constant parameters.
Draw the frames and fill in the table directly on the extra sheet #1 provided separately. Therein,
the two DH frames 0 and 7 are already assigned and should not be modified. [Please, make clean
drawings and return the completed sheet with your name written on it.]
• Write explicitly the seven resulting DH homogeneous transformation matrices 0A1 (q1 ) to 6A7 (q7 ).
[Do NOT attempt to write the direct kinematics in symbolic form!]
• Assume that all constant DH parameters have been specified numerically. While the robot is moving,
the actual position p ∈ R3 of the end-effector (i.e., of the origin O7 of frame 7) should be computed in
real time using the measurements of q ∈ R7 collected by the encoders at each sampling instant (say,
every 400 µs). Provide an efficient scheme for this computation, and determine the total number
of elementary operations (evaluation of trigonometric functions, of products ×, and of sums +)
required at each sampling step. You may proceed without exploiting the specific structure of the
DH matrices, or customize the procedure avoiding unnecessary elementary operations for this robot.
Exercise 2
A number of statements are reported on the extra sheet #2, regarding the Newton and the Gradient
methods for the numerical solution of inverse kinematics problems. Check if each statement is True or
False, providing also a very short motivation/explanation for your answer. [Return the sheet with your
answers and your name written on it.]
1
Exercise 3
With reference to the setup in Fig. 2, two identical planar 3R manipulators, a master robot M and a
slave robot S having link lengths `1 = `2 = 0.5 and `3 = 0.25 [m], should perform a Cartesian motion
task in coordination. The base frames of the robots are displaced by pM S = (∆x, ∆y, 0) = (1.6, 0.9, 0) [m]
and rotated by αM S = π [rad] around the common z 0 axis. The desired Cartesian motion starts at
t = t0 from the position pM (t0 ) ∈ R2 assumed by the end-effector of the master robot in the configuration
q M (t0 ) = (π/2, −π/3, 0) [rad] and will proceed along a straight line path, which is specified by the initial
direction of the end-effector velocity v M = ṗM (t0 ) ∈ R2 resulting from q̇ M (t0 ) = (−π/6, 0, −π/2) [rad/s].
The slave robot should execute the same Cartesian motion in position, while keeping its end-effector always
oriented orthogonally to the linear path (more specifically, rotated by a constant angle β = −π/2 [rad]
with respect to the vector v M ).
• Determine an initial configuration q S (t0 ) of the slave robot such that its end-effector position
pS (t0 ) ∈ R2 and orientation are initially matched with those required by the motion task.
• Determine the initial joint velocity q̇ S (t0 ) ∈ R3 of the slave robot, in order to match also the initial
desired Cartesian velocity (i.e., v S = ṗS (t0 ) is equal to v M ).
• If the initial configuration of the slave robot is not matched with the desired Cartesian motion,
how can this robot still perform the task after an initial transient, with its task error decreasing
exponentially to zero?
pM x0,S
qS,1
qM,3
y0,S
qS,2 !y = 0.9 m
master
robot slave
y0,M qM,2 robot
pS
qM,1
qS,3
x0,M
!x = 1.6 m
Figure 2: The relative placement of the bases of the two planar 3R robots that should perform a
Cartesian motion task in coordination.
Exercise 4
Consider the planning of a smooth trajectory for a planar RP robot (with unlimited joint ranges) between
the configurations q(0) = (π/4, −1) [rad,m] at t = 0 and q(T ) = (−π/2, 1) [rad,m] at t = T . The initial
and final joint velocity and acceleration should be zero, and the acceleration should be continuous in the
entire time interval [0, T ]. The following joint velocity and acceleration bounds are also present:
|q̇1 | ≤ V1 = 120◦/s, |q̇2 | ≤ V2 = 180 cm/s, |q̈1 | ≤ A1 = 150◦/s2 , |q̈2 | ≤ A2 = 200 cm/s2 . (1)
Define a suitable class of trajectories and choose a final time T = 3 s. Will the resulting robot motion be
feasible with respect to the bounds in (1)? Using uniform time scaling, find the minimum feasible motion
time T ∗ to perform the desired reconfiguration along the chosen trajectory. Sketch a plot of the resulting
joint velocity and acceleration profiles. Will the robot cross a singular configuration during its motion?
[240 minutes, open books but no computer or smartphone]
2
7R Panda robot by Franka Emika ‒ DH frames assignment and table
Name: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!""
y7
O7
z7
i !i ai di "i!
1
2
3
4
5
z0
6
x0
7 O0
Robotics I ‒ Sheet for Exercise 1, January 11, 2018
Robotics I - Sheet for Exercise 2
January 11, 2018
Name:
Consider the basic algorithms of the two main numerical methods used for solving inverse kinematics
problems, denoted here as N (Newton method) and G (Gradient method). Check if each of the following
statements is True or False, and provide a very short motivating/explanation sentence.
4. N can be used only when there is a single global solution to the problem.
True False
6. For a non-square Jacobian, the pseudoinverse should replace the Jacobian transpose in G.
True False
9. Neither N nor G would terminate without the use of a small tolerance on the final error.
True False
10. Beside matrix operations with the Jacobian and the error, G needs an extra choice to be made.
True False
Solution
January 11, 2018
Exercise 1
To help in defining DH frames for the Panda robot by Franka Emika, Figure 3 shows preliminarily the arm
decomposition into the series of its links and the definition of the seven joint axes (with a few comments).
link 2
joint 2
spherical
link 1 shoulder
link 0
joint 1
Figure 3: Decomposition of the Panda robot into links and definition of the seven joint axes.
A possible DH frame assignment and the associated table of parameters are reported in Fig. 4 and Tab. 1,
respectively, together with their signs. The definition of the constant non-zero DH parameters dj and ak
and of the DH variables θi (i = 1, . . . , 7) at the current configuration is illustrated in Fig. 5.
z0
x0
O0
Figure 4: A possible DH frame assignment for the Panda robot by Franka Emika.
5
i αi ai di θi
1 π/2 0 d1 > 0 q1
2 −π/2 0 0 q2
4 −π/2 a4 < 0 0 q4
5 π/2 0 d5 > 0 q5
6 π/2 a6 > 0 0 q6
7 0 0 d7 > 0 q7
!x5
O5 d5
x6 !x4 (z5 pointing x6 !5 = 0
O6 a6 z4
! inside) !6 > 0 z4
d7 z6 z5 a4 O4 z6
x3 a3 x5 z5 x3
y7 (z3 going inside)
O7 O3 y7 !4 < 0
z7 x4
d3 !7 = ! !/2 z7
x2 (x7 going outside)
z2 x2 !3 = 0
z2
x1 O1 = O2
!2 > 0
(z1 going inside)
x1
d1 !1 = 0
z0
z0
x0
O0 x0
Figure 5: Definition of the (non-zero) constant and variable DH parameters for the Panda robot.
6
0 1 0 1
cos q5 0 sin q5 0 cos q6 0 sin q6 a6 cos q6
4
B sin q5 0 − cos q5 0 C
5
B sin q6 0 − cos q6 a6 sin q6 C
A5 (q5 ) = B C, A6 (q6 ) = B C,
B C B C
@ 0 1 0 d5 A @ 0 1 0 0 A
0 0 0 1 0 0 0 1
and 0 1
cos q7 − sin q7 0 0
6
B sin q7 cos q7 0 0 C
A7 (q7 ) = B C.
B C
@ 0 0 1 d7 A
0 0 0 1
The numerical computation for obtaining the end-effector position p ∈ R3 at a given (measured) configu-
ration q ∈ R7 is efficiently organized as recursive matrix-vector operations in the form
2 2 2 2 2 2 0 1333333
! 0
p 6 6 6 6 6 6 B 0 C777777
phom = = 0A1 (q1 ) 61A2 (q2 ) 62A3 (q3 ) 63A4 (q4 ) 64A5 (q5 ) 65A6 (q6 ) 66A7 (q7 ) B C777777 . (2)
6 6 6 6 6 6 B C777777
1 4 4 4 4 4 4 @ 0 A555555
1
The number of elementary operations to be performed is evaluated as follows. We need in any case:
Without exploiting the specific structure of the DH matrices, but taking into account that only the first
three rows of each matrix are actually involved in the computations, we have additionally:
The total number of products and sums can be reduced if we proceed by customization, namely by using the
known structure of the specific DH matrices and thus avoiding useless products by 0 or ±1 and additions
of null terms. In this case, we have:
• the first step (the product by 6A7 ) can be skipped, and computations can start with the 4-dimensional
` ´T
vector 0 0 d7 1 ;
• in the second step (the product by 5A6 ), we have only 4 × and 2 + actual operations;
• proceeding similarly: in the third step (with 4A5 ) ⇒ 3 ×, 1 +; in the fourth (etc., . . . ) ⇒ 6 ×, 4 +;
in the fifth ⇒ 7 ×, 5 +; in the sixth ⇒ 4 ×, 2 +; in the seventh and last (with 0A1 ) ⇒ 5 ×, 3 +;
• in total ⇒ 29 products and 17 sums.
Exercise 2
7
4. N can be used only when there is a single global solution to the problem.
False. N (as well as G) can be used in any case, finding only one solution at a time.
6. For a non-square Jacobian, the pseudoinverse should replace the Jacobian transpose in G.
False. The pseudoinverse replaces in this case the Jacobian inverse in N. G needs no changes.
9. Neither N nor G would terminate without the use of a small tolerance on the final error.
True. Numerical methods always require a small final tolerance (due to roundings, etc.).
10. Beside matrix operations with the Jacobian and the error, G needs an extra choice to be made.
True. G needs the choice of a stepsize in the (negative) gradient direction.
Exercise 3
The solution to the problem requires a combination of direct kinematics and differential kinematics for
the master robot and of inverse kinematics and inverse differential kinematics for the slave robot. In
addition, one should take into account the roto-translation between the base frames of the two robots.
This is represented by a constant homogenous transformation matrix used to change the representations
of position vectors starting from the two different origins. Some care should be also used in the treatment
of the end-effector orientation of the slave robot as required by the task. Note that the slave robot, with
its n = 3 joints, is not redundant for the given coordinated task, which in fact specifies m = 3 variables.
To begin, frame 0 of the slave robot is related to frame 0 of the master robot by
0 1 0 1
! cos αM S − sin αM S 0 ∆x −1 0 0 1.6
RM S pM S B sin α
MS cos αM S 0 ∆y C B 0 −1
C B 0 0.9 C
T MS = =B C=B C. (3)
B C
0T 1 @ 0 0 1 0 A @ 0 0 1 0 A
0 0 0 1 0 0 0 1
It follows that
RSM = RTM S = RM S , T SM = (T M S )−1 = T M S . (4)
Since the problem is planar, we can conveniently work with two-dimensional vectors in the plane (and
their three-dimensional homogeneous version), 2 × 2 rotation matrices (around a unit normal to the motion
plane), and associated 3 × 3 homogeneous transformation matrices. We have in particular
0 1
! −1 0 1.6
RM S pM S
T MS = = @ 0 −1 0.9 A , (5)
B C
0T 1
0 0 1
and similar relations hold for the overlined matrices as those in (4).
With the direct positional kinematics of the master robot
!
`1 cos qM,1 + `2 cos(qM,1 + qM,2 ) + `3 cos(qM,1 + qM,2 + qM,3 )
pM (q M ) = , (6)
`1 sin qM,1 + `2 sin(qM,1 + qM,2 ) + `3 sin(qM,1 + qM,2 + qM,3 )
8
the end-effector position is evaluated in q M (t0 ) = (π/2, −π/3, 0) [rad] = (90◦ , −60◦ , 0) at time t = t0 ,
!
0.6495
pM (q M (t0 )) = = M pM , (7)
0.8750
where the superscript on the last term reminds us of the frame in which this (planar) vector is expressed.
Similarly, using the 2 × 3 Jacobian of the master robot (written with the usual compact notation)
!
∂pM (q M ) −(`1 sM,1 + `2 sM,12 + `3 sM,123 ) −(`2 sM,12 + `3 sM,123 ) −`3 sM,123
J M (q M ) = = , (8)
∂q M `1 cM,1 + `2 cM,12 + `3 cM,123 `2 cM,12 + `3 cM,123 `3 cM,123
the initial linear velocity in the plane of the master end-effector is evaluated as
0 1
! −π/6 !
−0.8750 −0.3750 −0.1250 B 0.6545
ṗM (q M (t0 )) = J M (q M (t0 )) q̇ M (t0 ) = @ 0 A= = M vM .
C
0.6495 0.6495 0.2165 −0.6802
−π/2
(9)
In order to obtain the desired initial position of the end-effector of the slave robot and its desired linear
velocity, the vectors in (7) and (9) should be expressed in the reference frame of this second robot. Using (3)
and (4), we have
! ! !
S M
S pS M pM S 0.9505
pS,hom = = T SM pM,hom = T M S ⇒ pS = [m] (10)
1 1 0.0250
and !
S M −0.6545
v S = RSM vM = [m/s]. (11)
0.6802
The angular direction of vector S v S prescribes also the desired orientation of the slave end-effector as
n o π
φS = qS,1 + qS,2 + qS,3 = ATAN2 S v S,y , S v S,x + β = 2.3370 − = 0.7662 [rad] = 43.89◦ . (12)
2
The above quantities, together with other parts of the solution, are conveniently illustrated in Fig. 6.
In order to solve the inverse kinematics of the slave robot for the desired S pS and φS , given respectively
by (10) and (12), we compute first the associated position of the tip of the second link
! ! !
pS2,x S `3 cos φS 0.7703
pS2 = = pS − = [m]. (13)
pS2,y `3 sin φS −0.1483
The solution for the first two joints follows then from the standard inverse formulas for a planar 2R robot:
9
qS,3 = 93.1! slave
robot
pM = pS x0,S
master
robot qM,3 = 0! qS,1 = 27.4!
!y = 0.9 m
Mp
"0.6495% Sp
"0.9505%
M = $0.8750' S = $0.0250'
y0,M # & # &
qM,1 = 90! Mv
# 0.6545& Sv
# "0.6545&
M = % "0.6802( S = % 0.6802(
$ ' $ '
! !
x0,M
! !
!x = 1.6 m
Figure 6: The desired initial configurations of the master and slave robots and the direction of the
Cartesian velocity (not in scale) for the coordinated task.
As just seen, the coordination task for the slave robot is specified by three variables which can be jointly
described as ! ! !
S S S
pS 3 ṗS vS
rS = ∈R , ṙ S = = ∈ R3 , (17)
φS φ̇S 0
where we set φ̇S = 0 since the absolute orientation of the slave end-effector should remain constant along
the fixed linear path. Therefore, since
0 1
`1 cos qS,1 + `2 cos(qS,1 + qS,2 ) + `3 cos(qS,1 + qS,2 + qS,3 )
r S (q S ) = @ `1 sin qS,1 + `2 sin(qS,1 + qS,2 ) + `3 sin(qS,1 + qS,2 + qS,3 ) A , (18)
B C
qS,1 + qS,2 + qS,3
10
Finally, if there is an initial mismatch (because the slave robot is not in one of the two possible correct
initial configurations, the other being that obtained with s2 < 0 in (14)), a kinematic feedback control law
driven by the (Cartesian) task error should be applied. In order to have the task error converge to zero
exponentially and in a decoupled way for each component of the task error, the required control law is
q̇ S = J −1
S (q S ) (ṙ S,d + K(r S,d − r S (q S ))) , (22)
where a subscript d has been added to denote the desired task variables and their first time derivatives,
and with K > 0 being a diagonal 3 × 3 gain matrix that specifies the rate of convergence of the errors.
Exercise 4
In view of the smoothness requirement, it is convenient to choose quintic polynomials as the class of motion
trajectories for each joint. These polynomials can be used to impose also the initial and final values for
the joint velocity and acceleration, in particular all zero as in the present case. Being the required joint
displacements
3π
0 1 !
− −135
∆q = q(T ) − q(0) = @ 4 A [rad; m] = [◦ ; cm], (23)
2 200
the double normalized expression of the trajectory in the joint space is
t
q(τ ) = q(0) + ∆q 6τ 5 − 15τ 4 + 10τ 3 ,
` ´
τ= ∈ [0, 1]. (24)
T
In order to find the maximum velocity and acceleration reached along this trajectory, which should satisfy
the bounds (1), the first three time derivatives are needed:
∆q ` 4 ∆q ` ... ∆q `
τ − 2τ 3 + τ 2 , q̈(τ ) = 60 2 2τ 3 − 3τ 2 + τ , q (τ ) = 60 3 6τ 2 − 6τ + 1 .
´ ´ ´
q̇(τ ) = 30
T T T
(25)
The maximum acceleration occurs where the third derivative is zero (no need to check the value at the
boundaries t = τ = 0 and t = T (τ = 1), since we have q̈(0) = q̈(1) = 0 by construction):
√
... 3 ∆q
q (τ ) = 0 ⇐⇒ 6τ 2 − 6τ + 1 = 0 @ τa = 0.5 ± ⇒ q̈(τa ) = ± 5.7735 2 . (26)
6 T
Similarly, the maximum velocity occurs where the second derivative is zero (again, no need to check the
value at the boundaries, since q̇(0) = q̇(1) = 0):
30 ∆q
τ 2τ 2 − 3τ + 1 = 0 @ τv = {0, 0.5, 1} ⇒ q̇(0.5) =
` ´
q̈(τ ) = 0 ⇐⇒ . (27)
16 T
For the given motion time T = 3 [s], the maximum values are:
|q̇1 (0.5)| = |−84.375| < 120 = V1 [◦/s], |q̇2 (0.5)| = 125 < 180 = V2 [cm/s],
(28)
|q̈1 (τa )| = 86.6025 < 150 = A1 [◦/s2 ], |q̈2 (τa )| = 128.3 < 200 = A2 [cm/s2 ].
It follows that the original trajectory is feasible. Figure 7 shows the originally planned trajectory profiles.
As a result, we can speed up motion by considering a uniform time scaling. In order to find the minimum
motion time T ∗ that still produces feasible trajectories, we compute
( s ) ( s )
V1 A1 V2 A2
k1 = min , = 1.3161, k2 = min , = 1.2485 (29)
|q̇1 (0.5)| |q̈1 (τa )| |q̇2 (0.5)| |q̈2 (τa )|
T 3
⇒ k = min{k1 , k2 } = 1.2485 ⇒ T∗ = = = 2.4028 [s]. (30)
k 1.2485
The scaled trajectory and its first two derivatives are shown in Fig. 8. The new maximum values are:
|q̇1 (0.5)| = |−105.34| < 120 = V1 [◦/s], |q̇2 (0.5)| = 156.06 < 180 = V2 [cm/s],
(31)
◦
|q̈1 (τa )| = 135 < 150 = A1 [ /s ],2
|q̈2 (τa )| = 200 = A2 [cm/s2 ].
11
original joint trajectories with T=3
100
80
60
40
20
[deg, cm]
−20
−40
−60
−80
−100
0 0.5 1 1.5 2 2.5 3
time [s]
150
100
50
[deg/s, cm/s]
−50
−100
−150
200
150
100
50
[deg/s2, cm/s2]
−50
−100
−150
−200
Figure 7: Original joint trajectory for a motion time T = 3 [s], with velocity and acceleration
profiles (joint 1 = blue, joint 2 = red). The bounds (1), shown by dashed lines (·−), are satisfied.
12
joint trajectories with scaled T=2.4028
100
80
60
40
20
[deg, cm]
−20
−40
−60
−80
−100
0 0.5 1 1.5 2
time [s]
150
100
50
[deg/s, cm/s]
−50
−100
−150
0 0.5 1 1.5 2
time [s]
200
150
100
50
[deg/s2, cm/s2]
−50
−100
−150
−200
0 0.5 1 1.5 2
time [s]
Figure 8: Scaled joint trajectory for a motion time T ∗ = 2.4028 [s], with velocity and acceleration
profiles (joint 1 = blue, joint 2 = red). The bound in (1) for the acceleration of the second joint
is being reached in two instants that are symmetric w.r.t. the trajectory midpoint.
13
Cartesian path of the end−effector of the RP robot
40
−20
y [cm]
−40
−60
−80
initial Cartesian position
p(0) = (-0.7071, -0.7071), final Cartesian position
−100
with orientation q1(0) = 45! p(T) = (0, -1),
with orientation q1(T)= -90!
−120
−100 −80 −60 −40 −20 0 20 40 60
x [cm]
Figure 9: Cartesian path traced by the end-effector of the RP robot. Its orientation is shown at
the start and final configurations, and at the intermediate motion instant t = T /2 (or T ∗/2) when
the robot crosses the singularity q2 = 0.
During motion, the RP robot will certainly cross a singular configuration with q2 = 0. This will certainly
happen for any class of interpolating trajectories, since the initial and final values of q2 have opposite signs.
However, this singularity does not harm when planning (and control) is made directly in the joint space,
as in the present case. Figure 9 shows the motion path of the end-effector with the (original or uniformly
scaled) quintic polynomial trajectory.
∗∗∗∗∗
14