From a DH table to the end-effector pose
The Denavit–Hartenberg convention describes each joint of a serial robot with four numbers: the joint angle θ, the link offset d, the link length a and the link twist α. Each row becomes a 4×4 homogeneous transform Aᵢ, and multiplying them from the base outward gives
T₀ⁿ = A₁ · A₂ · … · Aₙ
whose upper-left 3×3 block is the tool's orientation and whose last column is its position. The calculator builds every Aᵢ from your table, multiplies them, and shows the result as a matrix, as x, y, z and as roll-pitch-yaw angles. For a revolute joint θ is the variable you change to move the arm; for a prismatic joint it is d.
Standard or modified DH?
Two conventions are in common use, and mixing them up is the most common reason an answer does not match the textbook:
| Standard (distal) | Modified (proximal) | |
|---|---|---|
| Used by | Spong, Corke's Robotics Toolbox, most courses | Craig's Introduction to Robotics |
| Frame i sits at | the far end of link i | the near end of link i |
| Aᵢ | Rot_z(θᵢ)·Trans_z(dᵢ)·Trans_x(aᵢ)·Rot_x(αᵢ) | Rot_x(αᵢ₋₁)·Trans_x(aᵢ₋₁)·Rot_z(θᵢ)·Trans_z(dᵢ) |
The same robot has different tables in the two conventions, so switch the calculator to the one your table was written in. The general Aᵢ is shown in symbols next to the numbers, so you can check each entry against your notes.
Worked example: a 3-link planar arm
The first preset has link lengths 100, 80 and 50 mm and joint angles 30°, 45° and −30°. Every joint turns about a parallel z axis, so all d and α are 0. The first link matrix is
A₁ = [ cos 30°, −sin 30°, 0, 100·cos 30° ; sin 30°, cos 30°, 0, 100·sin 30° ; 0, 0, 1, 0 ; 0, 0, 0, 1 ] = [ 0.866, −0.5, 0, 86.60 ; 0.5, 0.866, 0, 50 ; 0, 0, 1, 0 ; 0, 0, 0, 1 ]
and multiplying all three gives the tool at x = 142.66 mm, y = 162.63 mm, pointing at 45° (30° + 45° − 30°). That matches the planar formula x = L₁cos θ₁ + L₂cos(θ₁+θ₂) + L₃cos(θ₁+θ₂+θ₃), which is a quick way to check any DH table for a planar arm.
How to write the DH table for your own robot (standard DH)
Most mistakes happen before any matrix is multiplied, while placing the frames. In standard DH, work joint by joint from the base:
- Put z on the joint axes. z₀ is the axis of joint 1, z₁ the axis of joint 2, and so on: zᵢ₋₁ is the axis joint i turns about (revolute) or slides along (prismatic).
- Put x on the common normal. xᵢ is the line perpendicular to both zᵢ₋₁ and zᵢ, pointing from zᵢ₋₁ towards zᵢ. If the two z axes cross, make xᵢ perpendicular to both at the crossing point. If they are parallel (every planar arm), any common normal works, so pick the one that makes d zero.
- Read the four numbers for row i:
- aᵢ: distance from zᵢ₋₁ to zᵢ, measured along xᵢ (the link length).
- αᵢ: angle from zᵢ₋₁ to zᵢ, turning about xᵢ (the twist; 0 when the axes are parallel, ±90° when they are perpendicular).
- dᵢ: distance from xᵢ₋₁ to xᵢ, measured along zᵢ₋₁ (the offset).
- θᵢ: angle from xᵢ₋₁ to xᵢ, turning about zᵢ₋₁ (the joint angle).
- Mark the variable. A revolute joint's θ changes as it moves; a prismatic joint's d does. Everything else in the row is fixed by the robot's shape.
Then check the table here at a pose you can picture, such as all joints at zero. If the tool lands somewhere the real arm can't reach, one of the frames is placed wrongly.
Worked example 2: a SCARA with a prismatic joint
The SCARA preset has two horizontal links of 350 mm and 300 mm, a vertical slide d₃ and a wrist with d₄ = 50 mm. The 180° twist on row 2 turns z₂ to point down, so a positive d₃ lowers the tool. At home (all angles 0, d₃ = 100 mm) the tool is at (650, 0, −150) mm: both links stretched out along x, and 100 + 50 mm below the base frame.
Now pose it at θ₁ = 30°, θ₂ = 45°, d₃ = 150 mm, θ₄ = 60°. The twist shows up in A₂, whose middle column is flipped:
A₂ = [ 0.707, 0.707, 0, 212.13 ; 0.707, −0.707, 0, 212.13 ; 0, 0, −1, 0 ; 0, 0, 0, 1 ]
and the product gives the tool at x = 380.76 mm, y = 464.78 mm, z = −200 mm, with roll 180° (the tool points down) and yaw 15°. Three quick checks: x and y equal the planar formula 350·cos 30° + 300·cos 75° and 350·sin 30° + 300·sin 75°; z is −(d₃ + d₄) = −(150 + 50); and the yaw is θ₁ + θ₂ − θ₄, because the flipped z axis makes joint 4 turn the other way.
Enter the same table with the convention switched to modified and the tool moves to (609.81, 150.00, −200) mm. The numbers are identical; only the meaning changed. That is why the first thing to check, when your answer disagrees with the textbook, is which convention the table was written in.
Real robot presets
- SCARA (RRPR): the α = 180° on joint 2 turns z downwards, so the prismatic joint lowers the tool.
- Stanford arm (RRPRRR): the classic spherical-wrist arm with a prismatic third joint.
- PUMA 560: at all-zero joints the tool sits at (0.4521, −0.15005, 0.4318) m with no rotation, the same answer Corke's Robotics Toolbox gives, which makes it a good test of your own code.
- UR5: Universal Robots' published table; at zero the tool is at (−0.81725, −0.19145, −0.0055) m.
Each preset names its source so you can cite it. Edit any cell and everything recomputes. For the planar case, the forward kinematics and inverse kinematics tools draw the arm, and the joint torque calculator sizes its motors.