Robotics core · topic B3 · 45 hours
Rigid-body dynamics
Decides whether you can compute «how much torque this joint needs». Humanoid WBC, quadruped gaits, arm gravity compensation — all of it starts here.
What to learn
- The Lagrange derivation in one line: kinetic minus potential energy, differentiated with respect to the generalized coordinates
- The mass matrix, the Coriolis-and-centrifugal term, the gravity term — and at which speeds each becomes non-negotiable
- Newton–Euler recursion (RNEA): why engineering computes inverse dynamics with it instead of expanding formulas
- Parameter identification: why mass, center of mass, and inertia of the real machine must be measured, never taken from CAD
The lesson · plain words
Kinematics only answers «where»; dynamics answers «how much force». The entire page is really one equation: M(q)q̈ + C(q,q̇)q̇ + g(q) = τ. The three terms are inertia, Coriolis-and-centrifugal, gravity.
You can make a robot move without this equation — but you will never explain «why it is smooth at low speed and shakes when you speed up», or «why the same gains go unstable in a different posture».
The mass matrix is not a constant
Arm stretched out, the tip sits far from the axis and turning takes effort; bend the elbow and the equivalent inertia instantly drops. So M is a function of posture q, not three numbers hard-coded once.
Drag the elbow joint below: same motor, same gains, only the pose changed — the equivalent inertia swings by tens of percent. That is the mathematical reason «one set of PID gains for everything» must fall apart at high speed.
Interactive figure · drag it and see
What each term owns
Inertia term: the force you must supply to accelerate, proportional to acceleration. Coriolis and centrifugal: once things spin, links fling each other — velocity times velocity; negligible at low speed, the main character at high speed. Gravity: the holding torque you owe even standing still, changing with pose.
The most common engineering recipe is «gravity compensation + PID»: feed g(q) forward, hand the remainder to PID. Gains become far easier to tune, because the biggest known disturbance is gone from the loop.
Identification: where the parameters come from
Link masses, center-of-mass positions, inertia tensors — drawings usually do not carry them, and CAD is wrong anyway (harnesses, screws, and glue are never modeled). The only reliable route is identification: run the robot through several carefully designed trajectories, log joint angles, velocities, and torques, then least-squares your way back to the parameters.
Identification accuracy lives or dies on the excitation trajectory: too gentle, and parameters stay coupled (mass and center of mass blur together); too violent, and friction and flexibility pollute the fit. This is where experience genuinely earns its price.
Why it is fine in simulation but shakes on hardware
Inertia off by 20%, friction unmodeled, harmonic drives flexible, encoders lagging. At low speed all of that hides inside the noise floor; raise the control bandwidth and it amplifies into chatter — sometimes into singing.
Suggested debug order: get gravity compensation right first, then friction (low-speed crawling is friction), then flexibility (high-frequency squeal), and only then suspect inertia. Debug in reverse and you will circle for days.
Three questions — do you really get it?
1. Same arm, different posture — does the mass matrix M change?
- AYes, it varies continuously with posture
- BNo, it is a constant matrix
- COnly when the payload changes
Show answer
A. M is a function of q. Stretched versus bent, the links sit differently around the axis, so the equivalent inertia differs.
2. Which term is commonly neglected at low-to-medium speed?
- AThe inertia term
- BThe Coriolis-and-centrifugal term
- CThe gravity term
Show answer
B. The Coriolis term scales with velocity squared, tiny at low speed; the gravity term does not care about speed — it is always there.
3. Low-speed motion «moves in little jerks» — what do you suspect first?
- AInaccurate inertia parameters
- BInsufficient encoder resolution
- CFriction (static greater than kinetic)
Show answer
C. Static friction above kinetic causes stick-slip. Inertia error mostly shows up during acceleration; insufficient resolution shows up as uniform quantization steps.
Keep going deeper
Links without a marker stay on this site; the rest point to the Chinese edition until its translation batch lands.
How it fails in the field
- Ignoring the Coriolis term: at high speed the tracking error explodes beyond any story your PID tuning can tell
- Feeding CAD's theoretical inertia straight in without identifying: force-control parameters never converge
You have learned enough when
The Chinese edition carries the full topic page for Rigid-body dynamics, including the complete outline, depth requirements per career track, and further derivations: robotguide.dev/k/B3/.