The Recursive Newton-Euler Algorithm (RNEA) is the most efficient method for computing inverse dynamics of serial kinematic chains (robot arms, manipulators). Given joint positions, velocities, and desired accelerations, it computes the required joint torques in
This contrasts with the Euler-Lagrange approach, which requires explicitly forming and multiplying
The algorithm has two passes over the kinematic chain:
- Forward pass (base → tip): propagate angular velocities, angular accelerations, and linear accelerations from link to link using kinematic relationships
- Backward pass (tip → base): accumulate forces and torques from the tip back to the base using Newton-Euler equations on each link
The joint torque at each joint is then the projection of the net torque onto the joint axis.
A serial chain of
-
$m_i$ — mass -
$I_i \in \mathbb{R}^{3 \times 3}$ — inertia tensor at the center of mass, in the link frame -
$\hat{z}_i \in \mathbb{R}^3$ — joint axis (unit vector in the link frame) -
$r_{p \to j}^{(i)} \in \mathbb{R}^3$ — position of joint$i$ in the parent (link$i-1$ ) frame -
$r_{j \to c}^{(i)} \in \mathbb{R}^3$ — position of the center of mass in the link$i$ frame
The rotation matrix
For link
Angular velocity:
Angular acceleration: $$\dot{\omega}i = R_i^T \dot{\omega}{i-1} + \ddot{q}_i \hat{z}_i + \omega_i \times (\dot{q}_i \hat{z}_i)$$
Linear acceleration at joint origin of link
Linear acceleration at center of mass: $$a_{C_i} = a_{J_i} + \dot{\omega}i \times r{j \to c}^{(i)} + \omega_i \times (\omega_i \times r_{j \to c}^{(i)})$$
For the base link (
For each link
Net force on link
Net torque on link
Joint torque:
The rotation matrix for angle
where
| Operation | Time | Space | Notes |
|---|---|---|---|
| Inverse dynamics | Two linear passes over |
||
| Per-link forward pass | Fixed 3×3 matrix-vector operations | ||
| Per-link backward pass | Cross products and additions | ||
| Rotation matrix | Rodrigues' formula: trig functions + 3×3 matrix |
Compared to Euler-Lagrange
A single thin rod of mass
Inertia at CoM:
Setup:
Forward pass:
$\omega_0 = [0, 0, 0]^T + 0 \cdot [0, 0, 1]^T = [0, 0, 0]^T$ -
$\dot{\omega}_0 = [0, 0, 1]^T$ (from$\ddot{q}$ ) $a_{C_0} = 0 + [0, 0, 1] \times [0.5, 0, 0] + 0 = [0, 0.5, 0]^T,\text{m/s}^2$
Backward pass:
$f_0 = 2 \cdot [0, 0.5, 0]^T = [0, 1, 0]^T,\text{N}$ $\tau_0 = I \cdot [0, 0, 1]^T + 0 + [0.5, 0, 0] \times [0, 1, 0]^T$ $= [0, 0, 0.167]^T + [0, 0, 0.5]^T = [0, 0, 0.667]^T$ $\tau_q = [0, 0, 1]^T \cdot [0, 0, 0.667]^T = 0.667,\text{N·m}$
This matches
- Joint axis convention: The joint axis must be a unit vector. Non-unit vectors will produce incorrect rotation matrices and torque projections.
- Frame consistency: All link parameters (inertia, CoM position, joint axis) must be expressed in the link's own body frame. Mixing world-frame and body-frame quantities is a common source of bugs.
-
Gravity convention: Gravity enters as
$a_0 = -g$ (negative) in the base acceleration. This "fictitious force" convention avoids special-casing gravity in each link's force calculation. - Serial chains only: This implementation assumes a single serial chain with no branches. Tree-structured or closed-chain mechanisms require extensions.
-
Numerical precision: For long chains, the recursive propagation can accumulate floating-point errors. For
$n \leq 10$ , this is typically negligible. -
Fixed-point arithmetic: Like other dynamics algorithms, physical quantities exceed Q15/Q31 range. Use
float.
| Variant | Key Difference | Use Case |
|---|---|---|
| RNEA (this) |
|
Real-time robot control, computed torque |
| RNEA + mass matrix | Call RNEA |
Forward dynamics via |
| Articulated Body Algorithm (ABA) |
|
Simulation without forming |
| Extended RNEA | Includes friction, motor inertia | Realistic robot modeling |
| RNEA for trees | Handles branching chains | Humanoid robots, multi-fingered hands |
-
Computed torque control: RNEA provides the feedforward torque
$\tau = M\ddot{q}_d + h(q, \dot{q})$ for tracking controllers at each control cycle -
Gravity compensation: RNEA with
$\dot{q} = \ddot{q} = 0$ yields gravity torques directly -
Simulation: Build the mass matrix column-by-column using
$n$ RNEA calls, then solve$M\ddot{q} = \tau - h$ for forward dynamics - Model-based friction estimation: Compare RNEA-predicted torques with measured motor currents
-
Real-time control loops: The
$O(n)$ complexity makes RNEA suitable for 1 kHz+ control rates
- Newton-Euler (NewtonEuler.md): RNEA applies the single-body Newton-Euler equations recursively across the chain. The per-link force/torque computation is identical.
-
Euler-Lagrange (EulerLagrange.md): Both compute the same dynamics (
$M\ddot{q} + C\dot{q} + g = \tau$ ) but RNEA is$O(n)$ vs.$O(n^3)$ . RNEA is preferred for computation; Euler-Lagrange for analytical derivation. - Gaussian Elimination (GaussianElimination.md): When using RNEA for forward dynamics, the mass matrix built via RNEA is solved with Gaussian elimination.
- Featherstone, R. (2008). Rigid Body Dynamics Algorithms. Springer. Chapters 3, 5.
- Siciliano, B., Sciavicco, L., Villani, L., & Oriolo, G. (2009). Robotics: Modelling, Planning and Control. Springer. Chapter 7.
- Luh, J. Y. S., Walker, M. W., & Paul, R. P. C. (1980). On-line computational scheme for mechanical manipulators. Journal of Dynamic Systems, Measurement, and Control, 102(2), 69–76.
- Craig, J. J. (2005). Introduction to Robotics: Mechanics and Control (3rd ed.). Pearson. Chapter 6.