Multi-Rate DM Command Pacing & Slow-WFS Trajectory
Drives DM commands at a user-specified hardware-dependent rate f_DM (smooth centered linear ramps) even when a faint-star WFS slows to 200-500 Hz, sitting upstream of DMch2disp and dmpreshaper.
Overview & Role
Decouples the DM command rate f_DM (hardware-dependent, explicitly supplied by the user — e.g. 1 kHz on AO3k ALPAO 64x64 or 2-4 kHz on fast MEMS DMs) from a slower faint-star WFS frame rate (200-500 Hz) via three coordinated C upgrades: (1) a zero-DC temporal-difference velocity predictor (EOF/VEL) inside mkEOFPF/applyEOFPF with exact Cholesky-trace James-Stein shrinkage that prevents noise-driven sawtooth ramps; (2) zero-latency j=0 waking cacao-fpsexec-mvalpacer emitting centered zero-mean linear-ramp sub-steps (K_sub = round(f_DM / f_WFS), 0.000 fr added lag) upstream of mvalC2dm -> DMch2disp -> dmpreshaper; and (3) exact exposure-averaged ramp PSOL (+0.5*alpha*(1-alpha)*(v_old - v_new)) in modalfilter.c with dual-writer suppression (PF.mr_pacer_out).
Verified across 23 live GPU cacaosim runs on AO3k (f_DM = 1 kHz): slowing Stage-1 WFS from 1000 Hz to 250 Hz at m=10 under predictive control boosts Stage-1 H-band Strehl from 68.2% to 80.4% (vs best integrator 50.7% @ 500 Hz) and full 2-stage H-band Strehl to 86.9% (94.0 nm, 9.19e-5 coronagraph contrast), while cutting downstream dmpreshaper stroke 18-40%, HF OPD ripple -35%, and ALPAO 1 kHz plate-band energy -40% with zero actuator clips. Subaru 4-spider island-petaling imposes a physical rate floor near ~250 Hz at 0.6" seeing.
Compute Units / Entry Points: cacao-fpsexec-mvalpacermodalfilter (exact ramp PSOL + aolN_modevalDM_traj)mkEOFPF / applyEOFPF (EOF/VEL zero-DC velocity)
Verified Highlights:
- m=10 live GPU Stage 1 (1000 -> 250 Hz): H-Strehl 68.2% -> 80.4% (129.3 nm total, 108.7 nm SS) vs best integrator 50.7% @ 500 Hz
- Full 2-stage m=10 (Stg1 250 Hz MR + Stg2 2 kHz): 94.0 nm final WFE, 86.9% H-Strehl, 53.8% Vis Strehl, 9.19e-5 coro 3-10 l/D
- m=6 250 Hz 2x2 ablation (MR + 2 kHz Pre-Shaper): -35% HF OPD ripple, -40% 1 kHz plate band, -18..40% pre-shaper stroke, 0 clips, 0.000 fr added lag
Option Variants (CODE/OPT)
| Option Code | Behavior & Usage | Main Flags |
|---|---|---|
DM/MR | Multi-rate centered linear-ramp DM command pacer (`mvalpacer`) driven at a user-specified hardware-dependent rate `f_DM` upstream of `DMch2disp -> dmpreshaper` with zero-latency j=0 wake. | --mr-dm1 --mr-substeps --mr-vel-gain --mr-vel-reg-mult |
EOF/VEL | Zero-DC temporal-difference velocity solver with exact Cholesky-trace James-Stein shrinkage inside `mkEOFPF` / `applyEOFPF`. | --mr-dm1 --mr-vel-gain --mr-vel-reg-mult |
WFS/SLOW | Faint-star WFS frame-rate reduction (1000 -> 250-500 Hz) with camera dark-pedestal subtraction (`--wfs-dark-adu`) and low `WFSnormfloor`. | --wfs1-rate --wfs-dark-adu --star-mag |
Dependencies & Calibration Chain
Terminal diagnostic or output stage.
CLI Flags, Environment Variables & FPS Parameters
| Layer | Option (Links to Reference) | Default | Description |
|---|---|---|---|
| CLI Flag | --wfs1-rate | 1000 | Stage-1 NIR PyWFS frame rate [Hz], integer divisor of 2000 (e.g. 250/500/1000) |
| CLI Flag | --mr-dm1 | OFF | Enable Stage-1 multi-rate 1 kHz DM command pacing (mvalpacer-1 + EOF velocity) |
| CLI Flag | --mr-substeps | 1000 / wfs1-rate | Override Stage-1 DM sub-steps K_sub per WFS1 exposure frame |
| CLI Flag | --mr-vel-gain | 1.0 | Stage-1 multi-rate centered linear-ramp velocity gain multiplier |
| CLI Flag | --mr-vel-reg-mult | 3.5 | Stage-1 multi-rate zero-DC temporal-difference velocity ridge multiplier |
| CLI Flag | --wfs-dark-adu | 0.0 | Camera dark/bias pedestal [ADU] subtracted before WFS intensity normalization |
| CACAO_* Env | CACAO_PF_MR_ENABLE | OFF | Enable multi-rate zero-DC temporal-difference velocity output in mkEOFPF/applyEOFPF |
| CACAO_* Env | CACAO_PF_MR_SUBSTEPS | 1 | Multi-rate DM command sub-steps K_sub per WFS exposure frame |
| CACAO_* Env | CACAO_PF_MR_VELGAIN | 1.0 | Multi-rate centered linear-ramp velocity gain multiplier |
| CACAO_* Env | CACAO_PF_MR_VEL_REG_MULT | 3.5 | Multi-rate velocity ridge regularization multiplier on top of pf_reg |
| CACAO_* Env | CACAO_PF_MR_PACER_OUT | OFF | Route modalfilter output via aolN_modevalDM_traj to mvalpacer (suppresses dual-writer race) |
| CACAO_* Env | CACAO_WFS_DARK_ADU | 0.0 | Uniform WFS detector dark/bias pedestal [ADU] subtracted prior to normalization |
| CACAO_* Env | CACAO_WFS_DARKSUB | OFF | Enable dark/bias pedestal subtraction in acquWFS (ON/OFF) |
| CACAO_* Env | CACAO_WFS_NORMFLOOR | 1.0 | Minimum flux denominator floor in acquWFS intensity normalization (0.001 for faint stars) |
Implementation, Tests & Related Reports
Source Files
- cacao:
AOloopControl_DM/AOloopControl_DM_mvalpacer.c - cacao:
AOloopControl/modalfilter.c - cacao:
AOloopControl_PredictiveControl/AOloopControl_PredictiveControl_mkEOFPF.c - cacao:
AOloopControl_PredictiveControl/AOloopControl_PredictiveControl_applyEOFPF.c
Verification Tests
test_18_multirate_dm.py (3/3 passed)23-run live GPU cacaosim shootout
Related Staged Technical Reports
- Unified AO Real-Time Control Architecture: Taxonomy, Decoupled Synthesis, White-Noise Safety & Faint-Star Multi-Rate DM Control
- Implementation Plan: Unified AO Real-Time Control Architecture (milk, cacao, milk-mltools)
- Raw 3D Spatiotemporal Response Matrix Calibration — ALPAO 64×64 Plate DM (cacaoac-measdynresp)
- Predictive Control Report: Per-Mode Diagonal AR(4..64) & Full Cross-Mode Block-EOF (VAR) Study