AI Wiki中文/EN

Robot kinematics: from joint angles to the end-effector pose

机器人运动学

Compute the forward kinematics of a serial arm by trigonometry, by chaining link frames and by the product of exponentials, read Denavit–Hartenberg tables, and see why the two parametrizations behave differently near parallel axes.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

The motors report angles; the task needs a pose

A robot arm’s encoders report joint angles. The task, picking up a cup or welding a seam, is stated in terms of where the gripper is and how it is turned. Forward kinematics connects the two: from the joint coordinates, it computes the position and orientation of the end-effector frame. For an open chain with a fixed base frame {s}\{s\} and an end-effector frame {b}\{b\}, Lynch and Park define it as the map T(θ)T(\theta) that gives {b}\{b\} in {s}\{s\} as a function of the joint vector θ\theta. Forward kinematics

For a planar arm with three revolute joints (a 3R arm) the answer is school trigonometry: each link adds its length in the direction of the accumulated angle. That approach quickly becomes unwieldy. A six-joint industrial arm has axes pointing in different directions, offsets between them and a tool mounted at an angle, and writing its trigonometry by hand invites sign errors. Robotics relies on two standard methods: attach a frame to each link and multiply link-to-link transforms (classically with the frames chosen by the Denavit–Hartenberg convention). Alternatively, describe every joint as a screw axis at a home pose and multiply matrix exponentials (the product-of-exponentials, PoE, formula).

This article works through both and checks them against each other in code. It relies on rigid transformations for SO(3), SE(3), homogeneous matrices and the exponential of a screw. Solving the reverse problem, finding joint values for a desired pose, is inverse kinematics. Velocities are handled by the manipulator Jacobian, and forces and torques by robot dynamics.

Three ways to write the same map

Trigonometry for a planar chain. For a planar 3R arm with link lengths L1,L2,L3L_1,L_2,L_3, the tip position and heading are

x=L1cos⁡θ1+L2cos⁡(θ1+θ2)+L3cos⁡(θ1+θ2+θ3)x=L_1\cos\theta_1+L_2\cos(\theta_1+\theta_2)+L_3\cos(\theta_1+\theta_2+\theta_3) y=L1sin⁡θ1+L2sin⁡(θ1+θ2)+L3sin⁡(θ1+θ2+θ3),ϕ=θ1+θ2+θ3y=L_1\sin\theta_1+L_2\sin(\theta_1+\theta_2)+L_3\sin(\theta_1+\theta_2+\theta_3),\qquad \phi=\theta_1+\theta_2+\theta_3

If only the position matters, the task space is the plane and the heading equation is dropped. Planar 3R

Chaining link frames. A more systematic approach attaches a frame {i}\{i\} to each link and writes the configuration of each frame relative to the previous one. Each factor depends only on its own joint value, and subscript cancellation gives

T0,n(θ)=T01(θ1) T12(θ2)⋯Tn−1,n(θn)T_{0,n}(\theta)=T_{01}(\theta_1)\,T_{12}(\theta_2)\cdots T_{n-1,n}(\theta_n)

with a final constant factor if the tool frame differs from the last link frame. Link-frame product The method is only as good as the rules for placing the frames, which is what Denavit and Hartenberg’s convention supplies.

Product of exponentials. Lynch and Park’s alternative avoids link frames entirely. Choose a home configuration θ=0\theta=0 and record MM, the end-effector configuration there. Each revolute joint is a zero-pitch screw: in the base frame its screw axis is Si=(ωi,vi)\mathcal{S}_i=(\omega_i,v_i), where ωi\omega_i is the unit direction of the joint axis and qiq_i is any point on it,

Si=[ωivi],vi=−ωi×qi\mathcal{S}_i=\begin{bmatrix}\omega_i\\ v_i\end{bmatrix},\qquad v_i=-\omega_i\times q_i

and for a prismatic joint ωi=0\omega_i=0 and viv_i is the unit direction of travel. Screw axes of joints Moving joint ii by θi\theta_i applies the rigid motion e[Si]θie^{[\mathcal{S}_i]\theta_i}, whose closed form (Lynch and Park, Proposition 3.25) for a unit rotation axis is

e[S]θ=[e[ω]θ(Iθ+(1−cos⁡θ)[ω]+(θ−sin⁡θ)[ω]2)v01]e^{[\mathcal{S}]\theta}=\begin{bmatrix}e^{[\omega]\theta} & \big(I\theta+(1-\cos\theta)[\omega]+(\theta-\sin\theta)[\omega]^2\big)v\\ 0 & 1\end{bmatrix}

The derivation moves the most distal joint first, which carries MM with it, then the next joint inward, and so on. Every joint applies a screw motion to all links outboard of it. The result is the space form of the PoE; the same map can also be written with screw axes Bi\mathcal{B}_i expressed in the end-effector frame at home, the body form:

T(θ)=e[S1]θ1⋯e[Sn]θnM=M e[B1]θ1⋯e[Bn]θn,Bi=[AdM−1]SiT(\theta)=e^{[\mathcal{S}_1]\theta_1}\cdots e^{[\mathcal{S}_n]\theta_n}M=M\,e^{[\mathcal{B}_1]\theta_1}\cdots e^{[\mathcal{B}_n]\theta_n},\qquad \mathcal{B}_i=[\mathrm{Ad}_{M^{-1}}]\mathcal{S}_i

