Robotic Systems

Robotic Systems · teaching-draft · v0.2.0

Gauss least constraint and soft engine constraints

Lecture 10 · Week 5 · 90 minutes

Learning outcomes

  • Derive the mass-weighted acceleration projection.
  • Relate Gauss's principle to Udwadia–Kalaba.
  • Distinguish exact equality constraints from compliant engine constraints.

Prerequisites: Linear algebra, ODEs, and earlier lectures in this sequence.

The least-change viewpoint

Let a0=M−1(τ−c)a_0=M^{-1}(\tau-c) be unconstrained acceleration. Seek the acceleration satisfying Ja=bJa=b that changes a0a_0 as little as possible in the kinetic metric:

min⁡a 12(a−a0)⊤M(a−a0)subject to Ja=b.\min_a\ \frac12(a-a_0)^\top M(a-a_0)\quad\text{subject to }Ja=b.
The mass metric gives a physical meaning to the correction. A Euclidean projection would treat all acceleration directions equally even when their inertias differ.

Stationarity gives a=a0+M−1J⊤fa=a_0+M^{-1}J^\top f. For independent constraint rows,

f=(JM−1J⊤)−1(b−Ja0).f=(JM^{-1}J^\top)^{-1}(b-Ja_0).
This recovers the multiplier dynamics from the previous lecture.

Udwadia–Kalaba form

Define A=JM−1/2A=JM^{-1/2}. A mass-weighted pseudoinverse expression is

a=a0+M−1/2A+(b−Ja0).a=a_0+M^{-1/2}A^+(b-Ja_0).
For compatible linear acceleration constraints, this yields the minimum-change solution, including rank-deficient cases with the appropriate pseudoinverse. If constraints are inconsistent, the pseudoinverse instead minimizes a residual; it cannot satisfy contradictory equations exactly.

In code, factorization-based solves often avoid explicitly forming a matrix square root. The formula clarifies the geometry, while the multiplier solve is convenient for the small full-rank practice.

Worked unequal-mass example

Let M=diag⁡(1,4)M=\operatorname{diag}(1,4), a0=(1,0)a_0=(1,0), and require a1+a2=0a_1+a_2=0. Then JM−1J⊤=1.25JM^{-1}J^\top=1.25 and f=−0.8f=-0.8. The corrected acceleration is (0.2,−0.2)(0.2,-0.2). The heavier direction changes less because its acceleration change costs more in the mass metric.

A Euclidean projection gives (0.5,−0.5)(0.5,-0.5), which satisfies the constraint but is not the least-change acceleration in the physical metric.

MuJoCo soft constraints

MuJoCo solves its own regularized constraint problem with compliance and solver parameters. Its constraint forces need not enforce zero geometric penetration or exactly match rigid Lagrange multipliers. solref and solimp influence the modeled response. Increasing numerical solver accuracy does not remove deliberately modeled compliance.

The link to Gauss's principle is conceptual: both organize dynamics around inertia-weighted corrections. They are not identical algorithms or interchangeable parameterizations MuJoCo computation.

Practice and exercise

Practice 5 verifies the analytic unequal-mass example, then examines drift stabilization. An extension uses a MuJoCo equality constraint and varies solref while keeping timestep and solver tolerance fixed.

Check: A compliant constraint has a small nonzero position error at equilibrium. Is that automatically a solver bug? Answer: no. Determine whether the error follows the chosen compliance model. Compare model parameters and numerical convergence separately.

Reading and source connections

Advanced Robot Dynamics and Simulation — lecture series — CMU 16-715. Companion video series for modeling, integration, rigid-body dynamics, constraints, and contact.

Multi-Body Dynamics — Russ Tedrake. Compare manipulator equations and constrained dynamics with the MuJoCo force decomposition.

MuJoCo computation — MuJoCo contributors. Authoritative force, generalized-coordinate, actuator, and constraint conventions.

Equations of Motion for Mechanical Systems — Firdaus E. Udwadia and Robert E. Kalaba (1996). Primary discussion of the explicit constrained equations and Lagrange multipliers.