Engineering mission · M-005
The Precision Challenge
Solve a two-link arm's joint angles by hand, prove them in the lab, then design an arm that can reach every target.
About 1.5 h · intermediate · 5 steps · Uses Lab 01 · Free
The situation
A teaching lab has a small two-link arm mounted on a bench. Its upper arm is L1 = 20 cm and its forearm is L2 = 15 cm. The arm's controller accepts joint angles, not positions, so to move the tip to a point someone has to work out the angles first.
Four target points have been marked on the bench, measured in centimetres from the shoulder joint (x to the right, y away from the base):
- Target A: (25, 10)
- Target B: (5, 22)
- Target C: (30, 20)
- Target D: (3, 3)
The lab technician wants three things from you. First, the exact joint angles for every target the arm can reach, using the elbow-down solution. Second, a clear statement of which targets it cannot reach and why. Third, because the lab is about to order a new arm, a recommendation for link lengths that would reach all four targets, with your reasoning.
The first two parts have exact answers that you will check with the kinematics explorer. The third is a design decision with many valid answers. You will be judged on whether your recommendation is justified, not on matching anyone else's.
You will learn to
- Solve two-link inverse kinematics with the law of cosines and a stated elbow convention.
- Determine reachability from the inner and outer workspace radii.
- Verify hand calculations with a simulation and explain any differences.
- Choose link lengths to meet workspace requirements and justify trade-offs.
Constraints
- C1Current arm: L1 = 20 cm, L2 = 15 cm, joints unlimited.
- C2Use the elbow-down convention (θ2 positive) for all angles you report.
- C3Report angles in degrees, wrapped to between −180° and 180°, to at least one decimal place.
- C4New-arm recommendation: each link between 8 and 32 cm (the explorer's slider range) and it must reach all four targets.
Background
Conventions
The base is at the origin, x to the right and y upwards (away from the base on the bench). θ1 is measured from the +x axis to the upper arm; θ2 is measured from the upper arm to the forearm. Both are counter-clockwise positive. This matches the kinematics explorer.
For this mission, elbow-down means θ2 is positive. In the explorer this is the "Elbow down" option. For a target to the right of the base, the elbow then sits below the line from the base to the target.
Reachability
A two-link arm with unlimited joints can reach any point whose distance r from the base satisfies |L1 − L2| ≤ r ≤ L1 + L2. With L1 = 20 cm and L2 = 15 cm, that is the ring from 5 cm to 35 cm. Compute r = √(x² + y²) for each target first.
Inverse kinematics
For a reachable target (x, y):
c2 = (x² + y² − L1² − L2²) / (2 · L1 · L2)
θ2 = +acos(c2) (elbow-down)
θ1 = atan2(y, x) − atan2(L2 · sin θ2, L1 + L2 · cos θ2)If c2 is greater than 1 or less than −1, there is no solution: the target is outside the ring.
A worked example (not one of the targets)
Take the point (20, 15). Then x² + y² = 400 + 225 = 625, so r = 25 cm, which is inside the ring.
- c2 = (625 − 400 − 225) / (2 × 20 × 15) = 0 / 600 = 0, so θ2 = acos(0) = 90°.
- atan2(15, 20) ≈ 36.87°. With θ2 = 90°: atan2(15 × 1, 20 + 15 × 0) = atan2(15, 20) ≈ 36.87°.
- θ1 ≈ 36.87° − 36.87° = 0°.
Check with forward kinematics: the upper arm points along x to (20, 0); the forearm is then at 0° + 90° = 90°, pointing straight up by 15 cm to (20, 15). Correct.
Checking your work in Python
import math
def ik_elbow_down(L1, L2, x, y):
c2 = (x * x + y * y - L1 * L1 - L2 * L2) / (2 * L1 * L2)
if abs(c2) > 1:
return None
t2 = math.acos(c2)
t1 = math.atan2(y, x) - math.atan2(L2 * math.sin(t2), L1 + L2 * math.cos(t2))
return math.degrees(t1), math.degrees(t2)
print(ik_elbow_down(20, 15, 20, 15))(0.0, 90.0)Choosing link lengths
The outer radius L1 + L2 must be at least the farthest target's distance, and the inner radius |L1 − L2| must be at most the nearest target's distance. Longer links reach further but are heavier, need more torque at the shoulder and make the tip move further for a small joint error. A tip error from a joint angle error Δθ (in radians) at distance r is roughly r × Δθ, so 1° (0.01745 rad) of shoulder error at 30 cm moves the tip about 0.52 cm.
Lab 01 · Robotic kinematics
Explorer 01 — Robotic kinematics
From joint angles to a position, and back again
Fig. — 2-link planar arm · units cm · y up
Joint angles (relative)
More controls
Arm geometry
- End x
- 15.1 cm
- End y
- 26.4 cm
- Distance r
- 30.4 cm
- workspace 5.0–35.0 cm
- |sin θ2|
- 0.87
- well-conditioned
- Tip angle φ
- 95.0°
State
Forward kinematics. Joint angles: joint 1 35°, joint 2 60°. End effector at x 15.1 cm, y 26.4 cm, 30.4 cm from the base. Elbow well-conditioned (|sin θ2| = 0.87).
Forward kinematics. Joint angles: joint 1 35°, joint 2 60°. End effector at x 15.1 cm, y 26.4 cm, 30.4 cm from the base. Elbow well-conditioned (|sin θ2| = 0.87).
How to read this
The base sits at the centre (grid squares are 10 cm). Each thick bar is a link; circles are joints J1, J2. The shaded ring is the workspace: every point the tip can reach with unlimited joint travel. Its outer edge is L1 + L2; the inner hole appears when one link is longer than the others combined.
Arcs show each joint angle. θ1 is measured from the dashed horizontal; θ2 from the dashed extension of link 1. In inverse mode the square is the target (dashed and labelled unreachable when outside the ring), and the arm is solved with the law of cosines. Most targets have two solutions: elbow-up and elbow-down.
Assumptions & limitations
- Ideal rigid links and revolute joints with no mass, friction, backlash, or flex.
- Joints may rotate a full ±180°; real joints have hard limits that shrink the workspace, and links cannot pass through each other or the floor.
- Kinematics only: nothing here says whether the motors are strong or fast enough to hold or reach a pose (that is dynamics).
- Three-link inverse kinematics is made solvable by fixing the tool angle φ; real controllers choose among redundant solutions with extra goals.
- Unreachable targets are projected onto the nearest edge of the reachable ring for display; a real controller would refuse or plan around them.
How to approach it
- 01
Check reachability
For each of the four targets, compute r = √(x² + y²) and compare it with the ring from 5 cm to 35 cm. Write down which targets are reachable and, for the others, whether they are too far or too close to the base.
- 02
Solve the reachable targets by hand
For each reachable target, compute c2, θ2 and θ1 with the elbow-down formulas. Keep at least four significant figures in intermediate steps so rounding does not pile up. Then check each answer with forward kinematics: x = L1·cos θ1 + L2·cos(θ1 + θ2) and y = L1·sin θ1 + L2·sin(θ1 + θ2).
- 03
Verify in the explorer
Open the kinematics explorer, set L1 = 20 cm and L2 = 15 cm, choose Inverse mode and Elbow down, and set each target with the sliders. Compare the explorer's angles with yours. Then switch to Forward mode, type in your angles, and read the tip position. Try the unreachable targets too, and note what the explorer shows.
- 04
Look at sensitivity
For one reachable target, change θ1 by 1° in the explorer and note how far the tip moves. Compare with the estimate r × Δθ. Look at the |sin θ2| readout: which target is closer to a singular configuration, and what does that mean for control?
- 05
Recommend new link lengths
Find link lengths, each between 8 and 32 cm, that reach all four targets. There are many valid answers. Choose one and justify it: consider margin beyond the farthest target, margin inside the nearest one, torque and sensitivity to joint error. Verify your choice in the explorer for all four targets.
Your work
Everything above is free to read and use. To save drafts, submit versions and get feedback, sign in.
You can also work on paper: the prompts below are what a submission asks for.
- Target A: θ1 (elbow-down) (°)
- Target A: θ2 (elbow-down) (°)
- Target B: θ1 (elbow-down) (°)
- Target B: θ2 (elbow-down) (°)
- How many of the four targets can the current arm reach?
- Reachability explanation and verification
- New-arm recommendation
How it's judged
There is more than one good answer. This rubric describes what strong work looks like.
Inverse kinematics
- Beginning
- Angles are missing, use the wrong convention or are clearly wrong.
- Developing
- The method is right but one or more angles are wrong by more than a degree, or the convention is unstated.
- Proficient
- All reachable targets solved correctly with the elbow-down convention, each checked with forward kinematics.
- Exemplary
- As Proficient, plus the elbow-up solutions are also given and the student explains when each would be preferred.
Reachability reasoning
- Beginning
- Reachability is guessed or not addressed.
- Developing
- Reachable targets are identified but the reason for the unreachable ones is unclear.
- Proficient
- Each target's distance is compared with both the inner and outer radius, with the reason stated.
- Exemplary
- As Proficient, plus the student explains what the explorer does with unreachable targets and how far short each falls.
Verification
- Beginning
- No verification in the explorer.
- Developing
- Explorer values are copied but not compared with the hand calculation.
- Proficient
- Hand and explorer results are compared, with any differences explained by rounding or slider resolution.
- Exemplary
- As Proficient, plus the sensitivity test compares the measured tip movement with r × Δθ.
Design recommendation
- Beginning
- No recommendation, or one that does not reach all targets.
- Developing
- A valid recommendation with little justification.
- Proficient
- A valid recommendation verified in the explorer, with margins and at least one trade-off discussed.
- Exemplary
- As Proficient, plus a comparison of two valid options on torque and sensitivity, with a clear reason for the choice.
Reflect
- Why does the arm have two solutions for most reachable targets, and how would a real robot choose between them?
- Which was harder to get right, the arithmetic or the conventions? What would help you avoid convention mistakes in future?
- How did adding margin to your link lengths trade against precision?
Go further
Switch the explorer to three links with a fixed tool angle of 0°. Using your new arm's first two links and a 6 cm tool, find which of the four targets can be reached with the tool pointing along +x, and explain why the third link changes the workspace.