If you are unfamiliar with basic principles of robot manipulators I suggest reading the introduction to this series.

This tutorial continues from the previous tutorial which covers forward kinematic analysis using **homogeneous transformation matrices**. We now examine the **Denavit Hartenberg (DH)** method using a modified homogeneous transformation matrix to find the real world co-ordinates of the tool tip where the joint angles are given. The advantage of the DH method is that only four parameters are required to define transformations, as opposed to six for the previous method (three rotations and three translations). Four input parameters are more economical than six in computing software terms. It is fair to say however that the DH method is more complex using manual calculations.

Firstly we explain the DH method and then work through the transformation stages using our robot model as an example.

#### Rules for applying the DH method

**Rules for co-ordinate frames**

Fig.1 above shows the six axis robot model used in the previous tutorial, illustrating the vertical datum position and the tool tip pose produced by specified joint angles. Frame 0, coincident with the origin of frame 1, represents the real world co-ordinates of the base frame (grey colour).

The DH method requires co-ordinate frames set up in accordance with very specific rules which we now state. Co-ordinate frames are considered in pairs, successive frames being designated frame n and frame (n-1) with co-ordinates denoted X_{n}, X_{(n-1)}, etc.

**Rule 1:** The axis of rotation of every frame associated with a revolute joint must be the Z axis (also applies to the axis of linear movement for a prismatic joint).

**Rule 2:** Axis X_{n} must be perpendicular to axis Z_{(n-1)}

**Rule 3:** Axis X_{n} must intersect axis Z_{(n-1)} . To achieve this requirement frame n can: (a) be rotated, or (b) translated along one of the joint axes.

**Rule 4:** The Y axis in all frames must be orientated in accordance with the right hand rule.

#### Setting up co-ordinate frames

We now set up each pair of co-ordinate frames in the robot model in accordance with DH rules. Diagrams and summaries explain the process.

**Frame 1**

Fig.2 below illustrates DH rules for frame co-ordinates applied to frame 1 associated with joint 1. Note that DH rules do not apply to frame 0 as the static base frame is not a joint. It follows that rules 2 and 3 relating to the (n-1) joint do not apply in this case. The origin of frame 1 is coincident with the origin of frame 0 which represents the origin of real world co-ordinates

- Z axis is the axis of rotation.
- Y axis corresponds to the right-hand rule

**Frame 2**

Fig.3 below illustrates DH rules for frame co-ordinates applied to frame 2 (associated with joint 2). In this case frame 2 is frame n and frame 1 is frame (n-1)

- Z
_{2}is the axis of joint rotation - Axis X
_{2}is perpendicular to axis Z_{1} - In its original position at the centre of joint 2 axis X
_{2}does not intersect axis Z_{1}. By moving frame 2 along the Z_{2}axis we obtain the necessary intersection shown in Fig.3. - Y
_{2}axis corresponds to the right-hand rule

**Frame 3**

Fig.4 below illustrates DH rules for frame co-ordinates applied to frame 3 (associated with joint 3). In this case frame 3 is frame n and frame 2 is frame (n-1)

- Z
_{3}is the axis of joint rotation - Axis X
_{3}is perpendicular to axis Z_{2} - Axis X
_{3}intersects axis Z_{2} - Y axis corresponds to the right-hand rule

**Frame 4**

Fig.5 below illustrates DH rules for frame co-ordinates applied to frame 4 (associated with joint 4). In this case frame 4 is frame n and frame 3 is frame (n-1)

- Z
_{4}is the axis of joint rotation - In its original position at the centre of joint 4 axis X
_{4}does not intersect axis Z_{3}. By moving frame 4 along the Z_{4}axis we obtain the necessary intersection shown in Fig.5. - Axis X
_{4}is perpendicular to axis Z_{3}

**Frame 5**

Fig.6 below illustrates DH rules for frame co-ordinates applied to frame 5 (associated with joint 5). In this case frame 5 is frame n and frame 4 is frame (n-1)

- Z
_{5}is the axis of joint rotation - Axis X
_{5}is perpendicular to axis Z_{4} - Axis X
_{5}intersects axis Z_{4} - Y axis corresponds to the right-hand rule

