30 min

Workspace and reachability: what the arm can actually touch

The set of poses an arm can reach is a ring with a hole in it, joint limits carve pieces out of it, and reaching a point is a different question from reaching it facing the right way.

Where you are. You can compute where the 2-link arm’s fingertip goes for any pair of joint angles. This lesson asks the reverse question one step early: which points can it get to at all, and how many of those are actually useful.

String, pencil, bench

You have bolted an arm to a bench. The datasheet says its reach is 1.70.

So take a piece of string 1.70 long, pin one end at the base of the arm, tie a pencil to the other, and sweep a circle onto a sheet of paper taped to the bench. That circle is where you plan to put the parts bin, the fixture, and the camera stand.

Now do the honest version. Tape a fresh sheet down. Drive the arm to a few hundred joint angles at random and mark the paper wherever the gripper tip ends up. Come back in twenty minutes and look at what you have.

It is not a disc. There is a hole punched in the middle: a region near the arm’s own base, well inside your string circle, where no combination of joint angles will put the gripper. And along the rim, where you had planned to put the far corner of the bin, every mark comes from an arm that is dead straight; you will discover over the next two lessons that this is the worst place on the bench to ask the arm to move.

Two sheets of paper, same machine, and the datasheet number was true and useless.

The idea in one paragraph

The workspace of a robot is the set of poses it can reach: the image of forward kinematics over every joint configuration the machine allows. For the 2-link planar arm this is an annulus, a flat ring, whose outer edge is the arm fully extended and whose inner edge is the arm folded back on itself. Joint limits erode it, and which joint you clamp determines whether you lose a ring of area or a whole wedge of directions. And the whole question has a second, sharper version that catches people out: the set of points the gripper can touch is much larger than the set of points it can touch while facing the way you need. Every failure mode of inverse kinematics, which is two lessons away, is a case of asking for something outside one of these sets.

Why it is a ring

Take the forward kinematics from the last lesson and ask only how far the fingertip is from the base. Square and add:

x2+y2=(l1cosθ1+l2cos(θ1+θ2))2+(l1sinθ1+l2sin(θ1+θ2))2=l12+l22+2l1l2[cosθ1cos(θ1+θ2)+sinθ1sin(θ1+θ2)]=l12+l22+2l1l2cosθ2\begin{aligned} x^2 + y^2 &= \bigl(l_1\cos\theta_1 + l_2\cos(\theta_1+\theta_2)\bigr)^2 + \bigl(l_1\sin\theta_1 + l_2\sin(\theta_1+\theta_2)\bigr)^2 \\ &= l_1^2 + l_2^2 + 2\,l_1 l_2 \left[\cos\theta_1\cos(\theta_1+\theta_2) + \sin\theta_1\sin(\theta_1+\theta_2)\right] \\ &= l_1^2 + l_2^2 + 2\,l_1 l_2 \cos\theta_2 \end{aligned}

The bracket collapses because cosAcosB+sinAsinB=cos(BA)\cos A\cos B + \sin A\sin B = \cos(B - A), and here BAB - A is just θ2\theta_2. So:

r2=l12+l22+2l1l2cosθ2r^2 = l_1^2 + l_2^2 + 2\,l_1 l_2 \cos\theta_2

Read it in words: the distance from the base depends on the elbow angle alone. θ1\theta_1 has vanished from the equation entirely, which makes sense the moment you see it - turning the shoulder swings the whole arm about the base like a hand on a clock, and swinging something about a point does not change its distance from that point.

outer rim: arm straight · r = l1 + l2 = 1.70 inner rim: arm folded · r = |l1 - l2| = 0.30 θ2 = 0 θ2 = 180° folds back along link 1 base r² = l1² + l2² + 2 l1 l2 cos θ2 how far out you reach depends on the elbow alone θ1 does not appear: it only spins the picture θ2 = 0 → r = 1.70 θ2 = 180° → r = 0.30 everything between is reachable, and reachable twice ring area = 4π l1 l2 = 8.80 square units
The reachable set of a two-link planar arm is a ring: the outer rim is where the arm is straight, the inner rim is where it is folded back on itself, and the distance from the base depends only on the elbow angle

