# AUTONOMOUS MOBILE ROBOTICS MEM 1883 CHAPTER 2 a

AUTONOMOUS MOBILE ROBOTICS MEM 1883 CHAPTER 2 a Robot Kinematics UTM

The Robot System Kinematics Hardware Mechanical Design Actuators Dynamics Control System Task Planning Software Sensors Prof Dr Shamsudin Hj Mohd Amin 2

Introduction to Kinematics Prof Dr Shamsudin Hj Mohd Amin 3

Robot Kinematics – In order to control and programme a robot we must have knowledge of both its spatial arrangement and a means of reference to the environment. – KINEMATICS - the analytical study of the geometry of motion of a robot arm: • with respect to a fixed reference co-ordinate system • without regard to the forces or moments that cause the motion. Prof Dr Shamsudin Hj Mohd Amin 4

z Co-ordinate Frames x y Right-handed Co-ordinate frame Camera Frame x Tool Frame x Link Frame x Goal Frame x Base x Frame 5

Kinematic Relationship – Between two frames we have a kinematic relationship - basically a translation and a rotation. z x y y x z – This relationship is mathematically represented by a 4 4 Homogeneous Transformation Matrix. Prof Dr Shamsudin Hj Mohd Amin 6

Homogeneous Transformations 3 3 Rotational Matrix r 1 r 2 r 3 x r 4 r 5 r 6 y r 7 r 8 r 9 z 0 1 0 0 3 1 Translation Global Scale 1 3 Perspective Prof Dr Shamsudin Hj Mohd Amin 7

Kinematic Considerations • Using kinematics to describe the spatial configuration of a robot gives us two approaches: • Forward Kinematics. (direct) – Given the joint angles for the robot, what is the orientation and position of the end effector? • Inverse Kinematics. Prof Dr Shamsudin Hj Mohd Amin – Given a desired end effector position what 8

Inverse Kinematics • For a robot system the inverse kinematic problem is one of the most difficult to solve. • The robot controller must solve a set of non-linear simultaneous equations. • The problems can be summarised as: – The existence of multiple solutions. – The possible non-existence of a solution. Prof Dr Shamsudin Hj Mohd Amin – Singularities. 9

Multiple Solutions Goal • This two link planar manipulator has two possible solutions. • This problem gets worse with more ‘Degrees of Freedom’. • Redundancy of movement. Prof Dr Shamsudin Hj Mohd Amin 10

Non Existence of Solution Goal • A goal outside the workspace of the robot has no solution. • An unreachable point can also be within the workspace of the manipulator - physical constraints. • A singularity is a place of Prof Dr Shamsudin Hj Mohd Amin- trajectory tracking. 11 acceleration

Kinematics Control • Kinematics is the first step towards robotic control. Cartesian Space z Joint Space Actuator Space y x Prof Dr Shamsudin Hj Mohd Amin 12

Kinematics involves with angles, lengths, of … Prof Dr Shamsudin Hj Mohd Amin 13

An Example - The PUMA 560 2 3 4 6 5 There are two more joints on the end effector (the gripper) 1 The PUMA 560 has SIX revolute joints A revolute joint has ONE degree of freedom ( 1 DOF) that is defined by its angle Prof Dr Shamsudin Hj Mohd Amin 14

