Back to all posts
Tutorial

Part 6: Controlling Chaos & Singular Perturbation

Ensemble AI
June 20, 2026
6 min read

Welcome to Part 6 of "Robotics Zero to Hero." As we saw in Part 5, real robots — especially our flexible, cable-driven octopus — exhibit dynamics on wildly different time scales at once. How do you control a system that moves slowly and massively while also vibrating fast and jittery? You decompose it with Singular Perturbation Theory.

The Math: Separating Fast and Slow Dynamics

Many robotic systems have variables that evolve on drastically different time scales. A heavy arm driven by lightweight, responsive motors swings slowly (the slow dynamics), while the electrical currents inside those motors change almost instantly (the fast dynamics). Flexible joints and stretchy tendons create the same split.

We write the system in standard singularly perturbed form:

x˙=f(x,z,t)(slow subsystem)\dot{\mathbf x} = f(\mathbf x, \mathbf z, t) \qquad \text{(slow subsystem)} ϵz˙=g(x,z,t)(fast subsystem)\epsilon\,\dot{\mathbf z} = g(\mathbf x, \mathbf z, t) \qquad \text{(fast subsystem)}

Here ϵ\epsilon is a small positive parameter (small motor inductance, high cable stiffness, low link flexibility). Because ϵ1\epsilon \ll 1, z˙\dot{\mathbf z} can be enormous, so z\mathbf z races to its steady state almost instantly relative to x\mathbf x.

The reduced and boundary-layer models

Setting ϵ=0\epsilon = 0 collapses the fast dynamics to their quasi-steady-state (the slow manifold):

0=g(x,z,t)    z=ϕ(x,t)0 = g(\mathbf x, \mathbf z, t) \;\Rightarrow\; \mathbf z = \phi(\mathbf x, t)

Substituting back gives a reduced (slow) model x˙=f(x,ϕ(x,t),t)\dot{\mathbf x} = f(\mathbf x, \phi(\mathbf x,t), t) of lower dimension. To analyze the fast transient, we stretch time with σ=t/ϵ\sigma = t/\epsilon and study the boundary-layer model dzdσ=g(x,z,t)\frac{d\mathbf z}{d\sigma} = g(\mathbf x, \mathbf z, t) with x\mathbf x frozen.

Tikhonov's theorem is the payoff: if the boundary-layer system is exponentially stable, the full system's behavior is well-approximated by separately solving the slow and fast models. This justifies composite control:

u=uslow(x)designed on the reduced model+ufast(z)stabilizes the boundary layer\mathbf u = \underbrace{\mathbf u_{slow}(\mathbf x)}_{\text{designed on the reduced model}} + \underbrace{\mathbf u_{fast}(\mathbf z)}_{\text{stabilizes the boundary layer}}

We design one controller for the slow task and a separate fast controller that damps the rapid transients — and prove the combination stable.

Competing approaches to multi-time-scale control

ApproachIdeaShortcomings
Singular perturbation / compositeSplit into slow + fast, control eachRequires a clear ϵ\epsilon separation; approximation error O(ϵ)O(\epsilon)
Full-order (ignore the split)One controller for everythingMust run at the fastest rate; ill-conditioned; can excite vibration
Backstepping (flexible joints)Recursively design through the fast statesAlgebra explodes for many DOF; needs model derivatives
Integral manifoldHigher-order correction to the slow manifoldHeavier math; still needs scale separation
Rigid approximationPretend ϵ=0\epsilon = 0 outrightUnmodeled vibrations can destabilize a stiff controller

The honest caveat: singular perturbation only works when a genuine time-scale gap exists. If ϵ\epsilon is not small — fast and slow dynamics overlap — the decomposition's O(ϵ)O(\epsilon) error is no longer negligible and you must fall back to full-order design.

Python Implementation: Two-Time-Scale Simulation

Loading Interactive Python Environment...

Note the use of LSODA — a stiff solver. The factor 1/ϵ1/\epsilon makes this system stiff, and a naive explicit integrator would need impossibly tiny steps. Stiffness in the simulator is the numerical shadow of the time-scale separation in the physics.

High-Dimensional vs. Low-Dimensional: Hierarchy as Necessity

For a low-dim rigid arm, a single control loop running at one rate is usually fine — there is no dramatic time-scale split to exploit.

For a high-dim flexible/continuum robot, hierarchy is not a convenience but a requirement. A continuum tentacle has a near-continuum of vibration modes; their natural frequencies span orders of magnitude. Trying to control all of them in one monolithic loop forces the entire controller to run at the fastest mode's rate — computationally hopeless and numerically ill-conditioned. Singular perturbation (and its cousin, multi-rate hierarchical control) lets us assign each time scale to its own loop, which is the only tractable way to handle the explosion of modes that high dimensionality brings.

Focus on the Octopus: Base vs. Tentacle Control

For our metallic continuum octopus, singular perturbation is the core of the control architecture, not an academic flourish.

The octopus has a heavy central body (base) that moves slowly through tight spaces, and lightweight, highly flexible tentacles that whip in milliseconds. If we controlled both in one giant loop, the computer could not keep up with the tentacles' fast dynamics, and the result would be violent oscillation (the whiplash from Part 4).

So we decompose:

  1. Slow controller (≈ 50 Hz): navigates the heavy central body to the target region — this is the reduced model, where ϵ0\epsilon \to 0 hides the tentacle vibration.
  2. Fast controller (≈ 1000 Hz): the boundary-layer stabilizer, damping tentacle-tip vibration and doing fine manipulation.

By mathematically decoupling the chaos, we get smooth, biological-looking motion — and, crucially, a stability proof for the combination rather than hand-tuned hope. The fast loop is increasingly implemented with sampling-based optimal controllers like MPPI (arXiv:1707.02342), which we revisit alongside planning in Part 7.

In Part 7 we move from stabilizing motion to planning it — choosing the paths these robots take through cluttered, uncertain environments.

Further reading: Kokotović, Khalil & O'Reilly, "Singular Perturbation Methods in Control" (1986); Khalil, "Nonlinear Systems" (2002), Ch. 11; Spong on flexible-joint control.

Interested in the research?

We collaborate with researchers, engineers, and institutions pushing Physical AI into extreme environments. Get in touch to explore working with the lab.

Collaborate with us

Ensemble Assistant

Ready

Quick Actions: