Education › Robotics › Stage 4: Build real robots

Robotic arms and manipulation

Servos, inverse kinematics basics, and programming a cheap multi-joint arm to pick things up.

Intermediate→Advanced ~33 min read Module 15 of 16

A robot arm — a manipulator — is where robotics meets the physical task: picking, placing, assembling, sorting. It brings together ideas from across this track: servos or geared motors as joints, kinematics to relate joint angles and hand position, control to move smoothly, and often vision to find what to grasp. This lesson explains how an arm is built and described, how it moves to a target, how a gripper picks things up, and the safety mindset a moving arm demands. Build a simple pick-and-place arm and you have touched every core skill in robotics.

After this module you can
  • Describe an arm in terms of links, joints and degrees of freedom
  • Relate joint space and task space through forward and inverse kinematics
  • Explain how an arm moves smoothly to a target and grasps an object
  • Apply the safety practices a powered arm requires

Joint space and task space

There are two ways to describe where an arm is, and moving between them is the central skill. Joint space is the list of joint angles — what the servos actually take as commands. Task space (or Cartesian space) is where the hand is in the real world — an (x, y, z) position and an orientation, which is how you naturally think about a task ('put the gripper here'). Connecting them is the kinematics from the earlier lesson. Forward kinematics turns joint angles into a hand position — easy, one answer. Inverse kinematics turns a desired hand position into the joint angles that achieve it — harder, possibly several solutions (elbow up or down) or none if the target is out of reach. Every 'move the hand to that spot' command is an inverse-kinematics problem whose output is a set of joint angles you then send to the servos.

python
import numpy as np

def forward_2link(a1, a2, L1, L2):
    """Two-joint planar arm: joint angles -> hand (x, y)."""
    x = L1*np.cos(a1) + L2*np.cos(a1 + a2)
    y = L1*np.sin(a1) + L2*np.sin(a1 + a2)
    return x, y

def inverse_2link(x, y, L1, L2):
    """Hand (x, y) -> joint angles (elbow-down solution)."""
    r2 = x*x + y*y
    cos_a2 = (r2 - L1*L1 - L2*L2) / (2*L1*L2)
    if abs(cos_a2) > 1:
        return None                     # target is out of reach
    a2 = np.arccos(cos_a2)
    a1 = np.arctan2(y, x) - np.arctan2(L2*np.sin(a2), L1 + L2*np.cos(a2))
    return a1, a2

print(inverse_2link(0.3, 0.1, 0.2, 0.2))   # angles to reach (0.3, 0.1)

Moving smoothly and grasping

Knowing the target joint angles is not enough — an arm must move to them *smoothly*, or it will jerk, overshoot, and knock things over. This is trajectory planning: instead of snapping each joint to its final angle, you ramp the angles over time along a smooth profile (accelerate, cruise, decelerate) so the whole arm glides. On top of that, closed-loop control (the PID from the control lesson) holds each joint on its planned path against gravity and load. The gripper is the business end: a simple servo-driven claw that opens and closes, and the real skill is knowing *when* to close and how hard — too little and the object slips, too much and you crush it or stall the servo. Vision often feeds this step, locating the object so inverse kinematics can aim the hand at it. Put together — see the object, solve IK for its position, plan a smooth trajectory, move under control, close the gripper — is a complete pick-and-place.

  • Plan a smooth trajectory, don't snap joints to their target.
  • Hold each joint on its path with closed-loop control against gravity.
  • Close the gripper with enough force to hold but not crush.
  • Use vision to locate the object, then solve IK to reach it.

Safety: an arm can hurt you

A moving arm carries real hazards that a small rover does not, and a safety mindset is not optional. A geared arm can move fast and with force — enough to pinch fingers, hit a face, or fling an object. Powerful arms have a workspace (the volume the hand can reach) that people must stay clear of while it runs. Practise these habits from your very first arm: keep an emergency stop — a way to cut power instantly — within reach whenever it is powered; test new motions slowly or at reduced power before running them at speed; keep your hands and face out of the workspace during a run; secure the arm's base so it cannot tip; and be aware that a power loss can make an arm drop under gravity, so never rest anything (including a hand) under a raised joint. These are the same instincts professionals use around industrial robots, scaled to your bench, and building them now keeps a fun project from becoming an injury.

Watch out

Always have a way to cut power to the arm instantly, and never put your hand inside the arm's reach while it is powered and moving. Test new trajectories at low speed first — a bug that is harmless in simulation can swing a real arm hard.

Hands-on practice

Build a pick-and-place motion

  1. Assemble or simulate a 4–5 DOF servo arm and confirm each joint responds to an angle command.
  2. Implement forward kinematics and verify the predicted hand position matches where the arm actually points.
  3. Implement inverse kinematics for a target position and command the joints to reach it.
  4. Add a smooth trajectory so the joints ramp to their targets instead of snapping, and tune it until motion is steady.
  5. Add gripper open/close and perform a full pick from one spot and place at another — with an emergency stop within reach and first runs at low speed.
Cheat sheet

Robotic arms and manipulation — at a glance

Main things to focus on

  • An arm is links joined by joints, ending in a gripper; each moving joint is a degree of freedom.
  • Joint space = the angles; task space = the hand's position in the world.
  • Forward kinematics: angles → position; inverse kinematics: position → angles.
  • Move with a smooth trajectory and closed-loop control, not by snapping joints.
  • Grip with enough force to hold but not crush; vision often locates the target.
  • Keep an emergency stop, test slowly, and stay out of the workspace.

Arm anatomy

linka rigid segment of the arm
jointa moving connection between links
end-effectorthe hand or gripper
degrees of freedomcount of independently moving joints

Describing pose

joint spacethe list of joint angles
task spacethe hand's (x, y, z) and orientation
forward kinematicsangles → hand position
inverse kinematicshand position → angles

Moving & grasping

trajectory planningramp joints smoothly to target
closed-loop controlhold each joint on its path
gripper forcehold without crushing or slipping
vision-guided grasplocate object, then solve IK

Safety

emergency stopcut power instantly
workspacereach volume to keep clear of
test slowlow speed before full speed
power-loss droparm can fall when unpowered

Common pitfalls

  • Snapping joints to their target angles, making the arm jerk and overshoot.
  • Gripping with too much force and crushing the object or stalling the servo.
  • Commanding a target outside reach, so inverse kinematics has no valid solution.
  • Running a new trajectory at full speed before testing it slowly.
  • Putting a hand inside the powered workspace, or resting something under a raised joint.
Quiz

Check your understanding

5 questions · 4 to pass · answers are explained as you go. Your best score is saved on this device only.

Progress and quiz scores are saved in this browser only. Back up or restore on the hub.

Was this lesson useful? Tell me what to improve →