Manipulator dynamics: Lagrange-Euler formulation

Deriving manipulator equations of motion from L = T − V: the mass matrix, Coriolis/centrifugal and gravity terms, with single-link and two-link torque calculations.

Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Kinematics says where the arm goes; dynamics says what torque each motor must produce to get it there at the required speed and acceleration. The dynamic model is used to size motors and gearboxes, to simulate a robot before it is built, and inside advanced controllers (computed-torque, feed-forward) that track fast trajectories accurately.

Key ideas

Two directions.

  • Inverse dynamics: given q, q̇, q̈ along a trajectory, find the joint torques τ — used for motor sizing and feed-forward control.
  • Forward dynamics: given τ, find q̈ and integrate to get the motion — used in simulation.

Lagrange-Euler (L-E) approach. Treat the joint variables q as generalised coordinates. Write the total kinetic energy T and potential energy V of all links, form the Lagrangian L = T − V, and apply Lagrange's equation to each joint. The right-hand side is the generalised force for that coordinate — the joint torque (revolute) or force (prismatic), plus any non-conservative effects such as friction, which are simply added to τ.

Kinetic energy of a link = translational energy of its centre of mass + rotational energy about the centre of mass: Tᵢ = ½·mᵢ·v_cᵢᵀv_cᵢ + ½·ωᵢᵀIᵢωᵢ. Both velocities come from the link's Jacobian, so T = ½·q̇ᵀM(q)q̇, where M(q) is the mass (inertia) matrix — symmetric and positive definite.

Standard form of the result:

τ = M(q)·q̈ + C(q, q̇)·q̇ + g(q) (+ friction)

  • M(q)q̈ — inertia terms. Diagonal terms: effective inertia seen by each joint; off-diagonal terms: coupling (accelerating joint 2 loads joint 1).
  • C(q, q̇)q̇ — velocity terms. Centrifugal (∝ q̇ᵢ²) and Coriolis (∝ q̇ᵢq̇ⱼ) forces. Zero when the arm is not moving.
  • g(q) — gravity terms. Depend only on configuration; the whole torque when the arm is held still.

Properties used in control: M is symmetric positive-definite; the model is linear in the inertial parameters (masses, inertias), which allows identification and adaptive control; Ṁ − 2C is skew-symmetric (energy conservation).

L-E vs Newton-Euler (N-E). L-E gives closed-form equations that show structure clearly, but the classic 4 × 4 matrix version costs O(n⁴) operations — slow for real-time use. Recursive N-E propagates velocities outward and forces inward, link by link, costing O(n), so controllers use N-E numerically while analysis uses L-E. Both give identical torques.

Formulas

L = T − V

  • T — total kinetic energy (J); V — total potential energy (J).

d/dt(∂L/∂q̇ᵢ) − ∂L/∂qᵢ = τᵢ

  • qᵢ — joint variable (rad or m); τᵢ — generalised force at joint i (N·m or N).

τ = M(q)·q̈ + C(q, q̇)·q̇ + g(q)

Single uniform link (mass m, length L) about one end, θ from horizontal: τ = (m·L²/3)·θ̈ + m·g·(L/2)·cos θ

Planar 2R with point masses m₁, m₂ at the link ends (θ₁ from horizontal, vertical plane):

M₁₁ = m₁·L₁² + m₂·(L₁² + 2·L₁·L₂·cos θ₂ + L₂²) M₁₂ = M₂₁ = m₂·(L₁·L₂·cos θ₂ + L₂²), M₂₂ = m₂·L₂² τ₁ = M₁₁·θ̈₁ + M₁₂·θ̈₂ − m₂·L₁·L₂·sin θ₂·(2·θ̇₁·θ̇₂ + θ̇₂²) + (m₁ + m₂)·g·L₁·cos θ₁ + m₂·g·L₂·cos(θ₁ + θ₂) τ₂ = M₂₁·θ̈₁ + M₂₂·θ̈₂ + m₂·L₁·L₂·sin θ₂·θ̇₁² + m₂·g·L₂·cos(θ₁ + θ₂)

  • masses in kg, lengths in m, rates in rad/s and rad/s², torques in N·m.