Wider than the screen; scroll it sideways.

That leaves a one-dimensional question. Cosine runs from +1 to -1, so rr runs between two values:

  • θ2=0\theta_2 = 0, cosine at +1, arm dead straight: r=l1+l2r = l_1 + l_2. With our links, 1.70. The outer rim.
  • θ2=180\theta_2 = 180^{\circ}, cosine at -1, link 2 folded straight back along link 1: r=l1l2r = |l_1 - l_2|. With our links, 0.30. The inner rim.

Everything between is reachable, and θ1\theta_1 spins that whole picture around the base, so the reachable set is the full ring.

The area of that ring is π((l1+l2)2(l1l2)2)\pi\bigl((l_1+l_2)^2 - (l_1-l_2)^2\bigr), which simplifies to 4πl1l24\pi\,l_1 l_2. Two consequences worth carrying. First, our arm’s usable area is 8.80 square units, against 9.08 for the whole disc inside the outer rim: the hole costs only about 3%, because it is small. Second, and more useful when you are choosing hardware, for a fixed total reach the product l1l2l_1 l_2 is largest when the two links are equal. Splitting 1.70 as 0.85 and 0.85 gives 9.08 square units, which is the full disc, because equal links close the hole entirely; splitting it as 1.50 and 0.20 gives 3.77. Same reach on the datasheet, less than half the usable area.

What joint limits actually do

Real joints have hard stops. A servo horn hits the link, a cable runs out of slack, a mechanical design decides that the elbow may fold one way and not the other. The workspace is the image of forward kinematics over the allowed configurations, so limits carve into it.

They do not all carve the same way, and this is where intuition usually goes wrong.

shoulder at its stop gone elbow clamped, shoulder free still a ring · the hole grows from 0.30 to 0.68 the pale red band is what the stop costs you shoulder clamped to ±90° not a ring at all · nothing past x = -0.70 the two rims survive, the far side does not
Joint limits reshape the reachable set differently depending on which joint is clamped: limiting the elbow leaves a ring with a larger hole, while limiting the shoulder removes a whole angular sector so the result is no longer a ring at all

Wider than the screen; scroll it sideways.

The arm in this course’s code has an asymmetric elbow, allowed to run from -137.5° to +13.8°, with the shoulder free to spin all the way round. You might expect a bite taken out of one side of the ring. You do not get one. Because θ1\theta_1 still covers a full turn, the result is still perfectly circular: the elbow limit stops the arm folding all the way back, so the inner rim moves out from 0.30 to 0.68, and the ring loses about 13% of its area. Symmetric in, symmetric out.

Clamp the shoulder instead and the shape changes character. Restrict θ1\theta_1 to plus or minus 90 degrees and no amount of elbow travel gets the gripper round to the back: the far side is simply gone, the arm never reaches past x=0.70x = -0.70, and what remains is a kidney rather than a ring.

Reachable is not the same as useful

Now the sharper version of the question. You do not usually want the gripper at a point. You want it at that point, pointing down, so it can pick something up.

Count degrees of freedom. The 2-link arm has two joints, so it can control two numbers. Planar task space has three: x, y, and heading. Spend both joints on position, and heading is whatever falls out. At the target (0.90,0.60)(0.90, 0.60) from the last lesson, the two elbow branches give headings of +97.9° and -30.5°. That is your entire menu: two options out of 360. Ask for the gripper at that point pointing at, say, 0°, and there is no solution, even though the point is comfortably inside the workspace.

