TactivergeLite

Lite / Building Machines That Respond / Week 29

Find the fingertip: two links, one answer

A robot finger has a 5 cm link and a 3 cm link. Bend the knuckle straight up and the middle joint back down. Where does the fingertip end up?

About 40 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

This is forward kinematics: the first calculation in every robot arm's software. A gripper can't pick up an egg until it knows where its fingertip is, and that comes from the joint angles, the link lengths and two lines of trigonometry.

Predict

A finger with L1 = 5 cm and L2 = 3 cm has θ1 = 90° (first link straight up) and θ2 = −90° (second link bent back to horizontal). Where is the fingertip?

  1. (3, 5) cm
  2. (8, 0) cm
  3. (0, 8) cm
  4. (5, 3) cm
Guess first, then reveal

(3, 5) cm. The first link goes 5 cm straight up. The second link's absolute angle is θ1 + θ2 = 0°, so it points along +x for 3 cm. Add the parts: x = 0 + 3, y = 5 + 0.

Discover

Open the Robotic Gripper build, Level 2. For each pose, write your predicted fingertip position on paper first, then test it on the live finger. Then find the closest and furthest the fingertip can ever reach.

What the interactive shows (text version)

In the gripper build's Level 2, a two-link finger (5 cm and 3 cm) is drawn with joint angle sliders and a fingertip readout. You calculate the tip position for two given poses ((90°, −90°) gives (3, 5) cm; (30°, 60°) gives about (4.33, 5.5) cm), the reach limits (2 cm and 8 cm), and which of four points are reachable, then check each on the live finger.

You can also open the interactive on the full site when you have a faster connection.

Watch (optional)

Watch for: Notice how the builder adds up the contribution of each link, then reverses the process to choose angles.

A robot builder shows how trigonometry turns a target position into joint angles on real hardware.

“How Robots Use Maths to Move” by James Bruton (opens YouTube; streaming video uses a lot of data)

The video is optional. Everything you need is in this lesson's text.

Understand

Add links tip to tail

Each link is a vector: a length at an angle. To find the fingertip, start at the base, walk along link 1, then walk along link 2 from where you stopped. Adding their x parts and y parts gives the tip, exactly like adding two forces on a free-body diagram.

Relative angles add up

The middle joint's motor only knows how far it is bent relative to link 1. So link 2's direction is θ1 + θ2. Forgetting to add θ1 is the classic forward-kinematics mistake: the answer looks reasonable but is wrong whenever θ1 isn't zero.

The tip is a function of the angles

For fixed link lengths, every pair (θ1, θ2) gives exactly one fingertip position: the tip is a function of the joint angles. Going the other way (inverse kinematics) is harder, because one target can have two answers, elbow up or elbow down, or none if it is out of reach.

Explain it another way

Intuitive

Point your upper arm somewhere, then bend your elbow. Where your fingertips end up depends on both, and you add the two movements together.

Technical

p = L1·[cos θ1, sin θ1] + L2·[cos(θ1+θ2), sin(θ1+θ2)]. The workspace of a planar 2R arm is the annulus |L1 − L2| ≤ |p| ≤ L1 + L2.

Mathematical

L1 = 5, L2 = 3 cm at (30°, 60°): x = 5 cos 30° + 3 cos 90° ≈ 4.33 cm, y = 5 sin 30° + 3 sin 90° = 2.5 + 3 = 5.5 cm. Reach ring: 2 cm to 8 cm.

Applied

Industrial arms chain six such links in 3D, and the same add-the-links idea, written with matrices, tells the controller where the tool is 1000 times a second.

Derivation: Forward kinematics of a two-link arm
  1. Link 1 starts at the base and points at θ1, so its tip (the middle joint) is at (L1 cos θ1, L1 sin θ1).

  2. The second joint angle θ2 is measured relative to link 1, so link 2 points at the absolute angle θ1 + θ2.

  3. Link 2 adds (L2 cos(θ1 + θ2), L2 sin(θ1 + θ2)) to the middle joint's position.

  4. Add the two: x = L1 cos θ1 + L2 cos(θ1 + θ2), y = L1 sin θ1 + L2 sin(θ1 + θ2).

  5. Reach: the tip is furthest when the links line up (L1 + L2) and closest when folded back (|L1 − L2|). The reachable area is a ring between those radii.

Worked example 1

L1 = 6 cm, L2 = 4 cm, θ1 = 0°, θ2 = 90°. Tip?

Link 2 points at 0° + 90° = 90°. x = 6 cos 0° + 4 cos 90° = 6 cm, y = 6 sin 0° + 4 sin 90° = 4 cm. Tip at (6, 4) cm.

Worked example 2

Can a 5 cm + 3 cm finger touch the point (0, −7) cm? And (1, 1) cm?

(0, −7) is 7 cm from the base: between 2 and 8 cm, so yes. (1, 1) is √2 ≈ 1.4 cm away: closer than 2 cm, so no; the fingertip can't fold that tight.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

cm

cm

cm

Practice 4. Can a 5 cm + 3 cm finger touch the point (0, 9) cm?
Practice 5. A learner computes link 2's contribution as L2 cos θ2 instead of L2 cos(θ1 + θ2). When will their answer still be right?

Apply it

Finish Level 2 of the Robotic Gripper build. Then choose your own link lengths for a gripper finger that must reach an object 6 cm away and 2 cm up, and show by calculation that the tip can get there.

Reflect

Why do you think robot designers like the ratio of L1 to L2 to be close to 1?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Angles in, positions out (and back again)Draw the forces: free-body diagrams and equilibrium →