Making the optimiser keep a stability margin cost under 1% and removed the hidden divergences

Simulated quadrotors trained under a linear stability margin lose 0.7% in cost and diverge on 0 of 384 flights at a 45° tilt limit, against 13.

Two steps back, a linear stability test showed something uncomfortable about our co-designed quadrotors. These are simulated quadrotors with canted rotors, tuned by an evolutionary optimiser (CMA-ES). When we added a feed-forward from the attitude integrator, the optimiser set the integral gain right on the edge of stability: between 0.88 and 1.11 times the largest gain the linear model calls stable at every corner of the plant uncertainty. The last step found why that looked harmless. The simulator's 20° tilt-command limit holds the unstable loop in a bounded oscillation. Raise the limit and those designs start to diverge.

The advice so far was "keep the integral gain at about 0.8 times its ceiling", but we had only tested it by cutting gains after training. This step builds it into training. Each candidate design gets an 11-state eigenvalue check on both horizontal axes at the eight plant corners, at its own gain and at 1.25 times it. If either check fails, the candidate is rejected before it is simulated. We wrote five predictions into the research log before the full run: 24 CMA-ES runs of 3,200 evaluations, about 34 minutes on four cores.

The price is small. With the rotor side force acting on the side where the integrator does the work (centre of pressure above the centre of mass), the optimiser went straight back to the new edge. All six seeds ended at 1.26 to 1.30 times the margin's bound. Held-out cost got worse by 0.011, about 0.7%. That is consistent (worse in all six seeds), but position error did not change at the third decimal (0.105 m). With the centre of pressure below, the integrator carries almost no gain, so the margin barely binds and the cost difference was 0.000.

The benefit shows up where training didn't look. At twice the centre-of-pressure lever the designs were trained on, the unconstrained designs diverged on 15 of 384 held-out flights and the constrained ones on 4, with lower cost in all six seeds. Then we reran the last step's tilt-limit test on both sets of designs. This test was added after we had seen the main results, so it is a follow-up rather than a prediction. At a 45° or 59° limit, the unconstrained designs diverged on 13 of 384 flights and their position error more than doubled, to 0.26 m. The constrained designs diverged on none and held 0.10 m, the same as at 20°.

Where it did nothing. One prediction failed. We expected fewer divergences at twice the lever for both geometries, but with the centre of pressure below it was 45 against 42. That geometry's large-lever failures don't come from the integral gain, so a check on that gain can't fix them. The check also cleaned up one design with the centre of pressure below. Without the constraint, that seed was slightly unstable at one plant corner and diverged on 2 flights at the trained lever. Trained with the constraint, it diverged on none.

What a builder can take from it. For an integrator feed-forward like this one, an eigenvalue check per candidate costs milliseconds. Making the tuner respect a 0.8× margin bought robustness to looser tilt limits and larger disturbances for under 1% of nominal performance. Without the constraint, the optimiser uses up whatever margin it is given.

Everything here is simulated: one simulator, assumed plant ranges, six seeds, one margin value, and a tilt-limit check chosen after the main results. Code, results and figure: research/codesign-cant (experiments/m7e_margin/). Next: sweep the margin from 0.6 to 1.0 to trace cost against robustness, and find what drives the large-lever failures with the centre of pressure below.

All writing · More in Research findings · More on codesign-cant · All tools and research