Robot Kinematics

Kinematics maps joint angles to where the robot's tool is — and back. Learn joints and degrees of freedom, coordinate frames and homogeneous transforms, Denavit–Hartenberg parameters, forward and inverse kinematics, workspace, Jacobians and singularities.

To pick up a part, a robot controller must answer: 'what joint angles put my gripper here, at this orientation?' That's inverse kinematics. The reverse — 'where is the gripper for these joint angles?' — is forward kinematics.

Both rely on coordinate frames attached to each link and chained together with matrices.

An analogy

Your arm is a robot: shoulder, elbow and wrist angles decide where your hand is. You solve inverse kinematics unconsciously every time you reach for a cup.

Joints, links and DOF

Revolute joints rotate; prismatic joints slide. A free rigid body has 6 DOF (3 position + 3 orientation), so general-purpose arms have 6 joints. SCARA robots (4 DOF) suit planar pick-and-place; Cartesian gantries use 3 prismatic axes; 7-DOF arms add redundancy to avoid obstacles.

Frames and homogeneous transforms

Each link carries a coordinate frame. A 4 × 4 matrix combines a 3 × 3 rotation and a position vector; multiplying them chains frames from base to tool. Denavit–Hartenberg (DH) parameters (θ, d, a, α) describe each joint with four numbers.

Inverse kinematics and workspace

IK may have several solutions, one, or none (target out of reach). The workspace is the set of reachable points: for a 2-link arm, an annulus between |L₁ − L₂| and L₁ + L₂. Industrial 6-axis arms with spherical wrists have closed-form IK; others use numerical methods.

Jacobians and singularities

The Jacobian maps joint velocities to tool velocities (and, transposed, tool forces to joint torques). At singularities (arm fully stretched, wrist axes aligned) the Jacobian loses rank: some tool motions become impossible and joint speeds blow up. Path planners avoid them; damped least-squares IK stays stable nearby.

Formulas

Worked example: Forward kinematics

Given: L₁ = 0.4 m, L₂ = 0.3 m; θ₁ = 30°, θ₂ = 45°

Find: Tool position.

Answer: (0.424, 0.490) m

Worked example: Inverse kinematics

Given: Target (0.5, 0.3) m

Find: Joint angles (elbow down).

Answer: θ₁ ≈ 2.5°, θ₂ ≈ 68.0°

Forward & inverse kinematics of a 2-link arm (Python)

import math

def fk(t1, t2, L1=0.4, L2=0.3):
    x = L1*math.cos(t1) + L2*math.cos(t1 + t2)
    y = L1*math.sin(t1) + L2*math.sin(t1 + t2)
    return x, y

def ik(x, y, L1=0.4, L2=0.3, elbow_up=False):
    c2 = (x*x + y*y - L1*L1 - L2*L2) / (2*L1*L2)
    if abs(c2) > 1:
        raise ValueError("target out of reach")
    t2 = math.acos(c2) * (-1 if elbow_up else 1)
    t1 = math.atan2(y, x) - math.atan2(L2*math.sin(t2), L1 + L2*math.cos(t2))
    return t1, t2

print(fk(math.radians(30), math.radians(45)))   # (0.424, 0.490)
print([math.degrees(a) for a in ik(0.5, 0.3)])  # [2.48, 67.98]

Two IK solutions exist (elbow up/down); real robots choose based on joint limits and obstacles.

Common mistakes

Applications

Key takeaways

Going further