pyrtc.modal_gains

Per-mode integrator gain optimization from closed-loop telemetry.

The loop applies a gain per controlled mode (Loop.set_modal_gains). This module picks those gains from closed-loop data, following the modal control optimization of Gendron & Léna (1994, A&A 291, 337):

  1. Record the modal residuals the loop measures, y = signal @ cm.T (pyrtc.loop.Loop.modal_residuals()), while it runs with known gains.

  2. With an integrator g / (1 - z^-1) and a pure delay of d frames, the measured residual is y = E_g (phi + n), where E_g is the rejection transfer function, phi the disturbance and n the measurement noise. Dividing the residual PSD by |E_g0|^2 gives the pseudo open-loop PSD P_phi + P_n.

  3. The noise is white, and the disturbance falls steeply with frequency, so the high-frequency end of the pseudo open-loop PSD estimates P_n.

  4. For each mode, the chosen gain minimizes the predicted residual variance sum(|E_g|^2 P_phi + |T_g|^2 P_n) (T_g = 1 - E_g) over stable gains.

Optical gains (the reduced sensitivity of a pyramid WFS on a residual wavefront) are applied separately: Loop.set_optical_gains divides the effective gains by them.

Functions

max_stable_gain(delay_frames, *[, resolution])

Return the largest integrator gain that keeps the loop stable.

open_loop_transfer(freqs, frame_rate, gain, ...)

Return the open-loop transfer g z^-d / (1 - z^-1) at freqs (Hz).

optimize_modal_gains(residuals, frame_rate, ...)

Choose per-mode integrator gains from closed-loop modal residuals.

rejection_transfer(freqs, frame_rate, gain, ...)

Return the rejection (error) transfer E = 1 / (1 + H_ol).

Classes

ModalGainResult(gains, predicted_residual, ...)

Output of optimize_modal_gains().