Here AdX\mathrm{Ad}_X is the 6×6 adjoint of X∈SE(3)X\in\mathrm{SE}(3), and the body form follows from eM−1PM=M−1ePMe^{M^{-1}PM}=M^{-1}e^{P}M. Space and body forms

Why is it enough to find the axes once, at the home pose, although they move as the arm moves? Read the space form right to left: joint nn moves first, then joint n−1n-1, and so on. When joint ii acts, the joints proximal to it have not moved yet in this ordering, so axis ii is still where it was at home. In the body form the argument runs the other way: a distal joint’s axis, seen from the end-effector, is unaffected by proximal motion. Ordering The PoE needs only three ingredients: MM, the nn screw axes, and the joint values. No intermediate frames are required.

Denavit–Hartenberg parameters. The D–H convention fixes the link frames by rules so that each link transform needs only four numbers. In Lynch and Park’s version, z^i\hat z_i lies along joint axis ii; the origin of frame {i−1}\{i-1\} sits where the common perpendicular of axes i−1i-1 and ii meets axis i−1i-1; x^i−1\hat x_{i-1} points along that perpendicular toward axis ii; and y^\hat y completes a right-handed frame. Frame rules The four parameters are then:

  • link length ai−1a_{i-1}: the length of the common perpendicular (not necessarily the physical length of the link);
  • link twist αi−1\alpha_{i-1}: the angle from z^i−1\hat z_{i-1} to z^i\hat z_i about x^i−1\hat x_{i-1};
  • link offset did_i: the distance along z^i\hat z_i;
  • joint angle ϕi\phi_i: the angle from x^i−1\hat x_{i-1} to x^i\hat x_i about z^i\hat z_i.

For a revolute joint only ϕi\phi_i varies; for a prismatic joint did_i is the variable. If adjacent axes intersect, a=0a=0 and x^\hat x is normal to the plane of the two axes, with a free choice of sign. If they are parallel, there is a one-parameter family of common perpendiculars, and one picks the one that makes many parameters zero. Special cases The link transform in Lynch and Park’s convention is

Ti−1,i=Rot(x^,αi−1) Trans(x^,ai−1) Trans(z^,di) Rot(z^,ϕi)T_{i-1,i}=\mathrm{Rot}(\hat x,\alpha_{i-1})\,\mathrm{Trans}(\hat x,a_{i-1})\,\mathrm{Trans}(\hat z,d_i)\,\mathrm{Rot}(\hat z,\phi_i)

and the forward kinematics is the product of these transforms. Not every pair of frames can be related this way; for instance a pure translation along y^\hat y cannot, because only rotations and translations along x^\hat x and z^\hat z are allowed. The frame rules are what make four numbers enough, and Lynch and Park report that Denavit and Hartenberg showed four is the minimum. Why four

“D–H” names more than one convention. Some authors align the joint axis with x^\hat x rather than z^\hat z, or apply the four elementary motions in a different order, so a table of a,α,d,θa,\alpha,d,\theta values is meaningless without the frame drawing that goes with it. Conventions Hartenberg and Denavit’s own 1964 textbook illustrates this. They describe a mechanism as a sequence of pairs, each connection specified by four parameters a,α,θ,sa,\alpha,\theta,s measured along the unique common perpendicular of successive pair axes, with xx-axes along those perpendiculars. They write the mechanism first as a symbolic equation and then replace each term by a 4×4 matrix. In their matrix the homogeneous coordinate comes first: the first row is (1, 0, 0, 0), the first column carries (acos⁡θ,asin⁡θ,s)(a\cos\theta,a\sin\theta,s), and the rotation block equals Rot(z,θ)Rot(x,α)\mathrm{Rot}(z,\theta)\mathrm{Rot}(x,\alpha). In other words, their elementary motions are applied in the order rotate about zz, slide along zz, slide along xx, rotate about xx: Lynch and Park’s sequence with the roles of xx and zz exchanged. Matrix method They treat revolute and prismatic pairs as limiting cases of the screw pair, with zero and infinite lead, among the six lower pairs. For a closed chain, the product of the matrices around the loop must be the identity, A1A2A3A4=IA_1A_2A_3A_4=I, and they derive the displacement equations of a Hooke joint purely algebraically from that condition. Closed loops

How D–H and PoE relate. Each D–H link transform can be written Ti−1,i=Mie[Ai]θiT_{i-1,i}=M_ie^{[A_i]\theta_i}. Repeatedly applying MePM−1=eMPM−1Me^{P}M^{-1}=e^{MPM^{-1}} moves every exponential to the left and produces the space-form PoE, with M=M1⋯MnM=M_1\cdots M_n and each Si\mathcal{S}_i obtained by transforming AiA_i with M1⋯Mi−1M_1\cdots M_{i-1}. From D–H to PoE The two descriptions differ in what they cost and how they behave. D–H is minimal: Lynch and Park count 3n3n structural numbers plus nn joint values for an nn-joint robot. PoE uses 6n6n numbers for the screw axes plus the nn joint values, and we add that MM must also be specified. Parameter counts In exchange, PoE lets the base and end-effector frames be chosen freely, needs no link frames, treats revolute and prismatic joints alike and gives each parameter a direct geometric meaning. Lynch and Park conclude there is little reason to prefer D–H for open chains; they also note that most of the kinematics literature uses it. Comparison Their bibliography dates D–H to Denavit and Hartenberg’s 1955 paper in the ASME Journal of Applied Mechanics and the PoE formula to Brockett (1983); we know both papers only through that bibliography.

