Calibration & SysIDFEATURED STUDYcacao-fpsexec-cacaoac-measdynrespFixed 1 kHz WFS → 8 kHz (Δt = 125.0 μs)Wall-Clock Jitter: 1.76 μs (0 Drops)Static Parity vs measlinresp: 2.23%PSOL Residual: 7.98% → 0.17% (48.0×)

Live wall-clock stroboscopic 3D response matrix acquisition (cacaoac-measdynresp) on the Subaru AO3k ALPAO 64×64 magnetic plate DM through a fixed 1,000 Hz / 1.0 ms J-band PyWFS: achieves 125.0 μs (8.0 kHz) temporal resolution with 1.76 μs RMS poke jitter and 0.5 μs bin-centroid linearity, directly capturing circular facesheet waves, free-rim reflections, 28×28 Zernike modal dispersion, and a 48.0× PSOL residual reduction over CACAO's current 2-tap scalar delay.

Referenced Simulation Reports

No matching simulation reports staged locally yet.

Raw 3D Spatiotemporal Response Matrix Calibration — ALPAO 64×64 Plate DM (cacaoac-measdynresp)

Key Result: Without changing camera frame rate or exposure time, shifting DM poke offsets across NBsubfr = 8 stratified bit-reversed sub-frame phases in live wall-clock real time (CLOCK_MONOTONIC TIMER_ABSTIME + PR_SET_TIMERSLACK(1 μs)) yields a clean 8.0 kHz (Δt = 125.0 μs) raw 3D response matrix with 1.76 μs RMS poke jitter, 0.5 μs bin-centroid linearity, 0 dropped frames, r = 0.99999 repeatability across excitation modes, and 2.23% static-tail agreement with cacaoac-measlinresp. On a 28×28 Zernike modal cube (Z2–Z29), replacing CACAO's current 2-tap scalar latency with a full 3D MIMO DM convolution observer reduces PSOL reconstruction error by 48.0× (7.98% → 0.17% RMS).


1. Stroboscopic Acquisition Architecture (cacaoac-measdynresp)

When the WFS camera's frame period T_WFS and exposure time T_exp are fixed by hardware, each frame k integrates the DM step response s(t) over [τ − T_exp, τ] where τ = t_k − t_poke. By scheduling NBsubfr stratified sub-frame poke offsets δt_p = ((p + 0.5) / NBsubfr) · T_WFS in bit-reversed (van der Corput) order after each WFS semaphore wake-up, cacaoac-measdynresp directly samples the exposure-integrated 3D step response Y[out, in, τ_q] on a uniform Δt = T_WFS / NBsubfr grid:

flowchart LR
    WFS["Fixed 1 kHz PyWFS<br/>csim_wfs_nir (T_exp = 1.0 ms)"] -->|"semwait + CLOCK_MONOTONIC"| MDR["cacaoac-measdynresp<br/>Bit-reversed phase δt_p<br/>TIMER_ABSTIME + 60 μs spin"]
    MDR -->|"0 → +a → 0 → −a → 0<br/>(jitter = 1–2 μs)"| DM["dm01disp (64×64)<br/>ALPAO Plate PDE"]
    DM -->|"1.0 ms delay + plate waves"| WFS
    MDR -->|"Exact lag bin q"| CUBE["resp3D.fits [N_out, N_in, N_t]<br/>+ _cnt, _tmean, _static, _asym"]
    CUBE -->|"No deconv needed"| PSOL["Feature 2 & 3:<br/>3D PSOL Observer + Filtered-X EOF"]
    CUBE -->|"Regularized boxcar deconv"| PRE["Feature 1:<br/>High-Rate Command Pre-Shaper"]

Design Highlights Over Legacy mlat and measlinresp

Aspect Legacy mlat Legacy measlinresp New cacaoac-measdynresp
Spatial modes Single 2D poke pattern Arbitrary 3D poke cube (static 2D output) Arbitrary 3D poke cube (zonal, Hadamard, modal) → [N_out, N_in, N_t]
Temporal observable Frame-to-frame diff y[k] − y[k−1] (adds DC null) Discards NBexcl, averages NBave Direct local-baseline step y[k] − y_base (no DC null; tail = static RM)
Sub-frame timing Random ran1() · wfsdt + 2 μs poll Single fixed offset pokedelayns Bit-reversed stratified phases + semwait + PR_SET_TIMERSLACK + exact timestamp binning
Drift & nonlinearity Unipolar step ±a alternating pokemode=0 (0→+a→0→−a→0 cancels DC + linear drift + a²), 1 (+a↔−a), 2 (0→+a→0)
Early-stop resilience Incomplete histogram Partial cycle Per-phase atomic FITS checkpoints + guaranteed DM zeroing on SIGINT/runstop
Output compression Full WFS image Full WFS image Optional 2D .outmask (or direct modal aolX_modevalWFS)

