30
CS 3630 Robot Kinematics: Planar Arms

Robot Kinematics - Frank Dellaert

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Robot Kinematics - Frank Dellaert

CS 3630

Robot Kinematics:Planar Arms

Page 2: Robot Kinematics - Frank Dellaert

Robot Arms• A robot arm (aka serial link manipulator) consists of a series of rigid

links, connected by joints (motors), each of which has a single degree of freedom.• Revolute Joint: Single degree of freedom is rotation about an axis.

• Prismatic joint: Single degree of freedom is translation along an axis.

Revolute Joint Prismatic Joint

Page 3: Robot Kinematics - Frank Dellaert

Describing Serial Link Arms• Number the links in sequence. • For a robot with 𝑛 joints:

• Base (which does not move) is Link 0.• End-effector (tool) is attached to Link 𝑛.• Joint 𝑖 connects Link 𝑖 − 1 to Link 𝑖• We define the joint variable 𝑞𝑖 for joint 𝑖 as:

𝑞𝑖 = ቐ𝜃𝑖 if joint 𝑖 is revolute

𝑑𝑖 if joint 𝑖 is prismatic

Two-link Planar Arm: • 𝑛 = 2, • both links are always coplanar (no rotation

out of the plane). • 𝑞1 = 𝜃1, 𝑞2 = 𝜃2

Page 4: Robot Kinematics - Frank Dellaert

Manipulator Kinematics• Kinematics describes the position and motion of a robot, without

considering the forces required to cause the motion.

• Forward Kinematics: Given the value for each joint variable, 𝑞𝑖 ,determine the position and orientation of the end-effector (gripper, tool) frame.

The basic idea: ➢Assign lots of coordinate frames,

and express these frames in terms of the joint variables, 𝑞𝑖.

Page 5: Robot Kinematics - Frank Dellaert

General Approach• Each link is a rigid body.

• We know how to describe the position and orientation of a rigid body:• Attach a coordinate frame to the body.

• Specify the position and orientation of the coordinate frame relative to some reference frame.

• If two links, say link 𝑖 − 1 and link 𝑖 are connected by a single joint, then the relationship between the two frames can be described by a homogeneous transformation matrix 𝑇𝑖

𝑖−1 which will depend only on the value of the joint variable!

Page 6: Robot Kinematics - Frank Dellaert

Homogeneous Transformations

𝑷𝟎

1= 𝑹𝟏

𝟎𝑷𝟏 + 𝒅𝟎

1=

𝑹𝟏𝟎 𝒅𝟎

02 1𝑷𝟏

1

We can simplify the equation for coordinate transformations by augmenting the vectors and matrices with an extra row:

෨𝑃0 = 𝑇10 ෨𝑃1

෨𝑃0 = 𝑷𝟎

1, ෨𝑃1 = 𝑷𝟏

1

➢𝐓𝟏𝟎 is called a homogeneous transformation matrix

➢ ෩𝐏𝟎 are the homogeneous coordinates for 𝐏𝟎

Page 7: Robot Kinematics - Frank Dellaert

Composition of Transformations

𝑥0

𝑦1

𝑦2

𝑦0𝑥1

𝑥2

𝑃

෨𝑃1 = 𝑇21 ෨𝑃2

෨𝑃0 = 𝑇10 ෨𝑃1

From our previous results, we know:

෨𝑃0 = 𝑇10𝑇2

1 ෨𝑃2

෨𝑃0 = 𝑇20 ෨𝑃2

𝑇20 = 𝑇1

0𝑇21

But we also know:

𝑇10

𝑇21

𝑇20

This is the composition law for homogeneous transformations.

Page 8: Robot Kinematics - Frank Dellaert

What about robot arms??

𝑇10

𝑇21

𝑇20

• Attach a coordinate frame to each link of the robot!

• Frame 0 is attached to Link 0, which is merely the fixed mounting point to the environment.

• Now, the trick is to express 𝑇𝑖𝑖−1 as a function

of 𝜃𝑖

Page 9: Robot Kinematics - Frank Dellaert

A special case

𝑥0

𝑦1

𝑦2𝑦0

𝑥1

𝑥2

𝑇21 =

cos𝜃2 −sin 𝜃2 𝑎2 cos 𝜃2sin 𝜃2 cos 𝜃2 𝑎2 sin 𝜃20 0 1

𝑇10 =

cos 𝜃1 −sin 𝜃1 𝑎1 cos 𝜃1sin 𝜃1 cos 𝜃1 𝑎1 sin 𝜃10 0 1

