Module 2/5 · Weeks 4–6 · 27 h

Robot kinematics

UAT 308 Automation and Robotics Technology

About 90 minDraft, awaiting reviewLast updated 24 October 2026

Lesson

By the end of this module you will be able to

  1. Write the Jacobian of a planar arm and use it to convert tool velocity into joint velocity
  2. Explain singularities and measure closeness to them with manipulability
  3. Solve inverse kinematics numerically with damped least squares
  4. Compare actuator types and choose motors and gearing from the joint torques $\tau = J^{\mathsf{T}}F$
  5. Set safe working limits for an arm working near people and drones

Prerequisites: UAT 308 Module 1, including the review of vectors, matrices and rotation

Why this matters

The solar-farm UGV carries a small arm for swapping drone batteries on its roof and for holding a panel-cleaning nozzle. A two-joint arm’s forward and inverse kinematics can be solved with closed-form formulas, but real arms often have more joints, with no convenient closed form, and some poses force joints to turn impossibly fast. This module uses the Jacobian as its main tool.

The Jacobian and tool velocity

The Jacobian is the matrix of derivatives of the tool position with respect to the joint angles. It says that if the joints turn at , the tool moves at . To make the tool move as required, solve for in reverse. Poses where loses rank are singularities: the tool cannot move in some directions at all, and near them joints must turn very fast. Yoshikawa (1985) proposed the manipulability index , which is zero at a singularity; for a two-joint planar arm, .

Example 1 Reaching out almost to full extension

A two-joint arm with links of 0.40 and 0.30 m has its first joint at 0°. The tool must move outward along x at 0.10 m/s to push a battery into its slot. Compare different second-joint angles (simulated data).

import numpy as np

l1, l2 = 0.40, 0.30          # link lengths m
v_tool = np.array([0.10, 0.0])  # tool must move at 0.10 m/s

def jacobian(t1, t2):
    return np.array([
        [-l1*np.sin(t1) - l2*np.sin(t1+t2), -l2*np.sin(t1+t2)],
        [ l1*np.cos(t1) + l2*np.cos(t1+t2),  l2*np.cos(t1+t2)]])

t1 = np.radians(0)
for deg in [90, 30, 10, 2]:
    J = jacobian(t1, np.radians(deg))
    w = abs(np.linalg.det(J))
    qdot = np.linalg.solve(J, v_tool)
    print(f"θ2={deg:>2}°  manipulability={w:.4f}  "
          f"max joint speed={np.degrees(np.abs(qdot)).max():6.1f} deg/s")
θ2=90°  manipulability=0.1200  max joint speed=  19.1 deg/s
θ2=30°  manipulability=0.0600  max joint speed=  63.0 deg/s
θ2=10°  manipulability=0.0208  max joint speed= 191.2 deg/s
θ2= 2°  manipulability=0.0042  max joint speed= 957.4 deg/s

The straighter the arm (θ2 approaching 0), the lower the manipulability and the higher the joint speed needed, until it exceeds what typical motors can do. Working poses should therefore keep the arm reasonably bent, and the controller should limit joint speeds rather than try to follow impossible commands.

Manipulability against joint 2 angle from 0 to 180 degrees: a blue sine-shaped curve peaking at 90 degrees, with pink points at 90, 30, 10 and 2 degrees labelled with the required joint speeds of 19, 63, 191 and 957 degrees per second
Figure 1 Manipulability and required joint speed

Numerical IK with damped least squares

With no closed form, inverse kinematics is solved iteratively. Each iteration computes the error between the target and the current tool position, then moves the joints by a obtained from the Jacobian. The pseudoinverse method () converges fast when the target is reachable, but near singularities it commands huge joint jumps. Buss (2004) explains the damped least squares (DLS) method, which adds to trade a little accuracy for smooth motion.

Example 2 A three-joint arm, a reachable target and one too far away

A three-joint arm has links of 0.40, 0.30 and 0.20 m (maximum reach 0.90 m). The first target is the battery slot at (0.50, 0.40) m; the second is a point out of reach at (1.20, 0) m. Compare λ = 0 with λ = 0.2 over 200 iterations (simulated data).

import numpy as np

L = np.array([0.40, 0.30, 0.20])     # three links, maximum reach 0.90 m

def fk(q):
    a = np.cumsum(q)
    return np.array([np.sum(L*np.cos(a)), np.sum(L*np.sin(a))])

def jac(q):
    a = np.cumsum(q)
    J = np.zeros((2, 3))
    for i in range(3):
        J[0, i] = -np.sum(L[i:]*np.sin(a[i:]))
        J[1, i] = np.sum(L[i:]*np.cos(a[i:]))
    return J

def ik(target, lam, iters=200):
    q = np.radians([10.0, 20.0, 20.0])
    max_step = 0.0
    for _ in range(iters):
        e = target - fk(q)
        J = jac(q)
        dq = J.T @ np.linalg.solve(J @ J.T + (lam**2 + 1e-12) * np.eye(2), e)
        max_step = max(max_step, np.degrees(np.abs(dq)).max())
        q = q + dq
    return np.linalg.norm(target - fk(q)), max_step

for lam in [0.0, 0.2]:
    for target in [np.array([0.50, 0.40]), np.array([1.20, 0.0])]:
        err, step = ik(target, lam)
        print(f"lambda={lam}  target {target}  error {err*1000:5.1f} mm  "
              f"largest joint step {step:6.1f} deg")
lambda=0.0  target [0.5 0.4]  error   0.0 mm  largest joint step   76.2 deg
lambda=0.0  target [1.2 0. ]  error 799.9 mm  largest joint step 1480.9 deg
lambda=0.2  target [0.5 0.4]  error   0.0 mm  largest joint step   22.7 deg
lambda=0.2  target [1.2 0. ]  error 300.0 mm  largest joint step   28.4 deg

When the target is reachable, both methods get there, but DLS moves the joints far less per iteration. When the target is out of reach, the pseudoinverse commands joint jumps of more than a thousand degrees per iteration and ends 0.80 m from the target, while DLS smoothly stretches the arm towards it and ends 0.30 m away, exactly the real shortfall (). A real system should first check whether the target is in the workspace and raise a warning instead of trying on.

Two views of a blue three-joint arm: on the left the arm bends up to touch a pink target at 0.5, 0.4; on the right the arm is stretched straight horizontally towards a pink target at 1.2, 0, outside the dashed quarter circle showing the 0.90 metre maximum reach, leaving a 0.30 metre gap
Figure 2 Three-link arm poses from damped least squares IK

Actuators: types, torque and motor selection

An actuator turns a command into motion. Every joint of the arm and every wheel of the UGV needs one, and the right choice depends on the torque, speed and accuracy the job demands.

TypeHow it worksStrengths and limitsWhere in this case
Brushed DC motor with gearheadCurrent through the armature turns the shaft; a gearhead trades speed for torqueSimple to drive; brushes wearArm joints, small wheels
Brushless DC (BLDC) motorElectronic commutation by a driver, like the ESCs of a droneEfficient and long-lived; needs a driver and position sensingThe UGV’s drive wheels, drone rotors
Stepper motorTurns a fixed angle per pulseHolds position without feedback, but can lose steps under overload unnoticed (UAT 202)Camera pan on a slow mount
Smart servoMotor, gearbox, encoder and controller in one housingEasy to connect and command by position; limited torqueSmall arm joints and grippers
Pneumatic or hydraulicAir or oil pressure pushes a pistonLarge force; pneumatics need a compressor, hydraulics can leakGrippers and clamps in fixed stations

Torque is force times the lever arm: 1 kg held 0.9 m from a joint needs N·m. For an arm, Lynch and Park show that the joint torques needed to hold a force at the tool are , using the same Jacobian as Example 1. The worst case for gravity is usually the arm stretched out horizontally.

A gearhead with ratio and efficiency multiplies torque by and divides speed by (Lynch and Park). Most DC motors spin at thousands of rpm with low torque, so robot joints often use ratios of 100 or more. Motor data sheets give two torques: the stall torque at zero speed, which can only be sustained briefly, and the continuous torque, which the motor can deliver without overheating. The maxon key information explains how torque relates to current through the torque constant. ROBOTIS notes for its XM430-W350 servo (stall torque 4.1 N·m at 12 V, gear ratio 353.5:1, 12-bit absolute encoder) that real performance is closer to its performance graph than to the stall figure, so a servo should work well below its stall torque.

Example 3 Choosing actuators for the three-joint arm

The arm of Example 2 holds a battery with its gripper (0.80 kg) with the arm stretched out horizontally, the worst case for gravity. Each link’s mass, including the motor of the next joint, is assumed to act at the middle of the link. Usable torque follows the team’s rules (assumed): half the stall torque for a smart servo, and continuous torque × × for a geared motor. Motor figures other than the XM430 are assumed.

import numpy as np

g = 9.81
L = np.array([0.40, 0.30, 0.20])          # link lengths m (as in Example 2)
m_link = np.array([0.60, 0.40, 0.25])     # link masses incl. the next joint's motor kg (assumed)
m_load = 0.80                             # battery + gripper at the tool kg (assumed)

# worst case: arm straight out horizontally (all joint angles 0)
J_y = np.array([L.sum(), L[1:].sum(), L[2]])     # vertical row of the Jacobian at q = 0
tau_load = J_y * m_load * g                      # tau = J^T F for the load
joint_x = np.r_[0, np.cumsum(L)[:-1]]            # joint positions m
centres = np.cumsum(L) - L / 2                   # link mass centres m
tau_links = np.array([np.sum(m_link[i:] * (centres[i:] - joint_x[i])) * g for i in range(3)])
tau = tau_load + tau_links

