Numerical Inverse Kinematics
Most robot arms have no neat formula for inverse kinematics. Instead the solver starts from a guess and improves it: measure how far the hand is from the target, use the Jacobian to work out a joint change that reduces the gap, and repeat until close enough.
Click anywhere to set a target. Try one just out of reach.
The update
With hand error \(\mathbf{e} = \mathbf{x}_{\text{target}} - \mathbf{x}(\boldsymbol\theta)\), each iteration changes the joints by
What to notice
For a target well inside the workspace, both methods converge in a few steps, and the error plot drops fast. Click just outside the reach. The arm stretches out straight, the Jacobian becomes nearly singular, and the pseudoinverse asks for huge joint changes, so the arm whips around wildly. Damped least squares adds \(\lambda\) to keep the steps bounded: it settles at the closest reachable point. A larger \(\lambda\) is safer but slower to converge.
This arm has three joints for a two-number target, so there are infinitely many answers. Both methods pick the one that needs the smallest joint change from the current pose.