+97.9° -30.5° reachable at all: r up to 2.10 any heading works in here two joints: the heading comes with the point exactly two headings available here, out of 360 links 1.00 and 0.70 three joints: the heading is yours to pick inside the green ring (0.70 to 1.30) every heading works so does the pinprick at the base · together about 27% of the reach
Reaching a point and reaching it facing the right way are different questions: a two-joint arm offers exactly two hand headings at any reachable point, while a three-joint arm has a ring between radius 0.70 and 1.30, plus a small disc at the base, where every heading is available

Wider than the screen; scroll it sideways.

Add a third joint, a short wrist of length 0.40, and the count works out. Three joints, three task numbers, so orientation becomes something you can request. But only in part of the workspace, and there is a clean rule for which part.

Fix the target point and the hand heading you want. That pins down where the wrist joint has to be: a fixed distance l3l_3 back along the heading. Sweep the heading through a full turn and the wrist traces a circle of radius l3l_3 around the target. For every heading to work, that whole circle has to fit inside the ring the first two links can reach.

Do that arithmetic for links of 1.00, 0.70 and 0.40 and the dexterous workspace is the ring from 0.70 to 1.30. It is 3.77 square units against a reachable disc of 13.85: 27% of what the arm can touch. There is also a pinprick disc of radius 0.10 right at the base, where the wrist circle wraps entirely around the inner hole rather than avoiding it; it is a curiosity rather than a place to put a bin, but it falls straight out of the same rule.

Three arms, side by side, with every number in this lesson:

Armouter riminner rimreachable areawhere every orientation works
2 links: 1.00, 0.701.700.308.80nowhere; two headings per point
the same, elbow clamped -137.5° to +13.8°1.700.687.64nowhere, and only one elbow branch below r=1.69r = 1.69
3 links: 1.00, 0.70, 0.402.10no hole13.85the ring 0.70 to 1.30, worth 3.77, plus a pinprick at the base

Hold on to the three ways a request can fail, because they are exactly the three failure modes of inverse kinematics: the target is outside the reachable set and there is no answer at all; the target sits on a rim, where the answers collapse together and the arm can no longer move freely in every direction; or the target is reachable but the orientation you asked for is not. The next two lessons are about what happens at the rim, and the one after that is about what a solver does when you ask for the impossible.

Review

The workspace is a ring with a hole in it

The workspace of a robot is the set of poses it can reach: the image of forward kinematics over every joint configuration the machine allows. For the two-link planar arm that is an annulus, a flat ring, whose outer edge is the arm fully extended and whose inner edge is the arm folded back on itself. The hole is the part people forget, and it is why a target can be too close to reach as well as too far. Joint limits then erode the ring, and which joint you clamp decides what you lose: clamping one takes away a band of area, clamping the other takes away a whole wedge of directions.

Reachable is not the same as useful

The question has a second and sharper version that catches people out. The set of points the gripper can touch is much larger than the set of points it can touch while facing the way you need. Those are two different sets: the reachable workspace is every point the end-effector can be placed at in some orientation, and the dexterous workspace is every point it can be placed at in any orientation. The second is a subset of the first, usually a small one, and frequently empty. Every failure mode of inverse kinematics is a case of asking for something outside one of these sets, which is why it is worth computing them before designing a task rather than after the solver starts refusing.

Check yourself

1. Why does θ1 not appear in the formula for how far the fingertip is from the base?

Because turning the shoulder rotates the entire arm rigidly about the base, and a rotation about a point preserves distance from that point. Only the elbow changes the shape of the triangle formed by the two links and the line back to the base, so only the elbow changes rr. Algebraically, θ1\theta_1 cancels out of x2+y2x^2 + y^2 through the identity cosAcosB+sinAsinB=cos(BA)\cos A\cos B + \sin A\sin B = \cos(B - A).

2. An arm with equal links, l1 = l2, has no hole. Is that strictly better?

For area, yes: l1l2|l_1 - l_2| is zero, so the ring becomes a full disc, and for a fixed total reach equal links maximise 4πl1l24\pi\,l_1 l_2. But the centre becomes a point the arm can only reach with the elbow folded exactly back on itself, which is a degenerate configuration where control behaves badly, and where the two elbow branches merge. You have swapped an honest hole for a bad point in the middle of your workspace. That is why this course uses unequal links.

