Robotic Systems

Robotic Systems · teaching-draft · v0.2.0

Holonomic constraints and stabilization

Lecture 9 · Week 5 · 90 minutes

Learning outcomes

  • Derive velocity and acceleration constraints.
  • Solve a multiplier system with consistent signs.
  • Explain drift and Baumgarte stabilization.

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

Constraint levels

A holonomic constraint is ϕ(q)=0\phi(q)=0. For simple Euclidean coordinates, differentiating gives Jv=0Jv=0 and Ja+J˙v=0Ja+\dot Jv=0, where J=∂ϕ/∂qJ=\partial\phi/\partial q. A constrained mechanical system satisfies

Ma=τ−c+J⊤f.Ma=\tau-c+J^\top f.
The multiplier f enforces the acceleration constraint. Using this plus-sign force convention gives
[M−J⊤J0][af]=[τ−c−J˙v].\begin{bmatrix}M&-J^\top\\J&0\end{bmatrix} \begin{bmatrix}a\\f\end{bmatrix} =\begin{bmatrix}\tau-c\\-\dot Jv\end{bmatrix}.
Changing the definition of multiplier sign changes the off-diagonal block. Keep the equations and implementation together.

Worked particle on a circle

Let ϕ(p)=12(p⊤p−ℓ2)\phi(p)=\frac12(p^\top p-\ell^2), so J=p⊤J=p^\top and J˙v=v⊤v\dot Jv=v^\top v. At p=(1,0)p=(1,0), v=(0,2)v=(0,2), ℓ=1\ell=1, and no external force, the constraint requires p⊤a=−4p^\top a=-4. A unit mass therefore has centripetal acceleration a=(−4,0)a=(-4,0).

A velocity can be tangent while the acceleration has a radial component. Setting radial acceleration to zero would immediately leave the circle.

Constraint drift

An acceleration-level solve does not by itself eliminate discrete position and velocity errors. Even if Ja+J˙v=0Ja+\dot Jv=0 holds at each computed state, numerical integration can accumulate ϕ≠0\phi\ne0.

Baumgarte stabilization replaces the target with

Ja+J˙v=−2αJv−β2ϕ.Ja+\dot Jv=-2\alpha Jv-\beta^2\phi.
The ideal constraint error then obeys ϕ¨+2αϕ˙+β2ϕ=0\ddot\phi+2\alpha\dot\phi+\beta^2\phi=0. Large gains may make the numerical problem stiff. Projection methods are another approach, but projection changes momentum or energy unless designed carefully.

Practice

Practice 5 simulates the circle-constrained particle under gravity with and without stabilization. It reports maximum position-constraint error and the acceleration residual. Compare several timesteps before choosing gains.

Use consistent initial conditions: the position must satisfy ϕ=0\phi=0 and the velocity must satisfy Jv=0Jv=0. Starting off the manifold tests recovery, a different question from drift under consistent initialization.

Exercise and answer guide

If the same constraint row is duplicated, can you still invert JM−1J⊤JM^{-1}J^\top? Answer: generally no; the rows are dependent. Acceleration can remain well-defined while multipliers are nonunique. Use a rank-aware solve or remove redundant constraints, and inspect residuals rather than assuming a successful solve.

The next lecture interprets the acceleration correction as a minimum-change principle, then explains why MuJoCo's soft constraints should not be identified with this exact rigid equality solve MIT multibody dynamics.

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.