Controller¶
__init__ ¶
__init__(
telescope,
interactionMatrix,
controllerType,
reconstructionMethod,
logger=None,
**kwargs,
)
Initialize the Controller module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
telescope
|
Telescope instance
|
Telescope instance, provides the sampling time of the simulation. |
required |
interactionMatrix
|
InteractionMatrixHandler instance
|
Contains the interaction matrices and modal basis for the simulation configuration. |
required |
controllerType
|
String
|
The type of controller that will be used, supported types are: {leaky, forwardPI, backwardPI}. |
required |
reconstructionMethod
|
String
|
Type of reconstructor used, supported types are: {inversion, tikhonov}. |
required |
**kwargs
|
rcond : list of length equal to nDMs or float Percentage of the maximum singular value below witch the SV are discarded. beta : list of length equal to nDMs or float Regularisation coefficient beta for the Tikhonov Regularisation: alfa = beta * (Smax**2) gain : list of length equal to nDMs or float Proportional gain of the Leaky and PI controllers decay : list of length equal to nDMs or float Decay rate for the Leaky integrator ki : list of length equal to nDMs or float Integral gain for the PI controllers |
{}
|
initializeReconstructor ¶
Initialize the reconstructor matrix from the measured interaction matrices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reconstructionMethod
|
str
|
Type of reconstructor ('inversion' or 'tikhonov'). |
required |
interactionMatrix
|
InteractionMatrixHandler
|
Object containing the measured interaction matrices and modal basis. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
reconstructor |
list
|
List of reconstructor matrices per DM. |
modal_basis |
list
|
List of modal basis per DM. |
mask |
ndarray
|
Boolean mask indicating interactions between DMs and light paths. |
discarded_modes |
list
|
List of number of discarded modes per DM. |
initializeController ¶
Initialize the control state (history buffers) based on the controller type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
controllerType
|
str
|
Type of controller ('leaky', 'forwardPI', 'backwardPI'). |
required |
reconstructor
|
list
|
List of reconstructor matrices per DM. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if initialization succeeds. |
computeControlAction ¶
Compute the control action for each DM given the wavefront error from the light paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lightPaths
|
list
|
List of LightPath objects that contain the wavefront error measurements. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dm_cmd |
list
|
List of command arrays to be sent to each Deformable Mirror. |