**Frame 6**

Fig.7 below illustrates DH rules for frame co-ordinates applied to frame 6 (associated with joint 6). In this case frame 6 is frame n and frame 5 is frame (n-1)

- Z
_{6}is the axis of joint rotation - Axis X
_{6}is perpendicular to axis Z_{5} - Axis X
_{6}intersects axis Z_{5} - Y axis corresponds to the right-hand rule

**Frame TT (tool tip)**

Fig.8 below illustrates frame co-ordinates applied to the tool tip. Because the tool tip is not a joint the DH rules do not apply. We compute the transformation from the tool tip to frame 6 using the standard homogeneous transformation matrix T^{6}_{TT} where the rotational part of the matrix is the identity matrix because there can be no relative rotation between the tool tip and frame 6.

Fig. 9 below shows the complete set of co-ordinate frames for forward kinematic analysis of this six axis robot using the DH method.

#### Definition of DH parameters

With the co-ordinate frames set up according to DH rules we now define the four DH parameters designated **θ**, **α** (alpha), **r** * and **d**.

** sometimes denoted by a but easily mistaken in print for α*

**Parameter θ**

**θ _{n}** is the addition of two angles:

- angle 1 is the angle required to rotate axis X
_{(n-1)}around axis Z_{(n-1)}such that axis X_{(n-1)}is parallel to axis X_{n}. We will denote angle 1 as**θ**^{/}_{n} - angle 2 is the angle the revolute joint associated with frame (n-1) rotates around axis Z
_{(n-1)}. We will denote angle 2 as**θ**^{//}_{n}

**Parameter α**

**α _{n}** is the angle required to rotate axis Z

_{(n-1)}around axis X

_{n}such that axis Z

_{(n-1)}is parallel to axis Z

_{n}

**Parameter r**

**r _{n}** is the displacement in the X

_{n}direction from the centre of frame (n -1) to the centre of frame n .

**Parameter d**

**d _{n}** is the displacement in the Z

_{(n-1)}direction from the centre of frame (n -1) to the centre of frame n .

These parameters will become clearer as we work through each pair of co-ordinate frames. Note that rotations around and displacements along the Y axis play no active part in the DH method.

DH parameters are normally presented in a table shown below with each co-ordinate pair designated by a number n. Our robot model has 6 co-ordinate pairs giving the following parameter table.

Frames | n | θ | α | r | d |
---|---|---|---|---|---|

1, 2 | 2 | ||||

2, 3 | 3 | ||||

3, 4 | 4 | ||||

4, 5 | 5 | ||||

5, 6 | 6 |

#### DH homogeneous transformation matrix

In the previous tutorial we derived **homogeneous transformation matrices, T** combining:

- rotation angle θ of co-ordinate frame X
_{0}, ,Y_{0}, Z_{0}about axis X_{0}, ,Y_{0},or Z_{0}to create a new frame X_{1},Y_{1},Z_{1} - translation of the origin of frame X
_{0}, Y_{0}, Z_{0}to a position defined by vector [x_{10}, y_{10}, z_{10}].

For rotation about X, Y and Z axes respectively the transformation matrices are:

The **DH transformation matrix** is the combination of two rotations and two displacements for designated axes in the DH co-ordinate frames.

Examining the criteria for DH parameters it is seen that the applicable **rotation axes** are:

**Z**for which the parameter is_{(n-1)}**θ**_{n}**X**for which the parameter is_{n}**α**_{n}

The applicable **displacement axes** are:

**Z**for which the parameter is_{(n-1)}**d**_{n}**X**for which the parameter is_{n}**r**_{n}

The DH transformation matrix **T ^{(n-1)}_{n}** is a serial combination of homogeneous transformation matrices as follows.

**T ^{(n-1)}_{n}** =

**D**where:

_{d}• R_{θ}• D_{r}• R_{α}**D**denotes a transformation matrix for**displacement**where the rotation part of the matrix is the identity matrix.**R**denotes a transformation matrix for**rotation**where the displacement part of the matrix is the zero vector.

Giving:

#### Frame by frame computation

We now compute the DH matrix for each paired set of frames n and (n-1). In each case the first task is to determine values of θ_{n}, α_{n} , r_{n} and d_{n} using the physical parameters of the robot model noting that joint rotations producing the specified tool tip pose are as follows:

joint # | rotation angle |
---|---|

1 | 0° |

2 | 45° |

3 | -90° |

4 | 0° |

5 | -90° |

6 | 0° |

**Pair 1 - frame 1 and frame 2 (n = 2)**

Fig.10(a) above shows frame 1 and frame 2 set up using the DH rules as shown in Figs.2 and 3. Frame 2 is frame n and frame 1 is frame (n-1.) Consider each DH parameter in turn. Fig.10(b) shows the orientation of frames 1 after rotations θ^{/}_{1} and α_{1}.

**Parameter θ _{1}**

θ^{/}_{1} is the angle required to rotate axis X_{1} around axis Z_{1} such that axis X_{1} is parallel to axis X_{2}. Fig.9(a) shows X_{1} is already parallel to X_{2}. Thus θ^{/}_{1} = 0°.

θ^{//}_{1} is the angle revolute joint 1 rotates around axis Z_{1}. In this case θ^{//}_{1} = 0°.

Thus: θ_{1} = θ^{/}_{1} + θ^{//}_{1} = 0°

**Parameter α _{1}**

α_{1} is the angle required to rotate axis Z_{1} around axis X_{2} such that axis Z_{1} is parallel to axis Z_{2} . Fig.10 shows Z_{1} must be rotated 90° counter-clockwise around X_{2} for Z_{1} to be parallel to Z_{2}. Thus α_{1} = 90°.

**Parameter r _{1}**

r_{1} is the displacement in the X_{2} direction from the centre of frame 1 to the centre of frame 2. Fig10 shows there is no displacement between the frame centres in the X_{2} direction. Thus r_{1} = 0.

**Parameter d _{1}**

d_{1} is the displacement in the Z_{1} direction from the centre of frame 1 to the centre of frame 2 as shown on Fig.10. From the robot model d_{1} = 160 *.

* *We use unspecified units of length for displacements*

The first row of the DH parameter table is now complete.

Frames | n | θ | α | r | d |
---|---|---|---|---|---|

1, 2 | 2 | 0° | 90° | 0 | 160 |

We compute the DH transformation matrix T^{1}_{2} to give:

* *Recall from above that the origin of frame 1 is coincident with the origin of the base frame co-ordinates and thus represents real world co-ordinates. Also note that the real world co-ordinates of frame 2 are not the real world co-ordinates of the centre of joint 2 because frame 2 was translated along the Z _{2} axis to satisfy DH rule 3 for setting up frame co-ordinates.*

**Pair 2 - frame 2 and frame 3 (n = 3)**

Fig.11(a) above shows frame 2 and frame 3 set up using the DH rules as shown in Figs.3 and 4. Frame 3 is frame n and frame 2 is frame (n-1.) Consider each DH parameter in turn. Fig.11(b) shows the orientation of frames 2 after rotations θ^{/}_{2} and α_{2}.

**Parameter θ _{2}**

θ^{/}_{2} is the angle required to rotate axis X_{2} around axis Z_{2} such that axis X_{2} is parallel to axis X_{3} . Fig.11 shows X_{2} must be rotated 90° counter-clockwise around Z_{2} to be parallel to X_{3}. Thus θ^{/}_{2} = 90°.

θ^{//}_{2} is the angle revolute joint 2 rotates around axis Z_{2} . In this example θ^{//}_{2} = 45°.

Thus: θ_{2} = θ^{/}_{2} + θ^{//}_{2} = 90° + 45° = 135°

**Parameter α _{2}**

α_{2} is the angle required to rotate axis Z_{2} around axis X_{3} such that axis Z_{2} is parallel to axis Z_{3} . Fig.11 shows Z_{2} is already parallel to Z_{3}. Thus α_{2} = 0°.

**Parameter r _{2}**

r_{2} is the displacement in the X_{3} direction from the centre of frame 2 to the centre of frame 3 as shown on Fig.11. From the robot model, r_{2} = 400.

**Parameter d _{2}**

d_{2} is the displacement in the Z_{2} direction from the centre of frame 2 to the centre of frame 3 as shown on Fig11. From the robot model d_{2} = 135.

The second row of the DH parameter table is now complete.

Frames | n | θ | α | r | d |
---|---|---|---|---|---|

1, 2 | 2 | 0° | 90° | 0 | 160 |

2, 3 | 3 | 135° | 0° | 400 | 135 |

We compute the DH transformation matrix T^{2}_{3} to give* :

**Pair 3 - frame 3 and frame 4 (n = 4)**

Fig.12(a) above shows frame 3 and frame 4 set up using the DH rules as shown in Figs.3 and 4. Frame 4 is frame n and frame 3 is frame (n-1.) Consider each DH parameter in turn. Fig.12(b) shows the orientation of frames 3 after rotations θ^{/}_{3} and α_{3}.

**Parameter θ _{3}**

θ^{/}_{3} is the angle required to rotate axis X_{3} around axis Z_{3} such that axis X_{3} is parallel to axis X_{4}. Fig.12 shows X_{3} must be rotated 90° clockwise around Z_{3} to be parallel to X_{4}. Thus θ^{/}_{3} = -90°.

θ^{//}_{3} is the angle revolute joint 3 rotates around axis Z_{3}. In this example θ^{//}_{3} = -90°.

Thus: θ_{3} = θ^{/}_{3} + θ^{//}_{3} = -90° + (-90°) = -180°

**Parameter α _{3}**

α_{3} is the angle required to rotate axis Z_{3} around axis X_{4} such that axis Z_{3} is parallel to axis Z_{4} . Fig.12 shows Z_{3} must be rotated 90° clockwise around X_{4} to be parallel to Z_{4}. Thus α_{3} = -90°.

**Parameter r _{3}**

r_{3} is the displacement in the X_{3} direction from the centre of frame 3 to the centre of frame 4 as shown on Fig.12. In this case r_{3} = 0.

**Parameter d _{3}**

d_{3} is the displacement in the Z_{3} direction from the centre of frame 3 to the centre of frame 4 as shown on Fig12. From the robot model, d_{3} = 75.

The third row of the DH parameter table is now complete.

Frames | n | θ | α | r | d |
---|---|---|---|---|---|

1, 2 | 2 | 0° | 90° | 0 | 160 |

2, 3 | 3 | 135° | 0° | 400 | 135 |

3, 4 | 4 | -180° | -90° | 0 | 75 |

We compute the DH transformation matrix T^{3}_{4} to give:

and then compute T^{1}_{4} = T^{1}_{3} • T^{3} _{4} giving:

**Pair 4 - frame 4 and frame 5 (n = 5)**

Fig.13(a) above shows frame 4 and frame 5 set up using the DH rules as shown in Figs.3 and 4. Frame 5 is frame n and frame 4 is frame (n-1.) Consider each DH parameter in turn. Fig.13(b) shows the orientation of frames 4 after rotations θ^{/}_{4} and α_{4}.

**Parameter θ _{4}**

θ^{/}_{4} is the angle required to rotate axis X_{4} around axis Z_{4} such that axis X_{4} is parallel to axis X_{5} . Fig.13 shows X_{4} is already parallel to X_{5}. Thus θ^{/}_{4} = 0°.

θ^{//}_{4} is the angle revolute joint 4 rotates around axis Z_{4}. In this example θ^{//}_{4} = 0°.

Thus: θ_{4} = θ^{/}_{4} + θ^{//}_{4} = 0° + 0° = 0°

**Parameter α _{4}**

α_{4} is the angle required to rotate axis Z_{4} around axis X_{5} such that axis Z_{4} is parallel to axis Z_{5}. Fig.13 shows Z_{4} must be rotated 90° counter-clockwise around X_{5} to be parallel to Z_{5}. Thus α_{4} = 90°.

**Parameter r _{4}**

r_{4} is the displacement in the X_{4} direction from the centre of frame 4 to the centre of frame 5 as shown on Fig.13. In this case r_{4} = 0.

**Parameter d _{4}**

d_{4} is the displacement in the Z_{4} direction from the centre of frame 4 to the centre of frame 5 as shown on Fig.13. From the robot model, d_{4} = 630.

The fourth row of the DH parameter table is now complete.

Frames | n | θ | α | r | d |
---|---|---|---|---|---|

1, 2 | 2 | 0° | 90° | 0 | 160 |

2, 3 | 3 | 135° | 0° | 400 | 135 |

3, 4 | 4 | -180° | -90° | 0 | 75 |

4, 5 | 5 | 0° | 90° | 0 | 630 |

We compute the DH transformation matrix T^{4}_{5} to give:

and then compute T^{1}_{5} = T^{1}_{4} • T^{4} _{5} giving:

**Pair 5 - frame 5 and frame 6 (n = 6)**

Fig.14(a) above shows frame 5 and frame 6 set up using the DH rules as shown in Figs.3 and 4. Frame 6 is frame n and frame 5 is frame (n-1.) Consider each DH parameter in turn. Fig.14(b) shows the orientation of frames 5 after rotations θ^{/}_{5} and α_{5}.

**Parameter θ _{5}**

θ^{/}_{5} is the angle required to rotate axis X_{5} around axis Z_{5} such that axis X_{5} is parallel to axis X_{6} . Fig.14 shows X_{5} is already parallel to X_{6}. Thus θ^{/}_{5} = 0°.

θ^{//}_{5} is the angle revolute joint 5 rotates around axis Z_{5}. In this example θ^{//}_{5} = -90°.

Thus: θ_{5} = θ^{/}_{5} + θ^{//}_{5} = 0° + (-90°) = -90°

**Parameter α _{5}**

α_{5} is the angle required to rotate axis Z_{5} around axis X_{6} such that axis Z_{5} is parallel to axis Z_{6}. Fig.14 shows Z_{5} must be rotated 90° clockwise around X_{6} to be parallel to Z_{6}. Thus α_{5} = -90°.

**Parameter r _{5}**

r_{5} is the displacement in the X_{5} direction from the centre of frame 5 to the centre of frame 6 as shown on Fig.14. In this case r_{5} = 0.

**Parameter d _{5}**

d_{5} is the displacement in the Z_{5} direction from the centre of frame 5 to the centre of frame 6 as shown on Fig.14. From the robot model, d_{5} = 220.

The fifth row of the DH parameter table is now complete.

Frames | n | θ | α | r | d |
---|---|---|---|---|---|

1, 2 | 2 | 0° | 90° | 0 | 160 |

2, 3 | 3 | 135° | 0° | 400 | 135 |

3, 4 | 4 | -180° | -90° | 0 | 75 |

4, 5 | 5 | 0° | 90° | 0 | 630 |

5, 6 | 6 | -90° | -90° | 0 | 220 |

We compute the DH transformation matrix T^{5}_{6} to give:

and then compute T^{1}_{6} = T^{1}_{5} • T^{5} _{6} giving:

**Transformation from tool tip to frame 6**

Fig.15 shows co-ordinates for frame 6, associated with revolute joint 6, and the tool tip as established in Fig.8.

As stated previously we compute the transformation from the tool tip to frame 6 using the standard homogeneous transformation matrix T^{6}_{TT} where the rotational part of this matrix is the identity matrix since there can be no relative rotation between frame 6 and the tool tip.

Thus T^{6}_{TT} can be stated as:

Now perform the matrix multiplication T^{1}_{TT} = T^{1}_{6} • T^{6}_{TT} giving:

And the marathon Denavit Hartenberg forward kinematic analysis is complete!

*Note that the real world co-ordinate system used in this tutorial differs from the one used in the previous tutorial. Both are right handed co-ordinate systems but Y and Z axes are interchanged with the sign reversing in the change from Z axis to Y axis. *

Next: Kinematics of robot manipulators - inverse kinematics

I welcome feedback at: