Skip to content
LumenaryAcademy
Motion 75 min

Jacobians, velocity and singularities

One matrix turns joint speeds into tool speeds and tool forces into joint torques — and tells you exactly where an arm goes weak.

Code tested · 5AI-draftedAwaiting review by a roboticist

Your guides: Chloe · The Builder, Margaret · The Experimenter, Gideon · The Safety Engineer

MotivationH

From where to how fast, and how hard

Inverse kinematics told us how to put a tool somewhere. Most tasks also say how it should move and how hard it should push. A robot spraying lacquer on a guitar body in Guangzhou must keep the nozzle moving at a steady 0.20.2 m/s along the curve, or the coat will be uneven. A rehabilitation robot in Lyon guides a patient's hand along a straight line at walking-pace speeds. A polishing arm in Pune must press a pad onto a turbine blade with 1515 N, no more and no less.

All three need two conversions that position-level kinematics does not give: from a desired tool velocity to the joint velocities that produce it, and from a desired tool force to the joint torques that produce it. A single matrix does both, the Jacobian J(q)J(q). It also diagnoses the arm: where JJ loses rank the robot has a singularity, a configuration in which some direction of tool motion is impossible, nearby motions in that direction demand huge joint speeds, and the arm can resist forces in that direction with no motor torque at all.

This lesson derives the Jacobian for planar and spatial arms, computes singularities and the manipulability ellipse, proves the statics relation τ=J⊤F\tau = J^{\top}F, and simulates resolved-rate control, the oldest way of driving a tool along a line, including what goes wrong near a singularity and how damped least squares fixes it.

IntuitionH

Each joint contributes a velocity

Hold an arm still and turn just one joint at 11 rad/s. Everything beyond that joint rotates rigidly about the joint's axis, so the tool tip moves on a circle around the axis: its velocity is perpendicular to the line from the joint to the tip, with magnitude equal to the tip's distance from the axis. Turn a different joint and you get a different velocity. Turn several joints at once and, for small motions, the effects simply add. So the tool velocity is a weighted sum of one vector per joint, weighted by the joint speeds:

x˙=J1(q) q˙1+J2(q) q˙2+⋯+Jn(q) q˙n=J(q) q˙.\dot x = J_1(q)\,\dot q_1 + J_2(q)\,\dot q_2 + \cdots + J_n(q)\,\dot q_n = J(q)\,\dot q .

The vectors JiJ_i are the columns of the Jacobian. Each depends on the configuration qq, because the geometry changes as the arm moves.

J₁ = (−0.65, 0.43) m/sJ₂ = (−0.40, 0)elbowhandshoulder
The two columns of the planar arm's Jacobian at q = (30°, 60°), drawn as velocities of the hand: J₁ is the hand's velocity when only the shoulder turns at 1 rad/s, J₂ when only the elbow turns. Each is perpendicular to the dashed line from its joint to the hand.

Now the key question for control. To move the hand with a chosen velocity x˙\dot x, we need q˙\dot q with Jq˙=x˙J\dot q = \dot x: a linear system, unlike the nonlinear equations of inverse kinematics. That is the great simplification of working with velocities. The catch is visible in the figure: if the arm were straight, both columns would be perpendicular to the same line, so both would point the same way, and no combination of joint speeds could move the hand along the arm. That is a singularity.

DefinitionsH

Definitions

Definition— Jacobian (analytic)

For forward kinematics x=f(q)x = f(q) with q∈Rnq \in \mathbb{R}^n and x∈Rmx \in \mathbb{R}^m (a position, or a position and some orientation coordinates), the analytic Jacobian is the m×nm \times n matrix of partial derivatives Jij(q)=∂fi/∂qjJ_{ij}(q) = \partial f_i / \partial q_j, so that x˙=J(q) q˙\dot x = J(q)\,\dot q.

Definition— twist and geometric Jacobian

The velocity of a rigid body (the tool) is a twist V=(v,ω)∈R6\mathcal{V} = (v, \omega) \in \mathbb{R}^6: the linear velocity vv of a chosen reference point on the body and the body's angular velocity ω\omega, both expressed in a chosen frame. The geometric Jacobian J(q)J(q) is the 6×n6 \times n matrix with V=J(q) q˙\mathcal{V} = J(q)\,\dot q. If joint ii has unit axis ziz_i through the point pip_i and the reference point is pEp_E, its column is

Ji=[zi×(pE−pi)zi] (revolute),Ji=[zi0] (prismatic).J_i = \begin{bmatrix} z_i \times (p_E - p_i) \\ z_i \end{bmatrix} \text{ (revolute)}, \qquad J_i = \begin{bmatrix} z_i \\ 0 \end{bmatrix} \text{ (prismatic)}.

Definition— singular configuration

A configuration qq is singular if J(q)J(q) has rank less than its largest possible rank, min⁡(m,n)\min(m, n), for that arm. At a singular configuration there is a direction of tool motion that no joint velocity produces. For a square Jacobian, qq is singular exactly when det⁡J(q)=0\det J(q) = 0.

Definition— manipulability

The manipulability ellipsoid at qq is the set of tool velocities {Jq˙:∥q˙∥≤1}\{J\dot q : \|\dot q\| \le 1\}. If J=UΣV⊤J = U \Sigma V^\top is the singular value decomposition, its principal axes are the columns uiu_i of UU, with semi-axis lengths equal to the singular values σi\sigma_i. Yoshikawa's manipulability measure is w(q)=det⁡(JJ⊤)=σ1σ2⋯σmw(q) = \sqrt{\det(J J^\top)} = \sigma_1 \sigma_2 \cdots \sigma_m, proportional to the ellipsoid's volume; for a square JJ it equals ∣det⁡J∣|\det J|.

The analytic and geometric Jacobians agree in their linear-velocity rows. They differ in the angular rows: the analytic one differentiates whatever orientation coordinates you chose (roll–pitch–yaw angles, say), while the geometric one gives ω\omega, which is not the derivative of any three angles. As the rotations lesson showed, angle rates and ω\omega are related by a configuration-dependent matrix, which itself becomes singular at gimbal lock. Robotics software almost always means the geometric Jacobian.

Worked examplesH

The planar arm: Jacobian, singularities and ellipses

Differentiate the two-link arm's forward kinematics, writing s1=sin⁡q1s_1 = \sin q_1, c12=cos⁡(q1+q2)c_{12} = \cos(q_1 + q_2) and so on:

J(q)=[∂x∂q1∂x∂q2∂y∂q1∂y∂q2]=[−l1s1−l2s12−l2s12l1c1+l2c12l2c12].J(q) = \begin{bmatrix} \dfrac{\partial x}{\partial q_1} & \dfrac{\partial x}{\partial q_2} \\[2mm] \dfrac{\partial y}{\partial q_1} & \dfrac{\partial y}{\partial q_2} \end{bmatrix} = \begin{bmatrix} -l_1 s_1 - l_2 s_{12} & -l_2 s_{12} \\ l_1 c_1 + l_2 c_{12} & l_2 c_{12} \end{bmatrix}.

The second column is the elbow's contribution: the second link, of length l2l_2, rotated by 90°90°. The first column is the whole arm's tip, rotated by 90°90°. Both match the figure.

Theorem— Singularities of the planar 2R arm

det⁡J(q)=l1l2sin⁡q2\det J(q) = l_1 l_2 \sin q_2. So the arm is singular exactly when q2=0q_2 = 0 (stretched) or q2=πq_2 = \pi (folded), whatever q1q_1 is, and at a singularity the hand cannot move along the line through the shoulder and the hand.

Proof

Expand the determinant: det⁡J=(−l1s1−l2s12) l2c12+l2s12 (l1c1+l2c12)=l1l2(s12c1−s1c12)=l1l2sin⁡((q1+q2)−q1)=l1l2sin⁡q2.\det J = (-l_1 s_1 - l_2 s_{12})\, l_2 c_{12} + l_2 s_{12}\,(l_1 c_1 + l_2 c_{12}) = l_1 l_2 (s_{12} c_1 - s_1 c_{12}) = l_1 l_2 \sin\big((q_1 + q_2) - q_1\big) = l_1 l_2 \sin q_2. With l1,l2>0l_1, l_2 > 0 it vanishes exactly when sin⁡q2=0\sin q_2 = 0. Then the second link is parallel to the first, the tip lies on the line through the shoulder along the arm, and each column (the vector from its joint to the tip, rotated by 90°90°) is perpendicular to that line. So the column space, every achievable hand velocity, is the perpendicular direction only; the radial direction is missing.

