Skip to the content
FixTheRobot Explore Robotics / Manipulator Basics / Theory / 09

Manipulator Basics · Theory · Module 09 of 14

09 — Manipulator Dynamics

Kinematics says where the arm goes; dynamics says what torques it takes. Derive the equation of motion M(q)q̈ + C(q, q̇)q̇ + g(q) = τ for a 2R arm, compute gravity and inertia torques with real numbers, and see what a payload changes.

  • Advanced
  • About 7 minutes to read
  • 1 linked lab

Every motor torque a robot produces goes to one of four things: accelerating the links, the speed-dependent Coriolis and centrifugal effects, holding the links up against gravity, and overcoming friction. Knowing which dominates tells you how to size motors and design controllers.

Learning objectives

After this module you should be able to:

  • Write the manipulator equation of motion and explain each term.
  • Derive the 2R dynamics with the Euler–Lagrange method.
  • Describe the recursive Newton–Euler algorithm and when it is used.
  • Compute gravity, inertia and Coriolis torques for given states, and the effect of a payload.
  • State the limitations of a simplified rigid-body model compared with a real industrial robot.

Conceptual explanation

A manipulator's dynamics relate joint torques τ\tau to joint motion (q,q˙,q¨)(q, \dot q, \ddot q):

  • Inertia M(q)q¨M(q)\ddot q: the mass matrix M(q)M(q) is symmetric, positive definite and configuration-dependent. A stretched arm is harder to swing than a folded one. Off-diagonal terms couple the joints: accelerating the elbow pushes back on the shoulder.
  • Coriolis and centrifugal C(q,q˙)q˙C(q, \dot q)\dot q: quadratic in the velocities. They are small at low speed and significant in fast motions.
  • Gravity g(q)g(q): the torques needed to hold the arm still. For slow industrial motions this is usually the largest term.
  • Friction τf(q˙)\tau_f(\dot q): viscous, Coulomb and stiction in gears and bearings. On geared robots it is large and hard to model.

Two questions use the same equation. Inverse dynamics asks what torque produces a desired motion; it is used for feedforward control and motor sizing. Forward dynamics asks what motion a given torque produces; it is used for simulation.

Two ways to derive it

Euler–Lagrange works with energies: write the kinetic energy KK and potential energy VV as functions of qq and q˙\dot q, then differentiate. It is systematic and gives the closed-form structure, which is ideal for analysis and for small arms. Newton–Euler applies F=maF = ma and τ=Iω˙+ω×Iω\tau = I\dot\omega + \omega \times I\omega link by link. A forward pass propagates velocities and accelerations from the base out; a backward pass propagates forces and torques from the tool in. It runs in O(n)O(n) time and is what real-time controllers and simulators use.

About the model used here. The examples and the interactive figure use a 2R arm moving in a vertical plane: two rigid uniform rods, viscous friction only, an optional point payload. It shows the structure of manipulator dynamics faithfully. It is not an identified model of an industrial robot, which would add gear ratios and rotor inertia, Coulomb and Stribeck friction, joint elasticity, motor and drive limits, and cable forces. Identified parameters can differ from CAD values by tens of percent.

Mathematical formulation

Manipulator equation of motion
M(q) q¨+C(q,q˙) q˙+g(q)+τf(q˙)=τM(q)\,\ddot q + C(q, \dot q)\,\dot q + g(q) + \tau_f(\dot q) = \tau

Euler–Lagrange:

  1. L(q,q˙)=K−V,K=12q˙TM(q)q˙\mathcal{L}(q, \dot q) = K - V, \qquad K = \tfrac12 \dot q^{T} M(q)\dot q

    The Lagrangian: kinetic minus potential energy.

  2. ddt∂L∂q˙i−∂L∂qi=τi\frac{d}{dt}\frac{\partial \mathcal{L}}{\partial \dot q_i} - \frac{\partial \mathcal{L}}{\partial q_i} = \tau_i

    One equation per joint; τi is the generalised (non-conservative) force at joint i.

  3. Cij=∑k12(∂Mij∂qk+∂Mik∂qj−∂Mjk∂qi)q˙k,gi=∂V∂qiC_{ij} = \sum_k \tfrac12\left(\frac{\partial M_{ij}}{\partial q_k} + \frac{\partial M_{ik}}{\partial q_j} - \frac{\partial M_{jk}}{\partial q_i}\right)\dot q_k, \qquad g_i = \frac{\partial V}{\partial q_i}

    Christoffel symbols give C so that Ṁ − 2C is skew-symmetric, a property used in stability proofs.

The 2R arm in a vertical plane (link masses mim_i, centres of mass at lcil_{c_i}, inertias IiI_i about the centres of mass):

Mass matrix
M=[m1lc12+I1+m2(L12+lc22+2L1lc2c2)+I2m2(lc22+L1lc2c2)+I2m2(lc22+L1lc2c2)+I2m2lc22+I2]M = \begin{bmatrix} m_1 l_{c_1}^2 + I_1 + m_2(L_1^2 + l_{c_2}^2 + 2L_1 l_{c_2} c_2) + I_2 & m_2(l_{c_2}^2 + L_1 l_{c_2} c_2) + I_2 \\ m_2(l_{c_2}^2 + L_1 l_{c_2} c_2) + I_2 & m_2 l_{c_2}^2 + I_2 \end{bmatrix}
Coriolis, centrifugal and gravity terms
Cq˙=[−h (2q˙1q˙2+q˙22)h q˙12],h=m2L1lc2s2,g=[(m1lc1+m2L1) g c1+m2lc2 g c12m2lc2 g c12]C\dot q = \begin{bmatrix} -h\,(2\dot q_1\dot q_2 + \dot q_2^2) \\ h\,\dot q_1^2 \end{bmatrix}, \quad h = m_2 L_1 l_{c_2} s_2, \qquad g = \begin{bmatrix} (m_1 l_{c_1} + m_2 L_1)\,g\,c_1 + m_2 l_{c_2}\,g\,c_{12} \\ m_2 l_{c_2}\,g\,c_{12} \end{bmatrix}

A payload of mass mpm_p at the tool is folded into link 2: its mass becomes m2+mpm_2 + m_p and its centre of mass and inertia shift by the parallel-axis theorem.

Diagrams

Forces and torques on a 2R armTwo links with their centres of mass; gravity pulls each centre of mass down and the joint torques hold the arm. At q = (30°, 40°) the gravity torques are 8.08 and 0.60 N·m.m₁g = 19.6 Nm₂g = 11.8 Nτ₁ = 8.08 N·mτ₂ = 0.60 N·mCOM 1COM 2L₁ = 0.40 m, L₂ = 0.30 m, m₁ = 2.0 kg, m₂ = 1.2 kgq = (30°, 40°), arm at rest: τ = g(q)
Free-body sketch of the 2R arm used throughout this module, drawn to scale. Held still, each joint torque must balance the moment of gravity on every link beyond that joint; the numbers are computed by the engine's g(q).

Worked examples

The parameters

The 2R model used in this module and in Lab 08.
L₁L₂m₁m₂lc1lc2I₁, I₂friction
0.4 m0.3 m2 kg1.2 kg0.2 m0.15 mmL²/12 (uniform rods)b = 0.05 N·m·s/rad

Example 1: holding the arm horizontal

With both links horizontal (q=(0,0)q = (0, 0)) the arm is still, so only gravity acts:

g(0,0)=((2⋅0.2+1.2⋅0.4) 9.81+1.2⋅0.15⋅9.81, 1.2⋅0.15⋅9.81)=(10.40, 1.77) N⋅mg(0, 0) = \big((2\cdot0.2 + 1.2\cdot0.4)\,9.81 + 1.2\cdot0.15\cdot 9.81,\ 1.2\cdot0.15\cdot 9.81\big) = (10.40,\ 1.77)\ \text{N·m}

With a 1 kg payload at the tool the holding torques rise to (17.27, 4.71)(17.27,\ 4.71) N·m, an increase of 66% at the shoulder and 167% at the elbow. Pointing the arm straight up (q1=90°q_1 = 90°) drops the gravity torques to (0.00, 0.00)(0.00,\ 0.00): the weight then passes through the joints.

Example 2: the mass matrix depends on the pose

Mass matrix entries as the elbow folds.
q₂M₁₁ (kg·m²)M₁₂M₂₂
0°0.47870.10800.0360
90°0.33470.03600.0360
180°0.1907-0.03600.0360

The shoulder's effective inertia M11M_{11} at q2=0q_2 = 0 (stretched) is about 2.5 times its value at q2=180°q_2 = 180° (folded). A fixed-gain controller tuned in one pose behaves differently in another. M22M_{22} does not depend on qq.

Example 3: inverse dynamics of a fast start

Starting from rest at q=(0,0)q = (0, 0) with q¨=(2,0)\ddot q = (2, 0) rad/s²:

τ=Mq¨+g=[0.47870.10800.10800.0360][20]+[10.3991.766]=(11.36, 1.98) N⋅m\tau = M\ddot q + g = \begin{bmatrix}0.4787 & 0.1080 \\ 0.1080 & 0.0360\end{bmatrix}\begin{bmatrix} 2 \\ 0 \end{bmatrix} + \begin{bmatrix} 10.399 \\ 1.766 \end{bmatrix} = (11.36,\ 1.98)\ \text{N·m}