Worked examples

Example 1 (standard). A uniform link, m = 2 kg, L = 0.5 m, rotates in a vertical plane about one end. At θ = 30° above horizontal it has θ̈ = 4 rad/s². Find the joint torque.

  1. Inertia about the joint: I = m·L²/3 = 2 · 0.25 / 3 = 0.1667 kg·m².
  2. Inertia torque: I·θ̈ = 0.1667 · 4 = 0.667 N·m.
  3. Gravity torque: m·g·(L/2)·cos θ = 2 · 9.81 · 0.25 · 0.8660 = 4.248 N·m.
  4. τ = 0.667 + 4.248 = 4.915 N·m.

Answer: τ ≈ 4.91 N·m. (Velocity does not appear for a single link about a fixed axis.)

Example 2 (GATE level). Planar 2R in a vertical plane, point masses m₁ = 2 kg, m₂ = 1 kg at the link ends, L₁ = L₂ = 0.5 m. At θ₁ = 0°, θ₂ = 90°, θ̇₁ = 1 rad/s, θ̇₂ = 0, θ̈₁ = 2 rad/s², θ̈₂ = 0. Find τ₁ and τ₂.

  1. cos θ₂ = 0, sin θ₂ = 1, cos(θ₁ + θ₂) = 0, cos θ₁ = 1.
  2. M₁₁ = 2·0.25 + 1·(0.25 + 0 + 0.25) = 1.00 kg·m²; M₂₁ = 1·(0 + 0.25) = 0.25 kg·m².
  3. τ₁: inertia 1.00·2 = 2.000; velocity −1·0.25·1·(0 + 0) = 0; gravity (2 + 1)·9.81·0.5·1 + 1·9.81·0.5·0 = 14.715. τ₁ = 16.715 N·m.
  4. τ₂: inertia 0.25·2 = 0.500; centrifugal 1·0.25·1·1² = 0.250; gravity 0. τ₂ = 0.750 N·m.
  5. Checked numerically by differentiating the Lagrangian directly.

Answer: τ₁ = 16.7 N·m, τ₂ = 0.75 N·m. Note joint 2 needs torque even though it is not accelerating — coupling and centrifugal effects.

Common mistakes

  • Using m·L² instead of m·L²/3 for a uniform rod pivoted at its end (or m·L²/12, which is about the centre).
  • Measuring θ from the vertical but writing gravity with cos θ (it then becomes sin θ) — fix the reference first.
  • Forgetting the coupling term M₁₂θ̈₂, or that M depends on θ₂.
  • Setting the right side of Lagrange's equation to zero for a driven robot — it equals the joint torque.
  • Dropping the Coriolis factor 2 in 2θ̇₁θ̇₂.
  • Mixing degrees into θ̇ or θ̈.

For GATE ME

Questions focus on the Lagrangian of simple systems (single link, pendulum, prismatic joint with gravity), the holding torque of a link or two-link arm, the structure τ = Mq̈ + Cq̇ + g, and identifying which terms are inertial, centrifugal, Coriolis or gravitational. Practise single- and two-link torque calculations and checking units.

Quick check

  1. What is the Lagrangian of a system with T = 15 J and V = 5 J?
  2. A vertical prismatic joint lifts a 4 kg load with acceleration 2 m/s². Joint force?
  3. Which term of τ = Mq̈ + Cq̇ + g remains when the arm is held still?
  4. Which is cheaper for real-time computation: L-E or recursive N-E?
  5. A term proportional to θ̇₁θ̇₂ is called what?

Answers: 1. 10 J; 2. 4·(9.81 + 2) = 47.24 N; 3. g(q), the gravity term; 4. Recursive Newton-Euler (O(n)); 5. Coriolis term.

