Skip to the content
FixTheRobot Explore Robotics / Manipulator Basics / Theory / 05

Manipulator Basics · Theory · Module 05 of 14

05 — Denavit–Hartenberg Convention

Four numbers per joint describe any serial arm. The Denavit–Hartenberg convention fixes where to put each link frame so the transform between neighbours always has the same form. Learn both variants, build DH tables and see why two tables can describe the same robot.

  • Intermediate
  • About 7 minutes to read
  • 1 linked lab

Writing FK by hand is easy for a 2R arm and error-prone for a 6-DOF one. DH turns frame placement into a recipe with four parameters per joint, and that recipe is what most textbooks and many controllers use.

Learning objectives

After this module you should be able to:

  • Assign link frames to a serial arm with the standard DH rules.
  • Explain the geometric meaning of θ, d, a and α, and which of them is the joint variable.
  • Write the DH link transform in both the standard and the modified (Craig) convention.
  • Build DH tables for 2R, 3R and 4-DOF arms and check them with FK.
  • Recognise when a DH table is ambiguous and why parallel axes cause trouble in calibration.

Conceptual explanation

The idea: put the z axis of each frame along a joint axis, and the x axis along the shortest line between neighbouring axes (their common normal). Then the transform from one frame to the next is always "rotate about z, slide along z, slide along x, rotate about x", described by four numbers.

The four DH parametersTwo consecutive joint axes z_{i-1} and z_i, their common normal x_i, and the parameters θ_i, d_i, a_i and α_i.zᵢ₋₁ (axis i)zᵢ (axis i+1)dᵢaᵢ along xᵢ (common normal)xᵢ₋₁θᵢ about zᵢ₋₁αᵢ about xᵢ
The four standard DH parameters between joint axes i and i+1.
The four DH parameters. One of θ or d is the joint variable.
ParameterMeaning (standard DH)Revolute jointPrismatic joint
θiangle from xi−1 to xi, about zi−1variableconstant
didistance along zi−1 to the common normalconstantvariable
ailink length: distance along xi between the axesconstantconstant
αilink twist: angle from zi−1 to zi, about xiconstantconstant

Frame assignment recipe (standard DH)

  1. Number the joints 1 … n. Put zi−1z_{i-1} along the axis of joint i.
  2. Put the origin of frame i where the common normal of zi−1z_{i-1} and ziz_i meets ziz_i, and xix_i along that normal, pointing away from zi−1z_{i-1}.
  3. If the axes intersect, put the origin at the intersection and xix_i perpendicular to both. If they are parallel, the common normal is not unique: choose one, usually to make di=0d_i = 0.
  4. Complete each frame with yi=zi×xiy_i = z_i \times x_i. Frame 0 is the base; frame n is placed on the last link, and the tool transform adds the TCP.
  5. Read the four parameters off the drawing for each joint and write the DH table.

Standard versus modified DH

In standard (distal) DH, frame i sits at the far end of link i, on the axis of joint i+1. In modified (proximal) DH, used by Craig, frame i sits on joint i itself, and the parameters are (αi−1,ai−1,θi,di)(\alpha_{i-1}, a_{i-1}, \theta_i, d_i). Both describe the same robot, but the tables differ, the order of the elementary transforms differs, and the tool offset moves from the last row to a separate tool transform. Mixing a table from one convention with the formula of the other is one of the most common errors. Practise both in Lab 03.

Mathematical formulation