Even this brisk acceleration adds only about 9% to the shoulder torque; gravity dominates. The elbow torque also rises although its joint does not accelerate: that is the inertial coupling M21M_{21}.

Example 4: Coriolis and centrifugal torques

At q=(0,90°)q = (0, 90°) with the shoulder spinning at q˙1=2\dot q_1 = 2 rad/s and the elbow still, Cq˙=(0.000, 0.288)C\dot q = (0.000,\ 0.288) N·m. The centrifugal effect on link 2 is felt at the elbow. It grows with the square of speed: at 4 rad/s it is four times larger.

Example 5: checking the model with energy

Simulating a frictionless fall from horizontal for 2 s with fourth-order Runge–Kutta at 1 ms, the total energy K+VK + V stays within 1.3e−81.3e-8 J of its initial value while the kinetic energy peaks at 10.37 J. An energy test like this catches sign errors in CC or gg at once.

Interactive experiment

Interactive gravity torque of a 2R arm (needs JavaScript).

Move the joints and the payload: the gravity torque at each joint and the mass-matrix entries update.

Real-world applications

  • Gravity compensation: controllers add g(q)g(q) as feedforward so position loops do not need large integral action (Module 11).
  • Computed-torque control uses the full model to linearise the arm.
  • Motor and gearbox sizing uses inverse dynamics over the worst-case trajectories and payloads.
  • Collision detection on collaborative robots compares measured motor current with the torque the model predicts. A large difference means unexpected contact.
  • Simulation: forward dynamics drives physics engines and digital twins.

See the model working in Lab 08.

Common mistakes

Ignoring the coupling terms

M is not diagonal: moving one joint creates torque at the others. Independent joint controllers must reject this as a disturbance.

Assuming the mass matrix is constant

M(q) changes with the pose (Example 2). Gains tuned in one pose may be too soft or too aggressive in another.

Forgetting the payload

A payload changes link 2's mass, centre of mass and inertia. Industrial controllers require the payload to be entered, and wrong values give poor tracking and false collision alarms.

Trusting a CAD-based model for precise control

Friction, gear inertia and elasticity are missing from CAD. Precise feedforward needs parameter identification on the real robot.

Key takeaways

  1. M(q)q̈ + C(q, q̇)q̇ + g(q) + τf = τ: inertia, velocity effects, gravity and friction.
  2. Euler–Lagrange gives the structure; recursive Newton–Euler computes it in O(n) for control and simulation.
  3. M(q) is symmetric, positive definite and pose-dependent; gravity often dominates in slow motions.
  4. The 2R model here is a teaching model; industrial models add friction, drives and elasticity, and are identified on the robot.

Knowledge check

Write an answer to each question, then reveal the explanation. Your answers stay in your browser.

Question 1

Which term of the equation of motion remains when the arm is held still?

Explanation

Gravity g(q) (plus any static friction). With q̇ = q̈ = 0, the inertia and Coriolis terms vanish.

Question 2

Why is the shoulder's effective inertia larger when the arm is stretched?

Explanation

Link 2's mass is further from the shoulder axis: the m₂·2L₁lc2cos q₂ term in M₁₁ is largest at q₂ = 0.

Question 3

Name one property of M(q) and what it guarantees.

Explanation

Symmetric positive definite: the kinetic energy ½q̇ᵀMq̇ is positive for any motion, and M is always invertible, so forward dynamics is well defined.

Question 4

When is Newton–Euler preferred over Euler–Lagrange?

Explanation

For numerical, real-time computation on arms with many joints: its recursive form is O(n) and does not need the symbolic M, C and g.

Question 5

A 1 kg payload raised the shoulder holding torque from about 10.4 to 17.3 N·m. Why so much?

Explanation

The payload sits at the tool, 0.7 m from the shoulder: 1 kg × 9.81 × 0.7 ≈ 6.9 N·m extra, which is a large lever arm for a small mass.

Practise it in the labs

Then test yourself in practice exercises and challenge mode.

References and further reading

  • J. Y. S. Luh, M. W. Walker and R. P. C. Paul, "On-line computational scheme for mechanical manipulators", ASME Journal of Dynamic Systems, Measurement and Control, 102, 1980 (recursive Newton–Euler).
  • R. Featherstone, Rigid Body Dynamics Algorithms, Springer, 2008.
  • M. W. Spong, S. Hutchinson and M. Vidyasagar, Robot Modeling and Control, 2nd ed., Wiley, 2020, chapter 6.