Denavit-Hartenberg Parameters: The Standard Way to Model Humanoid Kinematics

Hey friend

I got a lot of questions after I wrote about Forward and Inverse Kinematics. You guys asked me: “Okay,. How do we actually describe a real humanoid arm or leg mathematically?”

That is where Denavit-Hartenberg parameters come in. It is the widely used standard in robotics for modeling the kinematics of humanoid robots like Tesla Optimus, Figure 01 or Boston Dynamics Atlas.

I will walk you through it step by step. I will not dump a lot of theory on you. Instead I will give you explanations, a simple example and working Python code you can play with today.

Why We Need a Standard Way to Model Robots

A humanoid arm or leg is a chain of links connected by joints. To calculate where the hand or foot ends up we need a way to describe:

  • How long each link is
  • How the joints are oriented
  • How much each joint rotates

The Denavit-Hartenberg convention gives us a clean systematic method using just four numbers per joint. Once you define these four Denavit-Hartenberg parameters you can automatically compute forward kinematics for the chain.

The Four Denavit-Hartenberg Parameters

For each joint we define:

  1. Θ. Joint angle, the variable we usually control
  2. D. Link offset, distance along the axis
  3. A. Link length distance between two joint axes
  4. Α. Link twist, angle between two joint axes

These four Denavit-Hartenberg values let us build a transformation matrix that converts coordinates from one joint frame to the next.

Simple Example: A 3-DOF Humanoid Arm

Lets model a simplified 3-joint arm. Here’s a typical Denavit-Hartenberg table for it:

JointθdaαDescription
1θ₁0090°Shoulder
2θ₂0L₁Shoulder
3θ₃0L₂Elbow

Where:

  • L₁ = upper arm length
  • L₂ = forearm length

Building the Denavit-Hartenberg Transformation Matrix

Each set of Denavit-Hartenberg parameters generates a 4×4 transformation matrix. Here’s the general form:

i1Ti=[cosθisinθicosαisinθisinαiaicosθisinθicosθicosαicosθisinαiaisinθi0sinαicosαidi0001]^{i-1}T_i = \begin{bmatrix} \cos\theta_i & -\sin\theta_i \cos\alpha_i & \sin\theta_i \sin\alpha_i & a_i \cos\theta_i \\ \sin\theta_i & \cos\theta_i \cos\alpha_i & -\cos\theta_i \sin\alpha_i & a_i \sin\theta_i \\ 0 & \sin\alpha_i & \cos\alpha_i & d_i \\ 0 & 0 & 0 & 1 \end{bmatrix}

Python Code: Forward Kinematics with Denavit-Hartenberg Parameters

import numpy as np
from scipy.spatial.transform import Rotation as R

def dh_transformation(theta, d, a, alpha):
    """Returns 4x4 homogeneous transformation matrix from DH parameters"""
    ct = np.cos(theta)
    st = np.sin(theta)
    ca = np.cos(alpha)
    sa = np.sin(alpha)
    
    return np.array([
        [ct,          -st*ca,      st*sa,     a*ct],
        [st,           ct*ca,     -ct*sa,     a*st],
        [0,            sa,         ca,        d   ],
        [0,            0,          0,         1   ]
    ])

def forward_kinematics(dh_params):
    """Compute end-effector pose from list of DH parameters"""
    T = np.eye(4)                                 # Start with identity matrix
    for params in dh_params:
        theta, d, a, alpha = params
        T = T @ dh_transformation(theta, d, a, alpha)
    return T

# Example: Simple 3-DOF arm
L1 = 0.30   # upper arm length
L2 = 0.25   # forearm length

dh_table = [
    [np.deg2rad(30),  0,  0,   np.deg2rad(90)],   # Joint 1
    [np.deg2rad(45),  0,  L1,  np.deg2rad(0)],    # Joint 2
    [np.deg2rad(60),  0,  L2,  np.deg2rad(0)]     # Joint 3
]

pose = forward_kinematics(dh_table)
position = pose[:3, 3]          # x, y, z position
rotation = R.from_matrix(pose[:3, :3]).as_euler('xyz', degrees=True)

print(f"End-effector position: ({position[0]:.3f}, {position[1]:.3f}, {position[2]:.3f}) m")
print(f"End-effector orientation (deg): {rotation}")

How Real Humanoids Use Denavit-Hartenberg Parameters

  • Tesla Optimus and Figure 01 use Denavit-Hartenberg tables internally to model their arms and legs.
  • Boston Dynamics Atlas uses kinematic models combined with whole-body optimization.
  • Most simulation tools. Convert to Denavit-Hartenberg style descriptions.

For legs the Denavit-Hartenberg table starts from the hip. Ends at the foot. Adding toes simply means adding one or two extra rows to the table.

My Personal Take

Denavit-Hartenberg parameters might look a bit dry at first. They are incredibly powerful. Once you can model any chain with just four numbers per joint the whole robot suddenly becomes mathematically manageable.

This is the bridge between design and software control. Good Denavit-Hartenberg parameters make forward kinematics fast and inverse kinematics solvable. They also help you quickly test ideas like “what if I add another degree of freedom at the ankle?”. How does changing the upper arm length affect the reachable workspace?”

We have come a way from the early articles, on balance and ZMP. Now you can see how everything connects: degrees of freedom, kinematics, PID control and contact forces all rely on having a mathematical model of the robot. And Denavit-Hartenberg is still the standard way to build that model.

Leave a Reply

Scroll to Top