usable = {  # smallest first; usable torque N·m (assumed rules in the text)
    "XM430-W350 servo": 0.5 * 4.1,          # half of stall torque at 12 V
    "DC motor + 100:1 gear": 0.10 * 100 * 0.7,
    "BLDC motor + 100:1 gear": 0.25 * 100 * 0.75,
}
for i in range(3):
    pick = next((n for n, u in usable.items() if tau[i] <= u), "none: redesign")
    print(f"joint {i + 1}: load {tau_load[i]:.2f} + links {tau_links[i]:.2f} = {tau[i]:5.2f} N·m -> {pick}")
joint 1: load 7.06 + links 5.30 = 12.36 N·m -> BLDC motor + 100:1 gear
joint 2: load 3.92 + links 1.57 =  5.49 N·m -> DC motor + 100:1 gear
joint 3: load 1.57 + links 0.25 =  1.81 N·m -> XM430-W350 servo

The shoulder (joint 1) must hold almost seven times the torque of the wrist, and over 40% of it comes from the arm’s own links rather than the battery. That is why arms put their heaviest motors near the base and keep the outer links light. The small servo suits only the wrist. Speed must be checked too: a motor at 6,000 rpm (assumed) through a 100:1 gear gives 60 rpm (360°/s) at the joint, well above the joint speeds of Example 1 in good poses.

Arm safety

An arm working near people and drones needs defined limits on workspace, speed and force. ISO 10218 (2025 edition) sets safety requirements for industrial robots and their use in robot cells. Although the UGV arm is small, the same principles apply: an emergency stop, joint speed limits, software limits on motion range, and an immediate stop when a person or still-spinning propeller is detected in the area.

Module lab

Lab: the Jacobian and IK on a training arm

Done in the course lab hours as Worksheet 2 (weeks 4 to 6 of the weekly plan); not counted in the module class time.

  1. Measure the training arm’s link lengths, write forward kinematics and the Jacobian, and check them against 5 measured poses
  2. Use Example 1 to compute the joint speeds needed in real working poses and compare with the servos’ maximum speed
  3. Write DLS IK following Example 2, command the arm to 5 mock battery-slot positions, and measure the error with a ruler
  4. Try different λ values and record accuracy against smoothness of motion
  5. Write the arm’s working limits and emergency-stop conditions

Common mistakes

Watch out

  • Designing working poses near singularities, such as keeping the arm fully stretched
  • Using the pseudoinverse without limiting step size
  • Not checking that the target is in the workspace before running IK
  • Setting λ too large, so the arm cannot reach targets that are reachable
  • Having no software limits or emergency stop
  • Choosing a motor by its stall torque or forgetting the weight of the arm’s own links

Summary

  • The Jacobian converts joint velocity into tool velocity and can be used in reverse
  • Near singularities, manipulability approaches zero and joint speeds soar
  • DLS makes numerical IK smooth and robust to unreachable targets
  • Joint torques follow and are worst with the arm stretched out; choose each actuator by continuous torque, not stall torque, with gearing that trades speed for torque
  • Arms need working limits and safety measures following the principles of ISO 10218

Check your understanding

  1. A two-joint arm with links of 0.4 and 0.3 m at θ2 = 90° has what manipulability?
  2. What is a singularity?
  3. A 1.0 kg load is held 0.5 m from a joint. What torque does the joint need, and what motor torque is that through a 100:1 gear with 70% efficiency?
  4. What does λ in DLS trade against what?
  5. A three-joint arm with 0.9 m total length has a target 1.1 m away. About what error will DLS leave?
Answers
  1. A pose where the Jacobian loses rank, so the tool cannot move in some directions
  2. N·m at the joint, so N·m at the motor
  3. A little accuracy for smooth motion without jumps
  4. About m

Key formulas

Tool velocity
Manipulability
Joint torque from tool force
Damped least squares

Key references

  1. Lynch, K. M., & Park, F. C. (2017). Modern robotics: Mechanics, planning, and control. Cambridge University Press. link
  2. Yoshikawa, T. (1985). Manipulability of robotic mechanisms. The International Journal of Robotics Research, 4(2), 3–9. link
  3. Buss, S. R. (2004). Introduction to inverse kinematics with Jacobian transpose, pseudoinverse and damped least squares methods [Unpublished manuscript]. University of California, San Diego. link
  4. Corke, P. (2023). Robotics, vision and control: Fundamental algorithms in Python. Springer. link
  5. International Organization for Standardization. (2025). Robotics – Safety requirements – Part 1: Industrial robots (ISO 10218-1:2025). link
  6. International Organization for Standardization. (2025). Robotics – Safety requirements – Part 2: Industrial robot applications and robot cells (ISO 10218-2:2025). link
  7. maxon. Key information on maxon DC motor and maxon EC motor (speed constant and torque constant). link
  8. ROBOTIS. XM430-W350 e-Manual (specifications). link

Further reading

Study the assigned knowledge units in advance, review media and take the module quiz

In class / field

Lab or field practice from worksheets with a safety checklist

Learning evidence: Checked worksheets and quiz results

Module quiz

This is a formative self-check, not a graded exam

Knowledge domain: Automation, robotics and swarms