ToolSphere

DH Parameters Matrix Calculator

Robotics

Enter a full DH table and get every link matrix, the base-to-tool transform T₀ⁿ and the end-effector pose. Presets: PUMA 560, UR5, SCARA, Stanford.

Pick a robot arm or type your own table, one row per joint. The answer is where the tool tip ends up.

Tool tip position (mm)

x 142.6634 · y 162.62941 · z 0

Relative to the base. Keep all table lengths in the same unit.

Every joint turns about a parallel z axis, so all d and α are 0. Lengths in mm; angles in degrees. Edit any cell to pose the arm.

Jointθᵢ (°)dᵢaᵢαᵢ (°)
Scroll the table sideways for all columns. Highlighted cells are the joint variables (θ for R, d for P). Click 1R / 2P to switch joint type.
Tool tip (end effector) position
T₀₃ = A₁·…·A₃
0.70711-0.707110142.66340.707110.707110162.6294100100001
x
142.6634
y
162.62941
z
0

Roll, pitch, yaw (ZYX): 0°, 0°, 45°

Each link transform
General Aᵢ = Rot_z(θᵢ)·Trans_z(dᵢ)·Trans_x(aᵢ)·Rot_x(αᵢ)
cθᵢ−sθᵢ·cαᵢsθᵢ·sαᵢaᵢ·cθᵢsθᵢcθᵢ·cαᵢ−cθᵢ·sαᵢaᵢ·sθᵢ0sαᵢcαᵢdᵢ0001
A₁
0.86603-0.5086.602540.50.8660305000100001
A₂
0.70711-0.70711056.568540.707110.70711056.5685400100001
A₃
0.866030.5043.30127-0.50.866030-2500100001

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use DH Parameters Matrix Calculator

  1. 1Pick a preset (3-link planar, SCARA, Stanford, PUMA 560, UR5) or edit the table: one row per joint, from the base outward.
  2. 2Choose standard DH (Spong, Corke) or modified DH (Craig) to match your textbook.
  3. 3Click a joint's 1R / 2P label to switch it between revolute and prismatic; green cells are the joint variables.
  4. 4Read T₀ⁿ, the end-effector x, y, z and roll-pitch-yaw, and every individual Aᵢ matrix, updated as you type.
  5. 5Copy the table, T₀ⁿ and the pose as text for your report.

About DH Parameters Matrix Calculator

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:

  1. 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).
  2. 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.
  3. 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).
  4. 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.

Guides and tutorials

Frequently asked questions

What are the four DH parameters?

θ, the joint angle about the previous z axis; d, the offset along that z axis; a, the link length along the common normal (the new x axis); and α, the twist about that x axis between consecutive z axes. For a revolute joint θ varies; for a prismatic joint d varies.

How do I get the transformation matrix from DH parameters?

Build one 4×4 matrix per row, Aᵢ = Rot_z(θᵢ)·Trans_z(dᵢ)·Trans_x(aᵢ)·Rot_x(αᵢ) in standard DH, then multiply them in order from the base: T₀ⁿ = A₁·A₂·…·Aₙ. The last column of T₀ⁿ is the end-effector position and the 3×3 block its orientation.

What is the difference between standard and modified DH?

Where each frame is attached. Standard DH (Spong, Corke) puts frame i at the far end of link i; modified DH (Craig) puts it at the near end, so its row i uses α and a of the previous link. The products of the matrices describe the same robot, but the tables are not interchangeable.

How do I handle a prismatic joint?

Set the joint type to P. Its variable is d, the slide along the joint's z axis, while θ stays fixed. The SCARA and Stanford presets each have one prismatic joint.

Why does my answer differ from the textbook?

Usually one of four things: the table is in the other DH convention, an angle was entered in radians instead of degrees, a link length has the wrong sign (UR5's a₂ and a₃ are negative), or the matrices were multiplied in the wrong order. Compare each Aᵢ shown here with yours to find the first one that differs.

What do roll, pitch and yaw mean here?

The tool's orientation as three rotations: yaw about z, then pitch about y, then roll about x (ZYX order). When pitch reaches ±90° the first and last rotations line up (gimbal lock), and yaw is reported as 0 with the rotation folded into roll.

How do I find the DH parameters of a robot?

Draw the robot, put each zᵢ₋₁ on the axis of joint i, put each xᵢ on the common normal between zᵢ₋₁ and zᵢ, then read a (distance along x), α (twist about x), d (offset along z) and θ (angle about z) for each row. The section above walks through the rules, and a SCARA example shows them applied.

Is a DH table unique?

No. Where two z axes are parallel the common normal can be placed anywhere along them, and the base and tool frames are free choices, so two correct tables for the same arm can have different d and θ offsets. They give the same tool pose once both frames are measured from the same base.

What units does the calculator use?

Angles θ and α are in degrees. Lengths a and d can be in any unit, as long as every row uses the same one: the position comes out in that unit. The presets say which they use (the planar arm and SCARA in mm, the Stanford arm, PUMA 560 and UR5 in m).

Why is α = 180° in the SCARA table?

The SCARA's vertical slide moves the tool down. A 180° twist about x₂ flips z₂ to point downwards, so a positive d₃ lowers the tool; it also makes the wrist joint turn in the opposite sense, which is why the tool's yaw is θ₁ + θ₂ − θ₄.

Does it do inverse kinematics?

Not for a general DH table, which needs a robot-specific solution. For a two-link planar arm, or a three-link one with a set tool angle, the inverse kinematics tool finds both elbow-up and elbow-down solutions.

Have a suggestion for DH Parameters Matrix Calculator?Share your feedback ↗