Four computations that must agree

The program is original numpy code. It uses one fixed-seed random generator (seed 16) for 1000 random joint vectors and runs in about a tenth of a second. Equality checks print “ok” when the largest entry difference is below 1e-12. Section 4 uses the spatial 3R chain from Lynch and Park’s Examples 4.1 and C.1; all other geometry is our own.

import numpy as np


def skew(w):
    return np.array([[0.0, -w[2], w[1]], [w[2], 0.0, -w[0]], [-w[1], w[0], 0.0]])


def exp_screw(S, theta):
    w, v = np.asarray(S[:3], float), np.asarray(S[3:], float)
    T = np.eye(4)
    if np.linalg.norm(w) < 1e-12:
        T[:3, 3] = v * theta
        return T
    K = skew(w)
    T[:3, :3] = np.eye(3) + np.sin(theta) * K + (1 - np.cos(theta)) * K @ K
    G = np.eye(3) * theta + (1 - np.cos(theta)) * K + (theta - np.sin(theta)) * K @ K
    T[:3, 3] = G @ v
    return T


def adjoint(T):
    R, p = T[:3, :3], T[:3, 3]
    A = np.zeros((6, 6))
    A[:3, :3] = R
    A[3:, 3:] = R
    A[3:, :3] = skew(p) @ R
    return A


def inv_T(T):
    R, p = T[:3, :3], T[:3, 3]
    Ti = np.eye(4)
    Ti[:3, :3] = R.T
    Ti[:3, 3] = -R.T @ p
    return Ti


def fk_space(M, S_list, thetas):
    T = np.eye(4)
    for S, th in zip(S_list, thetas):
        T = T @ exp_screw(S, th)
    return T @ M


def fk_body(M, B_list, thetas):
    T = M.copy()
    for B, th in zip(B_list, thetas):
        T = T @ exp_screw(B, th)
    return T


def rot_x(a):
    T = np.eye(4)
    c, s = np.cos(a), np.sin(a)
    T[1:3, 1:3] = [[c, -s], [s, c]]
    return T


def rot_z(a):
    T = np.eye(4)
    c, s = np.cos(a), np.sin(a)
    T[:2, :2] = [[c, -s], [s, c]]
    return T


def trans(x, y, z):
    T = np.eye(4)
    T[:3, 3] = [x, y, z]
    return T


def dh_link(alpha_prev, a_prev, d, phi):
    return rot_x(alpha_prev) @ trans(a_prev, 0, 0) @ trans(0, 0, d) @ rot_z(phi)


def screw_revolute(w, q):
    w = np.asarray(w, float)
    return np.concatenate([w, -np.cross(w, q)])


def ok(err, tol=1e-12):
    return "ok" if err < tol else f"FAIL ({err:.1e})"


def fmt(v, d=4):
    return "[" + ", ".join(f"{x + 0.0:+.{d}f}" for x in np.ravel(v)) + "]"


L1, L2, L3 = 1.0, 0.8, 0.5
th = np.radians([30.0, 45.0, -60.0])

print("1. Planar 3R arm, L = (1.0, 0.8, 0.5), theta = (30, 45, -60) deg")
x = L1*np.cos(th[0]) + L2*np.cos(th[0]+th[1]) + L3*np.cos(th.sum())
y = L1*np.sin(th[0]) + L2*np.sin(th[0]+th[1]) + L3*np.sin(th.sum())
print(f"   trigonometry: x = {x:.4f}, y = {y:.4f}, phi = {np.degrees(th.sum()):.1f} deg")

T_chain = rot_z(th[0]) @ trans(L1, 0, 0) @ rot_z(th[1]) @ trans(L2, 0, 0) @ rot_z(th[2]) @ trans(L3, 0, 0)
M = trans(L1 + L2 + L3, 0, 0)
S_list = [screw_revolute([0, 0, 1], [0, 0, 0]),
          screw_revolute([0, 0, 1], [L1, 0, 0]),
          screw_revolute([0, 0, 1], [L1 + L2, 0, 0])]
print("   space screw axes S_i = (w, v):")
for i, S in enumerate(S_list, 1):
    print(f"     S{i} = {fmt(S, 2)}")
T_space = fk_space(M, S_list, th)
B_list = [np.linalg.solve(adjoint(M), S) for S in S_list]
print("   body screw axes B_i = Ad(M^-1) S_i:")
for i, B in enumerate(B_list, 1):
    print(f"     B{i} = {fmt(B, 2)}")
T_body = fk_body(M, B_list, th)
print("   T(theta) from PoE space form:")
for row in T_space[:3]:
    print("     ", fmt(row))
print(f"   link-frame product = PoE space: {ok(np.abs(T_chain - T_space).max())}")
print(f"   PoE body = PoE space:           {ok(np.abs(T_body - T_space).max())}")
print(f"   trig (x, y) = T[0:2, 3]:        {ok(abs(x - T_space[0, 3]) + abs(y - T_space[1, 3]))}")

print("2. The order of the exponentials matters")
T_rev = exp_screw(S_list[2], th[2]) @ exp_screw(S_list[1], th[1]) @ exp_screw(S_list[0], th[0]) @ M
print(f"   reversed product tip: ({T_rev[0, 3]:.4f}, {T_rev[1, 3]:.4f}) vs correct ({T_space[0, 3]:.4f}, {T_space[1, 3]:.4f})")

