MRDMReal-Time Loop OperationVERIFIEDStg 1

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:

Option Variants (CODE/OPT)

Option CodeBehavior & UsageMain Flags
DM/MRMulti-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/VELZero-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/SLOWFaint-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

Selected Algorithm
★ Current Entry
MRDMRT Operation
Multi-Rate DM Command Pacing & Slow-WFS Trajectory
Feeds & Enables Downstream

Terminal diagnostic or output stage.

Interaction / Exclusion Note: Signal-flow order rule: `mvalpacer` MUST sit upstream of `mvalC2dm -> DMch2disp -> dmpreshaper -> DM` (never downstream of the plate pre-shaper). Avoid slowing Stage-1 WFS below ~250 Hz at 0.6" seeing on Subaru's 4-spider pupil where island-effect petaling dominates.

CLI Flags, Environment Variables & FPS Parameters

LayerOption (Links to Reference)DefaultDescription
CLI Flag--wfs1-rate1000Stage-1 NIR PyWFS frame rate [Hz], integer divisor of 2000 (e.g. 250/500/1000)
CLI Flag--mr-dm1OFFEnable Stage-1 multi-rate 1 kHz DM command pacing (mvalpacer-1 + EOF velocity)
CLI Flag--mr-substeps1000 / wfs1-rateOverride Stage-1 DM sub-steps K_sub per WFS1 exposure frame
CLI Flag--mr-vel-gain1.0Stage-1 multi-rate centered linear-ramp velocity gain multiplier
CLI Flag--mr-vel-reg-mult3.5Stage-1 multi-rate zero-DC temporal-difference velocity ridge multiplier
CLI Flag--wfs-dark-adu0.0Camera dark/bias pedestal [ADU] subtracted before WFS intensity normalization
CACAO_* EnvCACAO_PF_MR_ENABLEOFFEnable multi-rate zero-DC temporal-difference velocity output in mkEOFPF/applyEOFPF
CACAO_* EnvCACAO_PF_MR_SUBSTEPS1Multi-rate DM command sub-steps K_sub per WFS exposure frame
CACAO_* EnvCACAO_PF_MR_VELGAIN1.0Multi-rate centered linear-ramp velocity gain multiplier
CACAO_* EnvCACAO_PF_MR_VEL_REG_MULT3.5Multi-rate velocity ridge regularization multiplier on top of pf_reg
CACAO_* EnvCACAO_PF_MR_PACER_OUTOFFRoute modalfilter output via aolN_modevalDM_traj to mvalpacer (suppresses dual-writer race)
CACAO_* EnvCACAO_WFS_DARK_ADU0.0Uniform WFS detector dark/bias pedestal [ADU] subtracted prior to normalization
CACAO_* EnvCACAO_WFS_DARKSUBOFFEnable dark/bias pedestal subtraction in acquWFS (ON/OFF)
CACAO_* EnvCACAO_WFS_NORMFLOOR1.0Minimum flux denominator floor in acquWFS intensity normalization (0.001 for faint stars)

Implementation, Tests & Related Reports

Source Files

Verification Tests

Related Staged Technical Reports