∎

This explains the workspace of the previous lesson: singular configurations put the hand exactly on the boundaries r=l1+l2r = l_1 + l_2 and r=∣l1−l2∣r = |l_1 - l_2|, which the hand cannot cross. It also shows that q1q_1 is irrelevant: the shoulder angle merely rotates the whole picture. The code computes the Jacobian, checks it against finite differences, and watches the arm become singular as the elbow straightens.

python
import numpy as np

L1, L2 = 0.5, 0.4

def fk(q):
    return np.array([L1 * np.cos(q[0]) + L2 * np.cos(q[0] + q[1]),
                     L1 * np.sin(q[0]) + L2 * np.sin(q[0] + q[1])])

def jacobian(q):
    s1, c1 = np.sin(q[0]), np.cos(q[0])
    s12, c12 = np.sin(q[0] + q[1]), np.cos(q[0] + q[1])
    return np.array([[-L1 * s1 - L2 * s12, -L2 * s12],
                     [ L1 * c1 + L2 * c12,  L2 * c12]])

# 1. The analytic Jacobian agrees with finite differences.
q = np.radians([30.0, 60.0])
h = 1e-6
J_fd = np.column_stack([(fk(q + h * e) - fk(q - h * e)) / (2 * h) for e in np.eye(2)])
print("J(30 deg, 60 deg) =", np.round(jacobian(q), 4).tolist(),
      f"  max difference from finite differences: {np.abs(jacobian(q) - J_fd).max():.1e}")

# 2. How singular is the arm as the elbow straightens?  (For a square J, w = |det J|.)
print("\n q2 (deg)    det J   sigma_max   sigma_min   condition number")
for q2 in [90, 60, 30, 10, 2, 0]:
    J = jacobian(np.radians([30.0, q2]))
    s = np.linalg.svd(J, compute_uv=False)
    cond = s[0] / s[1] if s[1] > 1e-12 else float("inf")
    print(f"{q2:9d} {np.linalg.det(J):8.4f} {s[0]:11.4f} {s[1]:11.4f} {cond:14.1f}")

# 3. Statics: joint torques that make the hand press down on a table with 20 N.
q = np.radians([-30.0, 75.0])
F = np.array([0.0, -20.0])                    # force the hand applies to the table (N)
tau = jacobian(q).T @ F
print("\nhand at", np.round(fk(q), 3), "m, pressing with F =", F, "N")
print("joint torques tau = J^T F =", np.round(tau, 3), "N m")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The determinant column is 0.2sin⁡q20.2 \sin q_2, as the theorem says. The condition number σmax⁡/σmin⁡\sigma_{\max}/\sigma_{\min} is the more useful warning light: it measures how lopsided the arm's abilities are, and it climbs from 2.42.4 at a right-angled elbow to 138.9138.9 at q2=2°q_2 = 2°.

The singular values have a picture. A unit ball of joint velocities maps to an ellipse of hand velocities, the manipulability ellipse, with semi-axes σ1u1\sigma_1 u_1 and σ2u2\sigma_2 u_2. As the elbow straightens, the ellipse flattens into a line segment perpendicular to the arm.

q₂ = 90°, w = 0.200q₂ = 45°, w = 0.141q₂ = 10°, w = 0.035
Manipulability ellipses of the same arm at three elbow angles, drawn at the hand (scaled for visibility). At q₂ = 90° the hand moves reasonably in every direction; at q₂ = 10° the ellipse is almost a line: the hand can move sideways but hardly along the arm.

Manipulability is a design tool as well as a warning. For this arm w=l1l2∣sin⁡q2∣w = l_1 l_2 |\sin q_2| is largest at q2=±90°q_2 = \pm 90°, and for a fixed total length l1+l2l_1 + l_2 its largest possible value, l1l2l_1 l_2, comes with equal links; Yoshikawa remarked that human upper arms and forearms are roughly equal too. Designers map ww (or the condition number) over the workspace to place a robot so that its usual tasks sit in well-conditioned regions.

