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)
- Compute Unit: New standalone CACAO FPS binary
cacao-fpsexec-cacaoac-measdynresp(AOloopControl_acquireCalib/measure_dyn_resp.c, zerolibCLIcoredependency,MILK_RUNNABLE_FPS)—separate from existingmlatandmeaslinresp. - Hardware-in-the-Loop Testbed: Live GPU
cacaosimbench modeling the Subaru AO3k Stage-1 ALPAO 64×64 magnetic plate DM (dyn_mode = "plate",f₀ = 1,000 Hz,c_m = 14.0 m/s,β = 0.0085 m²/s,γ₀ = 195 s⁻¹,plate_drive = "force",rim_bc = "free",delay = 1.0 ms) observed solely through a fixed1,000 Hz/1.0 msexposure160×160J-band (1.22 μm) 4-sided Pyramid WFS (16596active pixels) (8.0 kHz/125 μsphysical master ticks,navg = 8, paced cleanly at2,000 Hz/250 HzWFS wall-clock =4×slow-motion for zero GPU overrun). - Companion Studies: ALPAO 64×64 DM Spatiotemporal Dynamics · DM Anti-Vibration Pre-Shaper Demo · Predictive Control (AR & Block-EOF) · 2-WFS + 1-DM Telemetry SysID
Key Result: Without changing camera frame rate or exposure time, shifting DM poke offsets across
NBsubfr = 8stratified bit-reversed sub-frame phases in live wall-clock real time (CLOCK_MONOTONICTIMER_ABSTIME+PR_SET_TIMERSLACK(1 μs)) yields a clean8.0 kHz(Δt = 125.0 μs) raw 3D response matrix with1.76 μsRMS poke jitter,0.5 μsbin-centroid linearity,0dropped frames,r = 0.99999repeatability across excitation modes, and2.23%static-tail agreement withcacaoac-measlinresp. On a28×28Zernike modal cube (Z2–Z29), replacing CACAO's current 2-tap scalar latency with a full 3D MIMO DM convolution observer reduces PSOL reconstruction error by48.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):
- Top row —
LepICSaBL-Eactuator(22, 23): Raw 1 ms-integrated PyWFS stepY(τ)(1×), dynamic wave residualY(τ) − Y_static(10×), and 1 ms differenceY(τ) − Y(τ − 1 ms)(14×, matching SCExAO's lab observable). - Bottom row — Radial comparison of
Y(τ) − Y_static(10×): Inner Pupil(31, 43), Mid-Outer(49, 31), and Free Rim(57, 31)— showing how proximity to the free circular rim alters wave reflection timing and overshoot amplitude.
Multi-Timestamp Contact Sheet Across All 4 Actuator Radii (τ ≈ +1.3 → +12.0 ms)
3. Zonal Radial Dynamics, Timing Precision & Static-RM Parity
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:
- Sub-2 μs wall-clock stroboscopic accuracy: Tightening Linux kernel timer slack (
PR_SET_TIMERSLACK = 1 μs) with a60 μsfinal spin-wait achieves1.76 μsRMS poke jitter and0.5 μsbin-centroid linearity across all160post-poke bins (min_cnt = 3,ndrop = 0,late_pokes = 0). - Spatial & radial dependence of plate dynamics: Peak PyWFS-RMS overshoot ranges from
+13.7%(Free Rim (57, 31), settling at4.06 ms, with+49.2%deconvolved local peak at the free rim) up to+17.7%(Mid-Outer (49, 31)), whileLepICSaBL-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. - Repeatability, baseline flatness, and static consistency: Independent
pokemode = 0(0→+a→0→−a→0) andpokemode = 1(+a↔−a) live acquisitions agree tor = 0.99999across the full 3D tensor; pre-poke baseline bins (τ < 0) stay flat to< 0.3%(0.21%–0.26%); total polarity asymmetry (resp3D_asym.fits) is0.80%; and the settled tail matchescacaoac-measlinresp(NBexcl = 26) to2.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, τ]:
Modal Dispersion Summary by Complete Zernike Radial Order (n = 1..6, Z2–Z28)
| 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
- Transient cross-mode coupling: During the
1.0–5.0 mswave-propagation window, off-diagonal modal cross-talk peaks at52.5%(τ = +1.31 ms)—driven by free-rim reflections and the asymmetric Subaru Nasmyth-IR V-spiders—before collapsing back to0.59%in the settled static tail (τ > 14 ms). - Quantified PSOL contamination reduction: Driving a 1 kHz Kolmogorov-weighted modal command stream through the measured
28×28WFS-rate 3D impulse responseH[τ]: - Current CACAO 2-tap scalar delay (
modalfilter.c, optimal global lag1.27frames):7.98%RMS residual DM leakage intoaol1_modevalOL. - 3D diagonal-only DM observer (per-mode temporal convolution, ignoring off-diagonal cross-talk):
7.60%RMS — barely improving over the 2-tap lag because transient cross-mode wave coupling is the dominant dynamic PSOL error on a coupled plate facesheet. - Full 3D MIMO DM observer (capturing both per-mode dispersion and off-diagonal wave coupling, even with synthetic calibration noise):
0.17%RMS — a48.0×reduction in command-correlated PSOL contamination!
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:
- PSOL & Filtered-X EOF (Features 2 & 3): Consume raw
Y(τ)directly — no deconvolution required. - Physical DM Step Recovery & High-Rate Pre-Shaper (Feature 1): Although a periodic Fourier transform of the
1.0 msexposure boxcar has multiplesinc(f · T_exp) = 0nulls (1, 2, 3 kHzacross the4 kHzNyquist band), we are not blind at1 kHz. Because a physical DM step response is time-limited (s(t) = 0before causal onset ands(t) → 1afterT_max ≈ 14 ms), no non-zero response can be1 ms-periodic: the tall two-sided Toeplitz boxcar matrixB(160 × 104) has strictly zero null space and a moderate condition numberκ(B) = 70.8.
Contrasting the two-sided finite-support Toeplitz solver directly against a naive periodic FFT Wiener filter on the live 1 kHz PyWFS data:
- Full
f₀ = 1 kHzresonance recovery: While the raw1 msPyWFS magnitude dips to0.07at1 kHzand periodic FFT deconvolution leaves a deep zero-notch, the two-sided finite-support Toeplitz solver cleanly recovers|H_phys(1 kHz)| = 1.51for(22, 23)and2.20for the free rim(57, 31). - Causal, exact-DC physical step: Unlike periodic FFT inversion (which introduces acausal pre-ringing before
1.0 msand artificially damps overshoot to+20.1%), the two-sided Toeplitz solver stays strictly0before causal onset, settles cleanly to1.000, reproduces the measured1 msPyWFS curve to0.20%RMS, and restores the true underdamped plate overshoot (+7.1%→+46.7%for(22, 23),+6.4%→+49.2%for the free rim). - Direct time-domain pre-shaper synthesis (
cacao-fpsexec-cacaocc-compdmpreshaper): Exploits the exact same finite-window time-domain Toeplitz structure directly (S_raw * K ≈ b₁ₘₛ * s_target,∑ K = I) to drive the asynchronous high-rate look-ahead pre-shaper (cacao-fpsexec-dmpreshaper) right acrossf₀ = 1 kHz.
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
- dm64_dyn_rm_metrics.json — Complete zonal, timing, 28×28 modal dispersion, cross-coupling, PSOL benchmark, and deconvolution telemetry
- dm64_3drm_wave.mp4 — Live 8 kHz stroboscopic 3D RM video (
884×728,136frames @12 fps=11.3 s, H.264yuv420p) - dm64_3drm_zonal_contact_sheet.png — 4×6 multi-radius dynamic wave contact sheet
- dm64_3drm_radial_and_timing_2x2.png — 2×2 radial step, Hovmöller wave, timing repeatability, and
measlinrespstatic-parity diagnostics - dm64_3drm_modal_28x28_2x2.png — 2×2
28×28Zernike modal dispersion, coupling heatmaps, and PSOL error comparison - dm64_3drm_exposure_deconv_1x2.png — Fixed 1 ms exposure boxcar spectrum and two-sided finite-support Toeplitz physical step inversion vs. periodic FFT Wiener
Telemetry & Data Files
| File | Format | Size |
|---|---|---|
dm64_dyn_rm_metrics.json | JSON | 15.00 KB |
