MAOS
Multithreaded Adaptive Optics Simulator
|
Data Structures | |
struct | kalman_t |
Functions | |
dmat * | sde_fit (const dmat *psdin, const dmat *coeff0, real tmax_fit, int vibid) |
dmat * | reccati (dmat **Pout, const dmat *A, const dmat *Qn, const dmat *C, const dmat *Rn) |
dcell * | reccati_cell (dmat **Pout, const dmat *A, const dmat *Qn, const dcell *C, const dcell *Rn) |
kalman_t * | sde_kalman (const dmat *coeff, const real dthi, const lmat *dtrat, const dcell *Gwfs, const dcell *Rwfs, const dmat *Proj) |
void | kalman_free (kalman_t *kalman) |
dmat * | kalman_test (kalman_t *kalman, dmat *input) |
void | kalman_init (kalman_t *kalman) |
void | kalman_update (kalman_t *kalman, dmat *meas, int ik) |
void | kalman_output (kalman_t *kalman, dmat **out, real alpha, real beta) |
void | kalman_write (kalman_t *kalman, const char *format,...) |
void | sde_psd (dmat **psd, const dmat *f, const real *coeff, int ncoeff, int nmod) |
dmat * | sde_psd2 (const dmat *ff, const dmat *coeff) |
struct kalman_t |
Data Fields | ||
---|---|---|
dmat * | Ad |
discrete state propagation at dT |
dcell * | Cd |
From discrete state to WFS measurement |
dmat * | AdM |
discrete state propagation at dthi |
dmat * | FdM |
From discrete state to averaged mode for dthi |
dmat * | Qn |
Covariance of the process noise term e_k |
dcell * | M |
M is innovation gain. |
dmat * | P |
Error covariance matrix |
real | dthi |
Sampling period of control loop |
lmat * | dtrat |
WFS sampling period over dthi |
dcell * | Gwfs |
WFS measurement from modes. Can be identity. |
dcell * | Rwfs |
WFS measurement noise covariance due to photon and RoN. |
dcell * | Rn |
Total WFS measurement error due to signal evolution and Rwfs. |
dmat * | xhat |
Temporary state |
dmat * | xhat2 |
Temporary state |
dmat * | xhat3 |
Temporary state |
Estiamte the total PSD power for vibration peaks using FWHM*peak If coeff0 is not null, use it immediately, otherwise, do vibration identification
Compute the reccati equation.
dcell* reccati_cell | ( | dmat ** | Pout, |
const dmat * | A, | ||
const dmat * | Qn, | ||
const dcell * | Cs, | ||
const dcell * | Rns | ||
) |
Compute the reccati equation.
kalman_t* sde_kalman | ( | const dmat * | coeff, |
const real | dthi, | ||
const lmat * | dtrat_wfs, | ||
const dcell * | Gwfs, | ||
const dcell * | Rwfs, | ||
const dmat * | Proj | ||
) |
Kalman filter based on SDE model
coeff | SDE coefficients |
dthi | Loop frequency |
dtrat_wfs | WFS frequency as a fraction of loop |
Gwfs | WFS measurement from modes. Can be identity |
Rwfs | WFS measurement noise covariance |
Proj | Project modes in statespace to DM/correction space |
void kalman_free | ( | kalman_t * | kalman | ) |
free the struct
Test the performance of kalman filter (LQG controller). Derived from servo_test()
void kalman_init | ( | kalman_t * | kalman | ) |
Initialize kalman filter state
Update state vector when there is a measurement. It modifies meas.
xhat3=xhat+M*(meas-Cd*xhat) xhat2=AdM*xhat3; xhat =Ad*xhat3;
Output correction
out=out*alpha+Fdm*(AdM*xhat2)*beta
Computes PSD of SDE with coefficients (coeff) and frequency (f)