Inverse Kinematics: Autorob - Github.io

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

autorob.github.

io

Inverse Kinematics

UM EECS 398/598 - autorob.github.io


Objective (revisited)
Goal: Given the structure of a
robot arm, compute

– Forward kinematics
kinematics: predicting
the pose of the end-effector, given
joint positions.

– Inverse kinematics: inferring


the joint positions necessary to
reach a desired end-effector pose.

We need to solve for configuration


from a transform between world
and endeffector frames.
UM EECS 398/598 - autorob.github.io
to robot configuration
Forward kinematics
kinematics: many-to-one mapping of robot configuration to
reachable workspace endeffector poses

Global
(Frame w)

Find this, From these

Transform of endeffector
Base wrt. base
Endeffector
(Frame 0) (Frame 6)
UM EECS 398/598 - autorob.github.io
Inverse kinematics: one-to-many mapping of workspace endeffector pose
to robot configuration

Global
(Frame w)

From this, Find these

Transform of endeffector
Base wrt. base
Endeffector
(Frame 0) (Frame 6)
UM EECS 398/598 - autorob.github.io
Inverse kinematics: how to solve for q = {θ1, …,θN} from T0N?

Global
(Frame w)

From this, Find these

Transform of endeffector
Base wrt. base
Endeffector
(Frame 0) (Frame 6)
UM EECS 398/598 - autorob.github.io
Let’s define IK
starting from FK

UM EECS 398/598 - autorob.github.io


Consider a planar 2-link arm as an example

UM EECS 398/598 - autorob.github.io


Consider a planar 2-link arm as an example

with 2 links with length 𝝰i, …

UM EECS 398/598 - autorob.github.io


Consider a planar 2-link arm as an example

with 2 links, 2 joints, …

UM EECS 398/598 - autorob.github.io


Consider a planar 2-link arm as an example

with 2 links, 2 joints, coordinate frames at


each body, and …
UM EECS 398/598 - autorob.github.io
Consider a planar 2-link arm as an example

Robot configuration
defined by DoF state q

2 angular DOFs
q = [𝜽1,𝜽2]
joint axes out
of plane
with 2 links, 2 joints, coordinate frames at
each body, and configuration over DoFs
UM EECS 398/598 - autorob.github.io
Consider a planar 2-link arm as an example

Do not forget
endeffector

Remember a robot has N joint frames


and N+1 link frames
UM EECS 398/598 - autorob.github.io
Consider a planar 2-link arm as an example Frame 2 is the “tool frame”

Robot endeffector is
the gripper pose in
world frame 2 Cartesian DOFs
o0N = p0 = (px0,py0)
Endeffector pose
has position
can consider
orientation Endeffector can be specified as
a point p2 (origin of tool frame)
Endeffector defines wrt. Frame 1
“tool frame” with
transform Endeffector transforms into p0
world frame in world frame

UM EECS 398/598 - autorob.github.io


Endeffector axes
“Sliding” axis

“Normal”
axis “Approach” axis
Checkpoint: Transform
endeffector on link to world

endeffectorworld
endeffectorlink4

tool world
frame frame
UM EECS 398/598 - autorob.github.io
Checkpoint: Transform
endeffector on link to world

endeffectorworld
endeffectorlink4

tool world
frame frame
UM EECS 398/598 - autorob.github.io
Forward kinematics: “given configuration, compute endeffector”

Robot configuration Robot endeffector


defined by DoF state is the gripper pose
in world frame
2 angular DOFs
2 Cartesian DOFs
q = [𝜽1,𝜽2]
o0N = p0 = (px0,py0)

UM EECS 398/598 - autorob.github.io


Forward kinematics: [o0N,R0N] = f(q) p0 = f(𝜽1,𝜽2)

Robot configuration Robot endeffector


defined by DoF state is the gripper pose
in world frame
2 angular DOFs
2 Cartesian DOFs
q = [𝜽1,𝜽2]
o0N = p0 = (px0,py0)