print("3. Many joint vectors, one end-effector position (2R arm, L = 1.0, 0.8)")
t1, t2 = np.radians([30.0, 45.0])
px = L1*np.cos(t1) + L2*np.cos(t1+t2)
py = L1*np.sin(t1) + L2*np.sin(t1+t2)
gamma = np.arctan2(L2*np.sin(t2), L1 + L2*np.cos(t2))
t1b, t2b = np.arctan2(py, px) + gamma, -t2
qx = L1*np.cos(t1b) + L2*np.cos(t1b+t2b)
qy = L1*np.sin(t1b) + L2*np.sin(t1b+t2b)
print(f"   (30.0, 45.0) deg -> ({px:.4f}, {py:.4f}); ({np.degrees(t1b):.4f}, {np.degrees(t2b):.1f}) deg -> ({qx:.4f}, {qy:.4f})")
print(f"   reachable radius range: [{abs(L1 - L2):.1f}, {L1 + L2:.1f}]")

print("4. Spatial 3R chain (Lynch & Park Example 4.1 / C.1), L1 = 1.0, L2 = 0.8")
M3 = np.array([[0, 0, 1, L1], [0, 1, 0, 0], [-1, 0, 0, -L2], [0, 0, 0, 1]], float)
S3 = [np.array([0, 0, 1, 0, 0, 0], float),
      np.array([0, -1, 0, 0, 0, -L1], float),
      np.array([1, 0, 0, 0, -L2, 0], float)]
T_dh_zero = dh_link(0, 0, 0, 0) @ dh_link(np.pi/2, L1, 0, -np.pi/2) @ dh_link(-np.pi/2, L2, 0, 0)
print(f"   DH chain at theta = 0 equals M: {ok(np.abs(T_dh_zero - M3).max())}")
rng = np.random.default_rng(16)
worst = 0.0
for _ in range(1000):
    q = rng.uniform(-np.pi, np.pi, 3)
    T_poe = fk_space(M3, S3, q)
    T_dh = dh_link(0, 0, 0, q[0]) @ dh_link(np.pi/2, L1, 0, q[1] - np.pi/2) @ dh_link(-np.pi/2, L2, 0, q[2])
    worst = max(worst, np.abs(T_poe - T_dh).max())
print(f"   PoE vs DH over 1000 random joint vectors: max entry difference {ok(worst)}")
S3_wrong = [S3[0], S3[1], np.array([1, 0, 0, 0, +L2, 0], float)]
q = np.radians([20.0, 30.0, 40.0])
T_dh = dh_link(0, 0, 0, q[0]) @ dh_link(np.pi/2, L1, 0, q[1] - np.pi/2) @ dh_link(-np.pi/2, L2, 0, q[2])
err = np.abs(fk_space(M3, S3_wrong, q) - T_dh).max()
print(f"   with v3 = (0, +L2, 0) instead of (0, -L2, 0): max entry difference {err:.4f} at (20, 30, 40) deg")
print("   parameter count, n = 3: DH structure 3n =", 3*3, "| PoE screws 6n =", 6*3, "+ M (6 dof)")

print("5. DH parameters are ill-conditioned near parallel axes; screw axes are not")


def common_normal(p1, u1, p2, u2):
    u1, u2 = u1/np.linalg.norm(u1), u2/np.linalg.norm(u2)
    n = np.cross(u1, u2)
    if np.linalg.norm(n) < 1e-12:
        return np.linalg.norm(np.cross(p2 - p1, u1)), None
    w0 = p1 - p2
    a, b, c = u1 @ u1, u1 @ u2, u2 @ u2
    d, e = u1 @ w0, u2 @ w0
    den = a*c - b*b
    s = (b*e - c*d) / den
    t = (a*e - b*d) / den
    return np.linalg.norm((p1 + s*u1) - (p2 + t*u2)), s


p1, u1 = np.zeros(3), np.array([0.0, 0.0, 1.0])
p2 = np.array([1.0, 0.0, 0.0])
for label, u2 in [("exactly parallel", np.array([0.0, 0.0, 1.0])),
                  ("tilt 1e-3 toward x", np.array([1e-3, 0.0, 1.0])),
                  ("tilt 1e-3 toward y", np.array([0.0, 1e-3, 1.0]))]:
    length, foot = common_normal(p1, u1, p2, u2)
    w2 = u2 / np.linalg.norm(u2)
    S2 = screw_revolute(w2, p2)
    dS = np.abs(S2 - screw_revolute(u1, p2)).max()
    foot_txt = "undefined (any height)" if foot is None else f"{foot:+.1f}"
    print(f"   {label:18s}: link length a = {length:.4f}, normal foot on axis 1 at z = {foot_txt}, screw change {dS:.4f}")
