Nullspace self-motion manifolds

A redundant arm has more joints than the task needs, so many configurations reach the same pose. This page works up to the geometry of that redundancy one step at a time, essentially replicating the explanation from Burdick [1]. Full disclosure this page is GLM 5.2's attempt at converting my original implementation to an interactive webpage, and I just made minor changes.
The star is the end-effector target. Drag it around!

Three links of length $L_1=L_2=L_3=1$ on revolute joints with relative angles $\theta_1,\theta_2,\theta_3$. With $\alpha_i=\theta_1+\cdots+\theta_i$, the end-effector position is

$$ f(\theta)=\Big(\sum_i L_i\cos\alpha_i,\ \sum_i L_i\sin\alpha_i\Big). $$

Before solving inverse kinematics for the three-joint arm, let's look at a simpler case. Now, we can see the two solutions for each target point, elbow up and elbow down.

With the third joint locked, we can once again see only two solutions. When it is free we see infinitely many solutions, forming a 1-dimensional curve in the 3-torus of joint space, called the self-motion manifold of the target. Orbit around the curve to see its structure. (If you see two curves, I'm getting to explaining this soon).

Fix the target and pick $\theta_1$. The wrist (green point) lies on a circle of radius $L_2$ about the shoulder (purple point) and on a circle of radius $L_3$ about the target. Sweeping $\theta_1$ over its feasible range traces the whole curve. When the target is far from the base, the wrist's two circles are tangent at the endpoints of the feasible $\theta_1$ interval, and the elbow-up and elbow-down branches meet there. The manifold is a single closed curve.
For most targets this is a single closed curve, but there can be two of them. Drag the star close to the base, and now the wrist can reach the target at every $\theta_1$, so the elbow-up and elbow-down branches never meet, and the manifold splits into two disjoint loops. You will see the joint-space plot jump from one loop to two.

Okay but why is redundancy even useful? Usually we only need to solve the task-space constraint of reaching: given a target pose, find a configuration that puts the end-effector there. But, because motion along the self-motion manifold does not affect the task-space constraint, we can spend that freedom on a secondary task by using the nullspace of the Jacobian to improve the secondary objective without disturbing the reach.
Here the secondary task is to not collide with the circles. Try placing obstacles onto the arm's links and maximizing clearance iteratively.

References

  1. J. W. Burdick, "On the inverse kinematics of redundant manipulators: characterization of the self-motion manifolds," in Proc. IEEE Int. Conf. Robotics and Automation (ICRA), Scottsdale, AZ, 1989, pp. 264–270, doi: 10.1109/ROBOT.1989.99999.