MOPTOnline Calibration (In-Loop)VERIFIEDStg 1Stg 2Stg 3

Online Per-Mode Leaky-Integrator Gain & Leak Autotuner

Joint per-mode (gain, leak) autotuner via Parseval Multi-Res PSD, faint-star adaptive memory, and ringing guard.

Overview & Role

Subscribes asynchronously to aol<N>_modevalOL_buff (and optional aol<N>_modevalWFS_buff, aol<N>_og_smooth/aol<N>_mWFSfact, aol<N>_mlimitcntfrac, and dynpsol H_diag/H_mimo FITS .kernel) in standalone C (cacao-fpsexec-modalopt). Builds a Parseval-exact unclamped 2-band Multi-Resolution PSD (decimated sub-Hz ring with exact sinc^2 boxcar inversion + explicit DC line + Hann Welch high-frequency PSD) and minimizes J_m(g, a) = sum P_OL * (|ETF|^2 + lam_dm * |CTF|^2) via shared BLAS SGEMM subject to Argument-Principle Nyquist stability and max|ETF| <= ms_max.

Decouples fast buffer-flip cadence (~0.25-0.5 s) from faint-star statistical memory using cumulative 1/k warmup into per-mode SNR-adaptive EWMA memory (tau_fast=3 s to tau_faint=15 s), dual regime-change flush (low-order power and HF noise floor), variance-aware James-Stein radial Empirical-Bayes pooling, and a statistically gated lag-d/lag-1 WFS ringing guard that backs off gain and freezes PSD updates on ringing slices. Publishes shadow aol<N>_mopt_* streams and opt-in live aol<N>_mgainfact / aol<N>_mmultfact paired with [0, 2.0] / [0, 1.0] safety clamps in modalfilter.c.

Compute Units / Entry Points: cacao-fpsexec-modaloptmodalfilter (mgain/mmult safety clamp)

Verified Highlights:

Option Variants (CODE/OPT)

Option CodeBehavior & UsageMain Flags
MOPT/SHADShadow monitoring mode (default `.apply_gain=OFF`, `.apply_mult=OFF`) publishing `aol<N>_mopt_{gain,mult,snr,taumem,ring}` without touching loop.—
MOPT/LIVELive joint `(gain, leak)` publisher writing `aol<N>_mgainfact` & `aol<N>_mmultfact` (`.apply_gain=ON`, `.apply_mult=ON`, auto loopgain/mult).—
MOPT/FAINTFaint-star SNR-adaptive memory (`tau_fast..tau_faint`, `1/k` warmup), James-Stein radial EB pooling (`.eb_enable`), and dual change-detector flush.—
MOPT/KERNExact discrete `dynpsol` `H_diag`/`H_mimo` FITS `.kernel` plant model with Argument-Principle stability & lag-d WFS ringing guard (`.ring_enable`).—

Dependencies & Calibration Chain

Selected Algorithm
★ Current Entry
MOPTOnline Calib
Online Per-Mode Leaky-Integrator Gain & Leak Autotuner
Feeds & Enables Downstream
⇄ Feedback
INTRT Operation
Modal Leaky Integrator

CLI Flags, Environment Variables & FPS Parameters

LayerOption (Links to Reference)DefaultDescription
CACAO_* EnvCACAO_LOOPGAIN0.35 / 0.35 / 0.20Closed-loop modal integrator gain (stage 1 / 2 / 3)
CACAO_* EnvCACAO_LOOPMULT0.98 / 0.98 / 0.99Closed-loop leaky integrator multiplier (stage 1 / 2 / 3)
CACAO_* EnvCACAO_TBUFF_SIZE256Modal telemetry ring-buffer depth [frames]
CACAO_* EnvCACAO_DYNPSOL_KERNEL(unset)Dynamic PSOL impulse kernel FITS path (H_mimo / H_diag) for modalfilter
CACAO_* EnvCACAO_PSOL_WFSFACT1.0Pseudo open-loop (PSOL) WFS residual scaling factor
CACAO_* EnvCACAO_LATENCYSOFTWFR1.65Effective software + hardware loop latency [WFS frames]

Implementation, Tests & Related Reports

Source Files

Verification Tests

Related Staged Technical Reports