Inspect the recorded output
1. Planar 3R arm, L = (1.0, 0.8, 0.5), theta = (30, 45, -60) deg
   trigonometry: x = 1.5560, y = 1.4022, phi = 15.0 deg
   space screw axes S_i = (w, v):
     S1 = [+0.00, +0.00, +1.00, +0.00, +0.00, +0.00]
     S2 = [+0.00, +0.00, +1.00, +0.00, -1.00, +0.00]
     S3 = [+0.00, +0.00, +1.00, +0.00, -1.80, +0.00]
   body screw axes B_i = Ad(M^-1) S_i:
     B1 = [+0.00, +0.00, +1.00, +0.00, +2.30, +0.00]
     B2 = [+0.00, +0.00, +1.00, +0.00, +1.30, +0.00]
     B3 = [+0.00, +0.00, +1.00, +0.00, +0.50, +0.00]
   T(theta) from PoE space form:
      [+0.9659, -0.2588, +0.0000, +1.5560]
      [+0.2588, +0.9659, +0.0000, +1.4022]
      [+0.0000, +0.0000, +1.0000, +0.0000]
   link-frame product = PoE space: ok
   PoE body = PoE space:           ok
   trig (x, y) = T[0:2, 3]:        ok
2. The order of the exponentials matters
   reversed product tip: (2.6557, 1.5469) vs correct (1.5560, 1.4022)
3. Many joint vectors, one end-effector position (2R arm, L = 1.0, 0.8)
   (30.0, 45.0) deg -> (1.0731, 1.2727); (69.7298, -45.0) deg -> (1.0731, 1.2727)
   reachable radius range: [0.2, 1.8]
4. Spatial 3R chain (Lynch & Park Example 4.1 / C.1), L1 = 1.0, L2 = 0.8
   DH chain at theta = 0 equals M: ok
   PoE vs DH over 1000 random joint vectors: max entry difference ok
   with v3 = (0, +L2, 0) instead of (0, -L2, 0): max entry difference 0.9024 at (20, 30, 40) deg
   parameter count, n = 3: DH structure 3n = 9 | PoE screws 6n = 18 + M (6 dof)
5. DH parameters are ill-conditioned near parallel axes; screw axes are not
   exactly parallel  : link length a = 1.0000, normal foot on axis 1 at z = undefined (any height), screw change 0.0000
   tilt 1e-3 toward x: link length a = 0.0000, normal foot on axis 1 at z = -1000.0, screw change 0.0010
   tilt 1e-3 toward y: link length a = 1.0000, normal foot on axis 1 at z = +0.0, screw change 0.0010

Planar 3R: four routes, one pose. With L=(1.0,0.8,0.5)L=(1.0,0.8,0.5) and θ=(30°,45°,−60°)\theta=(30°,45°,-60°), trigonometry gives x=1.5560x=1.5560, y=1.4022y=1.4022 and a heading of 15.0°. The space screw axes all point along z^\hat z; their linear parts are v=−z^×qv=-\hat z\times q, so they read (0, 0, 0), (0, −1.00, 0) and (0, −1.80, 0) for axes through the origin, (1, 0, 0) and (1.8, 0, 0). Seen from the end-effector at home, 2.3 m out along xx, the same axes have linear parts 2.30, 1.30 and 0.50. The PoE pose has a rotation block equal to a 15° turn (0.9659 and 0.2588) and position (1.5560, 1.4022, 0). The link-frame product, the space form, the body form and the trigonometric position all agree.

Order matters. Multiplying the three exponentials in reverse order puts the tip at (2.6557, 1.5469) instead of (1.5560, 1.4022). Rigid motions do not commute, and in the space form the rightmost factor must belong to the most distal joint.

Same position, different joints. For a 2R arm with L=(1.0,0.8)L=(1.0,0.8), the joint vectors (30°, 45°) and (69.7298°, −45°) both place the tip at (1.0731, 1.2727): the elbow is bent one way or the other. Reachable distances from the base range from 0.2 to 1.8. Forward kinematics is a function; going back is not, which is why inverse kinematics is a separate and harder problem.

PoE against D–H on a spatial arm. Lynch and Park’s 3R spatial chain has joint axes ω1=(0,0,1)\omega_1=(0,0,1), ω2=(0,−1,0)\omega_2=(0,-1,0), ω3=(1,0,0)\omega_3=(1,0,0), with q2=(L1,0,0)q_2=(L_1,0,0), q3=(0,0,−L2)q_3=(0,0,-L_2), and a home pose MM whose tool frame is rotated about y^\hat y. Example 4.1 Its D–H table in Example C.1 is (α,a,d,ϕ)=(0,0,0,θ1)(\alpha,a,d,\phi)=(0,0,0,\theta_1), (90°,L1,0,θ2−90°)(90°,L_1,0,\theta_2-90°), (−90°,L2,0,θ3)(-90°,L_2,0,\theta_3); note the −90° joint-angle offset that the D–H frame rules force on joint 2. Example C.1 With L1=1.0L_1=1.0 and L2=0.8L_2=0.8, the D–H product at θ=0\theta=0 equals MM, and the two formulas agree to below 1e-12 on 1000 random joint vectors. One detail: applying v=−ω×qv=-\omega\times q to joint 3 gives v3=(0,−L2,0)v_3=(0,-L_2,0), as the book’s text derives, whereas its summary table prints (0,L2,0)(0,L_2,0). The sign matters: with +L2+L_2 the PoE pose differs from the D–H pose by up to 0.9024 in one matrix entry at (20°, 30°, 40°). A randomized cross-check between two independent parametrizations is a cheap way to catch exactly this kind of slip. For n=3n=3 the D–H structure uses 9 numbers, the PoE screws 18 plus MM.

