Skip to content

Arm Playground

Drag a target. The planar arm solves its own inverse kinematics, and you can switch elbows or change link lengths

1. The playground

The arm is a planar 2R chain with its base at the origin. Link lengths are adjustable from 0.5 m to 1.5 m, and both joints can turn through a full revolution. Drag the yellow target anywhere on the canvas; the arm solves the inverse kinematics in closed form. The faint arm is the other elbow branch, and the dashed ring is the reachable annulus.

2. What to notice

  • Most reachable targets have two solutions. Switch the elbow branch and the solid arm jumps to the other side of the base-to-target line while the hand stays put.
  • The workspace is an annulus, not a disk, when the links are unequal. Shrink one link and the hole in the middle grows.
  • At the outer boundary the arm is fully extended. The two branches merge, det J goes to zero, and the readout says singular.
  • A target outside the annulus is clamped to the nearest reachable point. The arm points at the cursor but cannot reach it; the dashed outline shows where the cursor actually was.
  • θ1 and θ2 are joint-space numbers; hand x and y are task-space numbers. The same hand point can correspond to two different pairs.

3. The equations behind it

Forward kinematics adds two link vectors. Inverse kinematics solves the triangle formed by the base, elbow, and hand. The playground uses the closed-form solution, so there is no iteration and no initial guess.

Forward kinematics
Inverse kinematics

The determinant of the Jacobian is L1 L2 sin θ2. It is zero at full extension and at the folded configuration, which is why the readout turns red at the workspace boundary. The playground does not model joint limits, collisions, or torque; those are the next layer of a real robot controller.

4. Related lessons

When you are ready to make the arm move over time, continue with PID control and the state-space lesson. The arm in this playground is a kinematic model; a joint controller is what turns those angles into motion.

Site soundtrack