Robotics
Denavit–Hartenberg Parameters
A four-number recipe for every robot joint
Denavit–Hartenberg parameters are a set of four numbers — link length a, link twist α, link offset d, and joint angle θ — that fully describe how one joint of a robot arm connects to the next. Each set of four builds a single 4×4 homogeneous transformation matrix; multiply the chain of matrices together and you get the forward kinematics, the exact position and orientation of the robot's tool as a function of its joint angles. A standard six-axis industrial arm collapses to a table of just 24 numbers, and the same convention has described spatial linkages since Jacques Denavit and Richard Hartenberg published it in 1955.
- Parameters per joint4 (a, α, d, θ)
- Transform per joint4×4 matrix
- Six-axis arm table6 rows × 4 = 24 numbers
- Forward kinematicsT = A₁A₂…Aₙ
- Revolute joint variableθ (a, α, d fixed)
- Published1955 (Denavit & Hartenberg)
Interactive visualization
Press play, or step through manually. The visualization is yours to drive — try it before reading on.
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
What the four parameters are
A serial robot arm is a chain of rigid links connected by single-degree-of-freedom joints. To compute where the tool ends up, you need a way to describe how each link is positioned relative to the one before it. A fully general rigid-body transform takes six numbers — three for translation and three for rotation. The Denavit–Hartenberg (DH) convention exploits a clever choice of reference frames so that only four numbers are ever required per joint.
The trick is in how you attach a coordinate frame to each link. The z-axis of frame i is placed along joint axis i+1 (the axis the next joint rotates or slides about), and the x-axis of frame i is placed along the common normal — the unique shortest line segment connecting joint axis i and joint axis i+1. Once frames are placed this way, the transform from one frame to the next always decomposes into exactly four elementary motions:
- Link length a (or aᵢ): the distance along the common normal between the two joint axes. This is the physical "reach" of the link.
- Link twist α (alpha): the angle between the two joint axes, measured about the common normal (the x-axis). It captures how the next axis is tilted relative to this one — 0° for parallel axes, 90° for perpendicular.
- Link offset d: the distance along the joint axis (the z-axis) between the common normal of the previous link and the common normal of this link. It captures how far the link is shifted up or down its own joint axis.
- Joint angle θ (theta): the rotation of the link about the joint axis. This is the angle from the previous x-axis to the current x-axis.
For a revolute (rotating) joint, θ is the joint variable that changes as the motor turns, and a, α, d are fixed by the mechanical design. For a prismatic (sliding) joint, d is the variable and θ, a, α are fixed. So a single column of the DH table moves while the other three describe the unchanging steel.
The transformation matrix
Each row of the DH table builds one 4×4 homogeneous transformation matrix Aᵢ. In the standard convention it is the ordered product of two screw displacements — a rotation/translation about z followed by a rotation/translation about x:
Aᵢ = Rot_z(θ) · Trans_z(d) · Trans_x(a) · Rot_x(α)
Written out as a single 4×4 matrix:
⎡ cosθ −sinθ·cosα sinθ·sinα a·cosθ ⎤
Aᵢ = ⎢ sinθ cosθ·cosα −cosθ·sinα a·sinθ ⎥
⎢ 0 sinα cosα d ⎥
⎣ 0 0 0 1 ⎦
The top-left 3×3 block is the rotation R; the top-right
3×1 column is the position p; the bottom row is [0 0 0 1].
The upper-left 3×3 submatrix is a rotation matrix describing the orientation of frame i relative to frame i−1; the upper-right 3×1 column is the translation. The bottom row is always [0 0 0 1], which is what makes the matrix homogeneous — it lets a pure rotation and a pure translation live in one matrix that can be multiplied like any other.
Chaining to the tool pose: forward kinematics
Because each Aᵢ relates consecutive frames, the transform from the base frame all the way to the tool (end-effector) frame is simply the matrix product of the chain:
T⁰ₙ = A₁ · A₂ · A₃ · … · Aₙ
⎡ R p ⎤ R = 3×3 tool orientation
T⁰ₙ = ⎢ ⎥ p = 3×1 tool position (x, y, z)
⎣ 0 1 ⎦ 0 = [0 0 0]
This single 4×4 matrix T⁰ₙ is the forward kinematics of the arm: feed in the current joint angles, multiply the matrices, and read off exactly where the gripper is and how it's oriented. Matrix multiplication is cheap — a six-axis solution is a handful of microseconds — which is why every robot controller does this thousands of times a second to track its own pose.
Note the order matters: matrix multiplication is not commutative, so A₁A₂ is the not the same as A₂A₁. The chain must be built base-to-tip. Reversing or transposing pieces is one of the most common bugs in a hand-coded kinematics routine.
Worked example: a two-link planar arm
Consider a flat two-link arm lying in the plane, with link lengths a₁ = 0.30 m and a₂ = 0.25 m, both joints revolute. Because everything is planar, the twists are α₁ = α₂ = 0 and the offsets are d₁ = d₂ = 0. The DH table is just two rows:
Joint θ d a α
1 θ₁ 0 0.30 0
2 θ₂ 0 0.25 0
With α = 0 and d = 0, each matrix simplifies to a planar
rotation + translation. Multiplying A₁·A₂ gives the tool
position:
x = a₁·cos(θ₁) + a₂·cos(θ₁ + θ₂)
y = a₁·sin(θ₁) + a₂·sin(θ₁ + θ₂)
For θ₁ = 30°, θ₂ = 45°:
x = 0.30·cos30° + 0.25·cos75°
= 0.260 + 0.0647 = 0.325 m
y = 0.30·sin30° + 0.25·sin75°
= 0.150 + 0.2415 = 0.391 m
Tool is at (0.325, 0.391) m, reach 0.509 m of the
0.55 m maximum.
This is the entire forward-kinematics calculation for a planar arm, done by hand. The same procedure scales to six joints without changing in character — only the matrices get bigger and the trigonometry uglier.
Standard vs. modified DH
There are two widely used conventions, and mixing them silently produces a robot that points in the wrong direction. The difference is where the frame attaches and the order of the elementary transforms.
| Standard (classic) DH | Modified DH (Craig) | |
|---|---|---|
| Origin / publication | Denavit & Hartenberg, 1955 | Popularized by J.J. Craig's textbook |
| Frame i attached to | Far (distal) end of link i | Near (proximal) end of link i |
| Transform order | Rot_z(θ)·Trans_z(d)·Trans_x(a)·Rot_x(α) | Rot_x(α)·Trans_x(a)·Rot_z(θ)·Trans_z(d) |
| Each matrix uses | θᵢ, dᵢ, aᵢ, αᵢ (mixes link i and i−1 indices) | only joint i's own parameters |
| Dynamics derivation | Slightly more bookkeeping | Cleaner — favored for Lagrangian dynamics |
| Parameter values | Differ from modified for the same robot | Differ from standard for the same robot |
The practical rule: pick one convention, write it at the top of your DH table, and never copy a row from a table that used the other. A KUKA datasheet, a textbook, and a github library may each use a different one.
DH tables of real robots
Below is the kind of DH table that ships with a real six-axis manipulator. These numbers are the published Universal Robots UR5 parameters in the standard (classic) DH convention (lengths in metres, twists in radians):
| Joint | a (m) | α | d (m) | θ (variable) |
|---|---|---|---|---|
| 1 (base) | 0 | π/2 | 0.089 | θ₁ |
| 2 (shoulder) | −0.425 | 0 | 0 | θ₂ |
| 3 (elbow) | −0.392 | 0 | 0 | θ₃ |
| 4 (wrist 1) | 0 | π/2 | 0.109 | θ₄ |
| 5 (wrist 2) | 0 | −π/2 | 0.095 | θ₅ |
| 6 (wrist 3) | 0 | 0 | 0.082 | θ₆ |
That is the whole robot — 24 numbers (six rows of four), of which six are the live joint variables and eighteen are fixed geometry. The two long links (the −0.425 m and −0.392 m a-values) are the upper arm and forearm; the alternating ±π/2 twists in the wrist are the three orthogonal axes of a spherical wrist that lets the tool point in any direction.
Why minimality matters: calibration
Robots are never built exactly to their nominal DH table. A link machined 0.2 mm too long, a joint axis assembled 0.1° out of true — these errors accumulate down the chain and a six-axis arm can be off by several millimetres at the tool, far more than its sub-0.1 mm repeatability. Kinematic calibration measures the real tool poses with a laser tracker and solves for the actual DH parameters that best fit the data.
Here minimality is a virtue: the fewer parameters you have to identify, the better-conditioned the least-squares problem and the less you overfit measurement noise. DH's four-per-joint count is close to the theoretical minimum, which is why it remains the workhorse of calibration even though the convention is seventy years old.
Failure modes and trade-offs
- Parallel consecutive axes. When joint axis i and joint axis i+1 are exactly parallel, the common normal is no longer unique — any of infinitely many perpendiculars works. The offset d becomes ill-defined and must be set arbitrarily, which makes calibration of that joint numerically singular. Workaround: a parameterization like Hayati's that adds a small rotation parameter for near-parallel axes.
- Intersecting axes. If two axes intersect, the link length a is zero and the common normal degenerates to a point. This is fine geometrically (it's exactly what a spherical wrist does) but you must place the frame origin at the intersection by convention.
- Serial chains only. DH describes open serial chains of single-DOF joints. Parallel mechanisms — a Stewart platform, a delta robot — have closed loops and cannot be written as a single DH chain. They need loop-closure constraints instead.
- Multi-DOF joints. A ball joint or a spherical wrist is three rotations at one physical point; DH forces you to model it as three separate revolute joints with zero-length links between them. It works but inflates the table.
- Discontinuity at θ = ±π. Joint angles wrap around, and naïve interpolation through ±180° can flip orientation. Controllers track unwrapped angles or quaternions to avoid the jump.
- The full-transform alternative. Modern formats like URDF store the full six-parameter transform between links (xyz + roll-pitch-yaw) rather than DH's four. It is more parameters but avoids the parallel-axis degeneracy and is easier for non-experts to author. Many pipelines author in URDF and convert to DH only when a classical algorithm demands it.
Why the convention endures
DH parameters are the lingua franca of robot kinematics. They turn an arbitrary tangle of links and motors into a compact, standardized table that every textbook, simulator, and kinematics library can read. They are the input to forward kinematics (where is the tool?), the starting point for the Jacobian (how does tool velocity relate to joint velocity?), and the geometric scaffold for inverse kinematics (what joint angles put the tool here?). Learn the four numbers and the 4×4 matrix, and the rest of manipulator kinematics is bookkeeping on top of them.
Frequently asked questions
What are the four Denavit–Hartenberg parameters?
They are link length a (the distance along the common normal between two joint axes), link twist α (the angle between the two axes about that common normal), link offset d (the distance along the joint axis between consecutive common normals), and joint angle θ (the rotation of the link about the joint axis). For a revolute joint θ is the variable and the other three are fixed; for a prismatic joint d is the variable and the other three are fixed. Each set of four collapses an entire rigid link's geometry into four numbers.
How do DH parameters give forward kinematics?
Each joint's four parameters build a 4×4 homogeneous transformation matrix that relates frame i−1 to frame i. The matrix is the product of two screw displacements: a rotation by θ and translation by d about the z-axis, then a rotation by α and translation by a about the new x-axis. Multiply all the per-joint matrices in order — T = A₁A₂…Aₙ — and the result is the pose of the end effector frame in the base frame. That single 4×4 matrix is the forward kinematics solution.
Why use DH parameters instead of just measuring link lengths?
DH gives a minimal, unambiguous, and standardized description. A general rigid-body transform needs six numbers (three translation, three rotation); DH exploits the freedom to place each frame so that only four are ever needed, because two of the six can always be set to zero by aligning each frame's x-axis along the common normal. That minimality matters for calibration, where every extra parameter is one more thing to identify from noisy measurements, and for interoperability — every robotics textbook, URDF importer and kinematics library speaks DH.
What is the difference between standard and modified DH conventions?
Standard (classic) DH, from the 1955 paper, attaches frame i to the far end of link i and orders the transform as Rot_z(θ)·Trans_z(d)·Trans_x(a)·Rot_x(α). Modified DH, popularized by Craig, attaches frame i to the near end of link i and orders the transform as Rot_x(α)·Trans_x(a)·Rot_z(θ)·Trans_z(d). They describe the same robot but the parameter values and matrix structure differ, so you must never mix tables from the two conventions. Modified DH is often preferred because each matrix involves only that one joint's own parameters, which simplifies dynamics derivations.
When do DH parameters fail or become awkward?
DH assumes consecutive joint axes that are either skew, parallel, or intersecting in a well-defined way. When two consecutive axes are exactly parallel the common normal is not unique, so d is undefined and you must pick an arbitrary location — a known source of calibration error. The convention also handles only serial chains of single-DOF joints; spherical wrists must be decomposed into three revolute joints, and parallel mechanisms like a Stewart platform need a completely different formulation. For these reasons many modern frameworks store the full 6-parameter transform (as in URDF) and only convert to DH when a textbook algorithm requires it.
Where did the Denavit–Hartenberg convention come from?
Jacques Denavit and Richard Hartenberg published it in 1955 in the Journal of Applied Mechanics as a notation for describing the kinematics of spatial linkages. It predates industrial robots entirely — it was a mechanism-analysis tool — but it became the standard way to specify robot arms once programmable manipulators appeared in the 1960s and 1970s. Seventy years later, every six-axis industrial robot from KUKA, ABB, FANUC and Universal Robots can be described by a DH table of just 24 numbers.