mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Implements a general integrator controller.
document the math for the G.I.
document the filter coefficients, etc.
_realT | is the floating point type for all calculations. |
Definition at line 38 of file generalIntegrator.hpp.
#include <ao/sim/generalIntegrator.hpp>
Public Types | |
typedef _realT | realT |
The real data type. More... | |
typedef std::complex< realT > | complexT |
The real data type. More... | |
typedef wfMeasurement< realT > | commandT |
The wavefront data type. More... | |
typedef Eigen::Array< realT, Eigen::Dynamic, Eigen::Dynamic > | imageT |
The image type, used here as a general storage array. More... | |
Public Member Functions | |
generalIntegrator () | |
Default c'tor. More... | |
int | initialize (int nModes) |
Allocate and initialize all state. More... | |
int | nModes () |
Get the number of modes. More... | |
int | openLoop (bool ol) |
Set the m_openLoop flag. More... | |
bool | openLoop () |
Get the value of the m_openLoop flag. More... | |
int | openLoopDelay (int cr) |
Set the open loop delay. More... | |
int | openLoopDelay () |
Get the value of the m_openLoopDelay. More... | |
int | closingRamp (int cr) |
Set the closing ramp. More... | |
int | closingRamp () |
Get the value of the m_closingRamp. More... | |
int | closingDelay (int cd) |
Set the closing delay. More... | |
int | closingDelay () |
Get the value of the m_closingDelay. More... | |
int | closingGains (const std::vector< realT > &gains) |
Set the simple integrator gains to use during closing. More... | |
int | closingGains (realT g) |
Set the simple integrator gain to use for all modes during closing. More... | |
int | lowOrders (int lo) |
Set m_lowOrders. More... | |
int | lowOrders () |
Get the value of the m_lowOrders. More... | |
int | setASize (int n) |
Set the size of the IIR vector (the a coefficients) More... | |
int | setA (int i, const imageT &a) |
Set the IIR coefficients for one mode. More... | |
int | setBSize (int n) |
Set the size of the FIR vector (the b coefficients) More... | |
int | setB (int i, const imageT &b) |
Set the FIR coefficients for one mode. More... | |
realT | gain (int i) |
Get the gain for a single mode. More... | |
int | gain (int i, realT g) |
Set the gain for a single mode. More... | |
int | gains (realT g) |
Set the gain for all modes to a single value. More... | |
int | gains (const std::vector< realT > &gains) |
Set the gains for all modes, using a vector to specify each gain. More... | |
int | gains (const std::string &ogainf) |
Set the gains for all modes, using a file to specify each gain. More... | |
int | initMeasurements (commandT &filtAmps, commandT &rawAmps) |
Allocate the provided command structures. More... | |
Protected Attributes | |
int | m_nModes {0} |
The number of modes being filtered. More... | |
bool | m_openLoop {false} |
If true, then commands are not integrated. Default is false. More... | |
int | m_openLoopDelay {0} |
If > 0, then the loop is open for this time in time steps. Default is 0. More... | |
int | m_closingRamp {0} |
If > 0, then gains are famped linearly up to m_closingGains over this interval in time steps. Default is 0. This is relative m_openLoopDelay. More... | |
int | m_closingDelay {0} |
If > 0, then the simple integrator,with m_closingGains is used up to this timestep. This is relative m_openLoopDelay. Default = 0. More... | |
imageT | m_closingGains |
Column-vector of gains used for loop closing as simple integrator. More... | |
int | m_lowOrders {0} |
If > 0, then this sets the maximum mode number which is filtered. All remaining modes are set to 0. Default = 0. More... | |
imageT | m_gains |
Column-vector of gains. More... | |
typedef wfMeasurement<realT> mx::AO::sim::generalIntegrator< _realT >::commandT |
typedef std::complex<realT> mx::AO::sim::generalIntegrator< _realT >::complexT |
The real data type.
Definition at line 47 of file generalIntegrator.hpp.
typedef Eigen::Array< realT, Eigen::Dynamic, Eigen::Dynamic> mx::AO::sim::generalIntegrator< _realT >::imageT |
The image type, used here as a general storage array.
Definition at line 56 of file generalIntegrator.hpp.
typedef _realT mx::AO::sim::generalIntegrator< _realT >::realT |
The real data type.
Definition at line 44 of file generalIntegrator.hpp.
mx::AO::sim::generalIntegrator< realT >::generalIntegrator |
Default c'tor.
Definition at line 274 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::closingDelay |
Get the value of the m_closingDelay.
Definition at line 377 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::closingDelay | ( | int | cd | ) |
Set the closing delay.
If m_closingDelay > 0, then the simple integragor is used until this timestep.
[in] | cd | The new value of m_closingDelay |
Definition at line 369 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::closingGains | ( | const std::vector< realT > & | gains | ) |
Set the simple integrator gains to use during closing.
-1 | on vector size mismatch |
[in] | gains | vector of gains. |
Definition at line 383 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::closingGains | ( | realT | g | ) |
Set the simple integrator gain to use for all modes during closing.
Definition at line 401 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::closingRamp |
Get the value of the m_closingRamp.
Definition at line 363 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::closingRamp | ( | int | cr | ) |
Set the closing ramp.
If m_closingRamp > 0, then the gains are ramped linearly up to m_closingGains over this timer interval in timesteps. Requires m_closingDelay > 0.
[in] | cr | The new value of m_closingRamp |
Definition at line 355 of file generalIntegrator.hpp.
realT mx::AO::sim::generalIntegrator< realT >::gain | ( | int | i | ) |
Get the gain for a single mode.
0 | if the mode doesn't exist. |
i | The mode number |
Definition at line 487 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::gain | ( | int | i, |
realT | g | ||
) |
Set the gain for a single mode.
0 | if the mode doesn't exist. |
i | The mode number |
g | The new gain value |
Definition at line 499 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::gains | ( | const std::string & | ogainf | ) |
Set the gains for all modes, using a file to specify each gain.
The file format is a simple ASCII single column, with 1 gain per line. Must be exactly as long as m_nModes.
-1 | if file open fails |
[in] | ogainf | the name of the file, full path |
Definition at line 546 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::gains | ( | const std::vector< realT > & | gains | ) |
Set the gains for all modes, using a vector to specify each gain.
The vector must be exactly as long as m_nModes.
-1 | on vector size mismatch |
[in] | gains | vector of gains. |
Definition at line 525 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::gains | ( | realT | g | ) |
Set the gain for all modes to a single value.
g | The new gain value |
Definition at line 514 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::initialize | ( | int | nModes | ) |
Allocate and initialize all state.
[in] | nModes | the number of modes to be filtered |
Definition at line 281 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::initMeasurements | ( | commandT & | filtAmps, |
commandT & | rawAmps | ||
) |
Allocate the provided command structures.
Used by the calling system to allocate the commands being passed between components.
filtAmps | The structure to contain the filtered commands |
rawAmps | The structure to contain the raw commands |
Definition at line 571 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::lowOrders |
Get the value of the m_lowOrders.
Definition at line 420 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::lowOrders | ( | int | lo | ) |
Set m_lowOrders.
If m_lowOrders > 0, then this sets the maximum mode number which is filtered. All remaining modes are set to 0.
[in] | lo | The new value of m_lowOrders |
Definition at line 412 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::nModes |
Get the number of modes.
nModes is only set by calling initialize.
Definition at line 322 of file generalIntegrator.hpp.
bool mx::AO::sim::generalIntegrator< realT >::openLoop |
Get the value of the m_openLoop flag.
Definition at line 335 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::openLoop | ( | bool | ol | ) |
Set the m_openLoop flag.
If m_openLoop is true, then commands are not filtered.
[in] | ol | the new value of m_openLoop |
Definition at line 328 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::openLoopDelay |
Get the value of the m_openLoopDelay.
Definition at line 349 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::openLoopDelay | ( | int | cr | ) |
Set the open loop delay.
If m_openLoopDelay > 0, then the loop is open for this period in time-steps Requires m_closingDelay > 0.
[in] | cr | The new value of m_openLoopDelay |
Definition at line 341 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::setA | ( | int | i, |
const imageT & | a | ||
) |
Set the IIR coefficients for one mode.
[in] | i | the mode number |
[in] | a | the IIR coefficients for this mode |
Definition at line 448 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::setASize | ( | int | n | ) |
Set the size of the IIR vector (the a coefficients)
This allocates m_a to be m_nModes X n in size.
[in] | n | the number of IIR coefficients |
Definition at line 426 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::setB | ( | int | i, |
const imageT & | b | ||
) |
Set the FIR coefficients for one mode.
[in] | i | the mode number |
[in] | b | the IIR coefficients for this mode |
Definition at line 478 of file generalIntegrator.hpp.
int mx::AO::sim::generalIntegrator< realT >::setBSize | ( | int | n | ) |
Set the size of the FIR vector (the b coefficients)
This allocates m_b to be m_nModes X n in size.
[in] | n | the number of FIR coefficients |
Definition at line 456 of file generalIntegrator.hpp.
|
protected |
If > 0, then the simple integrator,with m_closingGains is used up to this timestep. This is relative m_openLoopDelay. Default = 0.
Definition at line 72 of file generalIntegrator.hpp.
|
protected |
Column-vector of gains used for loop closing as simple integrator.
Definition at line 74 of file generalIntegrator.hpp.
|
protected |
If > 0, then gains are famped linearly up to m_closingGains over this interval in time steps. Default is 0. This is relative m_openLoopDelay.
Definition at line 70 of file generalIntegrator.hpp.
|
protected |
Column-vector of gains.
Definition at line 84 of file generalIntegrator.hpp.
|
protected |
If > 0, then this sets the maximum mode number which is filtered. All remaining modes are set to 0. Default = 0.
Definition at line 76 of file generalIntegrator.hpp.
|
protected |
The number of modes being filtered.
Definition at line 64 of file generalIntegrator.hpp.
|
protected |
If true, then commands are not integrated. Default is false.
Definition at line 66 of file generalIntegrator.hpp.
|
protected |
If > 0, then the loop is open for this time in time steps. Default is 0.
Definition at line 68 of file generalIntegrator.hpp.