Inverse Kinematics: Aiming the Arm Backwards
From 'the cup is there' to 'set the joints thus' — a problem with two right answers, regions with none, and places where the arm briefly loses a direction of motion.
Builds on: 4.1 Forward Kinematics: Where Did the Hand Go?
The useful direction is the hard one
Nobody commands a robot arm by angles. Tasks arrive as positions — grasp the cup at (x, y) — and someone must recover the angles that put the hand there: inverse kinematics, IK. For the two-link arm the law of cosines cracks it in closed form:
Read the right side: it only asks how far the target is. Distance dictates elbow bend; the shoulder then swings the bent arm onto the bearing. And notice the crack in the equation: a cosine must live in [−1, 1]. Targets too far (or inside the folded hole) push it outside — the formula itself reports unreachable, the workspace lesson speaking algebra.
Two answers, and sometimes none
cos θ₂ = 0.5 has two answers: θ₂ = +60° and −60°. Geometrically: elbow-up and elbow-down — two mirror poses whose hands land on the identical spot. Neither is wrong; real controllers pick by convention, by obstacle clearance, or by whichever is nearest the current pose (to avoid a wild swing through the workspace mid-task). IK answers are a menu, not a verdict.
Singularities: losing a direction
Stretch the arm fully straight and ask for the hand to move further outward: no joint velocity, however large, produces motion in that direction. The arm has hit a singularity — a pose where it locally loses one direction of movement. Near one, tiny hand motions demand huge joint swings; solvers command frantic speeds, and real arms shudder. Industrial path planners route around singular poses the way sailors route around shoals — the map of them is part of knowing an arm.
Real arms with six joints trade the law of cosines for numerical solvers — but inherit everything else intact: multiple solutions (typically eight), unreachable regions, singular poses. The two-link arm is not a toy; it is the smallest honest specimen of the species.
⚗️ Lab — The Target Range
Drag a target around; the arm solves IK live. Toggle elbow-up/down, and watch the singularity meter as you graze the workspace edges.
- Park the target mid-workspace and flip elbow-up/elbow-down: two honest poses, one hand position.
- Drag the target slowly out past the rim — watch the arm straighten, the meter redline, then the solver give up as cos θ₂ leaves [−1, 1].
- Slide the target along the rim and watch the joints thrash to follow small motions — the shoal the planners avoid.
Work it by hand — 0 / 1
No multiple choice here: compute the value and type it. Suffixes like 2.5k or 20m are understood; answers within ±3% count.