A spatial arm and its three classic singularities

For a six-axis arm, the geometric Jacobian is built column by column from the frames that forward kinematics already computes: for revolute joint ii, take its axis ziz_i and a point pip_i on it from 0Ti{}^{0}T_{i}, and form (zi×(pE−pi), zi)(z_i \times (p_E - p_i),\ z_i). The code below describes a six-axis arm with a spherical wrist by a standard Denavit–Hartenberg table, as in forward kinematics: each joint turns about its own zz axis, followed by a fixed offset to the next joint. It is a simplified cousin of that lesson's Lumen-6, without the small shoulder and elbow offsets, so that its singularities sit at angles that are easy to state. The code builds JJ column by column, checks it against finite differences of the pose, and finds the singularities.

python
import numpy as np

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

def fixed(d, a, alpha):
    """The fixed offset after a joint (one standard DH row): up d along z, out a along x, twist alpha about x."""
    c, s = np.cos(alpha), np.sin(alpha)
    return np.array([[1, 0, 0, a], [0, c, -s, 0], [0, s, c, d], [0, 0, 0, 1.0]])

# A six-axis arm with a spherical wrist: shoulder 0.40 m up, upper arm 0.45 m, forearm 0.40 m, flange 0.08 m.
OFFSETS = [fixed(0.40, 0, np.pi / 2), fixed(0, 0.45, 0), fixed(0, 0, np.pi / 2),
           fixed(0.40, 0, -np.pi / 2), fixed(0, 0, np.pi / 2), fixed(0.08, 0, 0)]

def frames(q):
    """Poses 0T0 ... 0T6; joint i+1 turns about the z axis of frame i."""
    T, out = np.eye(4), [np.eye(4)]
    for qi, F in zip(q, OFFSETS):
        T = T @ rot_z(qi) @ F
        out.append(T)
    return out

def geometric_jacobian(q):
    Ts = frames(q)
    p_e = Ts[-1][:3, 3]
    cols = []
    for i in range(6):                         # every joint is revolute
        z, p = Ts[i][:3, 2], Ts[i][:3, 3]
        cols.append(np.concatenate([np.cross(z, p_e - p), z]))
    return np.column_stack(cols)               # rows: v_x, v_y, v_z, w_x, w_y, w_z

def numeric_twist_jacobian(q, h=1e-6):
    """Finite differences: linear velocity from d(p)/dq, angular from dR R^T."""
    J = np.zeros((6, 6))
    for j in range(6):
        dq = np.zeros(6)
        dq[j] = h
        Tp, Tm = frames(q + dq)[-1], frames(q - dq)[-1]
        J[:3, j] = (Tp[:3, 3] - Tm[:3, 3]) / (2 * h)
        W = (Tp[:3, :3] - Tm[:3, :3]) / (2 * h) @ frames(q)[-1][:3, :3].T   # skew-symmetric
        J[3:, j] = [W[2, 1], W[0, 2], W[1, 0]]
    return J

q = np.radians([20.0, 50.0, -30.0, 40.0, 60.0, 10.0])
print("geometric vs numerical Jacobian, max difference:",
      f"{np.abs(geometric_jacobian(q) - numeric_twist_jacobian(q)).max():.1e}")
