Lite / Intelligent Robotic Systems / Week 15
Forward kinematics: where is the hand?
A robot knows only its two joint angles. From those two numbers alone, it must know where its hand is to the millimetre. How?
Why should I care?
Joint encoders measure angles, not positions. Forward kinematics (FK) turns those angles into the position of the hand, which is what the task actually cares about: a weld, a pick, a camera view. It's two link vectors added tip to tail, using everything from weeks 10 to 12.
- Compute the hand position of a two-link planar arm from its joint angles.
- Explain why link 2's absolute angle is θ1 + θ2.
- Check a forward-kinematics result against a simulation.
Predict
An arm with L1 = 0.5 m and L2 = 0.3 m has θ1 = 90° and θ2 = −90°. Where is the hand?
- (0.3, 0.5)
- (0, 0.8)
- (0.5, 0.3)
- (0, 0.2)
Guess first, then reveal
(0.3, 0.5). Link 1 points straight up to (0, 0.5). Link 2's absolute angle is 90° − 90° = 0°, so it points right: (0 + 0.3, 0.5 + 0) = (0.3, 0.5).
Discover
In 'Forward' mode with L1 = 0.5 m, L2 = 0.35 m: predict the hand position for (θ1, θ2) = (0°, 90°), (90°, 0°) and (45°, −45°) on paper, then set each pose and check. Where must θ2 be to reach the furthest point of the ring? The nearest?
What the interactive shows (text version)
The two-link diagram draws the arm in blue from the shoulder at the centre, with a lime dot at the hand, over a purple ring showing every reachable point. In Forward mode the readout substitutes the chosen angles into both FK equations and gives the hand's x and y in metres.
Watch (optional)
Watch for: Watch for the moment the maker draws the two links as a triangle: that's the same geometry as the equations below.
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
Two vectors, tip to tail
Link 1 points at θ1: its vector is L1(cos θ1, sin θ1). Link 2 starts at the elbow and points at θ1 + θ2, because θ2 is measured from link 1. Add them:
x = L1 cos θ1 + L2 cos(θ1 + θ2)
y = L1 sin θ1 + L2 sin(θ1 + θ2)
Relative angles add up
Each joint's encoder measures its angle relative to the previous link. The absolute direction of any link is the sum of the joint angles before it. Forgetting to add θ1 to θ2 is the most common FK error, and it gives positions that look plausible but are wrong.
Two numbers in, one position out
FK always has exactly one answer: given the angles, the hand is in one place. A two-joint planar arm has two degrees of freedom, enough to place the hand anywhere in its ring-shaped workspace but not to choose the hand's orientation too. That needs a third joint.
Explain it another way
Intuitive
Your shoulder sets the direction of your upper arm; your elbow bends your forearm relative to it. Where your hand ends up is 'upper arm, then forearm', added up.
Technical
FK maps joint space (θ1, θ2) ∈ T² to task space (x, y) ∈ ℝ². It is smooth and many-to-one: generally two joint configurations map to the same hand position (elbow up and down).
Mathematical
L1 = 0.5, L2 = 0.2, θ1 = 45°, θ2 = −90°: link 2 at −45°. x = 0.5(0.7071) + 0.2(0.7071) = 0.495, y = 0.5(0.7071) + 0.2(−0.7071) = 0.212 m.
Applied
Industrial robot controllers run FK hundreds of times a second to display the tool position, check it against safety zones and log where every weld was made.
Worked example 1
L1 = 0.4 m, L2 = 0.3 m, θ1 = 30°, θ2 = 60°. Find the hand position.
Link 2 is at 90°. x = 0.4 cos 30° + 0.3 cos 90° = 0.346 + 0 = 0.346 m. y = 0.4 sin 30° + 0.3 sin 90° = 0.2 + 0.3 = 0.5 m.
Common mix-ups
Link 2 points at θ2.
✓ Link 2 points at θ1 + θ2, because θ2 is measured from link 1.The hand's distance from the shoulder is always L1 + L2.
✓ Only when the arm is straight (θ2 = 0). Bending the elbow brings the hand closer.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
Apply it
Write fk(L1, L2, t1_deg, t2_deg) in Python returning (x, y). Test it on the worked example and on (90°, −90°). Then compare three poses against the two-link diagram to within 1 mm.
Reflect
A robot's elbow encoder slips by 2°. Which part of the FK calculation is affected, and roughly how big might the hand error be?
Write your answer on paper or in your own notes. Lite never stores what you write.
Go further
- Forward kinematics (Wikipedia)
FK for longer chains and in 3D.