Stage 05 · Lesson 03/15

Robotics Fundamentals · Lesson 03

Joints, Links & DOF

Est. 50–65 min

Why

Why counting freedoms is the first design decision

Every robot design starts with one question: how many independent ways does it need to move? That number is its degrees of freedom (DOF). Too few, and the robot cannot reach the pose the job needs. Too many, and you pay for extra motors, weight, wiring, calibration and control complexity. Modern Robotics defines DOF precisely: the smallest number of real-valued coordinates needed to represent the robot’s configuration. The door needs one; the coin on the table needs three.

By the end you will be able to: name the common joint types (R, P, H, C, U, S) and how many freedoms each allows; tell a link from a joint on any machine; count DOF of open chains by counting joints; use Grübler’s formula for closed chains like a four-bar linkage; explain why a free rigid body has 6 DOF in space and 3 in a plane; and say why a 6-DOF arm can place its gripper in any position *and* orientation within reach.

A grey PUMA robot arm on a pedestal in a laboratory, its upper arm and forearm raised above a table holding small objects
A PUMA robot arm in a NASA Ames laboratory. Look for the pattern: a fixed base (link 0), then link–joint–link–joint all the way to the wrist. Each rotary joint adds one degree of freedom. This is an open chain — and for open chains, counting DOF is as easy as counting joints.Photo: NASA / Dominic Hart · Public domain · Source: Wikimedia Commons · resized, converted to WebP

Concept

Joints, links and degrees of freedom in plain words

Look at your own arm. Your upper arm, forearm and hand are rigid pieces — robotics calls them links. The places where they move relative to each other — shoulder, elbow, wrist — are joints. Your elbow is a hinge: it bends one way only, so it gives one freedom. Your shoulder is a ball-and-socket: it can swing forward, swing sideways and twist, so it gives three. Robots copy these ideas with simpler, stronger parts.

The joint menu

Common robot joints and the freedoms each allows (Modern Robotics, Table 2.1)
JointSymbolMotion allowedFreedoms fEveryday example
Revolute (hinge)RRotation about one axis1Door hinge, servo joint
Prismatic (sliding / linear)PTranslation along one axis1Drawer slide, 3D-printer axis
Helical (screw)HRotation and translation tied together1Bottle cap, lead screw
CylindricalCIndependent rotation + translation on one axis2Telescope tube that also turns
UniversalURotation about two perpendicular axes2Car steering-shaft joint
Spherical (ball-and-socket)SRotation about three axes3Your shoulder, a gear-stick ball

Modern Robotics adds a rule worth remembering: every joint connects exactly two links. Hobby and industrial arms use almost only R and P joints, because one motor can drive one freedom simply and stiffly. A “spherical wrist” on an industrial arm is usually three R joints whose axes meet at one point — it behaves like an S joint but each freedom has its own motor.

Why 6 is the magic number in space

A free rigid body in three-dimensional space has six freedoms: three to say *where* it is (x, y, z) and three to say *which way* it points (roll, pitch, yaw). On a flat table (a plane) it has three: x, y and one turning angle — exactly the coin. So if a gripper must reach any position *and* any orientation in its workspace, the arm generally needs at least six independent joints. That is the reason for “6DOF” in your arm’s name.

Rigid body freedoms
Where the body movesPosition freedomsOrientation freedomsTotal
Along a line (a bead on a wire)101
In a plane (a coin on a table)2 (x, y)1 (θ)3
In 3-D space (a gripper, a drone)3 (x, y, z)3 (roll, pitch, yaw)6

Counting DOF: open chains and Grübler’s formula

For an open chain (a serial arm: base → joint → link → joint … → gripper), every joint is driven and the count is easy: DOF = sum of the joints’ freedoms. Six R joints → 6 DOF. For closed chains (loops, like a four-bar linkage or the Stewart platform used in flight simulators), joints constrain each other and you need Grübler’s formula:

DOF = m (N − 1 − J) + Σ fᵢ

  • m = 3 for planar mechanisms, 6 for spatial; N = number of links including the ground; J = number of joints; fᵢ = freedoms of joint i. Modern Robotics notes the formula assumes the joint constraints are independent — special geometry can break that.
  1. Planar four-bar

    N = 4 links (ground + 3), J = 4 R joints, m = 3. DOF = 3(4 − 1 − 4) + 4 = 1. One input crank sets the whole linkage — that is why car wipers and pliers-style grippers use linkages.

  2. Planar 2R arm

    N = 3, J = 2, m = 3. DOF = 3(3 − 1 − 2) + 2 = 2 — same as counting joints, as expected for an open chain.

  3. Stewart platform

    N = 14, J = 18 (six legs, each U–P–S), Σf = 6×(2+1+3) = 36, m = 6. DOF = 6(14 − 1 − 18) + 36 = 6. Six legs, six freedoms for the top plate.

A white SCARA robot with a vertical base column, two horizontal arm links and a vertical spindle at the end, with arrows labelling its axes
A SCARA robot (Mitsubishi Electric). Two horizontal R joints swing the arm in a plane, a vertical P axis moves the spindle up and down, and a final R joint turns the tool — R R P R, 4 DOF. Perfect for pick-and-place on a flat table, where you never need to tilt the tool.Photo: Mitsubishi Electric Automation, Inc. · CC BY-SA 4.0 · Source: Wikimedia Commons · resized, converted to WebP

Visual

Visualise it: move one joint at a time

Move one joint at a time and watch the arm. Each slider is **one degree of freedom**. Notice how the tip’s position depends on *all* the joints before it — that is what makes an open chain.

Interactive · DOF & joint explorer

Educational diagram of revolute, prismatic, and spherical joints

Degrees of freedom

2

For a serial chain of 1-DOF joints, DOF ≈ joint count (planar teaching model).

Code lab

Code lab: Grübler’s formula for ten mechanisms

This script stores each joint type’s freedoms (from Modern Robotics Table 2.1) and computes DOF for ten mechanisms, from a door to a Stewart platform. Run it with python3 dof_counter.py and check each answer against your own hand calculation.

dof_counter.py · Python
"""dof_counter.py - Grubler's formula from Modern Robotics (Lynch & Park), Section 2.2.
dof = m(N - 1 - J) + sum(f_i)
  m = 3 for planar mechanisms, 6 for spatial; N = links including ground; J = joints; f_i = freedoms of joint i."""

JOINT_F = {"R": 1, "P": 1, "H": 1, "C": 2, "U": 2, "S": 3}  # MR Table 2.1

def grubler(m, n_links, joints):
    return m * (n_links - 1 - len(joints)) + sum(JOINT_F[j] for j in joints)

MECHANISMS = [
    # name, m, N (incl. ground), joint list
    ("Door on a hinge", 6, 2, ["R"]),
    ("Planar 2R arm (shoulder + elbow)", 3, 3, ["R", "R"]),
    ("Planar 3R arm", 3, 4, ["R", "R", "R"]),
    ("SCARA (R R P R)", 6, 5, ["R", "R", "P", "R"]),
    ("Cartesian gantry (P P P)", 6, 4, ["P", "P", "P"]),
    ("6R industrial-style arm", 6, 7, ["R"] * 6),
    ("7R arm (redundant)", 6, 8, ["R"] * 7),
    ("Planar four-bar linkage", 3, 4, ["R"] * 4),
    ("Slider-crank", 3, 4, ["R", "R", "R", "P"]),
    ("Stewart platform (6 x U-P-S legs)", 6, 14, ["U"] * 6 + ["P"] * 6 + ["S"] * 6),
]

print(f"{'Mechanism':38s} m   N   J  sum(f)  dof")
for name, m, n, joints in MECHANISMS:
    f = sum(JOINT_F[j] for j in joints)
    print(f"{name:38s} {m}  {n:2d}  {len(joints):2d}  {f:5d}  {grubler(m, n, joints):3d}")

print("\nOpen chain shortcut: for a serial arm, dof = number of 1-dof joints.")
print("Task space for a pose in 3-D is 6, so the 7R arm has 1 extra (redundant) dof.")

Output (run with python3 dof_counter.py)

Mechanism                              m   N   J  sum(f)  dof
Door on a hinge                        6   2   1      1    1
Planar 2R arm (shoulder + elbow)       3   3   2      2    2
Planar 3R arm                          3   4   3      3    3
SCARA (R R P R)                        6   5   4      4    4
Cartesian gantry (P P P)               6   4   3      3    3
6R industrial-style arm                6   7   6      6    6
7R arm (redundant)                     6   8   7      7    7
Planar four-bar linkage                3   4   4      4    1
Slider-crank                           3   4   4      4    1
Stewart platform (6 x U-P-S legs)      6  14  18     36    6

Open chain shortcut: for a serial arm, dof = number of 1-dof joints.
Task space for a pose in 3-D is 6, so the 7R arm has 1 extra (redundant) dof.

