When a surgeon's robotic assistant threads a suture through a 2 mm loop, or a car-body welding robot traces a seam at 1.2 m/s, neither is running a lookup table of poses. Both rely on two reciprocal transformations that sit at the heart of robotics: forward kinematics (joint angles → Cartesian pose) and inverse kinematics (desired pose → joint angles). Getting them right — and knowing when they break down — is the difference between a robot that works and one that destroys itself at a singularity.
Forward Kinematics and the Denavit-Hartenberg Convention
A serial robot arm is a kinematic chain: a sequence of rigid links connected by joints. Each joint has one degree of freedom — either a revolute (rotation) or prismatic (translation) joint. To describe the pose (position + orientation) of every link relative to the previous one, roboticists use the Denavit-Hartenberg (DH) parameterisation, introduced by Jacques Denavit and Richard Hartenberg in 1955.
Each link-to-link transformation is captured by exactly four parameters:
- θi — joint angle (rotation about zi−1)
- di — link offset (translation along zi−1)
- ai — link length (translation along xi)
- αi — link twist (rotation about xi)
The homogeneous transformation matrix from frame i−1 to frame i is the product of four elementary transformations:
Ti = Rotz(θi) · Transz(di) · Transx(ai) · Rotx(αi)For an n-joint arm, the end-effector pose in the base frame is the product of all link matrices:
T0n = T1 · T2 · … · Tn
Each Ti is a 4×4 matrix containing a
3×3 rotation block and a 3×1 translation vector, all in
homogeneous coordinates. Forward kinematics is therefore a closed-form
matrix multiplication — fast, exact, and always has a unique
answer for a given set of joint angles.
Why homogeneous coordinates? Stacking a 3D rotation (3×3) and translation (3×1) into a single 4×4 matrix lets you compose an arbitrary chain of rigid-body transformations with ordinary matrix multiplication, rather than mixing additions and multiplications. Every robotics library, from ROS 2 to Drake, uses this convention internally.
Inverse Kinematics via the Jacobian Transpose
Forward kinematics is easy; inverse kinematics (IK) is hard. Given a
desired end-effector position and orientation
xd, find the joint angles
q such that f(q) = xd, where
f is the forward kinematic map. The problem is generally
non-linear and may have zero, one, or infinitely many solutions.
The most widely used numerical approach is based on the
Jacobian matrix J(q), which maps joint
velocities to end-effector velocities:
The Jacobian is an m×n matrix where
m is the number of task-space dimensions (typically 6 for
3D position + orientation) and n is the number of joints.
Each column Ji describes how joint
i contributes to end-effector motion.
The Jacobian transpose method iterates towards the goal using a gradient-descent-style update:
Δq = α JT(q) Δx
where Δx = xd − f(q) is the
Cartesian error and α is a step-size gain. This
update is computationally cheap — it avoids inverting
J — but converges slowly near solutions and can
oscillate without careful damping. A more robust alternative is the
damped least-squares (DLS) pseudoinverse:
The damping factor λ prevents large joint
velocities near singularities where JJT would
otherwise approach zero determinant.
Joint Limits and Clamping
Every physical robot has joint angle limits — mechanical stops beyond which the arm cannot rotate without damage. After each IK iteration, the updated joint angles must be clamped:
// Pseudocode — clamp each joint after update
for i in 0..n_joints:
q[i] = q[i] + delta_q[i]
q[i] = clamp(q[i], q_min[i], q_max[i])
Naive clamping can create solver stall: the target requires a joint to exceed its limit, so the arm reaches the boundary and stops converging. More sophisticated approaches use null-space projection to exploit the arm's redundancy (when n > m) to satisfy secondary objectives — such as keeping joints near their centre range — without affecting the primary end-effector goal.
Singularities, Workspace Boundaries, and Condition Numbers
A kinematic singularity occurs when the Jacobian
loses rank — when two or more joint axes become collinear, or
when the arm is fully extended or fully folded. At a singularity, the
end-effector loses the ability to move in one or more Cartesian
directions, no matter how fast the joints spin. The determinant of
JJT drops to zero:
A practical measure of how close the arm is to a singularity is the manipulability index, introduced by Tsuneo Yoshikawa in 1985:
w(q) = √det(J(q) JT(q))
When w → 0, small Cartesian errors demand huge
joint velocities, saturating actuators and causing erratic motion.
Control strategies that keep w above a threshold
— or use DLS with an adaptive λ that
increases as w decreases — avoid the worst
effects.
Workspace Boundaries
The reachable workspace is the set of all end-effector positions attainable for any combination of joint angles. For a planar two-link arm with link lengths l1 and l2, the reachable workspace is an annulus:
|l1 − l2| ≤ r ≤ l1 + l2
The outer boundary (r = l1 + l2)
is a singular configuration (fully extended). The inner boundary is
also singular (fully folded). In 3D, joint limits carve further
cavities out of this space, leaving a dexterous workspace
— the subset of positions that can be reached with full
orientation freedom — which is typically much smaller than the
reachable workspace.
Rule of thumb: for a 6-DOF serial arm, the dexterous workspace is roughly a sphere of radius 0.5×(l1 + l2 + …) centred not at the base but at the "shoulder" of the kinematic chain. Industrial arms are typically mounted slightly elevated and angled precisely to place the workpiece inside this sphere.
Wrist Singularity: A Concrete Example
The most infamous singularity in 6-DOF arms is the
wrist singularity, which occurs when joints 4 and 6 become
collinear (the wrist is straight). In this configuration the arm
loses one rotational degree of freedom; trying to pass through it
causes joints 4 and 6 to spin at very high speed in opposite
directions to achieve what would otherwise be a tiny Cartesian
rotation. Industrial robot controllers detect this condition via the
condition number of J and either halt motion or
automatically reroute the path to avoid the configuration.
Try It Yourself
The following mysimulator.uk simulations let you explore these concepts interactively. Drag the sliders, watch the matrices update in real time, and deliberately drive the arm into a singularity to see what happens.
As you explore the robot kinematics simulation, try these experiments:
- Set all DH link twists
αi = 0to create a planar arm, then verify the annular workspace boundary analytically. - Drive joint 5 of a 6-DOF arm to 0° and watch the manipulability index collapse towards zero as the wrist singularity is approached.
- In the IK sim, compare how quickly each solver converges when the target is placed near the workspace boundary versus near the centre of the dexterous workspace.
Closing Thought
Robot kinematics is a field where elegant mathematics meets brutal physical reality. The DH convention is a beautiful compression of rigid-body geometry into four numbers per joint. The Jacobian bridges joint space and Cartesian space with a single matrix. Yet both break down precisely where you need them most — at singularities and workspace limits — which is why practical IK solvers are never just the textbook formula. They are the textbook formula plus decades of engineering around its failure modes.
Understanding why the maths fails — and not merely that it does — is what separates a robotics programmer from a robotics engineer. The next time you see a robotic arm pause mid-path and reroute itself, you will know it just avoided a singularity that the controller detected via a falling manipulability index. That small pause is the Jacobian saving the wrist motors.