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 covered forward kinematic analysis using
homogeneous transformation matrices. We now examine
the ** Denavit Hartenberg**
(DH) method for using homogeneous transformation matrices 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 software terms.

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

Fig.1(a) above shows the six axis robot model used in the previous tutorial, illustrating the vertical datum position and the tool tip pose produced by setting the joint angles.

In the previous tutorial we established co-ordinate frames in the datum position with directions of X, Y and Z co-ordinates initially the same in each frame. The first joint and frame were designated #1.

Following convention for the DH method the first co-ordinate
frame is designated #0 as shown in Fig.1(b) *(i)* front and
*(ii)* side views We also number the joints from #0 to
#5
corresponding with the frame number*. Frame #6 is the tool tip
(not a joint). Frame #0 in the datum
position is also the base frame in real world co-ordinates.

* It is more conventional to designate the first joint #1 but for this example it seems to me less confusing to use the same number for frame and joint.

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 **f*** rame n* and

** 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

** Rule 3** Axis X

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

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

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

*Frame 0*

- Z
_{0}is the axis of joint rotation - Rules 2 and 3 do not apply as there is no previous frame
- Y axis corresponds to the right-hand rule

*Frame 1*

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

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

*Frame 1 *has been established (frame repositioned).

*Frame 2*

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

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

*Frame 2 *has been established.

*Frame 3*

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

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

*Frame 3 *has been established (frame repositioned).

*Frame 4*

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

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

*Frame 4 *has been established.

*Frame 5*

- 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

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

*Frame 5 *has been established.

*Frame 6*

- 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

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

With the co-ordinate frames set up according to DH rules we now
define the four DH parameters designated ** θ**,

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

**Parameter θ**

** θ_{n}** is the addition of two
angles: angle1 is the angle required to rotate axis X

**Parameter α**

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

* This is a tricky parameter as rotation is around an axis in another frame.

**Parameter r**

** r_{n}** is the displacement in
the X

**Parameter d**

** d_{n} **is the displacement in
the Z

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 (seven frames*) giving the
following parameter table.

* to apply the DH method there must be at least one more frame than there are joints, including one frame at the tool tip / end effector.

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

0, 1 | 1 | ||||

1, 2 | 2 | ||||

2, 3 | 3 | ||||

3, 4 | 4 | ||||

4, 5 | 5 | ||||

5, 6 | 6 |

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

- rotation θ
of co-ordinate frame X_{0}, ,Y_{0}, Z_{0}about axes X_{0}, ,Y_{0},Z_{0}to create a new frame X_{1},Y_{1},Z_{1} - translation of the origin of frame X
_{1}Y_{1}Z_{1}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
_{(n-1)}for which the parameter is θ_{n} - X
_{n}for which the parameter is α_{n}

and the applicable displacement axes are:

- Z
_{(n-1) }for which the parameter is d_{n} - X
_{n}for which the parameter is r_{n}

The DH transformation matrix T^{(n-1)}_{n} is a
serial combination of the following homogeneous transformation
matrices (D denotes a transformation matrix for displacement and R
for rotation; the notation is replicated from above).

T^{(n-1)}_{n} = D_{Z(n-1)}(d_{n})
. R_{Z(n-1)}(θ_{n}) . D_{Xn}(r_{n})
. R_{Xn}(α_{n}) which gives:

We compute this matrix for each paired value of frames* n* and
*(n-1)* using
values of ** θ_{n}**,

We now examine each pair of co-ordinate frames to determine the DH parameters.

Referring back to the robot model in Fig.1(a) the settings for joint angles are as follows:

Joint # |
Joint angle |

0 | 0 ° |

1 | 45° |

2 | -90° |

3 | 0° |

4 | -90° |

5 | 0° |

**P****air 1 - frame 0 and frame 1 (n = 1)**

Fig.9(a) above shows frame* 0* and frame* 1* set up using
the DH rules (as Fig.2). Frame *1* is frame* n*
and frame *0* is frame *(n-1)* Consider each DH
parameter in turn.

*Parameter θ _{1}*.

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

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

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

*Parameter α _{1}*

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

*Parameter r _{1}*

r_{1} is the displacement in the X_{1}
direction from the centre of frame *0 *to the centre of frame*
1*. Fig9(a) shows there is no displacement between the
frame centres in the X_{1} direction. Thus r_{1}
= 0.

*Parameter d _{1}*

d_{1} is the displacement in the Z_{0} direction
from the centre of frame *0* to the centre of frame *1*.as
shown on Fig.9(a). From the robot model d_{1} =
160 *.

* length units are not specified.

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

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

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

We compute the DH transformation matrix T

* For DH analysis we use the co-ordinates of frame 0 for the base frame. Thus in this example the Z axis is the real world vertical axis.

The real world co-ordinates of frame *1* are not
the real world co-ordinates of the centre of joint 1 because frame
*1* was translated along the Z_{1} axis to satisfy DH rule 3 for setting up frame
co-ordinates.

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

Fig.10(a) above shows frame* 1* and frame 2 set up using the DH
rules (as Fig.3). Frame *2* is frame* n*
and frame *1* is frame *(n-1)* Consider each DH
parameter in turn.

*Parameter θ _{2}*

θ^{/}_{2} 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.10(b) shows X_{1}
must be rotated 90° counter-clockwise around Z_{1} to be
parallel to X_{2}. Thus θ^{/}_{2} =
90°.

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

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

*Parameter α _{2}*

α_{2} 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(a) shows Z_{1}
is already parallel to Z_{2}. Thus α_{2} = 0°.

*Parameter r _{2}*

