# Forward Kinematics

In the forward kinematics problem, the transformation describing the position and orientation of a tool, or end effector, is determined by known joint variables. Joint variables are associated with a particular axis, or joint, and are denoted by q_{i}. The two common types of joints used in robot manipulators are revolute and prismatic joints. For a revolute joint, q_{i} is the angle of rotation ($\Theta$_{i}), while for a prismatic joint, q_{i} is the joint displacement (d_{i}).

## The Denavit-Hartenberg Representation

The Denavit-Hartenberg convention (DH convention) is commonly used to define reference frames for robotic serial arms. This convention is based on two assumptions:

**DH1**: The z-axis will lie along the joint. According to Spong, axis z_{i-1}lies along joint i. For example, the axis x_{1}is perpendicular to the axis z_{o}.**DH2**: The x-axes lie along the common normals between the joint axes. According to Spong, axis z_{i-1}lies along joint i. For example, the axis x_{1}intersects the axis z_{0}.

### DH Link Parameter Table

Link i | $\alpha$_{i} |
a _{i} |
d _{i} |
$\Theta$ _{i} |
---|---|---|---|---|

1 | Angle between z_{o} and z_{1} measured about x_{1} |
Distance from z_{o} to z_{1} measured along x_{1} |
Distance from x_{o} to x_{1} measured along z_{o} |
Angle between x_{o} and x_{1} measured about z_{o} |

2 | Angle between z_{1} and z_{2} measured about x_{2} |
Distance from z_{1} to z_{2} measured along x_{2} |
Distance from x_{1} to x_{2} measured along z_{1} |
Angle between x_{1} and x_{2} measured about z_{1} |

n | Angle between z_{n} and z_{n+1} measured about x_{n+1} |
Distance from z_{n} to z_{n+1} measured along x_{n+1} |
Distance from x_{n} to x_{n+1} measured along z_{n} |
Angle between x_{n} and x_{n+1} measured about z_{n} |

A reference frame must first be established for the manipulator. Frames are also assigned for the remaining joints of the manipulator and the end effector. Each frame i moves with link i and is attached to the end of the link. It is necessary to interpret the locations of the frame origins, because they do not always lie at the middle of the joint. To perform a transformation from frame i-1 to frame i:

- Rotate about axis z
_{i-1}by $\theta$_{i} - Translate along axis z
_{i-1}by d_{i} - Translate along axis x
_{i}by a_{i} - Rotate about axis x
_{i}by $\alpha$_{i}

**Figure 1:** Robot Manipulator

In the execution the transformation, the step order is important for rotation, but not for translation. The above four steps can be summarized by the following notation:

A = Rot_{z,$\theta$} Trans_{z,d} Trans_{x,a} Rot_{x,$\alpha$}

From the above equation, A can be written in matrix form as

(1)where R_{1}^{o} is the orientation frame 1 with respect to frame 0 (the base frame), and o_{1}^{o} is the position of frame 1 with respect to the base frame. The matrix A can be rewritten using the corresponding transformations for the rotations and translations of the frame.

The most common representation of the forward kinematics problem is based on the D&H convention and is given below,

(3)with D&H parameters assigned according to the Spong et. al. convention (frame i on joint i-1). The transformation T_{i}^{i-1} is the product of the rotation and translation matrices of matrix A_{i}. The upper left 3x3 matrix of the transformation corresponds to the orientation of the end effector with respect to the base frame. The three columns of this matrix give the direction of the x-, y-, and z-axes, from left to right. The 3x1 matrix in the upper right corner shows the location of the end effector with respect to the base frame.

## Summary of Deriving Robot Forward Kinematics

The general procedure for deriving the forward kinematics of a serial robot manipulator is given in the following steps:

- Label all joints i = 1 to n.
- Assign z-axes for joints 0 to n-1 (z
_{o}along joint 1, etc.). - Assign x
_{o}normal to z_{o}. - Assign x
_{1}through x_{n-1}, which lie at the common normals between z_{o}to z_{n-1}. - Establish y
_{1}to y_{n-1}to complete each frame. - Assign z
_{n}freely (but carefully) and define x_{n}. - Create the table of DH link parameters, defining $\alpha$
_{i}, a_{i}, d_{i}, and $\theta$_{i}for each joint. - Create T
_{i}^{i-1}for i = 1 to n. - Solve T
_{n}^{o}= T_{1}^{o}* T_{2}^{1}* … * T_{n}^{n-1}. - Show the position as the last column of T
_{n}^{o}and the orientation as the first three columns of T_{n}^{o}.

## Forward Kinematics Example

**Figure 2:** Robot Manipulator

For a revolute joint, the joint is the axis of rotation. For a prismatic joint, the joint is on the motion path of the joint.

**Figure 3:** Robot Manipulator with Joint and Frame Assignments

### DH Table

Link i | $\alpha$_{i} |
a _{i} |
d _{i} |
$\Theta$_{i} |
T_{i} ^{i-1} |
---|---|---|---|---|---|

1 | 90 | 0 | d_{1} |
$\Theta$ _{1}^{*} |
T_{1}^{o} |

2 | 0 | 0 | d_{2}^{*} |
0 | T_{2}^{1} |

3 | 0 | 0 | d_{3} |
$\Theta$ _{3}^{*} |
T_{3}^{2} |

Note: * denotes variable joint parameters. For each link, only one unknown joint variable can exist for each joint axis.

### Transformations

The resulting transformation matrices for the manipulator are given below:

(4)The rotation matrix (first 3 columns of T_{3}^{o}) is given as

while the translation matrix (4^{th} column) is

MATLAB can also be used to determine transformations by a user-defined symbolic toolbox. This symbolic toolbox contains the variable parameters for the robot manipulator. A MATLAB code for Example 1 is available below. The code can be modified and expanded to determine transformations of serial arms with six degrees of freedom. (See Serial Arm Manipulator Analysis for an analysis of a 6 DOF serial manipulator.)

#### MATLAB Code: Transformation

%Define symbolic variables

syms theta1 theta3 l2 d1 d2 d3

%Define transformations:

T1_0 = [cos(theta1), 0, sin(theta1), 0;

sin(theta1), 0, -cos(theta1), 0;

0, 1, 0, d1;

0, 0, 0, 1];

T2_1 = [1, 0, 0, 0;

0, 1, 0, 0;

0, 0, 1, d2;

0, 0, 0, 1];

T3_2 = [cos(theta3), -sin(theta3), 0, 0;

sin(theta3), cos(theta3), 0, 0;

0, 0, 1, d3;

0, 0, 0, 1];

%Determine transformation

T2_0 = T1_0 * T2_1;

T2_0 = simple(T2_0)

T3_0 = T2_0*T3_2;

T3_0 = simple(T3_0)

After executing the program, the output should be the following:

T2_0 =

[ cos(theta1), 0, sin(theta1), sin(theta1)*d2]

[ sin(theta1), 0, -cos(theta1), -cos(theta1)*d2]

[ 0, 1, 0, d1]

[ 0, 0, 0, 1]

T3_0 =

[ cos(theta1)*cos(theta3), -cos(theta1)*sin(theta3), sin(theta1), sin(theta1)*(d3+d2)]

[ sin(theta1)*cos(theta3), -sin(theta1)*sin(theta3), -cos(theta1), -cos(theta1)*(d3+d2)]

[ sin(theta3), cos(theta3), 0, d1]

[ 0, 0, 0, 1]

## References

*Robot Modeling and Control.*