shoulder_q3 = np.pi / 6 + np.arccos(-0.45 * np.cos(np.pi / 3) / 0.40)   # puts the wrist centre on axis 1
for name, qq in [("ordinary pose", q),
                 ("wrist: q5 = 0", np.radians([20, 50, -30, 40, 0, 10])),
                 ("elbow: arm stretched", np.radians([20, 50, 90, 40, 60, 10])),
                 ("shoulder: wrist over axis 1", np.array([0.35, np.pi / 3, shoulder_q3, 0.7, 1.0, 0.2]))]:
    J = geometric_jacobian(qq)
    U, s, Vt = np.linalg.svd(J)
    print(f"{name:28} rank {np.linalg.matrix_rank(J, tol=1e-9)}   singular values {np.round(s, 3)}")
    if s[-1] < 1e-9:
        print(f"{'':28} joint motion that moves nothing: {np.round(Vt[-1] * np.sign(Vt[-1][np.argmax(abs(Vt[-1]))]), 3) + 0.0}")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The two Jacobians agree to about 10−1010^{-10}. Then each of the three classic singularities of a six-axis arm drops the rank to 5, and the last row of V⊤V^\top names the joint motion that moves nothing:

  • Wrist singularity (q5=0q_5 = 0): the axes of joints 4 and 6 line up, so turning them equally in opposite directions, (0,0,0,−0.707,0,0.707)(0, 0, 0, -0.707, 0, 0.707), leaves the tool still. It occurs anywhere in the workspace, which makes it the one programmers meet most often, typically when a straight-line move points the tool along the forearm.
  • Elbow singularity: the arm is fully stretched, the spatial version of q2=0q_2 = 0 in the planar arm, at the boundary of the workspace.
  • Shoulder singularity: the wrist centre lies on the axis of joint 1. Turning the base then only spins the wrist centre in place, and a combination of base and wrist motion leaves the tool still.
ExplanationH

Statics: τ = Jᵀ F

The Jacobian also converts forces. Suppose the tool presses on the world with a force FF (or, in 3-D, a wrench: a force and a moment), and the arm is at rest. What joint torques τ\tau hold it there?

Theorem— Statics of a serial arm

If an arm in static equilibrium exerts the wrench FF on its environment, ignoring gravity and friction in the arm, the joint torques (forces, for prismatic joints) are τ=J(q)⊤F\tau = J(q)^\top F, where JJ is the Jacobian whose twist uses the same reference point and frame as FF.

Proof

Use conservation of power. Imagine any small joint velocity q˙\dot q about the equilibrium. The power the motors put in is τ⊤q˙\tau^\top \dot q. The power the tool delivers to the environment is F⊤V=F⊤Jq˙F^\top \mathcal{V} = F^\top J \dot q. In static equilibrium with no losses and no change in kinetic energy, the two must be equal for every q˙\dot q: τ⊤q˙=F⊤Jq˙\tau^\top \dot q = F^\top J \dot q. A linear function that vanishes for every q˙\dot q has zero coefficients, so τ⊤=F⊤J\tau^\top = F^\top J, that is τ=J⊤F\tau = J^\top F.

∎

This is the principle of virtual work, the same tool that gives Lagrange's equations in classical mechanics. In the code above, the hand at (0.716,0.033)(0.716, 0.033) m presses down on a table with 2020 N, and τ=J⊤F=(−14.317,−5.657)\tau = J^\top F = (-14.317, -5.657) N·m. The physics is checkable by hand: a vertical force produces a torque equal to the force times the horizontal distance to the joint. The hand is 0.7160.716 m to the right of the shoulder and 0.2830.283 m to the right of the elbow, and 20×0.716=14.3220 \times 0.716 = 14.32, 20×0.283=5.6620 \times 0.283 = 5.66. The minus signs say that the motors push clockwise, downwards.

The theorem has three consequences that engineers use daily.

  1. Singular directions carry load for free. If J⊤u=0J^\top u = 0, a force along uu needs no torque at all: the structure takes it. A stretched arm resists a push along its length with its bones, not its muscles; you lock your knees when you stand still for the same reason. The force ellipsoid {F:∥J⊤F∥≤1}\{F : \|J^\top F\| \le 1\} has the same axes uiu_i as the velocity ellipsoid but semi-axes 1/σi1/\sigma_i: where the arm is fast, it is weak, and where it is slow, it is strong, like a gearbox.
  2. Torque sensing becomes force sensing. Inverting the relation, F=(J⊤)+τF = (J^\top)^{+}\tau estimates the contact force from measured joint torques. Collaborative arms with torque sensors in every joint, and others that estimate torque from motor currents, use this to detect a collision with a person and stop.
  3. Redundant arms have internal torques. If n>mn > m, torques in the null space of J⊤J^\top produce no tool force: the arm can stiffen or relax its posture without changing what it pushes on.

