Robot Kinematics
Robot Kinematics
Robot kinematics
?
?
?
?
Industrial automation and robotics – Robot kinematics – Paolo Rocco
Position and orientation of a body in space
The best thing to do is to consider a reference frame and to attach a second frame
to the body.
z’ y’
z x’
y O’
O x
The problem is now how to characterize the position and orientation of a frame with
respect to another one.
Industrial automation and robotics – Robot kinematics – Paolo Rocco
Position and orientation of a body in space
The representation of the position is just made with the components of the origin of
the body-attached frame with respect to the reference frame:
z’ y’
The three components can be
z x’ conveniently gathered in a vector:
y O’
O’z 𝑜𝑜 ′ 𝑥𝑥
O’y 𝐎𝐎𝐎 = 𝑜𝑜 ′ 𝑦𝑦
O’x 𝑜𝑜 ′ 𝑧𝑧
O x
𝑥𝑥 ′ 𝑥𝑥 𝑦𝑦 ′ 𝑥𝑥 𝑧𝑧 ′ 𝑥𝑥
O x ′
𝐱𝐱 ′ = 𝑥𝑥 ′ 𝑦𝑦 , 𝐲𝐲 ′ = 𝑦𝑦 𝑦𝑦 , 𝐳𝐳 ′ = 𝑧𝑧 ′ 𝑦𝑦
𝑥𝑥 ′ 𝑧𝑧 𝑦𝑦 ′ 𝑧𝑧 𝑧𝑧 ′ 𝑧𝑧
𝑥𝑥 ′ 𝑥𝑥 𝑦𝑦 ′ 𝑥𝑥 𝑧𝑧 ′ 𝑥𝑥 𝑇𝑇 𝑇𝑇
𝐱𝐱 ′ 𝐱𝐱 𝐲𝐲 ′ 𝐱𝐱 𝐳𝐳 ′ 𝐱𝐱
𝑇𝑇
′
𝐑𝐑 = 𝐱𝐱 ′ 𝐲𝐲 ′ 𝐳𝐳 ′ = 𝑥𝑥 𝑦𝑦 𝑦𝑦 ′ 𝑦𝑦 𝑧𝑧 ′ 𝑦𝑦 = 𝐱𝐱 ′ 𝑇𝑇 𝐲𝐲 𝐲𝐲 ′ 𝑇𝑇 𝐲𝐲 𝐳𝐳 ′ 𝑇𝑇 𝐲𝐲
𝑥𝑥 ′ 𝑧𝑧 𝑦𝑦 ′ 𝑧𝑧 𝑧𝑧 ′ 𝑧𝑧 𝑇𝑇 𝑇𝑇
𝐱𝐱 ′ 𝐳𝐳 𝐲𝐲 ′ 𝐳𝐳 𝐳𝐳 ′ 𝐳𝐳
𝑇𝑇
This matrix is called rotation matrix of the frame (𝐱𝐱 ′ , 𝐲𝐲 ′ , 𝐳𝐳 ′ ) with respect to the frame (𝐱𝐱, 𝐲𝐲, 𝐳𝐳) .
y
cos 𝛼𝛼 − sin 𝛼𝛼 0
y’ 𝐱𝐱 ′ = sin 𝛼𝛼 , 𝐲𝐲 ′ = cos 𝛼𝛼 , 𝐳𝐳 ′ = 0
α
0 0 1
x’
α x
O
Consider now a point P whose coordinates are expressed in two reference frames:
𝑝𝑝𝑥𝑥 𝑝𝑝′ 𝑥𝑥
′
𝐩𝐩 = 𝑝𝑝𝑦𝑦 , 𝐩𝐩′ = 𝑝𝑝 𝑦𝑦
𝑝𝑝𝑧𝑧 𝑝𝑝′ 𝑧𝑧
Therefore:
𝐩𝐩 = 𝑝𝑝′ 𝑥𝑥 𝐱𝐱 ′ + 𝑝𝑝′ 𝑦𝑦 𝐲𝐲 ′ + 𝑝𝑝′ 𝑧𝑧 𝐳𝐳 ′ = 𝐱𝐱 ′ 𝐲𝐲 ′ 𝐳𝐳 ′ 𝐩𝐩′ = 𝐑𝐑𝐩𝐩′
Let us consider three frames (denoted with 0, 1 and 2) with a common origin.
We denote with:
𝑗𝑗 the rotation matrix of frame i with respect to frame j
𝐑𝐑 𝑖𝑖
The coordinates of the same point in the three frames can be expressed in different ways:
𝐩𝐩1 = 𝐑𝐑12 𝐩𝐩2 𝐩𝐩0 = 𝐑𝐑01 𝐩𝐩1 𝐩𝐩0 = 𝐑𝐑02 𝐩𝐩2 𝐑𝐑02 = 𝐑𝐑01 𝐑𝐑12
A rotation matrix represents the orientation of a frame with respect to another one by means
of 9 parameters, among which 6 constraints exist.
I) Rotation around Z
(angle ϕ)
Orientation can also be planned by resorting to the axis/angle representation: if we assign two
frames with the same origin but different orientation, it is always possible to determine a unit vector
𝐫𝐫 such that the second frame is obtained from the first one through a rotation of an angle 𝜗𝜗 around
the axis of such unit vector.
Formulas can be obtained to relate the
axis 𝐫𝐫 and the angle 𝜗𝜗 to the rotation
matrix 𝐑𝐑
Quaternions are widely used to express orientation of frames (for example in the
RAPID programming language of ABB). Given a rotation matrix
𝑟𝑟11 𝑟𝑟12 𝑟𝑟13
𝐑𝐑 = 𝑟𝑟21 𝑟𝑟22 𝑟𝑟23
𝑟𝑟31 𝑟𝑟32 𝑟𝑟33
the associated quaternion is expressed by the following four numbers:
1
𝑞𝑞0 = 𝑟𝑟11 + 𝑟𝑟22 + 𝑟𝑟33 + 1 Quaternions are related to the axis-angle
2 representation by the following formulas:
1
𝑞𝑞1 = sgn 𝑟𝑟32 − 𝑟𝑟23 𝑟𝑟11 − 𝑟𝑟22 − 𝑟𝑟33 + 1
2 𝜗𝜗 Notice that:
1 𝑞𝑞0 = cos
𝑞𝑞2 = sgn 𝑟𝑟13 − 𝑟𝑟31 𝑟𝑟22 − 𝑟𝑟33 − 𝑟𝑟11 + 1 2
2 𝑞𝑞1 𝑞𝑞02 + 𝑞𝑞12 + 𝑞𝑞22 + 𝑞𝑞32 = 1
𝜗𝜗
1 𝑞𝑞2 = sin 𝐫𝐫
𝑞𝑞3 = sgn 𝑟𝑟21 − 𝑟𝑟12 𝑟𝑟33 − 𝑟𝑟11 − 𝑟𝑟22 + 1 𝑞𝑞3 2
2
0 0 1
𝐱𝐱 ′ = 0 , 𝐲𝐲 ′ = 1 , 𝐳𝐳 ′ = 0
Fonte: ABB −1 0 0
0 0 1 0 0 1
𝐱𝐱 ′ = 0 , 𝐲𝐲 ′ = 1 , 𝐳𝐳 ′ = 0 𝐑𝐑 = 0 1 0
−1 0 0 −1 0 0
1 1 2
𝑞𝑞0 = 𝑟𝑟 + 𝑟𝑟22 + 𝑟𝑟33 + 1 = 0+1+0+1= = 0.707
2 11 2 2
1 1
𝑞𝑞1 = sgn 𝑟𝑟32 − 𝑟𝑟23 𝑟𝑟11 − 𝑟𝑟22 − 𝑟𝑟33 + 1 = sgn 0−0 0−1−0+1=0
2 2
1 1 2 Verification:
𝑞𝑞2 = sgn 𝑟𝑟13 − 𝑟𝑟31 𝑟𝑟22 − 𝑟𝑟33 − 𝑟𝑟11 + 1 = sgn 1+1 1−0−0+1= = 0.707
2 2 2
1 1 𝑞𝑞02 + 𝑞𝑞12 + 𝑞𝑞22 + 𝑞𝑞32 = 1
𝑞𝑞3 = sgn 𝑟𝑟21 − 𝑟𝑟12 𝑟𝑟33 − 𝑟𝑟11 − 𝑟𝑟22 + 1 = sgn 0−0 0−0−1+1=0
2 2
𝐑𝐑01 𝐨𝐨10
Let us introduce the homogeneous transformation matrix (size 4×4): 𝐀𝐀01 = 𝑇𝑇
0 1
The relationship:
𝐩𝐩0 = 𝐨𝐨10 + 𝐑𝐑01 𝐩𝐩1
can be expressed, in terms of homogeneous coordinates, as :
�0 = 𝐀𝐀01 𝐩𝐩
𝐩𝐩 �1
END EFFECTOR
JOINTS
BASE
Each joint allows for one (and only one) degree of freedom 𝑞𝑞1
between two links. We call joint variable the coordinate 𝐪𝐪 = ⋮
associated to such degree of freedom, and then we introduce 𝑞𝑞𝑛𝑛
the vector of joint variables:
?
The direct kinematics problem is to find position
and orientation of the tool frame w.r.t. the base
frame, as a function of the joint variables.
a2y a2
ϑ2
a1
a1y
ϑ1
X
a1x a2x
Direct kinematics:
𝑝𝑝𝑥𝑥 = 𝑎𝑎1𝑥𝑥 + 𝑎𝑎2𝑥𝑥 = 𝑎𝑎1 cos 𝜗𝜗1 + 𝑎𝑎2 cos 𝜗𝜗1 + 𝜗𝜗2
𝑝𝑝𝑦𝑦 = 𝑎𝑎1𝑦𝑦 + 𝑎𝑎2𝑦𝑦 = 𝑎𝑎1 sin 𝜗𝜗1 + 𝑎𝑎2 sin 𝜗𝜗1 + 𝜗𝜗2
To proceed in a systematic way in the computation of the direct kinematics, a frame should be
attached to each link:
frame i-1 attached to the link i-1
𝐀𝐀𝑖𝑖−1
𝑖𝑖 𝑞𝑞𝑖𝑖
It is the homogeneous
link 0 grounded transformation matrix of frame i
n is the last link
with respect to frame i−1
It only depends on the joint
coordinate 𝑞𝑞𝑖𝑖
The Denavit-Hartenberg
Proceeding iteratively: convention allows to place the
frames in a systematic way (we
𝐓𝐓𝑛𝑛0 𝐪𝐪 = 𝐀𝐀01 𝑞𝑞1 𝐀𝐀12 𝑞𝑞2 … 𝐀𝐀𝑛𝑛−1
𝑛𝑛 𝑞𝑞𝑛𝑛 will not cover it)
? ?
Given position and orientation of the tool frame, find the corresponding joint variables.
The problem may admit no solutions (if position and orientation do not belong to the
workspace of the manipulator)
The analytical solution (in closed form) may not exist. In this case numerical techniques
are used
Multiple or an infinite number of solutions might exist
Y
P 𝑝𝑝𝑥𝑥 = 𝑎𝑎1𝑥𝑥 + 𝑎𝑎2𝑥𝑥 = 𝑎𝑎1 cos 𝜗𝜗1 + 𝑎𝑎2 cos 𝜗𝜗1 + 𝜗𝜗2
𝑝𝑝𝑦𝑦 = 𝑎𝑎1𝑦𝑦 + 𝑎𝑎2𝑦𝑦 = 𝑎𝑎1 sin 𝜗𝜗1 + 𝑎𝑎2 sin 𝜗𝜗1 + 𝜗𝜗2
a2y a2
Even for this simple robot the
ϑ2
problem is:
a1
a1y
ϑ1
X
a1x a2x
COMPLICATED!
These two configurations correspond to the “elbow up” and “elbow down” situations:
Source: ABB
These two configurations can be obtained by rotating the arm backward and then
rotating axis 1 180 degrees:
Source: ABB
These two configurations are obtained with different combinations of the wrist joint
variables:
Source: ABB
Let’s introduce now the linear velocity and the angular velocity of the tool frame (attached to the tool):
𝐯𝐯 and ω.
The goal of differential kinematics is to express these velocities in terms of the joint velocities.
For the positional part, the Jacobian can be obtained differentiating the end-effector position with
respect to the joint variables:
Y
𝜕𝜕𝜕𝜕 𝐪𝐪 P
𝐉𝐉𝑃𝑃 𝐪𝐪 =
𝜕𝜕𝜕𝜕
a2y a2
For a two-link manipulator, the Jacobian is:
ϑ2
𝜕𝜕𝑝𝑝𝑥𝑥 𝜕𝜕𝑝𝑝𝑥𝑥 a1
a1y
𝜕𝜕𝑞𝑞1 𝜕𝜕𝑞𝑞2 ϑ1
𝐉𝐉 = X
𝜕𝜕𝑝𝑝𝑦𝑦 𝜕𝜕𝑝𝑝𝑦𝑦 a1x a2x
𝜕𝜕𝑞𝑞1 𝜕𝜕𝑞𝑞2
−𝑎𝑎1 sin 𝜗𝜗1 − 𝑎𝑎2 sin 𝜗𝜗1 + 𝜗𝜗2 −𝑎𝑎2 sin 𝜗𝜗1 + 𝜗𝜗2
=
𝑎𝑎1 cos 𝜗𝜗1 + 𝑎𝑎2 cos 𝜗𝜗1 + 𝜗𝜗2 𝑎𝑎2 cos 𝜗𝜗1 + 𝜗𝜗2
For the orientation part, things are more difficult.
The values of 𝐪𝐪 for which matrix 𝐉𝐉 is rank-deficient are called kinematic singularities. At a
kinematic singularity we have:
−𝑎𝑎1 sin 𝜗𝜗1 − 𝑎𝑎2 sin 𝜗𝜗1 + 𝜗𝜗2 −𝑎𝑎2 sin 𝜗𝜗1 + 𝜗𝜗2
𝐉𝐉 =
𝑎𝑎1 cos 𝜗𝜗1 + 𝑎𝑎2 cos 𝜗𝜗1 + 𝜗𝜗2 𝑎𝑎2 cos 𝜗𝜗1 + 𝜗𝜗2
These are singularities at the borders of the workspace.
We can compute singularities:
0
det 𝐉𝐉 = 𝑎𝑎1 𝑎𝑎2 sin 𝜗𝜗2 = 0 ⇔ 𝜗𝜗2 = �
𝜋𝜋
Wrist singularity
Source: ABB
https://www.youtube.com/watch?v=zlGCurgsqg8