𝜃1

𝜃2𝑎1 𝑎2

𝑇𝑖𝑖−1 =

cos 𝜃𝑖 −sin 𝜃𝑖 0sin 𝜃𝑖 cos 𝜃𝑖 00 0 1

1 0 𝑎𝑖0 1 00 0 1

=cos 𝜃𝑖 −sin 𝜃𝑖 𝑎𝑖 cos 𝜃𝑖sin 𝜃𝑖 cos 𝜃𝑖 𝑎𝑖 sin 𝜃𝑖0 0 1

Suppose the axis 𝑥𝑖 is collinear with the origin of Frame 𝑖 − 1:• 𝑥1 is collinear with the origin of Frame 0• 𝑥2 is collinear with the origin of Frame 1

Use this to simplify link coordinate frames!

Page 10: Robot Kinematics - Frank Dellaert

Assigning Coordinate Frames to Links

• Frame 0 (the base frame) has its origin at the center of Joint 1 (on the axis of rotation).

• Frame 𝑖 is rigidly attached to Link 𝑖, and has it’s origin at the center of Joint 𝑖 + 1.

• The 𝑥𝑖-axis is collinear with the origin of Frame 𝑖 − 1.

• The link length, 𝑎𝑖 is the distance between the origins of Frames 𝑖 and 𝑖 − 1.

• The homogeneous transformation that relates adjacent frames is given by:

𝑇𝑖𝑖−1 =

cos 𝜃𝑖 −sin 𝜃𝑖 𝑎𝑖 cos 𝜃𝑖sin 𝜃𝑖 cos 𝜃𝑖 𝑎𝑖 sin 𝜃𝑖0 0 1

Page 11: Robot Kinematics - Frank Dellaert

Assigning Link Frames

𝜃1 is the angle from 𝑥0to 𝑥1

• 𝑥1 is collinear with the origin of Frame 0

𝑥0

𝑦0

𝑥1

𝑥2 is collinear with the origin of Frame 1

𝑥2

𝜃2 is the angle from 𝑥1to 𝑥2

• Frame 𝑛 is the end-effector frame. It can be attached to link 𝑛 in any manner that is convenient.

• In this case, 𝑛 = 2, so Frame 2 is the end-effector frame.

Page 12: Robot Kinematics - Frank Dellaert

The Forward Kinematic Map• The forward kinematic map gives the position and orientation of the

end-effector frame as a function of the joint variables:

𝑇𝑛0 = 𝐹(𝑞1, … , 𝑞𝑛)

• For the two-link planar arm, we have

𝑇20 =

cos 𝜃1 −sin 𝜃1 𝑎1 cos 𝜃1sin 𝜃1 cos 𝜃1 𝑎1 sin 𝜃10 0 1

cos 𝜃2 −sin 𝜃2 𝑎2 cos 𝜃2sin 𝜃2 cos 𝜃2 𝑎2 sin 𝜃20 0 1

=cos(𝜃1+𝜃2) − sin(𝜃1+𝜃2) 𝑎1 cos 𝜃1 + 𝑎2 cos(𝜃1+𝜃2)sin(𝜃1+𝜃2) cos(𝜃1+𝜃2) 𝑎1 sin 𝜃1 + 𝑎2 sin(𝜃1+𝜃2)

0 0 1

Page 13: Robot Kinematics - Frank Dellaert

Simple Geometry…

𝜃2

𝑎1 cos 𝜃1

𝑎1 sin 𝜃1𝑎2 cos(𝜃1+𝜃2)

𝑎2 sin(𝜃1+𝜃2)

𝜃1

𝜃1 + 𝜃2

Page 14: Robot Kinematics - Frank Dellaert

Simple Geometry…

𝜃1 + 𝜃2

𝑎1 cos 𝜃1

𝑎1 sin 𝜃1𝑎2 cos(𝜃1+𝜃2)

𝑎2 sin(𝜃1+𝜃2)

𝑇20 =

cos(𝜃1+𝜃2) − sin(𝜃1+𝜃2) 𝑎1 cos 𝜃1 + 𝑎2 cos(𝜃1+𝜃2)sin(𝜃1+𝜃2) cos(𝜃1+𝜃2) 𝑎1 sin 𝜃1 + 𝑎2 sin(𝜃1+𝜃2)

0 0 1

Page 15: Robot Kinematics - Frank Dellaert

Three-Link Planar Arm 𝑥3𝑦3

𝑇30 =