How it works: grubler() is one line of maths. JOINT_F[j] looks up each joint’s freedoms and sum() adds them. For open chains, N − 1 − J is always 0 (one more link than joints, counting the ground), so the formula collapses to “add up the joints”.

Real world

Joints and DOF in real robots

  • Industrial 6R arms: six revolute joints so the tool can reach a position and orientation — Modern Robotics uses a spray-painting 6R arm as an example.
  • SCARA robots: R R P R, 4 DOF, for fast flat pick-and-place.
  • Cartesian gantries and 3D printers: three P joints for x, y, z — OSHA lists these as Cartesian (linear, gantry) robots.
  • 7-DOF arms: one more joint than the 6 a pose needs — *kinematically redundant* (Modern Robotics), so the elbow can move while the tool stays still, like your own arm.
  • Flight simulators: Stewart platforms — a closed chain with 6 DOF from six legs.
A line drawing of a gantry-style Cartesian robot frame with arrows labelled X, Y and Z along its three linear axes
A 3-DOF Cartesian robot: three prismatic joints along X, Y and Z. Easy to understand and program — the joint values *are* the tool’s coordinates — but the frame must be bigger than everything it reaches.Photo: Israel adilman · CC BY 4.0 · Source: Wikimedia Commons · resized, converted to WebP
The long white Canadarm2 robotic arm on the International Space Station, stretched out against the black of space and the blue curve of Earth
Canadarm2 on the International Space Station. It is about 17.6 metres long when fully stretched, with seven motorised joints and an identical Latching End Effector at each end, so it can “walk” end-over-end between grapple fixtures — the base and the tool can swap roles. That only works because the joint chain is symmetric.Photo: NASA · Public domain · Source: Wikimedia Commons · resized, converted to WebP

Bench build

Bench build: a cardboard 2R arm and a four-bar linkage

Feel DOF with your hands. Cut strips of thick cardboard (or use ice-cream sticks) and join them with paper fasteners (split pins) — each fastener is one R joint.

  1. Build a 2R arm

    Pin a 12 cm strip to the table edge (the base) and a 10 cm strip to its end. Hold the base fixed. You can set the shoulder and elbow angles independently: 2 DOF.

  2. Trace its reach

    Put a pencil through a hole at the tip and trace every point you can reach. You get a ring shape — we will use it in Lesson 9.

  3. Close the loop

    Add a third strip and pin its far end to the table, making a four-bar loop (ground + three strips, four pins).

  4. Feel the constraint

    Move one strip. The other two follow — you can no longer set angles independently. Grübler said 1 DOF; your hands agree.

  5. Label everything

    Write L0, L1, L2… on each link and J1, J2… on each joint. This is the naming you will use in kinematics (Stage 8).

Debugging

Debugging your DOF count

MistakeWhy it happensFix
Forgetting the ground link in NThe base doesn’t look like it “moves”Always count the fixed base as link 1
Grübler gives 0 or negativeA structure, not a mechanism — or a counting errorRecount joints; a triangle of three links really has 0 DOF
Getting 2 for a hinge-and-slider jointTreating one cylindrical joint as two joints (or vice versa)Use the joint menu: C = 2 freedoms in one joint
Counting the gripper motor in arm DOFKit names include itSeparate “pose DOF” from “tool DOF”
Formula disagrees with the modelSpecial geometry makes constraints dependentTrust the physical model; note the exception (Modern Robotics warns about this)

Think

Think about it

Think

Meera’s arm kit is called “6DOF”. It has six servos: base rotation, shoulder, elbow, wrist pitch, wrist roll and gripper open/close. Can it place a pencil tip at any point within reach *with any orientation*? Explain using DOF.

Experiment

Try it in the lab: count DOF on paper, in code and with your hands

Thirty minutes with the joint explorer, the Grübler script and your cardboard models. You will count the same mechanism three ways and make sure all three agree.

Experiment

Count DOF on paper, in code and with your hands

You will need

  • DOF joint explorer (below, runs in your browser)
  • Cardboard strips and paper fasteners
  • Notebook
  • Optional: `dof_counter.py`

Steps

  1. In the explorer, move each joint alone and describe what the tip does. Write “R” or “P” for each joint.
  2. Lock one joint (don’t touch its slider) and move the others. How many freedoms remain?
  3. Build the cardboard 2R arm and four-bar. Count DOF with Grübler on paper, then by feel. Do they agree?
  4. Run `dof_counter.py`. Add your cardboard four-bar as a new line and check the script prints 1.
  5. Look at the SCARA and Cartesian photos and write their joint strings (like “RRPR”).