UM EECS 398/598 - autorob.github.io


Forward kinematics: [o0N,R0N] = f(q) What is the
position and
orientation of
the tool wrt.
the world?

remember:

What are the elements of this matrix? What are the elements of this vector?

UM EECS 398/598 - autorob.github.io


Forward kinematics: [o0N,R0N] = f(q) What is the
position and
remember: orientation of
the tool wrt.
the world?
p0 = R20p2 + d20
where
R20 = R10R21

d20 = R10d21 + d10

What are the elements of this vector?

UM EECS 398/598 - autorob.github.io



 Start with:
d20 = R10d21 + d10
substitute in variables then perform operations:

then substitute trig identities

to get:

What are the elements of this vector?


Forward kinematics: [o0N,R0N] = f(q)

UM EECS 398/598 - autorob.github.io


Forward kinematics: [o0N,R0N] = f(q)

p0 = f(𝜽1,𝜽2)

UM EECS 398/598 - autorob.github.io


Inverse kinematics: “given endeffector, compute configuration”

UM EECS 398/598 - autorob.github.io


Inverse kinematics: q = f-1([o0N,R0N]) [𝜽1,𝜽2] = f-1(p0)

?
Just consider
endeffector
position for now
?

UM EECS 398/598 - autorob.github.io


1DOF pendulum example
assume:
desired endeffector position 1DOF motor at pendulum axis,
(o0N) given as an x,y location motor servo moves arm to angle 𝜽1

𝜽1
what is 𝜽1?

UM EECS 398/598 - autorob.github.io


1DOF pendulum example
assume:
desired endeffector position 1DOF motor at pendulum axis,
(o0N) given as an x,y location motor servo moves arm to angle 𝜽1

𝜽1
what is 𝜽1?

UM EECS 398/598 - autorob.github.io


Inverse kinematics: q = f-1([o0N,R0N]) [𝜽1,𝜽2] = f-1(x,y)

desired endeffector position


(o0N) given as location x,y

let’s start by solving for 𝜽2

UM EECS 398/598 - autorob.github.io


Inverse kinematics: q = f-1([o0N,R0N]) [𝜽1,𝜽2] = f-1(x,y)

solve for 𝜽2

UM EECS 398/598 - autorob.github.io


Inverse kinematics: q = f-1([o0N,R0N]) [𝜽1,𝜽2] = f-1(x,y)

solve for 𝜽2
Law of Cosines

UM EECS 398/598 - autorob.github.io


Inverse kinematics: q = f-1([o0N,R0N]) [𝜽1,𝜽2] = f-1(x,y)

solve for 𝜽2

solve for 𝜽1

Consider two triangles

UM EECS 398/598 - autorob.github.io


Inverse kinematics: q = f-1([o0N,R0N]) [𝜽1,𝜽2] = f-1(x,y)

solve for 𝜽2

solve for 𝜽1

UM EECS 398/598 - autorob.github.io


inverse kinematics: (𝜽1,𝜽2) = f-1(x,y)

is this the right


solution?

UM EECS 398/598 - autorob.github.io


when is there one
solution?

UM EECS 398/598 - autorob.github.io


when is there no
solution?

UM EECS 398/598 - autorob.github.io


when is there no
solution?

UM EECS 398/598 - autorob.github.io


Can we do IK for 3 links?

UM EECS 398/598 - autorob.github.io


Try this
http://scratch.mit.edu/projects/10607750/

UM EECS 398/598 - autorob.github.io


How many solutions for this arm?

3
unknowns

Remember:
Ax=b
2
constraints

UM EECS 398/598 - autorob.github.io


Inverse Kinematics: 2D

UM EECS 398/598 - autorob.github.io


Inverse Kinematics: 2D
Transform from
Configuration endeffector frame
to world frame

UM EECS 398/598 - autorob.github.io


Inverse Kinematics: 2D
Transform from
Configuration endeffector frame
to world frame

Inverse orientation