Standard DH link transform
i−1Aistd=Rz(θi) Trans⁡z(di) Trans⁡x(ai) Rx(αi)=[cθi−sθicαisθisαiaicθisθicθicαi−cθisαiaisθi0sαicαidi0001]{}^{i-1}A_{i}^{\text{std}} = R_z(\theta_i)\,\operatorname{Trans}_z(d_i)\,\operatorname{Trans}_x(a_i)\,R_x(\alpha_i) = \begin{bmatrix} c\theta_i & -s\theta_i c\alpha_i & s\theta_i s\alpha_i & a_i c\theta_i \\ s\theta_i & c\theta_i c\alpha_i & -c\theta_i s\alpha_i & a_i s\theta_i \\ 0 & s\alpha_i & c\alpha_i & d_i \\ 0 & 0 & 0 & 1 \end{bmatrix}
Modified (Craig) DH link transform
i−1Aimod=Rx(αi−1) Trans⁡x(ai−1) Rz(θi) Trans⁡z(di)=[cθi−sθi0ai−1sθicαi−1cθicαi−1−sαi−1−disαi−1sθisαi−1cθisαi−1cαi−1dicαi−10001]{}^{i-1}A_{i}^{\text{mod}} = R_x(\alpha_{i-1})\,\operatorname{Trans}_x(a_{i-1})\,R_z(\theta_i)\,\operatorname{Trans}_z(d_i) = \begin{bmatrix} c\theta_i & -s\theta_i & 0 & a_{i-1} \\ s\theta_i c\alpha_{i-1} & c\theta_i c\alpha_{i-1} & -s\alpha_{i-1} & -d_i s\alpha_{i-1} \\ s\theta_i s\alpha_{i-1} & c\theta_i s\alpha_{i-1} & c\alpha_{i-1} & d_i c\alpha_{i-1} \\ 0 & 0 & 0 & 1 \end{bmatrix}
  1. 0Tn(q)=0A1(q1) 1A2(q2)⋯n−1An(qn){}^{0}T_{n}(q) = {}^{0}A_{1}(q_1)\,{}^{1}A_{2}(q_2)\cdots{}^{n-1}A_{n}(q_n)

    Forward kinematics is the product of the link transforms.

  2. qi=θi (revolute),qi=di (prismatic)q_i = \theta_i \ (\text{revolute}), \qquad q_i = d_i \ (\text{prismatic})

    Each row has exactly one variable; real controllers also add a fixed offset so that q = 0 matches the robot's mechanical zero.

Each row has four parameters, but a general rigid transform has six degrees of freedom. DH gets away with four because the frame placement rules use up the other two. That is also why DH cannot place the base and tool frames arbitrarily, and why separate base and tool transforms are added.

Worked examples

Example 1: a planar 2R arm in both conventions

Standard DH table for a planar 2R arm (lengths in metres).
Jointθdaα
1q₁0L₁ = 0.40
2q₂0L₂ = 0.30
Modified DH table for the same arm. The last link length becomes a tool offset.
Jointαi−1ai−1θd
100q₁0
20L₁ = 0.4q₂0
tool—L₂ = 0.3——

At q=(30°,45°)q = (30°, 45°) the standard product is

0T2=[0.259−0.9660.0000.4240.9660.2590.0000.4900.0000.0001.0000.0000.0000.0000.0001.000]{}^{0}T_{2} = \begin{bmatrix}0.259 & -0.966 & 0.000 & 0.424 \\ 0.966 & 0.259 & 0.000 & 0.490 \\ 0.000 & 0.000 & 1.000 & 0.000 \\ 0.000 & 0.000 & 0.000 & 1.000\end{bmatrix}

The modified chain followed by Trans⁡x(0.3)\operatorname{Trans}_x(0.3) gives the same matrix. The largest element-wise difference computed by the engine is 0.0e+00.0e+0. Same robot, different tables.

Example 2: a planar 3R arm

Standard DH table of the engine's planar 3R arm.
Jointθdaα
1q100.400
2q200.300
3q300.150

Every α is zero because all axes are parallel to z. At q=(10°,50°,−40°)q = (10°, 50°, -40°) the tool is at (0.685,0.381)(0.685, 0.381) m with heading 20°20°, the sum of the joint angles.

Example 3: a 4-DOF articulated arm

Standard DH table of the engine's 4-DOF arm: a waist, a shoulder, an elbow and a wrist pitch.
Jointθd (m)a (m)α
1q10.300.0090°
2q20.000.320°
3q30.000.280°
4q40.000.100°

Row 1 has α1=90°\alpha_1 = 90°: the waist axis is vertical and the shoulder axis horizontal, so the twist turns z by a right angle. The shoulder offset d1=0.30d_1 = 0.30 m is the height of the shoulder above the base. At q=(0°, 60°, −90°, −60°)q = (0°,\ 60°,\ -90°,\ -60°) the first link transform is