Try answering each one aloud before you open it.

  1. 1.What is the Lagrange-Euler formulation in the context of manipulator dynamics?Concept

    It derives a manipulator's equations of motion from energy. Using the joint variables as generalised coordinates, you write the total kinetic energy T (usually via 4×4 link transforms or link Jacobians) and potential energy V, form L = T − V, and apply d/dt(∂L/∂q̇ᵢ) − ∂L/∂qᵢ = τᵢ for each joint. The result has the closed form τ = M(q)q̈ + C(q,q̇)q̇ + g(q), which shows the inertia, Coriolis/centrifugal and gravity effects explicitly.

  2. 2.Explain the significance of the Lagrangian in the Lagrange-Euler formulation.Concept

    The Lagrangian is a scalar function that represents the difference between the kinetic energy (T) and potential energy (V) of a system, expressed as L = T - V. In the Lagrange-Euler formulation, the Lagrangian is used to derive the equations of motion by applying the Euler-Lagrange equation. This approach simplifies the process of finding the dynamics of a system, especially when dealing with multiple degrees of freedom.

  3. 3.How does the Lagrange-Euler formulation differ from the Newton-Euler formulation?Concept

    The Lagrange-Euler formulation is based on energy methods, using the Lagrangian to derive equations of motion, while the Newton-Euler formulation relies on force and torque balance. The Lagrange-Euler method is often more straightforward for systems with many degrees of freedom, as it avoids dealing directly with forces and torques. However, the Newton-Euler method can be more intuitive for systems where forces and torques are more easily measured or controlled.

  4. 4.What happens if the potential energy is not considered in the Lagrange-Euler formulation?Application

    If the potential energy is not considered in the Lagrange-Euler formulation, the resulting equations of motion will be incomplete and may not accurately describe the system's behavior. Potential energy is crucial for capturing the effects of gravitational forces and other conservative forces. Ignoring it can lead to incorrect predictions of the manipulator's dynamics, especially in systems where these forces play a significant role.

  5. 5.Explain how the Euler-Lagrange equation is used to derive the equations of motion in the Lagrange-Euler formulation.Concept

    For each generalised coordinate qᵢ you compute ∂L/∂q̇ᵢ, differentiate it with respect to time, subtract ∂L/∂qᵢ, and set the result equal to the generalised force τᵢ, the joint torque or force plus any non-conservative forces such as friction. For a driven robot the right side is not zero. Doing this for all n joints gives n coupled second-order differential equations, usually collected as τ = M(q)q̈ + C(q,q̇)q̇ + g(q).

  6. 6.In what scenarios might the Lagrange-Euler formulation be less advantageous compared to other methods?Application

    Its main weakness is computational cost: the classic matrix form scales as O(n⁴) in the number of joints, too slow for computing torques every millisecond in a controller. Recursive Newton-Euler gives the same torques in O(n) and also yields internal joint reaction forces, which L-E does not. Friction and other non-conservative effects are not a real obstacle, since they are added as generalised forces.

  7. 7.Calculate the Lagrangian for a simple pendulum with mass m, length l, and gravitational acceleration g.Numerical
    1. The kinetic energy (T) of the pendulum is given by T = 0.5 * m * (l * θ̇)^2, where θ̇ is the angular velocity.
    2. The potential energy (V) is given by V = m * g * l * (1 - cos(θ)), where θ is the angular displacement.
    3. The Lagrangian (L) is L = T - V = 0.5 * m * (l * θ̇)^2 - m * g * l * (1 - cos(θ)).
  8. 8.Derive the equation of motion of a single uniform link of mass m and length L rotating in a vertical plane about one end, with θ measured from the horizontal.Numerical

    Kinetic energy T = ½·(mL²/3)·θ̇², potential energy V = m·g·(L/2)·sin θ, so L = T − V. ∂L/∂θ̇ = (mL²/3)·θ̇, whose time derivative is (mL²/3)·θ̈, and ∂L/∂θ = −m·g·(L/2)·cos θ. Lagrange's equation gives τ = (mL²/3)·θ̈ + m·g·(L/2)·cos θ, an inertia term plus a gravity term.

  9. 9.What role do generalized coordinates play in the Lagrange-Euler formulation?Concept

    Generalized coordinates are variables that uniquely define the configuration of a system relative to some reference configuration. In the Lagrange-Euler formulation, they are used to express the kinetic and potential energies of the system. These coordinates simplify the problem by reducing the number of variables needed to describe the system, especially in complex systems with multiple degrees of freedom.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?