We are interested in two kinematics topics Forward Kinematics (angles to position) What you are given: The length of each link The angle of each joint What you can find: The position of any point (i. e. it’s (x, y, z) coordinates Inverse Kinematics (position to angles) What you are given: The length of each link The position of some point on the robot What you can find: The angles of each joint needed to obtain that position Prof Dr Shamsudin Hj Mohd Amin 15

Quick Math Review Dot Product: Geometric Representation: Matrix Representation: Unit Vector in the direction of a chosen vector but whose magnitude is 1. Prof Dr Shamsudin Hj Mohd Amin 16

Quick Matrix Review Matrix Multiplication: An (m x n) matrix A and an (n x p) matrix B, can be multiplied since the number of columns of A is equal to the number of rows of B. Non-Commutative Multiplication AB is NOT equal to BA Matrix Addition: Prof Dr Shamsudin Hj Mohd Amin 17

Basic Transformations Moving Between Coordinate Frames Translation Along the X-Axis Y O (VN, VO) NO XY V V P X VN VO N Px Px = distance between the XY and NO coordinate planes Notation: 18

Writing in terms of Y O NO XY V V P X VN Prof Dr Shamsudin Hj Mohd Amin VO N 19

Translation along the X-Axis and Y-Axis O Y NO V VX Y Y VN VO N PX X Prof Dr Shamsudin Hj Mohd Amin 20

Using Basis Vectors Basis vectors are unit vectors that point along a coordinate axis O Unit vector along the N-Axis Magnitude of the VNO vector NO V VN Prof Dr Shamsudin Hj Mohd Amin VO N 21

Y Rotation (around the Z-Axis) Y X Z O O V V N VY N V VX X = Angle of rotation between the XY and NO coordinate axis 22

O Y Unit vector along X-Axis Can be considered with respect to the XY coordinates or NO coordinates O V V N VY VX N V X (Substituting for VNO using the N and O components of the vector) Prof Dr Shamsudin Hj Mohd Amin 23

Similarly…. So…. Written in Matrix Form Rotation Matrix about the z-axis Prof Dr Shamsudin Hj Mohd Amin 24

O Y 1 (VN, VO) Y 0 VNO VXY P N X 1 Translation along P followed by rotation by X 0 (Note : Px, Py are relative to the original coordinate frame. Translation followed by rotation is different than rotation followed by translation. ) In other words, knowing the coordinates of a point (VN, VO) in some coordinate frame (NO) you can find the position of that point relative to your original coordinate frame (X 0 Y 0). Prof Dr Shamsudin Hj Mohd Amin 25

HOMOGENEOUS REPRESENTATION Putting it all into a Matrix What we found by doing a translation and a rotation Padding with 0’s and 1’s Simplifying into a matrix form Homogenous Matrix for a Translation in XY plane, followed by a Rotation around the z-axis Prof Dr Shamsudin Hj Mohd Amin 26

Rotation Matrices in 3 D – OK, lets return from homogenous repn Rotation around the Z-Axis Rotation around the Y-Axis Rotation around the X-Axis Prof Dr Shamsudin Hj Mohd Amin 27

Homogeneous Matrices in 3 D H is a 4 x 4 matrix that can describe a translation, rotation, or both in one matrix O Y N P X A Translation without rotation Z Y O N X Z A Rotation without translation Prof Dr Shamsudin Hj Mohd Amin Rotation part: Could be rotation around z-axis, x-axis, y-axis or a combination of 28 the three.

Homogeneous Continued…. The (n, o, a) position of a point relative to the current coordinate frame you are in. 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. Prof Dr Shamsudin Hj Mohd Amin 29

Finding the Homogeneous Matrix EX. J Y N I T X P A K O Z Point relative to the X-Y-Z frame Point relative to the I-J-K frame Point relative to the N-O-A frame 30

J Y N I T X K P A O Z Substituting for Prof Dr Shamsudin Hj Mohd Amin 31

Product of the two matrices Notice that H can also be written as: 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) Prof Dr Shamsudin Hj Mohd Amin 32

The Homogeneous Matrix is a concatenation of numerous translations and rotations J I Y N T X K Z P A O One more variation on finding H: 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 || ) * ( Rotate so that the p-axis is aligned with the O-axis) This method might seem a bit confusing, but it’s actually an easier way to solve our problem given the information we have. Here is an example… 33

Forward Kinematics Prof Dr Shamsudin Hj Mohd Amin 34

Forward Kinematics Definition Kinematic parameters Orientation and position Joint variables Applied in simulation and animation Prof Dr Shamsudin Hj Mohd Amin 35

The Situation: You have a robotic arm that starts out aligned with the xo-axis. You tell the first link to move by 1 and the second link to move by 2. The Quest: What is the position of the end of the robotic arm? Solution: 1. Geometric Approach This might be the easiest solution for the simple situation. However, notice that the angles are measured relative to the direction of the previous link. (The first link is the exception. The angle is measured relative to it’s initial position. ) For robots with more links and whose arm extends into 3 dimensions the geometry gets much more tedious. 2. Algebraic Approach Involves coordinate transformations. 36

Example Problem: You have a three link arm that starts out aligned in the x-axis. Each link has lengths l 1, l 2, l 3, respectively. You tell the first one to move by 1 , and so on as the diagram suggests. Find the Homogeneous matrix to get the position of the yellow dot in the X 0 Y 0 frame. Y 3 3 Y 2 2 2 X 3 3 X 2 H = Rz( 1 ) * Tx 1(l 1) * Rz( 2 ) * Tx 2(l 2) * Rz( 3 ) 1 Y 1 X 1 Y 0 1 X 0 i. e. Rotating by 1 will put you in the X 1 Y 1 frame. Translate in the along the X 1 axis by l 1. Rotating by 2 will put you in the X 2 Y 2 frame. and so on until you are in the X 3 Y 3 frame. The position of the yellow dot relative to the X 3 Y 3 frame is (l 1, 0). Multiplying H by that position vector will give you the coordinates of the yellow point relative the X 0 Y 0 frame. 37

Slight variation on the last solution: Make the yellow dot the origin of a new coordinate X 4 Y 4 frame Y 3 Y 4 3 Y 2 2 2 X 3 3 X 4 H = Rz( 1 ) * Tx 1(l 1) * Rz( 2 ) * Tx 2(l 2) * Rz( 3 ) * Tx 3(l 3) 1 This takes you from the X 0 Y 0 frame to the X 4 Y 4 frame. Y 1 X 1 Y 0 1 X 0 The position of the yellow dot relative to the X 4 Y 4 frame is (0, 0). Notice that multiplying by the (0, 0, 0, 1) vector will equal the last column of the H matrix. Prof Dr Shamsudin Hj Mohd Amin 38

More on Forward Kinematics… Denavit - Hartenberg Parameters Prof Dr Shamsudin Hj Mohd Amin 39

Worked Example on Forward Kinematics Prof Dr Shamsudin Hj Mohd Amin 40

Inverse K i n e m a t i c s Prof Dr Shamsudin Hj Mohd Amin 41

Inverse Kinematics Definition Kinematic parameters Joint variables Orientation and position Applied in control Prof Dr Shamsudin Hj Mohd Amin 42

A Simple Example Revolute and Prismatic Joints Combined Finding : More Specifically: (x , y) arctan 2() specifies that it’s in the first quadrant Y S 1 Finding S: X Prof Dr Shamsudin Hj Mohd Amin 43

Inverse Kinematics of a Two Link Manipulator (x , y) Find: 2 l 2 1 l 1 Given: l 1, l 2 , x , y 1 , 2 Redundancy: A unique solution to this problem does not exist. Notice, that using the “givens” two solutions are possible. Sometimes no solution is possible. (x , y) l 2 l 1 44

The Geometric Solution 2 l 1 l 2 (x , y) Using the Law of Cosines: 1 Using the Law of Cosines: Redundant since 2 could be in the first or fourth quadrant. Redundancy caused since 2 has two possible values 45

The Algebraic Solution 2 l 2 (x , y) l 1 1 Only Unknown 46

We know what 2 is from the previous slide. We need to solve for 1. Now we have two equations and two unknowns (sin 1 and cos 1 ) Substituting for c 1 and simplifying many times Notice this is the law of cosines and can be replaced by x 2+ y 2 Prof Dr Shamsudin Hj Mohd Amin 47

Worked Example on Inverse Kinematics Prof Dr Shamsudin Hj Mohd Amin 48

- Slides: 48