Conditioning near parallel axes. Lynch and Park warn that when adjacent axes are nearly parallel, the common normal can change wildly with small changes in axis orientation, which makes D–H parameters of real, imperfect robots hard to measure and identify. Ill-conditioning Section 5 is our own toy illustration. Axis 1 is the zz-axis; axis 2 passes through (1, 0, 0). When the axes are exactly parallel, a=1.0000a=1.0000 and the common normal can sit at any height. Tilt axis 2 by 1e-3 toward xx and the two axes now intersect far below the origin: aa jumps to 0.0000 and the foot of the normal moves to z=−1000.0z=-1000.0. Tilt it by the same amount toward yy and the axes stay skew, with a=1.0000a=1.0000 and the foot at z=0.0z=0.0. In both cases the PoE screw axis changes by only 0.0010 in its largest entry. A calibration routine fitting D–H parameters near this configuration faces a discontinuous target, while the screw parameters vary smoothly.

The cost of forward kinematics is nn products of 4×4 matrices, linear in the number of joints; the practical concerns are conventions and modelling errors, not speed.

What the forward map does not tell you

The forward map assumes a perfect geometric model. Real arms have manufacturing tolerances, link flexibility, gear backlash and encoder offsets, so the computed pose differs from the true one; calibration estimates corrected parameters, and that is where the choice of parametrization matters (the conditioning example above). Our toy geometry illustrates the mechanism Lynch and Park describe; it is not a calibration study.

D–H tables travel badly. Conventions differ in which axis carries the joint, the order of the four elementary motions and the placement of the homogeneous coordinate (Hartenberg and Denavit’s 1964 matrix puts it first). Before using a published table, recover its frame drawing and test it against one known pose. The common labels for the two popular variants are not used here because neither of our sources defines them.

The PoE preference stated above is Lynch and Park’s view, argued in their book. D–H remains widespread in textbooks, papers and vendor documentation, and both describe the same map when used correctly.

Forward kinematics says nothing about how fast the end-effector moves (the Jacobian; Lynch and Park note that its columns are the configuration-dependent joint screws), which joint values reach a target (inverse kinematics), what torques are needed (robot dynamics), or whether a configuration violates joint limits or collides with something. Closed chains and parallel mechanisms add loop-closure constraints and are only mentioned through Hartenberg and Denavit’s A1A2A3A4=IA_1A_2A_3A_4=I.

Which axis, which frame, which order?

  1. Why does the space-form PoE need screw axes only at the home position, even though the axes move physically when the arm moves?

    Answer: In e[S1]θ1⋯e[Sn]θnMe^{[\mathcal{S}_1]\theta_1}\cdots e^{[\mathcal{S}_n]\theta_n}M the rightmost factor acts first: joint nn moves MM, then joint n−1n-1 moves the result, and so on. When joint ii acts, the joints proximal to it have not moved yet in this ordering, so axis ii is still at its home location in the fixed frame. The body form reverses the argument, with axes in the end-effector frame.

  2. A planar 2R arm has L1=1L_1=1, L2=0.8L_2=0.8. (a) Find (x,y)(x,y) at θ=(30°,45°)\theta=(30°,45°). (b) Write S2\mathcal{S}_2 for joint 2, whose axis is along z^\hat z through (1, 0, 0). (c) Check that e[S2]θe^{[\mathcal{S}_2]\theta} leaves the point (1, 0, 0) fixed.

    Answer: (a) x=cos⁡30°+0.8cos⁡75°=0.8660+0.8⋅0.2588=1.0731x=\cos30°+0.8\cos75°=0.8660+0.8\cdot0.2588=1.0731 and y=sin⁡30°+0.8sin⁡75°=0.5+0.8⋅0.9659=1.2727y=\sin30°+0.8\sin75°=0.5+0.8\cdot0.9659=1.2727, matching the program. (b) ω=(0,0,1)\omega=(0,0,1) and q=(1,0,0)q=(1,0,0) give ω×q=(0,1,0)\omega\times q=(0,1,0), so v=(0,−1,0)v=(0,-1,0) and S2=(0,0,1,0,−1,0)\mathcal{S}_2=(0,0,1,0,-1,0), the program’s −1.00. (c) The point is on the axis, and a zero-pitch screw only rotates about its axis. Algebraically, the image is e[ω]θ(1,0,0)+G(θ)ve^{[\omega]\theta}(1,0,0)+G(\theta)v, where e[ω]θ(1,0,0)=(cos⁡θ,sin⁡θ,0)e^{[\omega]\theta}(1,0,0)=(\cos\theta,\sin\theta,0) and G(θ)v=(1−cos⁡θ,−sin⁡θ,0)G(\theta)v=(1-\cos\theta,-\sin\theta,0); their sum is (1, 0, 0).

  3. Calibrating an arm whose joint-2 and joint-3 axes are nominally parallel and 1 m apart, an engineer finds that between two runs the fitted offset dd jumped from about 0 to about −1000 m and aa dropped from 1 m to 0, while the fitted axis directions differ by only about 0.001 rad. Is the robot broken?

    Answer: Probably not. Near-parallel axes make the common normal ill-defined: a tiny tilt can make the axes intersect far away (a→0a\to0, foot at large ∣d∣|d|) or stay skew with the foot near the origin. The program reproduces this with a 1e-3 tilt (foot at z=−1000z=-1000 or 0), and Lynch and Park name this ill-conditioning. The physical axis barely changed; its screw description moved by only 0.0010. Use a parametrization that varies continuously with the axis, such as screw axes.

  4. You must (i) model a new six-joint arm from a CAD file for simulation, (ii) use an old paper’s table of a,α,d,θa,\alpha,d,\theta for an arm, and (iii) calibrate a robot from measurements. Which representation for each, and what should you watch?

    Answer: (i) PoE: choose any base frame and home pose MM, read each joint’s axis direction and one point from CAD, compute Si\mathcal{S}_i; no link frames are needed. (ii) Keep the D–H table but first establish its convention: which axis carries the joint, and the order of the elementary motions (Lynch and Park’s Rot(x^)⋯Rot(z^)\mathrm{Rot}(\hat x)\cdots\mathrm{Rot}(\hat z) versus the zz-first order of Hartenberg and Denavit’s 1964 matrix). Check it against a known pose, and convert to PoE if needed. (iii) Avoid plain D–H near parallel axes because of the ill-conditioning; a continuous parametrization such as screw axes behaves better.

  5. Show that Rot(x^,α)Trans(x^,a)Trans(z^,d)Rot(z^,ϕ)\mathrm{Rot}(\hat x,\alpha)\mathrm{Trans}(\hat x,a)\mathrm{Trans}(\hat z,d)\mathrm{Rot}(\hat z,\phi) equals Trans(x^,a)Rot(x^,α)Rot(z^,ϕ)Trans(z^,d)\mathrm{Trans}(\hat x,a)\mathrm{Rot}(\hat x,\alpha)\mathrm{Rot}(\hat z,\phi)\mathrm{Trans}(\hat z,d).

    Answer: A rotation about an axis commutes with a translation along the same axis: rotating about x^\hat x leaves the x^\hat x direction unchanged. Swapping the first pair (both about x^\hat x) and the last pair (both about z^\hat z) gives the second expression. Lynch and Park note both swaps.

