gwordal

Lesson 1 of 5 · 18 min

Joints, degrees of freedom and workspace

A robot arm is a chain of rigid links connected by joints. Kinematics is the study of how that chain moves, ignoring forces and masses: given the joint positions, where is the hand, and what joint positions put the hand where you want it? Before any equation, you need a small vocabulary. It decides what the equations in the next lessons look like, and it tells you early whether a design can do the job at all.

Two kinds of joint

Almost every robot arm is built from just two joint types.

  • Revolute (R): rotates about a fixed axis. The variable is an angle, in degrees or radians. A hobby servo, a stepper on a pivot or a motor with a gearbox are all revolute joints.
  • Prismatic (P): slides along a fixed axis. The variable is a length, in mm. A lead-screw carriage or a linear actuator is a prismatic joint.

A ball joint or a wrist that tilts in two directions is not a new kind. It behaves like two or three revolute joints whose axes meet at one point. Engineers prefer single-axis joints because each one needs exactly one actuator and one sensor, and each adds exactly one number to the model.

Degrees of freedom

A free rigid body in space has 6 degrees of freedom (DOF): 3 translations (x, y, z) and 3 rotations (roll, pitch, yaw). A joint removes freedom between two links. For a general mechanism the Grübler-Kutzbach formula counts what is left:

DOF = 6*(N - 1 - J) + sum(f_i) for spatial mechanisms, and DOF = 3*(N - 1 - J) + sum(f_i) for planar ones

Here N is the number of links including the fixed ground, J the number of joints and f_i the freedom of joint i (1 for revolute and prismatic). For a serial chain every link hangs off the previous one, so J = N - 1 and the first term vanishes: DOF equals the number of joints. Three revolute joints give 3 DOF, four revolute plus one prismatic give 5 DOF.

Why does the number matter? To put a tool at any position and any orientation in space you need 6 DOF. To reach any position, ignoring orientation, you need 3. A planar two-link arm has 2 DOF: it can put its tip at any reachable (x, y), but its tool angle is then decided for you (it equals t1 + t2). If an arm has more DOF than the task needs, it is redundant, and there are infinitely many joint solutions for the same hand pose. Lesson 4 shows how to cope with that.

Workspace

The workspace is the set of all points the tool tip can reach. For a planar two-link arm with link lengths L1 and L2, it is a ring (an annulus):

r_max = L1 + L2 (arm fully stretched) r_min = |L1 - L2| (arm folded back on itself)

With L1 = L2 = 80 mm, the ring runs from 0 to 160 mm. Real hardware shrinks it. A hobby servo only turns about 180 degrees, and the links collide with the base and with each other. Run the sampling script below with plausible limits (shoulder 0 to 180 degrees, elbow -135 to +135 degrees) and the minimum reach grows from 0 to about 61 mm: there is a dead zone near the base.

import numpy as np

L1, L2 = 80.0, 80.0                              # link lengths, mm
t1 = np.radians(np.linspace(0, 180, 181))        # shoulder range
t2 = np.radians(np.linspace(-135, 135, 271))     # elbow range (assumed)
T1, T2 = np.meshgrid(t1, t2)

x = L1 * np.cos(T1) + L2 * np.cos(T1 + T2)
y = L1 * np.sin(T1) + L2 * np.sin(T1 + T2)
r = np.hypot(x, y)

print("reach:", r.min().round(1), "to", r.max().round(1), "mm")
print("height:", y.min().round(1), "to", y.max().round(1), "mm")

Resolution is part of the story too. A servo moves in steps of about 1 degree. At full reach, 160 mm out, one degree of shoulder rotation moves the tip by 160 mm * 0.01745 rad = 2.8 mm. Long links give a bigger workspace but coarser positioning.

Serial and parallel arms

StructureJoints (base to tool)StrengthWeakness
Articulated (MeArm)R, R, RLarge reach, compactErrors add up along the chain
SCARAR, R, PFast and stiff in a planeSmall vertical range
Cartesian (3D printer)P, P, PSimple maths, preciseBulky for its reach
Parallel (delta, five-bar)Several chains to one toolVery fast and stiffSmall workspace

In a serial arm one chain runs from base to tool. Every motor must carry all the links beyond it, and each joint's error is passed on to the tip. In a parallel arm several chains join the same tool, so the motors sit on the base and the structure is stiff and light. A planar five-bar linkage has N = 5 links and J = 5 revolute joints: DOF = 3*(5 - 1 - 5) + 5 = 2. The maths flips too: for a serial arm forward kinematics is easy and inverse is harder, for a parallel arm it is often the other way around.

Play with a hobby arm

The MeArm-style arm below has a rotating base, a shoulder and an elbow. Drag the sliders and watch the tip. Notice how the base angle swings the whole arm around a vertical axis, while shoulder and elbow work in one vertical plane. That split is what makes the 3D maths in the next lessons manageable.

#include <Servo.h>

Servo base, shoulder, elbow;

void setup() {
  base.attach(9);
  shoulder.attach(10);
  elbow.attach(11);
}

void loop() {
  base.write(40);
  shoulder.write(60);
  elbow.write(110);
}

The playground also generates Arduino code for the pose you set. A minimal version looks like this:

#include <Servo.h>

Servo base, shoulder, elbow;

void setup() {
  base.attach(11);       // base: rotates the arm around the vertical axis
  shoulder.attach(10);   // shoulder: raises and lowers link 1
  elbow.attach(9);       // elbow: bends link 2 relative to link 1
}

void loop() {
  for (int a = 60; a <= 120; a++) {   // sweep the base slowly
    base.write(a);
    delay(20);
  }
  for (int a = 120; a >= 60; a--) {
    base.write(a);
    delay(20);
  }
}

Check yourself

A serial arm has 4 revolute joints and 1 prismatic joint. How many degrees of freedom does it have?

Check yourself

A planar two-link arm has L1 = 100 mm and L2 = 60 mm, and both joints can rotate freely. What is the inner radius of its workspace?