Skip to content

MechanicsFrames and Kinematics

Forward Kinematics of a Two-Link Arm

Given the joint angles, the hand is at x = L1 cos θ1 + L2 cos(θ1 + θ2), y = L1 sin θ1 + L2 sin(θ1 + θ2).

Not started Jump to practice

A robot arm knows its joint angles from its motors. Where is its hand? Working that out is forward kinematics.

Key idea

For a two-link arm in a plane with link lengths $L_1$, $L_2$ and joint angles $\theta_1$ (shoulder, from the $x$-axis) and $\theta_2$ (elbow, from the first link):
$x = L_1\cos\theta_1 + L_2\cos(\theta_1 + \theta_2)$, $\ y = L_1\sin\theta_1 + L_2\sin(\theta_1 + \theta_2)$.
Slide the two joint angles. The readout gives the hand's position.

Why it works

The first link points at $\theta_1$. The second link is measured from the first, so its direction on the map is $\theta_1 + \theta_2$. Each link adds an arrow; the hand is at the tip of the last arrow.

Worked example: Hand position

$L_1 = 10$, $L_2 = 7$, $\theta_1 = 30^\circ$, $\theta_2 = 60^\circ$.
  1. First link: $(10\cos 30^\circ, 10\sin 30^\circ) \approx (8.66, 5)$.
  2. Second link points at $90^\circ$: $(0, 7)$.
  3. Add: $(8.66, 12)$.

Answer: About (8.66, 12).

Common mistake

Using $\theta_2$ alone for the second link's direction. It is measured from the first link, so use $\theta_1 + \theta_2$.

Hands-on: a servo arm

Parts, three price points (approximate U.S. prices, 2026)
  • About \$10: two small hobby servos, craft sticks or stiff cardboard, and your microcontroller from the starter kit.
  • About \$40 to \$60: an acrylic or plastic desktop arm kit with four small servos and a gripper.
  • About \$120 to \$250: an open-source 3D-printed arm kit with smart servos; printing is extra.

Build a two-joint arm from two servos and measure $L_1$ and $L_2$. Command a few angle pairs, predict the hand's position with the formula, then measure it with a ruler. How close are you? What makes the difference?

Safety. Power servos from their own battery pack, not from the microcontroller's pin. Keep fingers out of the joints while the arm has power; servos can snap to position fast on startup.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading