Skip to content

Robot Dynamics

Conceptual

Robot Dynamics is the study of the forces and torques required to produce motion in a robot — accounting for mass, inertia, gravity, and friction. Where kinematics asks where the robot is and how it moves geometrically, dynamics asks what forces and torques are needed to make it move that way. It is the difference between knowing a path exists and knowing how hard each motor must push to follow it.

Prerequisites

The Equation of Motion

Every rigid-body robot obeys one master equation, the manipulator equation. In plain terms:

The torque you apply at each joint must supply three things at once: the torque to accelerate the links (their inertia resists speeding up), the torque to handle velocity-dependent effects (Coriolis and centrifugal forces that appear when joints move together), and the torque to hold against gravity.

Naming the symbols before the math:

  • q — the vector of joint positions (angles or slides)
  • q̇ (q-dot) — joint velocities
  • q̈ (q-double-dot) — joint accelerations
  • M(q) — the mass/inertia matrix: how much each joint resists acceleration, depending on the current pose
  • C(q, q̇) — the Coriolis & centrifugal term: forces that arise from joints moving simultaneously
  • g(q) — the gravity term: torque needed just to hold the pose still
  • τ (tau) — the joint torques, what the motors actually deliver

Put together:

M(q)·q̈ + C(q,q̇)·q̇ + g(q) = τ
└─inertia─┘ └─Coriolis/centrifugal─┘ └gravity┘ └motors┘

Forward vs Inverse Dynamics

These mirror forward/inverse kinematics, but for forces instead of geometry:

Forward dynamics: τ (torques) → [solve for q̈] → motion (used in SIMULATION)
Inverse dynamics: desired q,q̇,q̈ → [solve for τ] → torques (used in CONTROL)

Forward dynamics answers “given these motor torques, how will the robot move?” — this is exactly what a physics simulator like Isaac Sim or MuJoCo computes every timestep. Inverse dynamics answers “to follow this trajectory, what torques do I command?” — the basis of gravity compensation and feedforward control. Model-based controllers (MPC, LQR) and any serious sim-to-real pipeline all need an accurate dynamics model; if the model is wrong, the simulation lies and the controller fights the real robot.

Worked Example: Gravity Compensation on a Pendulum

Take the simplest case — a single revolute joint holding a point mass m at the end of a massless link of length L, at angle θ measured from vertical. To hold it still (no acceleration, no velocity), the inertia and Coriolis terms vanish, leaving only gravity:

τ = m · g · L · sin(θ)

With m = 2 kg, L = 0.5 m, θ = 30°, g = 9.81 m/s²:

τ = 2 · 9.81 · 0.5 · sin(30°)
= 2 · 9.81 · 0.5 · 0.5
= 4.905 N·m

So the motor must supply 4.905 N·m just to keep the arm from falling — before any actual motion. A controller that adds this term as feedforward lets the PID loop handle only the small errors, not the whole weight of the arm.

import numpy as np
def gravity_compensation_torque(m, L, theta_deg, g=9.81):
"""Holding torque for a single-link pendulum (mass m at length L)."""
return m * g * L * np.sin(np.radians(theta_deg))
tau = gravity_compensation_torque(m=2.0, L=0.5, theta_deg=30.0)
print(f"Holding torque: {tau:.3f} N·m")
# Output: Holding torque: 4.905 N·m

Sources