0A1=[1.0000.0000.0000.0000.0000.000−1.0000.0000.0001.0000.0000.3000.0000.0000.0001.000]{}^{0}A_{1} = \begin{bmatrix}1.000 & 0.000 & 0.000 & 0.000 \\ 0.000 & 0.000 & -1.000 & 0.000 \\ 0.000 & 1.000 & 0.000 & 0.300 \\ 0.000 & 0.000 & 0.000 & 1.000\end{bmatrix}

and the full product puts the tool at (0.402,0.000,0.337)(0.402, 0.000, 0.337) m. Load this robot in Lab 03 and check the matrices row by row.

Interactive experiment

Interactive DH row (needs JavaScript): the 4×4 transform for the chosen parameters.

Change θ, d, a and α of one row, in the standard or the modified convention, and watch the 4×4 link transform and the origin of the next frame change. The same four numbers give a different matrix in each convention.

Real-world applications

  • Robot manufacturers publish DH (or similar) tables, and offline programming tools read them to build kinematic models.
  • Calibration identifies small errors in the DH parameters of each robot (Module 14).
  • URDF, used by ROS 2, does not use DH: each joint carries a full origin transform (xyz and rpy). Converting a DH table to URDF is a routine task (see the ROS 2 bridge page).

Common mistakes

Mixing conventions

Using a modified-DH table with the standard formula (or the reverse) gives a different, usually nonsensical robot. Check which convention a table uses before using it.

Measuring θ about the wrong axis

In standard DH, θi is about zi−1, not zi. Off-by-one indexing is the most common DH error.

Forgetting joint offsets

If the robot's zero position is not the DH zero, the controller angle and θ differ by a constant offset. Missing it rotates a whole link.

Using DH for nearly parallel axes in calibration

When consecutive axes are almost parallel, a tiny misalignment moves the common normal far along the axis and d jumps. Calibration uses modified models (e.g. Hayati parameters) for such joints.

Key takeaways

  1. DH places each z along a joint axis and each x along the common normal of neighbouring axes.
  2. Four parameters per joint: θ, d, a, α. θ is the variable for revolute joints, d for prismatic ones.
  3. Standard and modified DH place frames differently and multiply the elementary transforms in a different order.
  4. Base and tool transforms are added outside the DH table.

Knowledge check

Write an answer to each question, then reveal the explanation. Your answers stay in your browser.

Question 1

Which DH parameter is the joint variable of a prismatic joint?

Explanation

di, the offset along zi−1. θi is constant for a prismatic joint.

Question 2

All the axes of a planar arm are parallel. What are all its α values?

Explanation

Zero: the twist between parallel axes is 0 (or 180° if a z axis is flipped).

Question 3

Why is the common normal not unique when two joint axes are parallel?

Explanation

Every line perpendicular to both axes is a common normal, at any height along them. The convention chooses one, usually so that d = 0.

Question 4

A table lists (αi−1, ai−1, θi, di). Which convention is it?

Explanation

Modified (Craig) DH: the parameters of the previous link come first, and the frame sits at joint i.

Question 5

Why can't DH place the tool frame arbitrarily?

Explanation

Each DH row has 4 parameters, not 6; the frame rules (x along the common normal, intersecting the previous z) remove two freedoms. A separate tool transform with 6 freedoms is needed.

Practise it in the labs

Then test yourself in practice exercises and challenge mode.

References and further reading

  • J. Denavit and R. S. Hartenberg, "A kinematic notation for lower-pair mechanisms based on matrices", ASME Journal of Applied Mechanics, 22, 1955, pp. 215–221.
  • J. J. Craig, Introduction to Robotics: Mechanics and Control, 4th ed., Pearson, 2017, chapter 3 (modified DH).
  • M. W. Spong, S. Hutchinson and M. Vidyasagar, Robot Modeling and Control, 2nd ed., Wiley, 2020, chapter 3 (standard DH).