Inverse position
UM EECS 398/598 - autorob.github.io
Inverse Kinematics: 2D
Transform from
Configuration
endeffector

Closed form solution

UM EECS 398/598 - autorob.github.io


Inverse Kinematics: 3D
Transform from
Configuration
endeffector

6 DOF position and


orientation of endeffector

UM EECS 398/598 - autorob.github.io


Inverse Kinematics: 3D
Transform from
Configuration
endeffector

Closed form
solution?
6 DOF position and
orientation of endeffector
UM EECS 398/598 - autorob.github.io
Stanford
Manipulator

assumes D-H frames


UM EECS 398/598 - autorob.github.io
Recognize this robot?
RexArm (EECS 467 / ROB 550)
RexArm (EECS 467 / ROB 550)

Find: configuration
q = [𝜽1 𝜽2 𝜽3 𝜽4]
as robot joint angles
Given: Find: configuration
link lengths (L4,L3,L2,L1) q = [𝜽1 𝜽2 𝜽3 𝜽4]
as robot joint angles
endeffector orientation ɸ
as angle wrt. plane
centered at o3 and
parallel to ground plane

endeffector position [xg yg zg]


wrt. base frame
overhead view

solve for 𝜽1
solve for 𝜽3
solve for 𝜽1

Decoupling: solve for 𝜽3


separate endeffector from
rest of the robot at last joint

and joint 1 from rest


of robot
solve for 𝜽3
solve for 𝜽1

o3 𝜽3
L3

L2
𝜽2
solve for 𝜽3 Δz
Ψ
β

Δr o1
solve for 𝜽3
solve for 𝜽1

o3 𝜽3
L3
solve for 𝜽3
(Law of cosines with
ɣ
supplementary angle ɣ)

L2
𝜽2
Δz
Ψ
β

Δr o1
solve for 𝜽3
solve for 𝜽1

o3 𝜽3
L3
solve for 𝜽3

L2
𝜽2
solve for 𝜽2 Δz
Ψ
(Law of cosines with angle Ψ, β
arctan with angle β)
Δr o1
solve for 𝜽3
solve for 𝜽1

o3 𝜽3
L3
solve for 𝜽3

L2
𝜽2
solve for 𝜽2 Δz
Ψ
β

Δr o1
two potential solutions
depending on elbow angle
solve for 𝜽3
solve for 𝜽1

𝜽4 o3 𝜽3
solve for 𝜽3 ɸ L4

𝜽2
solve for 𝜽2

o1

solve for 𝜽4
solve for 𝜽3
solve for 𝜽1

solve for 𝜽3

𝜽2
solve for 𝜽2
𝜽3

ɸ 𝜽4 o1

solve for 𝜽4
(Equilvalence relation for
adding angles from z0)
solve for 𝜽3
solve for 𝜽1

𝜽4 o3 𝜽3
L3
solve for 𝜽3 ɸ L4
ɣ

L2
𝜽2
solve for 𝜽2 Δz
Ψ
β

Δr o1

solve for 𝜽4
(Addition of angles in arm
plane starting from z0)
Why Closed Form?

• Advantages
• Speed: IK solution computed in constant time
• Predictability: consistency in selecting satisfying IK solution
• Disadvantage
• Generality: general form for arbitrary kinematics difficult to express
UM EECS 398/598 - autorob.github.io
Iterative Solutions
to IK
• Minimize error between current
Start
endeffector and its desired position

• Transform desired endeffector


velocity into configuration space

• Repeatedly step to convergence at


Goal
desired endeffector position
5-link planar arm

UM EECS 398/598 - autorob.github.io


Next Class

• IK as an optimization problem

• Gradient descent optimization

• Manipulator Jacobian as the derivative of configuration

• Advanced: IK by Cyclic Coordinate Descent

UM EECS 398/598 - autorob.github.io


autorob.github.io

Inverse Kinematics:
Manipulator Jacobian

UM EECS 398/598 - autorob.github.io

You might also like