Robotics Lec3
Robotics Lec3
Robotics Lec3
Trajectory Generation:
Compute the motion functions of each joint as a smooth function of
time, 𝜃(𝑡), to cause a manipulator to move in a smooth, controlled
fashion.
Coordination:
Each joint starts and ends its motion
at the same time.
Q: if not?
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 2
Trajectory Generation
A path is described not only by a desired destination but also by some
intermediate locations, or via points (Path Planning).
Question ?
The primary concern is to compensate for errors that tend to perturb the
system from the desired trajectory.
Sources of errors:
Knowledge of the parameters
Disturbances
Noises and …
Description:
Positions
Orientations
An entity that contains both of these descriptions: the frame
𝐴
𝑃 have numerical values that indicate distances along the axes of {A}
(Projection).
𝐴
𝑝𝑥
𝐴
𝑃 = 𝐴𝑝𝑦
𝐴
𝑝𝑧
𝐴
𝑝𝑥 = 𝐴𝑃 . 𝑋𝐴
𝐴
𝑝𝑦 = 𝐴𝑃 . 𝑌𝐴
𝐴
𝑝𝑧 = 𝐴𝑃 . 𝑍መ𝐴
𝐴 𝐴 𝐴 1/2 𝐵 𝐵 1/2 𝐵
𝑃 = 𝑃. 𝑃 = 𝑃. 𝑃 = 𝑃
Q: Condition ?
Attach a coordinate system to the body and then give a description of this
coordinate system relative to the reference system.
𝐴
𝑋𝐵 . 𝐴𝑌𝐵 = 𝐴
𝑌𝐵 . 𝐴𝑍መ𝐵 = 𝐴
𝑋𝐵 . 𝐴𝑍መ𝐵 = 0
2) The rows of the matrix are the unit vectors of {A} expressed in {B}.
𝐵 𝑇
𝑋𝐵 . 𝑋𝐴 𝑌𝐵 . 𝑋𝐴 𝑍መ𝐵 . 𝑋𝐴 𝑋𝐴
𝐴 𝐴 𝐴 𝐴 𝐵 𝑇
𝑅𝐵 = 𝑋𝐵 𝑌𝐵 𝑍መ𝐵 = 𝑋𝐵 . 𝑌𝐴 𝑌𝐵 . 𝑌𝐴 𝑍መ𝐵 . 𝑌𝐴 = 𝑌𝐴
𝑋𝐵 . 𝑍መ𝐴 𝑌𝐵 . 𝑍መ𝐴 𝑍መ𝐵 . 𝑍መ𝐴 𝐵 መ𝑇
𝑍𝐴
𝑇
= 𝐵
𝑋𝐴 𝐵
𝑌𝐴 𝐵
𝑍መ𝐴 = 𝐵𝑅𝐴𝑇
4)
𝐴
𝑑𝑒𝑡 𝑅𝐵 = 1
Q: Why?
Q: Why
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 14
← Outline
Descriptions: Positions, Orientations and Frames
Description of a Frame
For a frame, both position and orientation should be determined.
𝐴
𝑃𝐵𝑂𝑅𝐺 is the vector that locates the origin of the frame {B}.
Translation
A position defined by the vector 𝐵𝑃 .
{A} has the same orientation as {B}
{A} differs only by a translation, i.e. 𝐴𝑃𝐵𝑂𝑅𝐺 .
Express this point in space in terms of frame {A}, i.e. 𝐴𝑃 .
𝐴
𝑃 = 𝐵𝑃 + 𝐴𝑃𝐵𝑂𝑅𝐺
𝐴
𝑝𝑥
𝐴
𝑃 = 𝐴𝑝𝑦
𝐴
𝑝𝑧
𝐴
𝑝𝑥 = 𝐵𝑋𝐴 . 𝐵𝑃
𝐴
𝑝𝑦 = 𝐵𝑌𝐴 . 𝐵𝑃
𝐴
𝑝𝑧 = 𝐵𝑍መ𝐴 . 𝐵𝑃
Q: Why?
Note that the rows of rotation matrix 𝐴𝑅𝐵 are 𝐵𝑋𝐴𝑇 , 𝐵𝑌𝐴𝑇 and 𝐵𝑍መ𝐴𝑇 .
𝐴
𝑃 = 𝐴𝑅𝐵 𝐵𝑃
𝐵
𝑃 is given.
Find 𝐴𝑃?
𝐴 𝐴
𝐴 𝑅𝐵 𝑃𝐵𝑂𝑅𝐺 𝐵
𝑃 = 𝑃
1 1
0 0 0 1
So,
𝐴
𝑃 = 𝐴𝑅𝐵 𝐵𝑃 + 𝐴𝑃𝐵𝑂𝑅𝐺
1=1
𝐴
𝑇𝐵 is called a Homogeneous Transformation Matrix.
where 𝐵𝑃 = 3 7 0 𝑇 .
Find 𝐴𝑃 ?
Translation
𝐴
Moving a point 𝑃1 in space a finite distance along a given vector
direction 𝐴𝑄.
𝐴
𝑃2 = 𝐴𝑃1 + 𝐴𝑄
Frame is invariant.
Translational Operator:
𝐴 𝐴
𝑃2 = 𝑇𝑇𝑟𝑎𝑛𝑠 𝑄 𝑃1
Q: 𝑇𝑇𝑟𝑎𝑛𝑠 𝑄 = ?
1 0 0 𝑞𝑥
𝑇𝑇𝑟𝑎𝑛𝑠 𝑄 = 0 1 0 𝑞𝑦
0 0 1 𝑞𝑧
0 0 0 1
Q: Sign of 𝑞𝑖 ?
𝐴
𝑃2 = 𝑅 𝐴𝑃1
The rotation matrix that rotates vectors through some rotation, R = the
rotation matrix that describes a frame rotated by 𝑅 relative to the
reference frame.
𝐴 𝐴
𝑃2 = 𝑅𝐾 𝜃 𝑃1
መ what is 𝑅𝐾 𝜃 ?
Q: Assume 𝐾 = 𝑍,
0
𝑅𝐾 𝜃 0
𝑇𝑅𝑜𝑡 𝑅 =
0
0 0 0 1
𝑐𝑜𝑠 𝜃 −𝑠𝑖𝑛 𝜃 0 0
𝑇𝑅𝑜𝑡 𝑅 = 𝑠𝑖𝑛 𝜃 𝑐𝑜𝑠 𝜃 0 0
0 0 1 0
0 0 0 1
𝐴
𝑃2 = 𝑇 𝐴𝑃1
𝐴
𝑇𝐶 = 𝐴𝑇𝐵 𝐵𝑇𝐶
𝐴 𝐴
𝑅𝐶 𝑃𝐶𝑂𝑅𝐺
𝐴
𝑇𝐶 =
0 0 0 1
? ?
𝐴
𝑇𝐶 =
0 0 0 1
𝐴
𝑅𝐵 𝐵𝑅𝐶 𝐴
𝑅𝐵 𝐵𝑃𝐶𝑂𝑅𝐺 + 𝐴𝑃𝐵𝑂𝑅𝐺
𝐴
𝑇𝐶 =
0 0 0 1
Computation:
𝐴 𝐶
𝑃 = 𝐴𝑇𝐵 𝐵𝑇𝐶 𝑃 32 𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑜𝑛 + 24 𝐴𝑑𝑑𝑖𝑡𝑖𝑜𝑛
𝐴 𝐶
𝑃 = 𝐴𝑇𝐵 𝐵𝑇𝐶 𝑃 80 𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑜𝑛 + 60 𝐴𝑑𝑑𝑖𝑡𝑖𝑜𝑛
𝐴
𝑃 = 𝐴𝑅𝐵 𝐵𝑃 + 𝐴𝑃𝐵𝑂𝑅𝐺
𝐴
𝑃 − 𝐴𝑃𝐵𝑂𝑅𝐺 = 𝐴𝑅𝐵 𝐵𝑃
𝐴 −1 𝐴
𝑅𝐵 𝑃 − 𝐴𝑃𝐵𝑂𝑅𝐺 = 𝐵
𝑃
𝐴 𝑇𝐴 𝑇𝐴
𝑅𝐵 𝑃 − 𝐴𝑅𝐵 𝑃𝐵𝑂𝑅𝐺 = 𝐵
𝑃
𝐴 𝑇 𝑇𝐴
𝐵
𝑅𝐵 − 𝐴𝑅𝐵 𝑃𝐵𝑂𝑅𝐺
𝑇𝐴 =
0 0 0 1
Q: Geometrical Description = ?
Note that
𝐵 −1
𝑇𝐴 = 𝐴𝑇𝐵
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 34
← Outline
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 35
More on Representation of Orientation
Remember rotation matrix:
𝑟11 𝑟12 𝑟13
𝐴
𝑅𝐵 = 𝑟21 𝑟22 𝑟23
𝑟31 𝑟32 𝑟33
The nine elements are not all independent (six dependencies).
These three vectors are the unit axes of some frame written in terms of
the reference frame.
Each is a unit vector, and all three must be mutually perpendicular (six
constraints).
𝐴
𝑋𝐵 = 𝐴𝑌𝐵 = 𝐴
𝑍መ𝐵 = 1
𝐴
𝑋𝐵 . 𝐴𝑌𝐵 = 𝐴𝑌𝐵 . 𝐴𝑍መ𝐵 = 𝐴
𝑋𝐵 . 𝐴𝑍መ𝐵 = 0
Q: 𝐴𝑅𝐵 =?
𝑐𝛼 −𝑠𝛼 0 𝑐𝛽 0 𝑠𝛽 1 0 0
𝐴
𝑅𝐵𝑍𝑌𝑋 = 𝑅𝑍 𝛼 𝑅𝑌 𝛽 𝑅𝑋 𝛾 = 𝑠𝛼 𝑐𝛼 0 0 1 0 0 𝑐𝛾 −𝑠𝛾
0 0 1 −𝑠𝛽 0 𝑐𝛽 0 𝑠𝛾 𝑐𝛾
where 𝑐𝛼 = 𝑐𝑜𝑠 𝛼, 𝑠𝛼 = 𝑠𝑖𝑛 𝛼
𝑐𝛼 𝑐𝛽 𝑐𝛼 𝑠𝛽 𝑠𝛾 − 𝑠𝛼 𝑐𝛾 𝑐𝛼 𝑠𝛽 𝑐𝛾 + 𝑠𝛼 𝑠𝛾
𝐴
𝑅𝐵_𝑍𝑌𝑋 𝛼, 𝛽, 𝛾 = 𝑠𝛼 𝑐𝛽 𝑠𝛼 𝑠𝛽 𝑠𝛾 + 𝑐𝛼 𝑐𝛾 𝑠𝛼 𝑠𝛽 𝑐𝛾 − 𝑐𝛼 𝑠𝛾
−𝑠𝛽 𝑐𝛽 𝑠𝛾 𝑐𝛽 𝑐𝛾
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 41
← Outline
More on Representation of Orientation
Z-Y-X Euler Angles
The Inverse Problem
Extracting equivalent X-Y-Z Euler angles from a given rotation matrix.
2 2
𝛽 = 𝐴𝑡𝑎𝑛2 −𝑟31 , 𝑟11 + 𝑟21
As long as 𝑐𝛽 ≠ 0,
𝛼 = 𝐴𝑡𝑎𝑛2 𝑟21 /𝑐𝛽, 𝑟11 /𝑐𝛽
𝛾 = 𝐴𝑡𝑎𝑛2 𝑟32 /𝑐𝛽, 𝑟33 /𝑐𝛽
For 𝛽 = +90.0° :
𝑐𝛼 𝑐𝛽 𝑐𝛼 𝑠𝛽 𝑠𝛾 − 𝑠𝛼 𝑐𝛾 𝑐𝛼 𝑠𝛽 𝑐𝛾 + 𝑠𝛼 𝑠𝛾 𝑟11 𝑟12 𝑟13
𝑠𝛼 𝑐𝛽 𝑠𝛼 𝑠𝛽 𝑠𝛾 + 𝑐𝛼 𝑐𝛾 𝑠𝛼 𝑠𝛽 𝑐𝛾 − 𝑐𝛼 𝑠𝛾 = 𝑟21 𝑟22 𝑟23
−𝑠𝛽 𝑐𝛽 𝑠𝛾 𝑐𝛽 𝑐𝛾 𝑟31 𝑟32 𝑟33
0 𝑠𝑖𝑛 𝛾 − 𝛼 𝑐𝑜𝑠 𝛾 − 𝛼 𝑟11 𝑟12 𝑟13
0 𝑐𝑜𝑠 𝛾 − 𝛼 − 𝑠𝑖𝑛 𝛾 − 𝛼 = 𝑟21 𝑟22 𝑟23
−1 0 0 𝑟31 𝑟32 𝑟33
𝛽 = +90.0° 𝛽 = −90.0°
𝛼 = 0.0 𝛼 = 0.0
𝛾 = 𝐴𝑡𝑎𝑛2 (𝑟12 , 𝑟22 ) 𝛾 = −𝐴𝑡𝑎𝑛2 (𝑟12 , 𝑟22 )
Each of the three rotations takes place about an axis in the fixed
reference frame {A}.
This convention is referred to as roll, pitch, yaw angles.
Q: 𝐴𝑅𝐵 =?
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 47
← Outline
More on Representation of Orientation
X-Y-Z Fixed Angles
The composition rule cannot be applied here, similarity transformation
can be used instead.
Similarity Transformation
A rotation matrix (as a coordinate transformation) may be viewed as
changing basis from one frame to another.
0 −1
𝑁= 𝑅1 𝑀 0𝑅1
𝐴
𝑅𝐵′ = 𝑅𝑋 𝛾
𝐵′ 𝐴 −1 𝐴
𝑅𝐵′′ = 𝑅𝐵 ′ 𝑅𝑌 𝛽 𝑅𝐵 ′
𝐵 ′′ 𝐴 −1 𝐴
𝑅𝐵 = 𝑅𝐵′′ 𝑅𝑍 𝛼 𝑅𝐵′′
Therefore,
𝐴
𝑅𝐵′ = 𝑅𝑋 𝛾
𝐴 𝐵′ −1
𝑅𝐵′′ = 𝐴𝑅𝐵′ 𝑅𝐵′′ = 𝐴𝑅𝐵′ 𝐴
𝑅𝐵 ′ 𝑅𝑌 𝛽 𝐴
𝑅𝐵′ = 𝑅𝑌 𝛽 𝑅𝑋 𝛾
𝐴 𝐵 ′′ −1
𝑅𝐵 = 𝐴𝑅𝐵′′ 𝑅𝐵 = 𝐴𝑅𝐵′′ 𝐴
𝑅𝐵′′ 𝑅𝑍 𝛼 𝐴
𝑅𝐵′′ = 𝑅𝑍 𝛼 𝑅𝑌 𝛽 𝑅𝑋 𝛾
Therefore,
𝑐𝛼 𝑐𝛽 𝑐𝛼 𝑠𝛽 𝑠𝛾 − 𝑠𝛼 𝑐𝛾 𝑐𝛼 𝑠𝛽 𝑐𝛾 + 𝑠𝛼 𝑠𝛾
𝐴
𝑅𝐵_𝑋𝑌𝑍 𝛾, 𝛽, 𝛼 = 𝑠𝛼 𝑐𝛽 𝑠𝛼 𝑠𝛽 𝑠𝛾 + 𝑐𝛼 𝑐𝛾 𝑠𝛼 𝑠𝛽 𝑐𝛾 − 𝑐𝛼 𝑠𝛾
−𝑠𝛽 𝑐𝛽 𝑠𝛾 𝑐𝛽 𝑐𝛾
𝐴
𝐾 : Equivalent axis of a finite rotation.
𝐴
𝐾 requires only two parameters caused
by its unit length.
𝑇
where 𝑐𝜃 = 𝑐𝑜𝑠 𝜃, 𝑠𝜃 = 𝑠𝑖𝑛 𝜃, 𝑣𝜃 = 1 − 𝑐𝑜𝑠 𝜃 and 𝐴𝐾
= 𝑘𝑥 , 𝑘𝑦 , 𝑘𝑧
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 51
← Outline
More on Representation of Orientation
Equivalent Angle-Axis
𝑘𝑥 𝑘𝑥 𝑣𝜃 + 𝑐𝜃 𝑘𝑥 𝑘𝑦 𝑣𝜃 − 𝑘𝑧 𝑠𝜃 𝑘𝑥 𝑘𝑧 𝑣𝜃 + 𝑘𝑦 𝑠𝜃
𝑅𝐾 𝜃 = 𝑘𝑥 𝑘𝑦 𝑣𝜃 + 𝑘𝑧 𝑠𝜃 𝑘𝑦 𝑘𝑦 𝑣𝜃 + 𝑐𝜃 𝑘𝑦 𝑘𝑧 𝑣𝜃 − 𝑘𝑥 𝑠𝜃
𝑘𝑥 𝑘𝑧 𝑣𝜃 − 𝑘𝑦 𝑠𝜃 𝑘𝑦 𝑘𝑧 𝑣𝜃 + 𝑘𝑥 𝑠𝜃 𝑘𝑧 𝑘𝑧 𝑣𝜃 + 𝑐𝜃
Example:
as principal axes (e.g. 𝐾 = 𝑋 = 1 0 0
For 𝐾 𝑇
or 𝑌 or 𝑍መ )
1 0 0
𝑅𝑋 𝜃 = 0 𝑐𝜃 − 𝑠𝜃
0 𝑠𝜃 𝑐𝜃
𝑐𝜃 0 𝑠𝜃
𝑅𝑌 𝜃 = 0 1 0
− 𝑠𝜃 0 𝑐𝜃
𝑐𝜃 −𝑠𝜃 0
𝑅𝑍 𝜃 = 𝑠𝜃 𝑐𝜃 0
0 0 1
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 52
← Outline
More on Representation of Orientation
Equivalent Angle-Axis
The Inverse Problem
Computing 𝐾 and 𝜃 from a given rotation matrix.
𝑟32 − 𝑟23
𝑟11 +𝑟22 +𝑟33 −1 1
𝜃 = 𝐴𝑐𝑜𝑠 =
, 𝐾 𝑟13 − 𝑟31
2 2 sin𝜃
𝑟21 − 𝑟12
𝐴
For any 𝐾, 𝜃 , − 𝐴𝐾,
−𝜃 results in the same orientation in space.
𝑇
In terms of the equivalent axis 𝐾 = 𝑘𝑥 , 𝑘𝑦 , 𝑘𝑧 and the equivalent
angle 𝜃, the Euler parameters are given by
𝜖1 𝑘𝑥
𝜃 𝜃
𝜖 𝑘
𝜖 = 2 = 𝑦 𝑠𝑖𝑛 = 𝐾 𝑠𝑖𝑛
𝜖3 2 2
𝑘𝑧
𝜃
𝜖4 = 𝑐𝑜𝑠
2
1 − 2𝜖22 − 2𝜖32 2 𝜖1 𝜖2 − 𝜖3 𝜖4 2 𝜖1 𝜖3 + 𝜖2 𝜖4
𝑅𝜖 = 2 𝜖1 𝜖2 + 𝜖3 𝜖4 1 − 2𝜖12 − 2𝜖32 2 𝜖2 𝜖3 − 𝜖1 𝜖4
2 𝜖1 𝜖3 − 𝜖2 𝜖4 2 𝜖2 𝜖3 + 𝜖1 𝜖4 1 − 2𝜖22 − 2𝜖22
1
𝜖4 = 1 + 𝑟11 + 𝑟22 + 𝑟33
2
𝑟 − 𝑟23
1 32
𝜖= 𝑟13 − 𝑟31
4𝜖4 𝑟 − 𝑟
21 12
For a rotation of 180 degrees about some axis, 𝜖4 → 0 (ill defined).
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 55
← Outline
More on Representation of Orientation
Euler Parameters
The Inverse Problem:
Remember:
𝜃
𝑠𝑖𝑛
𝜖=𝐾
2
𝜃
𝜖4 = 𝑐𝑜𝑠
2
By definition, if 𝜖4 = 0, then 𝜃 = 180° and 𝜖 is equal to rotation axis,
i.e. 𝜖 = 𝐾
1 + 2𝑟11 − 𝑡𝑟 𝐴
𝜖12 =
4
1 + 2𝑟22 − 𝑡𝑟 𝐴
𝜖22 =
4
2
1 + 2𝑟33 − 𝑡𝑟 𝐴
𝜖3 =
4
Line vector: a vector that is dependent on its line of action, along with
direction and magnitude. (Position & Force)
For free vectors, only the rotation matrix relating the two systems is used
in transforming.
Position Transformation
𝐴
𝑃 = 𝐴𝑇𝐵 𝐵𝑃
Velocity Transformation
𝐴
𝑉 = 𝐴𝑅𝐵 𝐵𝑉
𝐴
𝑃𝐵𝑂𝑅𝐺 which would appear in
a position-vector transformation,
does not appear in a velocity transform.
AMIRKABIR UNIVERSITY OF TECHNOLOGY, M. ZAREINEJAD 57
← Outline
Acknowledgment
References:
1-Advanced Robotics , Dr. H. Ghafarirad, Department Of Mech. Eng. Amirkabir University of
Technology
.تقریباً تمامی اسالیدها متعلق به جناب آقای دکتر غفاری است از لطف ایشان سپاسگزارم
2-Advanced Robotics , Dr. A. M. Shafei, Department Of Mech. Eng. Shahid Bahonar University of
Kerman