3. The elbow is clamped to a range but the shoulder can spin freely. Is the workspace still a ring?

Yes. The distance from the base depends only on the elbow, so the elbow limits set a new pair of minimum and maximum radii, and the free shoulder sweeps that radius band all the way around. With the limits in this course’s code the inner rim moves from 0.30 out to 0.68 and the ring loses about 13% of its area, but it stays a ring. To get an asymmetric shape you have to limit the shoulder, which removes whole directions rather than whole radii.

4. Why is “reach: 1.70” a poor summary of an arm’s capability?

It quotes one boundary of a set and implies the set is a disc. It hides the inner hole, hides everything joint limits remove, and says nothing about orientation. Task feasibility is a set-membership question: is this point in the reachable set, and is the orientation I need available there. A single maximum distance cannot answer either half.

5. A point sits comfortably inside the 2-link arm’s workspace, but the solver returns nothing for the pose you asked for. What is the most likely explanation?

You specified an orientation. With two joints, position uses up both degrees of freedom, so heading is determined by which of the two elbow branches you take: two values out of 360, and nothing else is available. The point is reachable; the pose is not. Either drop the orientation constraint, or add a joint.

6. A three-link arm has links 1.00, 0.70 and 0.40. Why is its dexterous workspace the ring from 0.70 to 1.30 rather than the whole thing?

Pick a target and a heading, and the wrist must sit exactly 0.40 back along that heading. Sweeping the heading through a full turn traces a circle of radius 0.40 around the target, and every point of that circle has to be reachable by the first two links, whose own ring runs from 0.30 to 1.70. The circle fits only when the target is at least 0.30+0.400.30 + 0.40 from the base and at most 1.700.401.70 - 0.40. Beyond 1.30 the circle pokes out past the outer rim; inside 0.70 it clips the inner hole.

Do this

Back to code/fk_2link.py, which you completed in the last lesson. About twenty minutes.

  1. Run python fk_2link.py --workspace. It sweeps both joints on a grid, runs your forward kinematics on every pair, and scatter-plots the results into workspace_full.png. Open it. The ring should run from 0.30 to 1.70; measure the hole against the axes and confirm it.

  2. Run python fk_2link.py --workspace --limits, which repeats the sweep using the LIMITS constant at the top of the file. Before you look at the image, write down what you expect. Then compare: the outer rim is unchanged at 1.70, the inner rim has moved out to 0.68, and the shape is still a perfect ring rather than the bite most people predict.

  3. Make it asymmetric. Set LIMITS = ((-np.pi/2, np.pi/2), (-np.pi, np.pi)), swapping which joint is clamped: the shoulder now runs only from -90° to +90° and the elbow is free. Run it again. Now you get a kidney rather than a ring: the outer rim survives only on the half you kept, the arm never reaches past x=0.70x = -0.70, and two round lobes appear on the far side where the elbow folds the hand back across the base. Put LIMITS back afterwards.

  4. On paper, place a bin. Your gripper needs to come in pointing straight down. Using the dexterous-workspace rule from this lesson, work out where on the bench you would put the bin for a three-link arm with lengths 1.00, 0.70 and 0.40, and write one sentence on what happens if you put it at radius 1.50 instead: reachable, or not, and with which orientations available.

What you can now do

You can derive the 2-link arm’s reachable set from its forward kinematics, state both of its radii and its area, and explain why the shoulder angle does not appear in either. You can predict how a limit on the elbow differs from a limit on the shoulder, and why one leaves a ring while the other does not. And you can separate the question “can the gripper get there” from “can it get there facing the way I need”, which is the distinction that decides where the parts bin goes.

What you can now do

You can compute an arm's reachable set, predict how joint limits reshape it, and separate the points it can touch from the points it can touch in a useful orientation.