Lec 3
Lec 3
Manipulators
Objectives
2
Outline
1. Introduction
4. Analytic solutions
5. Numeric solutions
{n}
qi+1
x f (q)
Forward
Joint Kinematics Operational
space space
q (q1 , , qn ) x ( x, y , z , , , )
- Forward kinematics
Given a joint configuration, find the pose (position/orientation) of some part of
the robot (e.g. end effector)
Given q (q1 , , qn )
Joint Operational
space space
q (q1 , , qn ) x ( x, y , z , , , )
Inverse
kinematics
q f 1 (x)
- Inverse kinematics
Find the joint configuration needed to achieve a certain position/orientation
(pose) for some part of the robot
Find q (q1 , , qn )
Kinematics of Robot Manipulators
Example: R-R Robot
ŷ
Cartesian Joint
y variables variables
x q
l2 x q 1
q2 y q2
l1 Considering
only position
q1
x x̂
Position and
Orientation
where:
Stanford Manipulator
Kinematics of Robot Manipulators
Example: Inverse Kinematics
¡System of nonlinear
trigonometric equations!
Stanford Manipulator
Inverse Kinematics
R t x
T x p
0 0 0 1 xr
Classical formulation: Generalized formulation:
Inverse kinematics for the end effector Inverse kinematics for task variables
• It is a nonlinear problem:
- Is there a solution?
Answer: workspace,
- Is there a unique solution, or multiple solutions?
redundancy
- How to solve it?
Outline
1. Introduction
4. Analytic solutions
5. Numeric solutions
ŷ
l1 > l2
y p x
y
l2
q2
l1
q1
x̂
x
𝑊𝑆 = {𝐩 ∈ ℝ : |𝑙 − 𝑙 | ≤ ‖𝐩‖ ≤ 𝑙 + 𝑙 }
- For all p WS2 there is (at least) one solution for every orientation
1. Introduction
4. Analytic solutions
5. Numeric solutions
If only position is
considered, the 4
configurations set the end
effector at the same point
Multiplicity of solutions
PUMA 560
Multiplicity of Solutions
What solution to choose?
d1 ‖ q1 q A‖ Shortest distance
is preferred
d 2 ‖ q 2 q A‖
- n joints: q (q1 , , qn )
- Task space: x ( x1 , x2 , , xm )
m: dimension of the task space
1. Introduction
4. Analytic solutions
5. Numeric solutions
• Example:
Find the inverse kinematics for the position of the R-R robot using a
geometric approach
ŷ
y
l2
l1 q2
q1
x x̂
Geometric Solutions
• Example: ŷ
Find the inverse kinematics for the position of
y
the R-R robot using a geometric approach
l l2
Solution q2
l1
For q2 :
q1
- Using the law of cosines: x x̂
l 2 l12 l22 2l1l2 cos(180 q2 )
For q1 (using the geometry of the figure)
x 2 y 2 l12 l22 2l1l2 cos(q2 )
q1
x y (l l2 )
2 2 2 2
c2 1
atan2( y, x)
2l1l2
- Using a trigonometric identity:
atan2(l2 s2 , l1 l2 c2 )
s22 c22 1
Inverse kinematics:
s2 1 c 2
2 q1 atan2( y, x) atan2(l2 s2 , l1 l2 c2 )
q2 atan2( s2 , c2 ) q2 atan2( s2 , c2 )
Algebraic Solutions
• Example:
Find the inverse kinematics for the position of the RR robot using an algebraic
approach
ŷ
Solution
- Forward kinematics:
y
x l1 c1 l2 c12 y l1 s1 l2 s12 l2
- For q2 : l1 q2
• Example:
Find the inverse kinematics for the position of the RR robot using an algebraic
approach
Solution
- For q1 (expanding terms from forward kinematics): ŷ
x l1c1 l2 (c1c2 s1 s2 ) y
y l1s1 l2 ( s1c2 c1s2 )
l2
Equations are linear in c1, s1: solve for them: q2
l1
x c1 (l1 l2 c2 ) s1 (l2 s2 )
y s1 (l1 l2 c1 ) c1 (l2 s2 ) q1
x x̂
In matrix form:
y (l1 l2c2 ) xl2 s2
s1
l1 l2c2 l2 s2 c1 x solving det
ls
2 2 l1 l2c2 s1 y x(l l c ) yl2 s2
c1 1 2 2
det
q1 atan2( s1 , c1 )
det l12 l22 2l1l2 c2
Algebraic Solutions
• Example 2
For a 3-dof robot, its end effector pose with respect to its base is given by
where l1, l2 and l3 are constants. The desired pose for the end effector is:
• Example 2
- Finding :
- Finding :
- Finding
Algebraic Solutions
Problem : The world coordinates for a robot in above example are x3 = 300 mm,y3
= 400 mm, and = 30° and given that the links have values L1 = 350 mm,L2 = 250
mm and L3 = 50 mm, determine the joint angles 1 , 2 and 3.
Given that L1 = 350 mm, L2 = 250 mm, L3 = 50 mm.
Outline
1. Introduction
4. Analytic solutions
5. Numeric solutions
f (q)
• They use the Jacobian matrix: J (q) 𝐽(𝐪) ∈ ℝ ×
q
• Usual solution methods:
- Newton’s method
- Gradient descent method
x d f (q k ) J (q k )(q q k )
q k 1 q k J 1 (q k ) x d f (q k )
Numeric Solutions
a) Newton’s Method
• Algorithm:
- Start with an initial q0 (usually the current configuration)
- Iteratively update using:
q k 1 q k J 1 (q k ) x d f (q k ) k = 0,1,2,3,…
- Stop when:
‖ x d f (q k )‖ or ‖ q k 1 q k‖ : small value
Small Cartesian error Small joint increment
• Comments:
- Convergence if we start with q0 (initial value) close to the solution
- When there is redundancy (m < n):
J is not square (and there is no inverse)! → we use the pseudo-inverse
- Disadvantages:
• Computation time of the inverse (or pseudo-inverse)
• Problems near singularities of J (Jacobian matrix)
- Advantage: it is fast (quadratic convergence)
Numeric Solutions
a) Newton’s Method
• Example: RR robot
Compute the joint values needed for the end effector to be at x = 1.2, y = 1.2
using Newton’s method. Assume that l1 = l2 = 1.
Solution ŷ
c1 c12
- Forward kinematics: f (q) y
s s
1 12
l2
- Jacobian matrix:
l1 q2
f x f x
q2 ( s1 s12 ) q1
f (q) q1 s12
J (q)
q f y f y c c c12 x x̂
1 12
q1 q2
Desired position:
- Inverse of the Jacobian:
1.2
1 c12 s12 xd
J 1 (q) (c c ) ( s s ) 1.2
s2 1 12 1 12
Numeric Solutions
a) Newton’s Method
• Example: RR robot
Compute the joint values needed for the end effector to be at x = 1.2, y = 1.2
using Newton’s method. Assume that l1 = l2 = 1.
Solution
- Expression for Newton’s method:
q k 1 q k J 1 (q k )(x d f (q))
- Replacing the previous values:
- It is iteratively applied
For example, use q1 = 0.5 y q2 = 0.5 as initial values (note: we cannot start with q2 = 0
since J-1 would not exist)
(Generic Gradient Descent)
• Objective:
- Minimize the generic function g (q)
min g (q)
q
• Idea:
- Start with an initial value q0
- “Move” in the negative direction of the gradient ( g), iteratively
- The step size α > 0 must guarantee a maximum descent of g(q) in every
iteration:
• α very high: it can lead to divergence (the minimum is not found)
• α very small: it generates a slow convergence
2
- Objective: minimize the error: min g (q )
q
- Compute the gradient of g(q):
T
1 f (q)
g (q) x d f (q) x d f (q) x d f (q)
T
g (q)
2 q
- Apply gradient descent J (q)
q k 1 q k g (q k )
q k 1 q k J T (q k ) x d f (q k )
• Example: RR robot
Compute the joint values for the end effector to be at x = 1.2, y = 1.2 using the
gradient descent method. Assume that l1 = l2 = 1.
Solution ŷ
c1 c12
- Forward kinematics f (q) y
s s
1 12
l2
- Jacobian matrix: q2
l1
f x f x
q1
f (q) q1 q2 ( s1 s12 ) s12
J (q)
f y c c x x̂
q f y c12
1 12
q1 q2
Desired position:
- Transpose of the Jacobian:
1.2
( s s ) c1 c12 xd
J T (q) 1 12 1.2
s12 c12
Numeric Solutions
b) Gradient Descent Method
• Example: RR robot
Compute the joint values for the end effector to be at x = 1.2, y = 1.2 using the
gradient descent method. Assume that l1 = l2 = 1.
Solution
- Expression for gradient descent:
q k 1 q k J T (q k )(x d f (q))
- Replacing the previous values:
- It is iteratively applied.
For example, use q1 = 0.5 y q2 = 0.5 as initial values (in this case we can start with
q2 = 0)