From a formula to a robot model

Lynch and Park’s Chapter 4 develops the PoE for open chains with worked spatial examples; Appendix C covers D–H frame assignment, the conversion to PoE and their comparison of the two. Chapter 4 and Appendix C Hartenberg and Denavit’s Chapter 12 shows the matrix method in its original setting, closed linkages such as the Hooke joint, and makes a useful contrast in notation. Kinematic synthesis

Lynch and Park’s Chapter 4 summary describes the Universal Robot Description Format (URDF), a file format used by the Robot Operating System and other software for tree-structured robots, including serial chains: its joint entries, each connecting a parent link to a child link, fully specify the kinematics, and its link entries carry inertial properties. URDF Software that reads such a file therefore has everything needed to evaluate the forward map. Whatever the format, two independent computations of the same pose, as in the program above, remain the simplest guard against sign and convention errors.

Make a prediction, then check

While calibrating an arm, the fitted D–H offset d between two nominally parallel joint axes 1 m apart jumps from about 0 to about −1000 m between two runs, while the axes' directions differ by only about 0.001 rad. What is the most reasonable explanation?

Choose one answer

Learning objectives

  • Write the forward kinematics of a serial arm as a map from joint space to SE(3), compute the end-effector pose by trigonometry, by chaining link-frame transforms and by the product of exponentials (space and body forms), and check that they agree.
  • Read and convert a D–H parameter table (frame rules, the four parameters, differing conventions), and explain how D–H relates to PoE and when to prefer each, including minimal parameters versus ill-conditioning near parallel axes.

Prerequisites & connections

Explore related knowledge →

References

  1. Modern Robotics: Mechanics, Planning, and Control — May 2017 preprint, scoped
    Kevin M. Lynch; Frank C. Park · 2017
  2. Kinematic Synthesis of Linkages (McGraw-Hill, 1964), Cornell eCommons KMODDL scan
    Richard S. Hartenberg; Jacques Denavit · 1964

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Claude · 2026-12-03 · Independent AI check (Claude subagent, not the author; not a human or expert review). Before this check the main session had applied style-only edits suggested by the Gemini app to the opening sections (logged in gemini-edits-016a.json); research was done by a separate research subagent (facts.md) and the prose by a writer subagent. I re-ran example.py with the pinned CPython + numpy 1.26.4 interpreter and diffed it against example.stdout.txt (identical), confirmed the python block in en.mdx and zh.mdx is byte-identical to example.py, the recorded-output block matches the stdout, and the seven display equations are identical across languages. I re-derived the planar 3R formulas, the screw axes v = −ω × q and the body axes Ad(M^{-1})S, the Prop. 3.25 closed form, the toy common-normal geometry (a 1e-3 tilt toward x makes the axes meet at z = −1000), and all five exercise answers including the G(θ)v computation in exercise 2. I downloaded the Modern Robotics preprint PDF (May 2017) and re-read by text extraction the Ch. 4 opening (3n + n vs 6n + n parameter counts), §4.1.2 Example 4.1 pp. 143–144 (text and the [S3] matrix give v3 = (0, −L2, 0); the summary table prints (0, L2, 0), as the article states), §4.3 Summary pp. 158–159 (including the URDF bullet), §4.5 p. 160 with bibliography entries [20] Brockett 1983 and [34] Denavit & Hartenberg 1955, and Appendix C pp. 585–596 (frame rules, four parameters, special cases, Fig. C.3, alternative conventions, link transform and swap note, Example C.1 table, C.5 relation to PoE, C.6 ill-conditioning and comparison). I downloaded the Chapter 12 file of the Cornell eCommons scan of Hartenberg & Denavit (1964) and re-read §12-3 pp. 347–355 by OCR, and checked Eq. 12-9 against the rendered page image of p. 353: first row (1, 0, 0, 0), first column (a cos θ, a sin θ, s), rotation block Rot(z, θ)Rot(x, α), as the article states; the six lower pairs, zero/infinite lead, and the closure A1A2A3A4 = I with the Hooke-joint derivation are also as stated. The 1955 paper and Brockett's paper are cited only via the Modern Robotics bibliography and were not read by me either. I compared zh and en section by section and checked data.json (source rows, catalogue IDs, quiz answer). Not checked: Modern Robotics §4.2 body text, Examples 4.3–4.6, other chapters of the 1964 book.

  • Code and output: example.py re-run with the pinned interpreter matches example.stdout.txt exactly; the python blocks in both languages are byte-identical to example.py, and every number in the prose (1.5560, 1.4022, 2.6557, 69.7298°, 0.9024, −1000.0, 0.0010) matches the output.
  • Equations and exercises: the planar 3R formulas, v = −ω × q, body-form screw axes, the Prop. 3.25 closed form, the D–H link transform and its two allowed swaps, the toy common-normal geometry and all five exercise answers re-derived correctly.
  • Sources: Example 4.1's text and [S3] matrix give v3 = (0, −L2, 0) while its summary table prints (0, L2, 0), and the article says exactly this; Hartenberg & Denavit's 1964 Eq. 12-9 was checked against the p. 353 page image and matches the article's description; the 1955 paper and Brockett's paper are cited only via the Modern Robotics bibliography.
  • Bilingual and Gemini edits: zh and en compared section by section; definitions, numbers, exercises and caveats agree. The nine logged Gemini edits are stylistic and change no fact or attribution; one wording that made D–H sound like the multiplication method was restored to its frame-choosing role.

