6-Axis Articulated Robot Denavit-Hartenberg (DH) Frames & Homogeneous Transformations
Six-degree-of-freedom (6-DOF) articulated serial manipulators—with six revolute joints ($J_1$ through $J_6$) arranged in an anthropomorphic shoulder-elbow-spherical-wrist geometry—are the workhorses of industrial welding, machine tending, palletizing, and precision dispensing.
To compute the exact 3D Cartesian position $(X, Y, Z)$ and orientation $(R_x, R_y, R_z)$ of the Tool Center Point (TCP) from the six motor encoder angles $(\theta_1, \theta_2, \theta_3, \theta_4, \theta_5, \theta_6)$, robotics engineers use the systematic Denavit-Hartenberg (DH) Convention (1955) and $4 \times 4$ homogeneous matrix multiplication.
1. The Four Denavit-Hartenberg (DH) Link Parameters
In the standard Denavit-Hartenberg convention, each link $i \in \{1 \dots 6\}$ connecting joint axis $i$ to joint axis $i+1$ is fully characterized by four geometric constants (three fixed mechanical dimensions and one variable joint angle $\theta_i$ for revolute joints):
| DH Symbol | Parameter Name | Geometric Definition | Role in 6-Axis Articulated Robot |
|---|---|---|---|
| $\theta_i$ | Joint Angle | Rotation angle around axis $Z_{i-1}$ from $X_{i-1}$ to $X_i$. | Control Variable: Driven by servo motor $J_i$ encoder position plus zero-offset. |
| $d_i$ | Link Offset | Signed distance along axis $Z_{i-1}$ from origin $O_{i-1}$ to the common normal $X_i$. | Defines base shoulder height ($d_1$), forearm reach ($d_4$), and wrist-to-flange length ($d_6$). |
| $a_i$ | Link Length | Length of the mutual perpendicular along $X_i$ between $Z_{i-1}$ and $Z_i$. | Defines shoulder forward offset ($a_1$), upper arm length ($a_2$), and elbow offset ($a_3$). |
| $\alpha_i$ | Link Twist | Rotation angle around axis $X_i$ from axis $Z_{i-1}$ to axis $Z_i$. | Defines orthogonal $90^\circ$ ($\pm \pi/2$) axis twists at the shoulder ($J_1/J_2$) and spherical wrist ($J_4/J_5/J_6$). |
2. Typical Industrial 6-Axis DH Parameter Table
For a standard compact industrial 6-axis robot with a spherical wrist (where axes $Z_4, Z_5, Z_6$ intersect at a single wrist center point $W$):
| Joint $i$ | Joint Role | $\theta_i$ (Variable) | $d_i$ (mm) | $a_i$ (mm) | $\alpha_i$ (rad) |
|---|---|---|---|---|---|
| $J_1$ (Waist / Base) | Base Turntable Rotation | $\theta_1$ | $d_1 = 400$ | $a_1 = 50$ | $-\pi / 2$ ($-90^\circ$) |
| $J_2$ (Shoulder) | Upper Arm Pitch | $\theta_2 - \pi/2$ | $0$ | $a_2 = 450$ | $0$ ($0^\circ$) |
| $J_3$ (Elbow) | Forearm Pitch | $\theta_3$ | $0$ | $a_3 = 40$ | $-\pi / 2$ ($-90^\circ$) |
| $J_4$ (Wrist Roll 1) | Forearm Axial Roll | $\theta_4$ | $d_4 = 420$ | $0$ | $+\pi / 2$ ($+90^\circ$) |
| $J_5$ (Wrist Pitch) | Wrist Bend | $\theta_5$ | $0$ | $0$ | $-\pi / 2$ ($-90^\circ$) |
| $J_6$ (Flange Roll) | Tool Flange Rotation | $\theta_6$ | $d_6 = 95$ | $0$ | $0$ ($0^\circ$) |
3. The $4 \times 4$ Homogeneous Link Transformation Matrix ${}^{i-1}T_i$
Each DH row defines an elementary sequence of four transformations: $\text{Rot}_z(\theta_i) \cdot \text{Trans}_z(d_i) \cdot \text{Trans}_x(a_i) \cdot \text{Rot}_x(\alpha_i)$, yielding the $4 \times 4$ matrix ${}^{i-1}T_i \in SE(3)$:
$${}^{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}$$
Cascading all six link matrices plus the tool offset matrix ${}^{6}T_{\text{TCP}}$ yields the complete Forward Kinematics Pose Matrix relative to the robot base frame: $${}^{0}T_{\text{TCP}}(\vec{\theta}) = {}^{0}T_1(\theta_1)\,{}^{1}T_2(\theta_2)\,{}^{2}T_3(\theta_3)\,{}^{3}T_4(\theta_4)\,{}^{4}T_5(\theta_5)\,{}^{5}T_6(\theta_6)\,{}^{6}T_{\text{TCP}} = \begin{bmatrix} R_{3\times 3} & \vec{P}_{3\times 1} \\ 0\ \ 0\ \ 0 & 1 \end{bmatrix}$$
4. Extracting Cartesian Position & Roll-Pitch-Yaw Euler Angles
From the resulting $4 \times 4$ matrix $T$, the TCP Cartesian coordinates are read directly from the fourth column: $(X, Y, Z) = (T_{0,3},\ T_{1,3},\ T_{2,3})$. The $3 \times 3$ rotation submatrix $R$ is converted into industrial ZYX Roll-Pitch-Yaw ($R_x, R_y, R_z$) angles via:
const sy = Math.hypot(R[0][0], R[1][0]);
let rx, ry, rz;
if (sy > 1e-6) {
rx = Math.atan2(R[2][1], R[2][2]); // Roll (X)
ry = Math.atan2(-R[2][0], sy); // Pitch (Y)
rz = Math.atan2(R[1][0], R[0][0]); // Yaw (Z)
} else {
// Gimbal lock fallback (Pitch = +/- 90 deg)
rx = Math.atan2(-R[1][2], R[1][1]);
ry = Math.atan2(-R[2][0], sy);
rz = 0;
}
Frequently Asked Questions (FAQ)
Q. What is the advantage of a spherical wrist (where J4, J5, and J6 axes intersect at one point)?
A spherical wrist decouples position from orientation (Pieper's Criterion): joints J1, J2, and J3 determine the 3D position of the wrist center, while J4, J5, and J6 rotate the tool to the desired orientation in closed form.
Q. What is the difference between Standard DH and Modified (Craig) DH conventions?
Standard DH attaches frame i to the distal end of link i (rotating about Z_{i-1} then X_i), whereas Craig's Modified DH attaches frame i to the proximal joint axis i (rotating about X_{i-1} then Z_i). Mixing the two produces incorrect link offsets.
Q. Why does Homogeneous Matrix representation use 4x4 matrices instead of 3x3?
A 3x3 matrix can only represent pure 3D rotation around the origin. Expanding to 4x4 homogeneous coordinates embeds both 3x3 rotation and 3x1 translation into a single matrix product.
Q. How is a custom end-effector gripper or welding torch TCP offset applied to Forward Kinematics?
By post-multiplying the flange matrix 0_T_6 by a constant 4x4 tool matrix 6_T_TCP containing the tool's local (dx, dy, dz) offset and tilt relative to the J6 mounting flange.