Gravity on the arm itself adds its own torques, g(q)g(q), which the next lesson computes; a payload of mass mm held at the tool needs the extra torque Jv⊤(0,0,mg0)J_v^\top (0, 0, m g_0), where JvJ_v is the linear-velocity part of JJ, the world frame has zz up and g0=9.81g_0 = 9.81 m/s²: the arm pushes up on the payload with a force equal to its weight.

ComputationC

Resolved-rate control, and what singularities do to it

In 1969 Daniel Whitney proposed controlling an arm directly in task space by solving the velocity equation at every control tick: given the desired tool velocity x˙d\dot x_d, command q˙=J(q)−1x˙d\dot q = J(q)^{-1}\dot x_d, and add a little feedback on the position error to stop drift,

q˙=J(q)−1(x˙d+K (xd−x)).\dot q = J(q)^{-1}\big(\dot x_d + K\,(x_d - x)\big).

This resolved-rate control is still how many robots are jogged with a joystick or teach pendant in "Cartesian mode", and how teleoperated and visual-servoing systems turn a desired motion into joint commands. It is also numerical IK from the previous lesson run in real time: each tick is one Newton step towards a moving target.

Near a singularity the inverse explodes. To see it, simulate an operator who pushes the hand outwards along a ray at 0.10.1 m/s, from 0.450.45 m to 0.950.95 m from the shoulder, and back again, although the arm reaches only 0.90.9 m. Compare the plain inverse with damped least squares, q˙=J⊤(JJ⊤+λ2I)−1(x˙d+K(xd−x))\dot q = J^\top (J J^\top + \lambda^2 I)^{-1}(\dot x_d + K(x_d - x)), for several λ\lambda.

python
import numpy as np

L1, L2 = 0.5, 0.4

def fk(q):
    return np.array([L1 * np.cos(q[0]) + L2 * np.cos(q[0] + q[1]),
                     L1 * np.sin(q[0]) + L2 * np.sin(q[0] + q[1])])

def jacobian(q):
    s1, c1, s12, c12 = np.sin(q[0]), np.cos(q[0]), np.sin(q[0] + q[1]), np.cos(q[0] + q[1])
    return np.array([[-L1 * s1 - L2 * s12, -L2 * s12], [L1 * c1 + L2 * c12, L2 * c12]])

# An operator pushes the hand outwards along a ray at 30 degrees at 0.1 m/s for 5 s, then back:
# 0.45 m -> 0.95 m -> 0.45 m from the shoulder. The arm reaches only 0.9 m.
u = np.array([np.cos(np.pi / 6), np.sin(np.pi / 6)])
def desired(t):
    if t <= 5.0:
        return (0.45 + 0.1 * t) * u, 0.1 * u
    return (0.95 - 0.1 * (t - 5.0)) * u, -0.1 * u

def run(lam, dt=0.002, T=10.0, k=5.0):
    x0, _ = desired(0.0)
    q2 = np.arccos((x0 @ x0 - L1**2 - L2**2) / (2 * L1 * L2))          # elbow-down start
    q = np.array([np.arctan2(x0[1], x0[0]) - np.arctan2(L2 * np.sin(q2), L1 + L2 * np.cos(q2)), q2])
    peak_speed = worst_error = 0.0
    flipped = False
    for n in range(int(round(T / dt)) + 1):
        xd, vd = desired(n * dt)
        command = vd + k * (xd - fk(q))           # feed-forward velocity plus a little feedback
        J = jacobian(q)
        if lam == 0.0:
            qdot = np.linalg.solve(J, command)    # plain resolved rate: J^-1
        else:
            qdot = J.T @ np.linalg.solve(J @ J.T + lam**2 * np.eye(2), command)
        reachable = xd * min(1.0, (L1 + L2) / np.linalg.norm(xd))   # closest point the arm can reach
        peak_speed = max(peak_speed, np.abs(qdot).max())
        worst_error = max(worst_error, np.linalg.norm(reachable - fk(q)))
        flipped = flipped or q[1] < 0                 # crossed to the elbow-up branch?
        q = q + dt * qdot
    return peak_speed, worst_error, flipped

