Carnegie Mellon
An Introduction to Robot Kinematics
Howie Choset Hannah Lyness
© Howie Choset, 2019 Carnegie Mellon
Robot kinematics refers to the geometry and movement of robotic mechanisms
Prof Michael Kaess 16-665: Robot Mobility In Air, Land, and Sea. Underwater Robotics Lecture 2 Slide 31. Used with permission. Carnegie Mellon
A select history of robotics
Elmer, 1948 Unimate, Wabot 2, Shakey, 1959 1980 1966
CyberKnife, 1991 Asimo, Baxter, Kuka KR AGILUS, 2000 Big Dog, 2011 2014 2005 https://en.wikipedia.org/wiki/Shakey_the_robot#/media/File:SRI_Shakey_with_callouts.jpg, http://roamerrobot.tumblr.com/post/23079345849/the-history-of- turtle-robots, https://www.robotics.org/joseph-engelberger/unimate.cfm, https://en.wikipedia.org/wiki/BigDog, https://www.techexplorist.com/wp- content/uploads/2016/03/Baxter_Robot-696x470.jpg Carnegie Mellon
Goals
- Use robotics kinematics terms to explain real world situations.
- Express a point in one coordinate frame in a different coordinate frame.
- Represent complex translations and rotations using a homogenous transformation matrix.
- Determine the position and orientation of an end effector given link and joint information. Carnegie Mellon
What does degrees of freedom mean? Carnegie Mellon
Degrees of Freedom (DOF): the number of independent parameters that can fully define the configuration Carnegie Mellon
How many degrees of freedom does this have?
https://www.chamonix.net/english/leisure/sightseeing/mer-de-glace Carnegie Mellon
1 DOF
https://www.chamonix.net/english/leisure/sightseeing/mer-de-glace Carnegie Mellon
How many degrees of freedom does this have?
http://www.andrew.cmu.edu/user/kbrennan/TeamZ-Lab9.html Carnegie Mellon
2 DOF
http://www.andrew.cmu.edu/user/kbrennan/TeamZ-Lab9.html Carnegie Mellon
How many degrees of freedom does this have?
https://pureadvantage.org/news/2016/11/15/underwater-robots/ Carnegie Mellon
6 DOF
https://pureadvantage.org/news/2016/11/15/underwater-robots/ Carnegie Mellon
How many degrees of freedom does this have?
https://www.shopecobambino.com/maple-landmark-starter-train-set.html Carnegie Mellon
1 DOF
https://www.shopecobambino.com/maple-landmark-starter-train-set.html Carnegie Mellon
How many degrees of freedom does this have?
http://hades.mech.northwestern.edu/index.php/File:Human-arm.png Carnegie Mellon
7 DOF
http://hades.mech.northwestern.edu/index.php/File:Human-arm.png Carnegie Mellon
Definitions
Reference Frame: Static coordinate system from which translations and rotations are based
Link: Single rigid body
Joint: Connection between links
Constraints: Limitations on movement
http://www.value-design-consulting.co.uk/co-ordinate-systems.html http://www.andrew.cmu.edu/user/kbrennan/TeamZ-Lab9.html Carnegie Mellon
Grübler’s Formula to find degrees of freedom
Basic Idea:
DOF of mechanism = Link DOFs – Joint Constraints Carnegie Mellon
Grübler’s Formula to find degrees of freedom
= 𝑗𝑗 (6 )
𝑀𝑀 6𝑛𝑛 − � − 𝑓𝑓𝑖𝑖 𝑖𝑖=1 M is the degrees of freedom n is the number of moving links j is the number of joints f_i is the degrees of freedom of the ith joint Carnegie Mellon
Grübler’s Formula – Simple Open Chain
= 𝑗𝑗
𝑀𝑀 � 𝑓𝑓𝑖𝑖 𝑖𝑖=1 M is the degrees of freedom n is the number of moving links j is the number of joints f_i is the degrees of freedom of the ith joint
http://hades.mech.northwestern.edu/index.php/File:Human-arm.png Carnegie Mellon
Grübler’s Formula – Simple Closed Chain
= 𝑗𝑗
𝑀𝑀 � 𝑓𝑓𝑖𝑖 − 𝑑𝑑 𝑖𝑖=1 M is the degrees of freedom n is the number of moving links j is the number of joints f_i is the degrees of freedom of the ith joint d is the dimension, 3 for planar, 6 for spatial
http://ocw.upm.es/ingenieria-mecanica/mechanical-devices-for- industry/contenidos/lectura-obligatoria/lesson-1/four-bar-linkages Carnegie Mellon Types of Joints – Lower Pairs
Revolute Joint 1 DOF ( Variable - )
Prismatic Joint 1 DOF (linear) (Variables - d)
Spherical Joint 3 DOF ( Variables - 1, 2, 3) Carnegie Mellon Types of Joints – Higher Pairs
Gears 1 DOF ( Variable - )
Cam and Follower 1 DOF (linear) (Variables - d)
https://nptel.ac.in/courses/112103174/module4/lec3/1.html Carnegie Mellon
Grübler’s Formula to find degrees of freedom Carnegie Mellon
We are interested in two kinematics topics
Forward Kinematics Inverse Kinematics (angles to position) (position to angles)
What you are given: What you are given: The length of each link The length of each link The angle of each joint The position of some point on the robot
What you can find: What you can find: The position of any point The angles of each joint needed to (i.e. it’s (x, y, z) coordinates) obtain that position Carnegie Mellon
Forward Kinematics (angles to position)
tf x,y
l2 l2 l1 l1 t1
Given l1, l2, t1, t2 Find x, y, tf Carnegie Mellon
Inverse Kinematics (angles to position)
tf x,y t2 l l2 2 l1 l1 t1
Given l1, l2, x, y, tf Find t1, t2 Carnegie Mellon
Quick Math Review
Vector: A geometric object with magnitude and direction Carnegie Mellon
Quick Math Review
Vector: A geometric object with magnitude and direction
Examples of vector quantities: Velocity, displacement, acceleration, force Carnegie Mellon
Quick Math Review
Vector Magnitude: Just the vector quantity without direction
Examples: Magnitude of velocity is speed, magnitude of displacement is distance, etc. Carnegie Mellon
Quick Math Review
Unit Vector: Vector with magnitude of 1
Used to indicate direction Carnegie Mellon
Quick Math Review
Vector: A geometric object with magnitude and direction
y
x
Can be written in matrix form as a column vector Carnegie Mellon
Quick Math Review
Vector Addition
- Sum each component of the vector
y
x Yields a new vector Commutative Carnegie Mellon
Quick Math Review
y
x
Yields a scalar Commutative Carnegie Mellon
Quick Math Review
Yields a vector perpendicular to both original vectors Not commutative
https://en.wikipedia.org/wiki/Cross_product Carnegie Mellon
Quick Math Review
Matrix Addition
- Sum matching elements
a b e f (a + e) (b + f ) + = c d g h (c + g) (d + h)
Matrices must be of same size Yields a new matrix of the same size Commutative Carnegie Mellon
Quick Math Review
Matrix Multiplication
- Multiply rows and columns and sum products
a b e f (ae + bg) (af + bh) ∗ = c d g h (ce + dg) (cf + dh)
Matrices must have the same inner dimension Yields a new matrix of the same size Not commutative Carnegie Mellon
We can use vectors to succinctly represent a point with respect to a certain reference frame
Y
X Carnegie Mellon
We will use superscripts to indicate our reference frame Y
O X M
L N Carnegie Mellon Basic Transformations Representing a point in a different frame: Translation along the x-axis
Y O
N X Carnegie Mellon Basic Transformations Representing a point in a different frame: Translation along the x-axis
Y O
N X Carnegie Mellon Basic Transformations Representing a point in a different frame: Translation along the x-axis
Y O
N X
Px
Px = distance between the XY and NO coordinate planes
Notation: Carnegie Mellon
XY NO Writing V in terms of V
Y O
N X
Px Carnegie Mellon
XY NO Writing V in terms of V
Y O
N X
PX Carnegie Mellon Basic Transformations Representing a point in a different frame: Translation along the x- and y-axes
O
Y
N
X Carnegie Mellon Basic Transformations Representing a point in a different frame: Translation along the x- and y-axes
O
Y
N
X Carnegie Mellon Using Basis Vectors Basis vectors are unit vectors that point along a coordinate axis
O n Unit vector along the N-Axis o Unit vector along the N-Axis V NO Magnitude of the VNO vector o n N
NO NO V N V cosθ V cosθ V NO • n NO = = = = V O NO NO NO V V sinθ V cos(90 − θ) V • o Carnegie Mellon Basic Transformations Representing a point in a different frame: Rotation about z-axis (out of the board) Y
V
VY
X VX = Angle of rotation between the XY and NO coordinate axis Carnegie Mellon
Y
V
VY
X VX
(Substituting for VNO using the N and O components of the vector) Carnegie Mellon
Y
V
VY
X VX
(Substituting for VNO using the N and O components of the vector) Carnegie Mellon Basic Transformations Representing a point in a different frame: Rotation about z-axis (out of the board) Y
V
VY
X VX Carnegie Mellon Compound Transformations Representing a point in a different frame: Translation along the x- and y-axes and rotation Y1
(VN,VO) Y0 VNO
VXY 1 P X
Translation along P followed by rotation by θ X0
X N V Px cosθ − sinθV XY = = + V Y O V Py sinθ cosθ V Carnegie Mellon Compound Transformations Representing a point in a different frame: Translation along the x- and y-axes and rotation Y1
(VN,VO) Y0 VNO
VXY 1 P X
Translation along P followed by rotation by θ X0
X N V Px cosθ − sinθV XY = = + V Y O V Py sinθ cosθ V
(Note : Px, Py are relative to the original coordinate frame. Translation followed by rotation is different than rotation followed by translation.) Carnegie Mellon
Relative versus absolute translation
Relative: - Can be composed to create Y0 homogenous transformation X1 matrix. P - Translations are with respect to a frame fixed to the robot or X0 point.
Y0 Absolute: - Translations are with respect to a X1 fixed world frame. P X0 Carnegie Mellon
The Homogeneous Matrix can represent both translation and rotation
X N V Px cosθ − sinθV What we found by doing a XY = = + V Y O translation and a rotation V Py sinθ cosθ V
V X P cosθ − sinθ 0V N x = Y = + O Padding with 0’s and 1’s V Py sinθ cosθ 0V 1 0 0 0 1 1
X N V cosθ − sinθ Px V Y O = = Simplifying into a matrix form V sinθ cosθ Py V 1 0 0 1 1 cosθ − sinθ P x Homogenous Matrix for a Translation in XY = H sinθ cosθ Py plane, followed by a Rotation around the z-axis 0 0 1 Carnegie Mellon Rotation Matrices in 3D
cosθ − sinθ 0 Rotation around the Z-Axis = R z sinθ cosθ 0 0 0 1
cosθ 0 sinθ = Rotation around the Y-Axis R y 0 1 0 − sinθ 0 cosθ
1 0 0 = − Rotation around the X-Axis R x 0 cosθ sinθ 0 sinθ cosθ Carnegie Mellon Homogeneous Matrices in 3D H is a 4x4 matrix that can describe a translation, rotation, or both in one matrix O
1 0 0 Px Y 0 1 0 Py N P H = 0 0 1 Pz A X 0 0 0 1 Translation without rotation Z
nx ox ax 0 Y O n o a 0 H = y y y N n o a 0 z z z X 0 0 0 1 Could be rotation around Z Rotation without translation z-axis, x-axis, y-axis or a A combination of the three. Carnegie Mellon Homogeneous Continued….
V N VO The (n,o,a) position of a point relative to the V XY = H current coordinate frame you are in. V A 1
N nx ox ax Px V X N O A n o a P VO V = n V + o V + a V + P V XY = y y y y x x x x n o a P V A z z z z 0 0 0 1 1
The rotation and translation part can be combined into a single homogeneous matrix IF and ONLY IF both are relative to the same coordinate frame. Carnegie Mellon Finding the Homogeneous Matrix
WN O W A W
P
N WI W J Point relative to the O Point relative to the W W I-J-K frame N-O-A frame K A W W
I N I N W ni oi ai Pi W W Pi ni oi ai W J O J O = + W n j o j a j Pj W W Pj n j o j a j W = K A K A W nk ok ak Pk W W Pk nk ok ak W 1 0 0 0 1 1 Carnegie Mellon Finding the Homogeneous Matrix
WN Y O W A W T P X
Z X i j k T I X I W x x x x W W Tx ix jx k x W Y J Y J W iy jy k y Ty W W = T + i j k W = y y y y WZ i j k T WK Z k z z z z W Tz iz jz k z W 1 0 0 0 1 1
X N W ix jx k x Tx ni oi ai Pi W WI Y O J W i j k T n o a P W Substituting for W = y y y y j j j j Z A WK W i j k T n o a P W z z z z k k k k 1 0 0 0 1 0 0 0 1 1 Carnegie Mellon The Homogeneous Matrix is a concatenation of numerous translations and rotations
X N W W i j k T n o a P x x x x i i i i WY WO = iy jy k y Ty n j o j a j Pj Z H A H = W W i j k T n o a P z z z z k k k k 1 1 0 0 0 1 0 0 0 1 Product of the two matrices Notice that H can also be written as:
1 0 0 Tx ix jx k x 01 0 0 Pi ni oi ai 0 0 1 0 T i j k 0 0 1 0 P n o a 0 H = y y y y j j j j 0 0 1 T i j k 00 0 1 P n o a 0 z z z z k k k k 0 0 0 1 0 0 0 10 0 0 1 0 0 0 1
H = (Translation relative to the XYZ frame) * (Rotation relative to the XYZ frame) * (Translation relative to the IJK frame) * (Rotation relative to the IJK frame) Carnegie Mellon One more variation on finding the homogeneous transformation matrix
WN Y O W A W T P X
Z
H = (Rotate so that the X-axis is aligned with T) * ( Translate along the new t-axis by || T || (magnitude of T)) * ( Rotate so that the t-axis is aligned with P) * ( Translate along the p-axis by || P || (magnitude of P)) * ( Rotate so that the p-axis is aligned with the O-axis) Carnegie Mellon
Three-Dimensional Illustration
• Rotate X • Translate X • Rotate Z • Translate Z Carnegie Mellon
Rotation about X Carnegie Mellon
Translation about X Carnegie Mellon
Rotation about Z
1 Carnegie Mellon
Translation in Z Carnegie Mellon
Example Problem 1
Set up:
- You have an RR robotic arm with base at the origin. - The first link moves th1 with respect to the x-axis. The second link moves th2 with respect to the first link.
Question:
- What is the position and orientation of the end effector of the robotic arm? Carnegie Mellon
Geometric Approach Carnegie Mellon
Algebraic Approach
X2
Y2 Y0
X0 Carnegie Mellon
Algebraic Approach
X2
Y2 Y0
X0 Carnegie Mellon
Algebraic Approach
X2
Y2 Y0
X0 Carnegie Mellon
Example Problem 2
Y3 Set up: U3
Y2 2 X3 3 - You are have a three-link arm U2 X2 with base at the origin.
- Each link has lengths l1, l2, l3, Y0 1 respectively. Each joint has
angles θ1, θ2, θ3, respectively. U1 X0
Question:
- What is the Homogeneous matrix to get the position of the yellow dot in the X0Y0 frame. Carnegie Mellon
Algebraic Approach Y3
U3
Y2 2 X3 3 U2 X2
H = Rz(U1 ) * Tx1(l1) * Rz(U2 ) * Tx2(l2) * Rz(U3 ) Y0 1 1 1 i.e. Rotating by 1 will put you in the X Y frame. 1 Translate in the along the X axis by l1. U1 2 2 Rotating by 2 will put you in the X Y frame. X0 and so on until you are in the X3Y3 frame.
The position of the yellow dot relative to the X3Y3 frame is (l1, 0). Multiplying H by that position vector will give you the coordinates of the yellow point relative the the X0Y0 frame. Carnegie Mellon
Slight variation on the last solution: Make the yellow dot the origin of a new coordinate X4Y4 frame
Y3
Y4 U3
Y2 2 X3 3 U2 X2 X4
H = Rz(U1 ) * Tx1(l1) * Rz(U2 ) * Tx2(l2) * Rz(U3 ) * Tx3(l3) Y0 1 This takes you from the X0Y0 frame to the X4Y4 frame.
U1 4 4 X0 The position of the yellow dot relative to the X Y frame is (0,0).
X 0 Y 0 = H Notice that multiplying by the (0,0,0,1) vector will Z 0 equal the last column of the H matrix. 1 1 Carnegie Mellon
Next Class: Inverse Kinematics
Forward Kinematics Inverse Kinematics (angles to position) (position to angles)
What you are given: What you are given: The length of each link The length of each link The angle of each joint The position of some point on the robot
What you can find: What you can find: The position of any point The angles of each joint needed to (i.e. it’s (x, y, z) coordinates) obtain that position