Interactive · DOF & joint explorer

Educational diagram of revolute, prismatic, and spherical joints

Degrees of freedom

2

For a serial chain of 1-DOF joints, DOF ≈ joint count (planar teaching model).

Open chains: DOF = number of driven joint freedoms. Closed chains: use Grübler, and check with a model. Six DOF is what a tool needs for full position and orientation in space.

Knowledge check

Check your understanding

Knowledge check

1. Degrees of freedom are the…

2. How many freedoms does a spherical (ball-and-socket) joint allow?

3. A coin lying on a table has how many DOF?

4. A free rigid body in 3-D space has…

5. Using Grübler, a planar four-bar linkage (N = 4, J = 4 revolute) has…

6. A SCARA robot’s joint string is usually…

7. A 7R arm doing a 6-DOF task is called…

8. For an open-chain (serial) arm, the DOF equals…

9. Your kit has six servos, one of which opens the gripper. How many DOF move the tool’s pose?

10. Grübler gives 0 for three links pinned into a triangle. This means…

Mini assignment

Hands-on assignment

Mini assignment

DOF detective: five machines, three methods

Count the DOF of five real mechanisms around you using joint counting, Grübler’s formula and a model, and decide how many motors each would need.

Deliverables

  • A table of five mechanisms (for example: a door, scissors, a desk lamp, a folding chair, an umbrella) with N, J, joint types, DOF and number of motors needed.
  • Photos of your cardboard 2R arm with its traced reach, and of the four-bar.
  • Your edited `dof_counter.py` with at least two new mechanisms and its output.
  • One paragraph: does your 6DOF arm kit really have 6 pose DOF? Justify it from its joint list.

Do this, step by step

  1. Choose five mechanisms around you (door, scissors, desk lamp, folding chair, umbrella or similar).
  2. For each, count links N (including the ground) and joints J, and note each joint’s type and freedoms.
  3. Work out DOF with Grübler’s formula (planar m = 3, spatial m = 6) and check it by moving the real object.
  4. Add at least two of your mechanisms to dof_counter.py, run it and compare with your hand results.
  5. Build the cardboard 2R arm and the four-bar, photograph them, and write one paragraph on whether your 6DOF kit really has 6 pose DOF.

Stuck? Hints, one at a time

NoteTry the task first. Read one hint, try again, and only then read the next one.
  1. Hint 1: Find the part that stays still. That is the ground link — count it.
  2. Hint 2: Every place two parts rotate or slide relative to each other is a joint. Decide R, P, U, S… using the joint menu.
  3. Hint 3: Is there a loop (can you trace a path through links and back to where you started)? If yes, use Grübler; if no, just add up joint freedoms.
  4. Hint 4: Planar or spatial? If every part moves in parallel planes, use m = 3.

Challenges (pick by level)

  • 🟢 Easy: Write the joint string for your own arm (shoulder, elbow, wrist).
  • 🟢 Easy: Explain to a friend why a coin has 3 DOF on a table but 6 in the air.
  • 🟡 Medium: Count the DOF of a pair of scissors with Grübler. *Hint:* planar, two links, one R joint.
  • 🟡 Medium: Count the DOF of an adjustable desk lamp. How many knobs or friction joints does it have?
  • 🟠 Hard-ish: Use Grübler on a planar slider-crank (like an engine piston). Then explain why one motor turning the crank is enough.
  • 🔴 Hard: Find a mechanism where Grübler gives the wrong answer because of special geometry (for example a parallelogram linkage with an extra parallel bar). Explain why.
  • ⚫ Expert: Read Modern Robotics Section 2.2 and compute the DOF of a delta robot from its legs. Explain what the parallelograms do to the platform’s orientation.

Next step

You can count freedoms. In Lesson 4 — Configuration Space Intuition you will turn those freedoms into a *space*: every possible set of joint angles as one point on a map — and see where joint limits and obstacles cut holes in it.

Look back: Lesson 2: Robot Systems Recap. Next: Lesson 4: Configuration Space Intuition. Related: Stage 1 — Math for Robotics and Stage 8 — Kinematics & IK.

Sources

Self-attested for now — keep artifacts in your lab notebook.

Complete

Today's goal

0 of 1 done today

0-day streak
Daily goal:lessons, quizzes or assignments a day

Mark this lesson complete when you have worked the experiment, knowledge check, and assignment (even roughly).

Stuck somewhere?

Ask a doubt about this lesson

Saved with this lesson's id and your email so we can reply. Privacy · or email contact@aihubstation.in