print("method              peak joint speed   worst error   elbow flipped")
for lam in (0.0, 0.05, 0.1, 0.2):
    name = "plain J^-1" if lam == 0 else f"DLS lambda = {lam}"
    peak, err, flip = run(lam)
    print(f"{name:18} {peak:12.2f} rad/s {err:11.3f} m   {'yes' if flip else 'no'}")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The plain inverse commands a peak joint speed of about 457457 rad/s, some seventy revolutions per second, as the arm approaches full stretch; it overshoots straight through the singularity and comes out on the other elbow branch. On a real robot the drives would saturate or trip, and if they did not, an arm whipping its elbow over at full speed is exactly the kind of motion that safety systems exist to stop. Damped least squares keeps the peak to 3.033.03, 1.421.42 and 0.750.75 rad/s for λ=0.05\lambda = 0.05, 0.10.1 and 0.20.2, never flips the elbow, and pays with a tracking error of 44 to 55 cm while the operator asks for the impossible: the hand lags inside the reachable region instead of chasing an unreachable point.

The table also shows that λ\lambda is a genuine trade-off. Small damping lets the arm get very close to full stretch, from where it recovers slowly, because exactly at the singularity the radial direction has zero gain; large damping keeps the arm well away from it but tracks less accurately everywhere near the boundary. Practical controllers therefore use variable damping, with λ\lambda zero when the smallest singular value is comfortably large and rising smoothly as it falls below a threshold, and they clip joint speeds to the drives' limits whatever the formula says.

ExplanationH

Jacobians in professional software

Every robotics library computes Jacobians, and the first thing to learn about each is its conventions, because a twist means nothing until you say which point's velocity and which frame it is expressed in.

  • Pinocchio computes all joint Jacobians in one pass and offers each frame's Jacobian in three conventions: LOCAL (velocity of the frame's origin, expressed in the frame itself, the body Jacobian), WORLD (the spatial Jacobian, whose linear part is the velocity of the point of the body that is passing through the world origin), and LOCAL_WORLD_ALIGNED (velocity of the frame's origin, expressed along world axes), which matches the geometric Jacobian of this lesson.
  • Drake's MultibodyPlant.CalcJacobianSpatialVelocity takes the frame of the moving body, the point on it, the frame to measure relative to, and the frame to express the result in, all as explicit arguments.
  • MuJoCo provides mj_jac, mj_jacBody and mj_jacSite, returning separate translational and rotational 3×nv3 \times n_v blocks in world coordinates.
  • KDL has ChainJntToJacSolver for serial chains.

With Pinocchio, the manipulability of a tool frame takes a few lines. It is shown, not run here, since it needs Pinocchio and a robot model:

python
import numpy as np
import pinocchio as pin

model = pin.buildModelFromUrdf("my_arm.urdf")
data = model.createData()
tool = model.getFrameId("tool0")

q = pin.neutral(model)
pin.computeJointJacobians(model, data, q)            # every joint Jacobian, in one pass
pin.updateFramePlacements(model, data)
J = pin.getFrameJacobian(model, data, tool, pin.LOCAL_WORLD_ALIGNED)   # 6 x nv
sigma = np.linalg.svd(J[:3], compute_uv=False)       # translational part only: one unit
print("manipulability", np.prod(sigma), "condition", sigma[0] / sigma[-1])

Beyond hand-written formulas, libraries also differentiate kinematics automatically: Pinocchio can be used with CasADi, Drake has its own automatic-differentiation scalar type, and MuJoCo's JAX version (MJX) differentiates through the whole simulator. This matters for optimisation-based planning and for learning, which need derivatives of many quantities, not just of the tool position.

In industry, Jacobians run inside every robot controller: for Cartesian jogging, for linear and circular moves, for force control, and for safety. Controllers monitor tool and elbow speeds as well as joint speeds, because near singularities modest tool speeds hide large joint speeds; safety standards for industrial robots, such as ISO 10218, specify safety-rated speed monitoring for robots that work alongside people. In research, manipulability and its relatives guide the placement of robots in work cells, the design of new arms, the choice of postures for redundant arms and humanoids, and the "dexterity" terms in grasp and motion optimisation.

Common misconceptionsH

Common misconceptions

Misconception

"At a singularity the robot cannot move." It loses one or more directions of tool motion, not all of them. The stretched planar arm can still move its hand sideways; the wrist-singular six-axis arm can still move its tool in five independent ways. The danger is in trying to move in, or near, the lost direction.

Misconception

"A small determinant means the arm is nearly singular." The determinant depends on units and on the arm's size: the same arm measured in millimetres has a determinant a million times larger. Use the smallest singular value relative to the largest (the inverse condition number), with consistent units, to judge closeness to a singularity.

Misconception

"The Jacobian is a property of the robot." It is a property of the robot in a configuration, for a chosen reference point, expressed in a chosen frame. Two libraries can return different matrices for the same arm and both be right. Mixing conventions, such as a body-frame Jacobian with a world-frame target velocity, is one of the commonest bugs in robot code.

Misconception

"The Jacobian transpose is roughly its inverse." The update Δq=αJ⊤e\Delta q = \alpha J^\top e is gradient descent on 12∥e∥2\tfrac12\|e\|^2, and it converges (slowly) without inverting anything, which is why it is popular in animation. But J⊤J^\top is not J−1J^{-1}: it scales directions by σi\sigma_i instead of 1/σi1/\sigma_i. The real relation between them is duality: JJ maps velocities forwards, and J⊤J^\top maps forces backwards.

Exercises

Exercises

1. Jacobians, velocity and singularities

Warm-upHuman

A planar two-link arm has l1=50l_1 = 50 cm and l2=40l_2 = 40 cm. At the configuration q1=70°q_1 = 70°, q2=30°q_2 = 30°, what is det⁡J\det J, in cm² (with lengths in centimetres and angles in radians)?

2. Jacobians, velocity and singularities

Warm-upHuman

For a planar two-link arm with l1=0.5l_1 = 0.5 m and l2=0.4l_2 = 0.4 m, which configurations are singular? Select all that apply.

Choose all that apply

3. Jacobians, velocity and singularities

CoreHuman

The arm (l1=0.5l_1 = 0.5 m, l2=0.4l_2 = 0.4 m) is stretched out horizontally, q=(0,0)q = (0, 0), and its hand presses straight down on a scale with a force of 2020 N, so F=(0,−20)F = (0, -20) N. Ignoring the arm's own weight, what is the magnitude of the shoulder torque, in N·m?

4. Jacobians, velocity and singularities

CoreComputational

Write planar_jacobian(lengths, q) returning the 2×n2 \times n Jacobian of the tip position of a planar arm with nn revolute joints. lengths[i] is the length of link i, and q[i] is the angle of joint i relative to the previous link, so link i points at the absolute angle ai=q0+⋯+qia_i = q_0 + \cdots + q_i.

The tests compare your matrix with finite differences for arms of 1 to 5 links.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

5. Jacobians, velocity and singularities

CoreComputational

The starter computes joint velocities by the plain inverse, which fails at singular configurations and does not work at all for non-square Jacobians. Rewrite dls_velocity(J, xdot, lam) to return the damped least-squares joint velocity

q˙=J⊤(JJ⊤+λ2I)−1x˙,\dot q = J^\top\left(J J^\top + \lambda^2 I\right)^{-1}\dot x,

which minimises ∥Jq˙−x˙∥2+λ2∥q˙∥2\|J\dot q - \dot x\|^2 + \lambda^2\|\dot q\|^2. It must reduce to the inverse when lam = 0 and JJ is invertible, stay finite at singularities, and work for a redundant 2×32 \times 3 Jacobian.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

6. Jacobians, velocity and singularities

CoreHuman

A six-axis arm with a spherical wrist has q5=0q_5 = 0, so the axes of joints 4 and 6 are collinear. Which statement is true?

Choose one

7. Jacobians, velocity and singularities

Warm-upHuman

For the planar two-link arm, at which elbow angle q2q_2 between 0°0° and 180°180° is the manipulability w=∣det⁡J∣w = |\det J| largest? Give the angle in degrees.

Further reading and resources