2. Live 8 kHz Stroboscopic 3D RM Video — ALPAO 64×64 Facesheet Waves

Acquired directly from cacao-fpsexec-cacaoac-measdynresp running live in wall-clock real time (1,000 Hz fixed J-band PyWFS, NBsubfr = 8 → Δt = 125.0 μs, pokemode = 0, ampl = 0.04 μm) on four illuminated single actuators spanning the circular 64×64 facesheet (outside Subaru's 30.7% central obscuration):

Live 8 kHz Stroboscopic 3D RM Video on ALPAO 64x64 Plate DM (Fixed 1 kHz J-band PyWFS, cacaoac-measdynresp) — 136 frames @ 12 fps · Download MP4

Multi-Timestamp Contact Sheet Across All 4 Actuator Radii (τ ≈ +1.3 → +12.0 ms)

Live 3D RM Dynamic Wave Residual Contact Sheet Across 4 Radii on ALPAO 64x64 Plate DM
Live 3D RM Dynamic Wave Residual Contact Sheet Across 4 Radii on ALPAO 64x64 Plate DM

3. Zonal Radial Dynamics, Timing Precision & Static-RM Parity

ALPAO 64x64 Plate DM Live Wall-Clock 3D RM Calibration Diagnostics (2x2)
ALPAO 64x64 Plate DM Live Wall-Clock 3D RM Calibration Diagnostics (2x2)

Per-Actuator Measured Dynamics (WFSFREQ = 1000.00 Hz, Δt = 125.0 μs, jitter = 1.76 μs, ndrop = 0)

Actuator Poke Distance from Center Peak Lag τ_peak Dynamic Overshoot 3% Settling Time Pre-Poke Baseline Leak Static Tail vs. measlinresp
LepICSaBL-E (22, 23) 12.8 act (19.1 mm) +2.06 ms +15.4% 5.94 ms 0.211% 2.63%
Inner Pupil (31, 43) 11.5 act (17.3 mm) +2.19 ms +15.1% 4.31 ms 0.264% 2.35%
Mid-Outer (49, 31) 17.5 act (26.3 mm) +2.19 ms +17.7% 4.06 ms 0.234% 2.25%
Free Rim (57, 31) 25.5 act (38.3 mm) +2.19 ms +13.7% 4.06 ms 0.253% 1.79%

Key quantitative observations from the live wall-clock 3D acquisition:

  1. Sub-2 μs wall-clock stroboscopic accuracy: Tightening Linux kernel timer slack (PR_SET_TIMERSLACK = 1 μs) with a 60 μs final spin-wait achieves 1.76 μs RMS poke jitter and 0.5 μs bin-centroid linearity across all 160 post-poke bins (min_cnt = 3, ndrop = 0, late_pokes = 0).
  2. Spatial & radial dependence of plate dynamics: Peak PyWFS-RMS overshoot ranges from +13.7% (Free Rim (57, 31), settling at 4.06 ms, with +49.2% deconvolved local peak at the free rim) up to +17.7% (Mid-Outer (49, 31)), while LepICSaBL-E (22, 23) rings longest (5.94 ms) as waves bounce across the full circular diameter—confirming that a spatially uniform temporal kernel cannot fully capture a free-rim circular plate DM.
  3. Repeatability, baseline flatness, and static consistency: Independent pokemode = 0 (0→+a→0→−a→0) and pokemode = 1 (+a↔−a) live acquisitions agree to r = 0.99999 across the full 3D tensor; pre-poke baseline bins (τ < 0) stay flat to < 0.3% (0.21%–0.26%); total polarity asymmetry (resp3D_asym.fits) is 0.80%; and the settled tail matches cacaoac-measlinresp (NBexcl = 26) to 2.23% relative L2.

4. 28×28 Modal 3D Response Matrix (Z2–Z29) & Impact on PSOL

To evaluate modal-space calibration directly applicable to CACAO's modalfilter.c and mkEOFPF.c, we acquired a second live wall-clock 3D cube on the first 28 Zernike modes (Z2–Z29, radial orders n = 1..6, ampl = 0.015 μm, NBsubfr = 8 → Δt = 125.0 μs, jitter = 2.30 μs, ndrop = 0) and projected every time slice through the static pseudo-inverse C_static = R_static⁺ to obtain the square 28 × 28 × 152 modal 3D response tensor M[sensed, poked, τ]:

Interactive 3D ALPAO 64x64 Plate DM 28x28 Modal 3D Response Matrix & PSOL Benchmark (2x2)
↓ Static PNG
ALPAO 64x64 Plate DM 28x28 Modal 3D Response Matrix & PSOL Benchmark (2x2)
Zernike Group Modes Mean 50% Lag τ₅₀ Mean 10–90% Rise Mean Peak Overshoot Mean 2% Settling Time
Radial order n = 1 2 (Z2–Z3) +1.50 ms 0.56 ms +1.7% 5.94 ms
Radial order n = 2 3 (Z4–Z6) +1.44 ms 0.62 ms +3.9% 3.98 ms
Radial order n = 3 4 (Z7–Z10) +1.44 ms 0.59 ms +3.7% 4.31 ms
Radial order n = 4 5 (Z11–Z15) +1.44 ms 0.62 ms +4.3% 4.76 ms
Radial order n = 5 6 (Z16–Z21) +1.44 ms 0.67 ms +5.3% 5.90 ms
Radial order n = 6 7 (Z22–Z28) +1.44 ms 0.71 ms +5.9% 6.35 ms

Why This Directly Improves PSOL & Predictive Control


5. Fixed-Exposure Boxcar Physics & Two-Sided Finite-Support Toeplitz Inversion

Because cacaoac-measdynresp preserves the raw exposure-integrated response Y(τ) = (b₁ₘₛ * s)(τ), downstream calibration tools separate cleanly into two regimes:

  1. PSOL & Filtered-X EOF (Features 2 & 3): Consume raw Y(τ) directly — no deconvolution required.
  2. Physical DM Step Recovery & High-Rate Pre-Shaper (Feature 1): Although a periodic Fourier transform of the 1.0 ms exposure boxcar has multiple sinc(f · T_exp) = 0 nulls (1, 2, 3 kHz across the 4 kHz Nyquist band), we are not blind at 1 kHz. Because a physical DM step response is time-limited (s(t) = 0 before causal onset and s(t) → 1 after T_max ≈ 14 ms), no non-zero response can be 1 ms-periodic: the tall two-sided Toeplitz boxcar matrix B (160 × 104) has strictly zero null space and a moderate condition number κ(B) = 70.8.
Fixed 1 ms Exposure Transfer Function & Two-Sided Finite-Support Toeplitz Inversion (1x2)
Fixed 1 ms Exposure Transfer Function & Two-Sided Finite-Support Toeplitz Inversion (1x2)

Contrasting the two-sided finite-support Toeplitz solver directly against a naive periodic FFT Wiener filter on the live 1 kHz PyWFS data:


Reproducibility & GitHub Provenance

Every cube, timing measurement, video frame, modal matrix, and PSOL benchmark on this page is generated live by running compiled cacao-fpsexec-cacaoac-measdynresp against the GPU cacaosim ALPAO 64×64 plate bench:

cd ~/src/cacao-work && source env.sh

# 1. Build cacao (including cacao-fpsexec-cacaoac-measdynresp) and run unit validation
cmake --build ../milk/_build --target cacaoAOloopControlacquireCalib cacao-fpsexec-cacaoac-measdynresp -j$(nproc)
cmake --install ../milk/_build
pytest -v tests/test_09_measdynresp.py

# 2. Acquire live 64x64 ALPAO plate zonal + 28-mode Zernike 3D RMs and render all figures/video
"${PYTHON_BIN}" ./scripts/build-dm64-dyn-rm-report.py --rerun-acq

# 3. Stage & publish to Firebase Hosting
./scripts/publish-ao-report.sh --slug dm64_dyn_rm_calib --project scexao-og _work/dm64_dyn_rm_calib

Example Direct CLI Invocation of cacao-fpsexec-cacaoac-measdynresp

milk-fps-init -q mdr cacao-fpsexec-cacaoac-measdynresp
milk-fps-set -q \
    mdr.streamin=aol1_dmRM \
    mdr.streamout=aol1_imWFS2 \
    mdr.inmodes=HpokeC.fits \
    mdr.outcube=resp3D.fits \
    mdr.outmask=wfsmask.fits \
    mdr.ampl=0.04 \
    mdr.timing.NBsubfr=8 \
    mdr.timing.NBrespfr=20 \
    mdr.pokemode=0 \
    mdr.phaseorder=0 \
    mdr.saveALL=ON \
    mdr.procinfo.loopcntMax=1
milk-fps-runstart -q mdr && milk-fps-wait -q mdr

Machine-Readable Artifacts

Telemetry & Data Files

FileFormatSize
dm64_dyn_rm_metrics.jsonJSON15.00 KB