𝐶123 −𝑆123 𝑎1𝐶1 + 𝑎2𝐶12 + 𝑎3𝐶123𝑆123 𝐶123 𝑎1𝑆1 + 𝑎2𝑆12 + 𝑎3𝑆1230 0 1

𝑇30 =

cos𝜙 − sin𝜙 𝑋𝑒sin𝜙 cos𝜙 𝑌𝑒0 0 1

𝐶123 = cos 𝜃1 + 𝜃2 + 𝜃3 , etc.

(𝑋𝑒 , 𝑌𝑒)

𝜙

We can parameterize the end effector frame by (𝑿𝒆, 𝒀𝒆, 𝝓)

Page 16: Robot Kinematics - Frank Dellaert

About the Forward Kinematic Map

• For the two-link arm, we can position the end-effector origin anywhere in the arm’s workspace: two inputs (𝜃1, 𝜃2) and two “outputs” (𝑋𝑒 , 𝑌𝑒).

• For the three-link arm, we can position the end-effector origin anywhere in the arm’s workspace, and we can choose the orientation of the frame: three inputs (𝜃1, 𝜃2, 𝜃3) and three “outputs” (𝑋𝑒 , 𝑌𝑒 , 𝜙).

• Suppose we had a four-link arm?• Infinitely may ways to achieve a desired end-effector configuration (𝑋𝑒 , 𝑌𝑒 , 𝜙).

Page 17: Robot Kinematics - Frank Dellaert

More General Robot Arms

• With a bit of work, this can be generalized to arbitrary robot arms.

• We shall not do this bit of work in CS3630.

Page 18: Robot Kinematics - Frank Dellaert

Motion Control

• Trajectory following is important

• Spray-painting

• Sealing

• Welding

• Three main approaches:

• Trajectory replay

• Joint-space Motion Control

• Cartesian Motion Control

Image by Roboguru

Page 19: Robot Kinematics - Frank Dellaert

Trajectory Replay

• Teaching by demonstration

• Define a set of waypoints by “showing” the robot

• Similar to keyframe animation in graphics

• Still need to interpolate between waypoints

Page 20: Robot Kinematics - Frank Dellaert

RRR example

• End-effector == frame 3

Page 21: Robot Kinematics - Frank Dellaert

RRR example, cont’d

• Multiply 3 matrices

• Note R in upper left

• Check orientation!

Page 22: Robot Kinematics - Frank Dellaert

Proportional Feedback Control

• Feedback law:

• At every time step:• Calculate joint space error

• Increase of decrease proportional to et

• Kp is proportional gain parameter

Page 23: Robot Kinematics - Frank Dellaert

Proportional Feedback Control

• Properties:• Closer to goal -> smaller steps

• Automatically reverses sign if we overshoot

• Generalizes to vector-valued control

• Value of Kp really matters: • too high: overshoot

• too low: slow convergence

• Special case of PID control

https://arduinoplusplus.wordpress.com/2017/06/21/pid-control-experiment-tuning-the-controller/

Page 24: Robot Kinematics - Frank Dellaert

The Manipulator Jacobian

• Velocity of end-effector if we move any given joint?

• Given by arrows:

• R=joint 1

• G=joint 2

• B=joint 3

Page 25: Robot Kinematics - Frank Dellaert

Jacobian = linear map

• Linear relationship between joint space velocity and cartesian velocity (pose space!)

• J is 3xn matrix:

• Each Ji(q) column corresponds to arrow.

• Partial derivative of pose wrt qi

Page 26: Robot Kinematics - Frank Dellaert

Worked Example: RRR manipulator

• Remember:

• Extracting x, y, theta:

• So what is Jacobian???

Page 27: Robot Kinematics - Frank Dellaert

Worked Example: RRR manipulator

• x, y, theta:

• Jacobian:

Page 28: Robot Kinematics - Frank Dellaert

Cartesian Motion Control

• Convert direction in cartesian space to direction in joint space

• Yields straight-line paths

Page 29: Robot Kinematics - Frank Dellaert

How do we convert?

• We want a straight line!

• Calculate (scaled) direction of the line

• Error in cartesian space:

• Then, simple proportional control:

Small print: we have to take care when subtracting angles, as they are not unique

Page 30: Robot Kinematics - Frank Dellaert

Summary

1. Forward Kinematics is just multiplying transforms

2. We went through an RRR Worked Example

3. Joint-Space Motion Control creates paths that minimize distance in joint space

4. The Manipulator Jacobian provides a relationship between cartesian and joint-space velocities/displacements

5. Cartesian Motion Control exploits this relationship to provide predictable paths in cartesian space