Source locations checked:

  • Modern Robotics: Mechanics, Planning, and Control — May 2017 preprint, scoped · Preprint PDF dated 2017-05-03 fetched 2026-12-03, text extracted with pdftotext; printed page numbers. Checked: Ch. 4 opening pp. 137–140 (FK definition; Eqs. 4.1–4.3 planar 3R; Eq. 4.4–4.5 link-frame product; Eqs. 4.6–4.11 M, S1–S3 and PoE for planar 3R; D–H 3n+n vs PoE 6n+n parameter counts and authors' preference); §4.1, §4.1.1 pp. 140–142 (frames needed; screw axis of revolute/prismatic joint, v = −ω × q; Eq. 4.14 space form; three required elements); §4.1.2 pp. 143–144 (Example 4.1: M, ω_i, q_i, v_i; table lists v3 = (0, L2, 0) while text gives (0, −L2, 0); start of Example 4.2 table); §4.1.3 pp. 148–150 (Eq. 4.16 body form via e^{M^{-1}PM} = M^{-1}e^{P}M; ordering argument); §4.3 pp. 158–159 (summary incl. D–H and PoE statements, URDF bullet); §4.4 p. 159 (FKinBody/FKinSpace); §4.5 p. 160 (D–H in most literature, ref. [34]; PoE from Brockett ref. [20]; Park ref. [132]; differing link-frame conventions); Appendix C pp. 585–596 (C.1 frame rules and four parameters, intersecting/parallel/prismatic cases, ground and end-effector frames; C.2 Fig. C.3 non-representable frames, four is minimum per D&H; alternative conventions; C.3 link transform and step order; C.4 Examples C.1–C.3 tables; C.5 Eqs. C.6–C.15 PoE from D–H; C.6 comparison incl. ill-conditioning near parallel axes); bibliography [20] Brockett 1983 MTNS Beer Sheva, [34] Denavit & Hartenberg 1955 J. Appl. Mech. 23:215–221, [132] Park 1994 IEEE TAC 39(3):643–647. NOT read: Examples 4.3–4.6 in detail, §4.2 URDF text, exercises, Chapters 5–7.
  • Kinematic Synthesis of Linkages (McGraw-Hill, 1964), Cornell eCommons KMODDL scan · Cornell eCommons item d0ec9495-2d37-4a17-888c-43fd7f8a8010 (handle 1813/58640), OCR text bitstreams fetched 2026-12-03: 013_001.pdf.txt (title page, Preface, table of contents — Preface says Chapter 12 summarizes the authors' previous work on matrix analysis of spatial mechanisms; TOC gives §12-3 on p. 347) and 013_013.pdf.txt (Chapter 12). Checked §12-1 pp. 343–344 (spatial linkages hard to visualize; analytic and matrix methods; full matrix method beyond scope, outlined in §12-3) and §12-3 pp. 347–355 (four parameters per connection; pairs, links, open/closed chains; six lower pairs, revolute and prismatic as zero/infinite-lead screws; common perpendicular, axes and parameters a, α, θ, s with Fig. 12-3; symbolic equations 12-3 to 12-8 for planar, spherical four-revolute and Bennett mechanisms; Eq. 12-9 4×4 matrix with first row (1,0,0,0); closure Eq. 12-10 A1A2A3A4 = I; Hooke-joint derivation Eqs. 12-12 to 12-16). OCR garbles Greek letters; matrix layout reconstructed and cross-checked against the a = s = 0 Hooke-joint matrices on p. 354. NOT read: §12-2 details beyond the equation shape, §12-4 to §12-6, chapter bibliography (OCR unreadable), other chapters, and the 1955 J. Applied Mechanics paper.

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.