Inverse Kinematics

2 downloads 0 Views 19MB Size Report
Inverse kinematics: inferring the joint positions necessary to reach a desired end-effector pose. We need to solve for configuration from a transform between ...
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

Base (Frame 0)

Transform of endeffector wrt. base

Endeffector (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

Base (Frame 0)

Transform of endeffector wrt. base

Endeffector (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

Base (Frame 0)

Transform of endeffector wrt. base

Endeffector (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 Robot endeffector is the gripper pose in world frame Endeffector pose has position can consider orientation Endeffector defines “tool frame” with transform world frame

Frame 2 is the “tool frame”

2 Cartesian DOFs o0N = p0 = (px0,py0)

Endeffector can be specified as a point p2 (origin of tool frame) wrt. Frame 1 Endeffector transforms into p0 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 frame

world frame UM EECS 398/598 - autorob.github.io

Checkpoint: Transform endeffector on link to world

endeffectorworld

endeffectorlink4

tool frame

world frame UM EECS 398/598 - autorob.github.io

Forward kinematics: “given configuration, compute endeffector”

Robot configuration defined by DoF state

2 angular DOFs q = [𝜽1,𝜽2]

Robot endeffector is the gripper pose in world frame

2 Cartesian DOFs o0N = p0 = (px0,py0)

UM EECS 398/598 - autorob.github.io

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

Robot configuration defined by DoF state

2 angular DOFs q = [𝜽1,𝜽2]

p0 = f(𝜽1,𝜽2)

Robot endeffector is the gripper pose in world frame

2 Cartesian DOFs 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) remember:

What is the position and 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: 1DOF motor at pendulum axis, motor servo moves arm to angle 𝜽1

desired endeffector position (o0N) given as an x,y location

what is 𝜽1?

𝜽1

UM EECS 398/598 - autorob.github.io

1DOF pendulum example assume: 1DOF motor at pendulum axis, motor servo moves arm to angle 𝜽1

desired endeffector position (o0N) given as an x,y location

what is 𝜽1?

𝜽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

2 constraints

Remember: Ax=b

UM EECS 398/598 - autorob.github.io

Inverse Kinematics: 2D

UM EECS 398/598 - autorob.github.io

Inverse Kinematics: 2D Configuration

Transform from endeffector frame to world frame

UM EECS 398/598 - autorob.github.io

Inverse Kinematics: 2D Configuration

Transform from endeffector frame to world frame

Inverse orientation

Inverse position UM EECS 398/598 - autorob.github.io

Inverse Kinematics: 2D Configuration

Transform from endeffector

Closed form solution

UM EECS 398/598 - autorob.github.io

Inverse Kinematics: 3D Transform from endeffector

Configuration

6 DOF position and orientation of endeffector

UM EECS 398/598 - autorob.github.io

Inverse Kinematics: 3D Configuration

Transform from 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: link lengths (L4,L3,L2,L1) endeffector orientation ɸ as angle wrt. plane centered at o3 and parallel to ground plane

endeffector position [xg yg zg] wrt. base frame

Find: configuration q = [𝜽1 𝜽2 𝜽3 𝜽4] as robot joint angles

overhead view

solve for 𝜽1

solve for 𝜽3 solve for 𝜽1

Decoupling: separate endeffector from rest of the robot at last joint

solve for 𝜽3

and joint 1 from rest of robot

solve for 𝜽3 solve for 𝜽1

o3

L3

𝜽3

solve for 𝜽3

L2

ɣ Δz

𝜽2

Ψ β Δr

o1

solve for 𝜽3 solve for 𝜽1

o3 solve for 𝜽3

L3

𝜽3 ɣ

L2

(Law of cosines with supplementary angle ɣ) Δz

𝜽2

Ψ β Δr

o1

solve for 𝜽3 solve for 𝜽1

o3 solve for 𝜽3

L3

𝜽3

solve for 𝜽2

L2

ɣ Δz

𝜽2

Ψ

(Law of cosines with angle Ψ, arctan with angle β)

β Δr

o1

solve for 𝜽3 solve for 𝜽1

o3 solve for 𝜽3

L3

𝜽3

solve for 𝜽2

L2

ɣ Δz

𝜽2

Ψ β Δr

two potential solutions depending on elbow angle

o1

solve for 𝜽3 solve for 𝜽1

𝜽4 solve for 𝜽3

solve for 𝜽2

ɸ

o3

𝜽3

L4

𝜽2

o1 solve for 𝜽4

solve for 𝜽3 solve for 𝜽1

solve for 𝜽3

𝜽2

solve for 𝜽2

𝜽3 ɸ 𝜽4

solve for 𝜽4

(Equilvalence relation for adding angles from z0)

o1

solve for 𝜽3 solve for 𝜽1

𝜽4 solve for 𝜽3

L3

𝜽3

L4

ɣ

L2

solve for 𝜽2

ɸ

o3

Δz

𝜽2

Ψ β Δr

solve for 𝜽4

o1

(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 endeffector and its desired position



Transform desired endeffector velocity into configuration space



Repeatedly step to convergence at desired endeffector position

Start

Goal 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