pyrtc.predictive
Model-based predictive control for the modal loop.
A loop running pyrtc.loop.Loop.predictive_integrator() estimates the
pseudo open-loop (POL) disturbance of each controlled mode every frame,
pol_t = residual_t - command_applied_t,
and asks a ModalPredictor for the disturbance horizon frames
ahead, when the next command will be on the corrector. The command cancels
that prediction.
Predictors are pluggable. Each one learns its model from recorded POL data
(ModalPredictor.fit()) and then filters online
(ModalPredictor.update() / ModalPredictor.predict()). Register a
new method with register_predictor(); the loop builds one from its
predictor config with make_predictor(). Built in:
persistencePredicts that the disturbance stays at its last measurement. Used before any fit, where it makes the loop a pseudo open-loop integrator.
ar_kalmanModal LQG: an AR(2) disturbance model per mode, fitted by least squares with the measurement noise estimated from the spectrum’s floor, and a steady-state Kalman filter that predicts
horizonframes ahead.least_squaresA per-mode linear prediction filter over the last
orderPOL samples, fitted by ridge regression to predicthorizonframes ahead.
All predictors work on (num_modes,) vectors, one per frame, and are
vectorized over modes.
Functions
|
Return the registered predictor names. |
|
Build a predictor from a |
|
Class decorator registering a |
Classes
|
Modal LQG predictor: an AR(2) model per mode with a steady-state Kalman filter. |
|
Per-mode linear prediction filter fitted by ridge regression. |
|
Predict each mode's disturbance |
|
Predict that each mode keeps its last measured value. |