One Equation, Read Two Ways
Earlier rungs built up the robot equation of motion: a tidy bookkeeping of how torque, inertia, motion, and gravity balance at every joint. The beautiful thing is that this single equation can be read in two directions, and each direction is a different, hugely useful tool. Read it one way and you have inverse dynamics; read it the other way and you have forward dynamics.
M(q) * qddot + C(q, qdot) * qdot + g(q) = tau M(q) : mass / inertia matrix (how heavy each motion feels) C(.) : Coriolis & centrifugal terms (velocity coupling) g(q) : gravity term tau : joint torques the motors must supply Inverse dynamics: given q, qdot, qddot -> solve for tau Forward dynamics: given tau, q, qdot -> solve for qddot
The symbols q, qdot, and qddot are the joint angles, velocities, and accelerations. The mass (inertia) matrix M, the Coriolis and centrifugal terms C, and the gravity term g are the three force contributions we met earlier. Everything below is just a story about which symbol you treat as known and which you solve for.
Inverse Dynamics: From Plan to Push
Inverse dynamics answers a planner's question: "I want the arm to move along this path, with these velocities and accelerations — what torque must each motor produce right now?" You feed in the desired motion (q, qdot, qddot) and the equation hands back the required joint torques tau. Because you are plugging known numbers into the right-hand side, there is no equation to invert here — it is a direct, fast computation.
This is the engine behind feedforward control. Instead of waiting for the robot to drift off course and then correcting — the reactive job of feedback control — inverse dynamics computes the torque the move will need *in advance* and applies it proactively. A pure PID controller would have to fight gravity and inertia by reacting to error; with a feedforward term, most of the work is already done, and feedback only mops up the small leftover mistakes.
Push this idea all the way and you get computed-torque control: at every cycle the controller uses inverse dynamics to cancel the robot's own nonlinear weight and inertia, turning a tangled multi-joint system into something that behaves like a simple, well-behaved spring-and-damper. Even the gentlest version — holding an arm steady against its own weight — is just inverse dynamics with zero target acceleration, better known as gravity compensation.
Forward Dynamics: From Push to Motion
Forward dynamics runs the equation the other way. Here you know the torques — perhaps the ones your controller is about to send — and you ask: "Given these pushes, how will the robot actually accelerate?" Solving for qddot does require inverting the mass matrix M, but that is a well-understood linear-algebra step. Once you have acceleration, you integrate it forward in tiny time steps to get velocity, then position, and the robot's future motion unrolls before your eyes.
This is exactly what a robot simulator does, thousands of times per second: take the current state and the applied torques, run forward dynamics, step time forward, repeat. It is the beating heart of every digital twin — a virtual copy of a real robot you can prod, crash, and retrain without bending any metal.
A clean way to remember the pair: inverse dynamics asks "what force do I need?" and lives inside controllers; forward dynamics asks "what will this force do?" and lives inside simulators. They are inverses of each other, and a good simulator and a good controller are really the same physics knowledge pointed in opposite directions.
Contact Dynamics: Where the Math Gets Rough
Everything so far assumed a robot moving freely through empty space, where forces and motions vary smoothly. The moment the robot *touches something* — a gripper on a part, a foot on the ground — that smoothness shatters. This is the realm of contact dynamics, and it is where elegant equations meet a stubborn world.
Three things break the smooth picture. First, impacts: when a foot strikes the floor, velocity changes almost instantly, a near-discontinuous jolt the differential equation has to absorb. Second, the friction cone: a contact can only push, never pull, and can only resist sideways slipping up to a limit set by friction — so the allowed forces live inside a cone, not the whole space. Third, the contact is on-off: a foot is either touching or not, and the equations flip between two completely different regimes the instant it switches.
This is also why touching the world is best handled not by stiff position commands but by yielding ones. A robot that meets a surface with impedance control behaves like a programmable spring, letting contact forces stay gentle instead of spiking — a far safer way to handle the discontinuities that contact throws at it.
Pitfalls, the Sim-to-Real Gap, and the Frontier
Dynamics is only as good as its model, and real robots conspire to spoil the model. Every mass, every center of gravity, every friction coefficient is measured imperfectly, so the M, C, and g you compute are always a little wrong. Worse, real links are not perfectly rigid: gears flex, belts stretch, and harmonic drives wind up like tiny springs. This unmodeled flexibility means the torque you commanded and the motion you got never quite match.
Friction deserves special blame. The simple joint friction in textbooks is a smooth curve, but real friction sticks, then suddenly slips, and changes with temperature and wear — notoriously hard to model. Add it all up and you get the reality gap: a controller or policy that works flawlessly in simulation but stumbles on the real machine. Closing it is the whole challenge of sim-to-real transfer.
The frontier is splitting the difference between hand-derived physics and pure trial-and-error. Learned dynamics models let a robot fit its own equation of motion from experience — including the friction and flexibility nobody can write down cleanly — and a world model takes this further, learning to predict the consequences of actions directly from data. The hardest prize of all is contact-rich manipulation: tasks like inserting a plug or buttoning a shirt, where success lives entirely in the messy contact regime that classical models handle worst. That is where dynamics research is heading next.