r_{2} is the displacement in the X_{2} direction
from the centre of frame* 1* to the centre of frame* 2*
as shown on Fig.10(a) From the robot model, r_{2} =
400.

*Parameter d _{2}*

d_{2} is the displacement in the Z_{1} direction
from the centre of frame* 1* to the centre of frame* 2*
as shown on Fig10(a). From the robot model d_{2}
= 135.

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

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

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

1, 2 | 2 | 135° | 0° | 400 | 135 |

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

* For the remaining transformations we omit this detail.

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

Fig.11(a) above shows frame* 2* and frame 3 set up using the DH
rules (as Fig.4). Frame *3* is frame* n*
and frame *2* is frame *(n-1)* Consider each DH
parameter in turn.

*Parameter θ _{3}*

θ^{/}_{3} 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(b) shows X_{2}
must be rotated 90° clockwise around Z_{2} to be parallel to
X_{3}. Thus θ^{/}_{3} = -90°.

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

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

*Parameter α _{3}*

α_{3} 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(b) shows Z_{2}
must be rotated 90° clockwise around X_{3} to be parallel to
Z_{3}. Thus α_{3} = -90°.

*Parameter r _{3}*

r_{3} is the displacement in the X_{2} direction
from the centre of frame* 2* to the centre of frame* 3*
as shown on Fig.11(a) In this case r_{3} = 0.

*Parameter d _{3}*

d_{3} is the displacement in the Z_{2} direction
from the centre of frame* 2* to the centre of frame* 3*
as shown on Fig11(a). From the robot model, d_{3}
= 75.

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

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

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

1, 2 | 2 | 135° | 0° | 400 | 135 |

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

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

and then compute T^{0}_{3} = T^{0}_{2
}. T^{2}_{3} giving:

Note that the real world co-ordinates of frame *3* are not
the co-ordinates of the centre of joint 3 because frame 3
is located to meet DH rule 3 for setting up frame co-ordinates.

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

Fig.12(a) above shows frame* 3* and frame* 4* set up using
the DH rules (as Fig.5). Frame *4* is frame* n*
and frame *3* is frame *(n-1)* Consider each DH
parameter in turn.

*Parameter θ _{4}*

θ^{/}_{4} 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(a) shows X_{3}
is already parallel to X_{4}. Thus θ^{/}_{4}
= 0°.

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

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

*Parameter α _{4}*

α_{4} 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(b) shows Z_{3}
must be rotated 90° counter-clockwise around X_{4} to be
parallel to Z_{4}. Thus α_{4} = 90°.

*Parameter r _{4}*

r_{4} 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(a). In this case r_{4} = 0.

*Parameter d _{4}*

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

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

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

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

1, 2 | 2 | 45° | 0° | 400 | 135 |

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

3, 4 | 4 | 0° | 90° | 0 | 630 |

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

and then compute T^{0}_{4} = T^{0}_{3
}. T^{3}_{4} giving:

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

Fig13(a) above shows frame* 4* and frame *5* set up using
the DH rules (as Fig.6). Frame *5* is frame* n*
and frame *4* is frame *(n-1)* Consider each DH
parameter in turn.

*Parameter θ _{5}*

θ^{/}_{5} 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(a) shows X_{4}
is already parallel to X_{5}. Thus θ^{/}_{5}
= 0°.

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

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

*Parameter α _{5}*

α_{5} 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(b) shows Z_{4}
must be rotated 90° clockwise around X_{5} to be parallel to
Z_{5}. Thus α_{5} = -90°.

*Parameter r _{5}*

r_{5} 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(a). In this case r_{5} = 0.

*Parameter d _{5}*

d_{5} is the displacement in the Z_{4} direction
from the centre of frame* 4* to the centre of frame* 5*
as shown on Fig13(a). From the robot model, d_{5}
= 220.

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

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

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

1, 2 | 2 | 135° | 0° | 400 | 135 |

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

3, 4 | 4 | 0° | 90° | 0 | 630 |

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

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

and then compute T^{0}_{5} = T^{0}_{4
}. T^{4}_{5} giving:

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

Fig.14(a) above shows frame* 5* and frame *6* (tool tip) set up using
the DH rules (as Fig.6). Frame *6* is frame* n*
and frame *5* is frame *(n-1)* Consider each DH
parameter in turn.

*Parameter θ _{6}*

θ^{/}_{6} 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(a) shows X_{5}
is already parallel to X_{6}. Thus θ^{/}_{6}
= 0°.

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

Thus θ_{6} = θ^{/}_{6}
+ θ^{//}_{6} = 0° + 0° = 0°

*Parameter α _{5}*

α_{6} 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(a) shows Z_{5}
is already parallel to Z_{6}. Thus α_{6} = 0°.

*Parameter r _{6}*

r_{6} 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(a). In this case r_{6} = 0.

*Parameter d _{6}*

d_{6} is the displacement in the Z_{5} direction
from the centre of frame* 5* to the centre of frame* 6*
as shown on Fig14(a). From the robot model, d_{6}
= 110.

The sixth and final row of the DH parameter table is now complete.

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

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

1, 2 | 2 | 135° | 0° | 400 | 135 |

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

3, 4 | 4 | 0° | 90° | 0 | 630 |

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

5, 6 | 6 | 0° | 0° | 0 | 110 |

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

and then compute T^{0}_{6} = T^{0}_{5
}. T^{5}_{6} giving:

And the marathon Denavit Hartenberg analysis is complete!

The real world co-ordinates computed for each frame correspond exactly to the values in the CAD drawing of the robot model.

I welcome feedback at: