MockControlOpenLoop¶
- class lsst.ts.m2com.MockControlOpenLoop¶
Bases:
object
Mock open-loop control.
- Attributes:
- inclinometer_angle
float
Inclinometer angle in degree.
- open_loop_max_limit_is_enabled
bool
The maximum limit of open-loop control is enabled or not.
- is_running
bool
The open-loop control is running or not.
- actuator_steps
numpy.ndarray [int]
Current positions of the actuator in steps referenced to the home position.
- inclinometer_angle
Attributes Summary
Methods Summary
calculate_forces_to_positions
(forces)Calculate the forces to positions.
calculate_forces_to_steps
(forces)Calculate the forces to steps.
calculate_steps_to_forces
(steps)Calculate the steps to forces.
correct_inclinometer_angle
(angle[, offset])Correct the inclinometer's value and make sure to limit the resulting value to the indicated range: (-270, 90).
Get the actuator positions in millimeter.
get_forces_mirror_weight
(angle)Get the forces that bear the weight of mirror.
The actuator force is out of limit or not.
move_actuator_steps
(actuators, steps)Move the actuator steps.
pause
()Pause the movement.
read_file_static_transfer_matrix
(filepath[, ...])Read the file of static transfer matrix (the size is 78 x 78).
resume
()Resume the movement.
run_steps
(steps)Run the steps.
start
(actuators, displacement, unit)Start the movement.
stop
()Stop the movement.
update_actuator_steps
(actuator_steps)Update the current actuator steps referenced to the home position.
Attributes Documentation
- LIMIT_FORCE_AXIAL = 489.3¶
- LIMIT_FORCE_TANGENT = 6005.1¶
- MAX_LIMIT_FORCE_AXIAL = 622.75¶
- MAX_LIMIT_FORCE_TANGENT = 6227.51¶
- STEP_TO_MM = 1.9967536601e-05¶
Methods Documentation
- calculate_forces_to_positions(forces)¶
Calculate the forces to positions.
This is just an extension of self.calculate_forces_to_steps().
- Parameters:
- forces
numpy.ndarray
Actuator forces in Newton.
- forces
- Returns:
numpy.ndarray
Actuator positions in millimeter.
- calculate_forces_to_steps(forces)¶
Calculate the forces to steps.
This is the reverse of self.calculate_steps_to_forces().
- Parameters:
- forces
numpy.ndarray
Actuator forces in Newton.
- forces
- Returns:
numpy.ndarray [int]
Actuator steps.
- calculate_steps_to_forces(steps)¶
Calculate the steps to forces.
This function is translated from vendor’s original LabVIEW code. The static transfer matrix is used to simlulate the force change of actuator’s movement.
- Parameters:
- steps
numpy.ndarray [int]
Actuator steps.
- steps
- Returns:
numpy.ndarray
Actuator forces in Newton.
- correct_inclinometer_angle(angle, offset=0.94)¶
Correct the inclinometer’s value and make sure to limit the resulting value to the indicated range: (-270, 90).
This function is translated from vendor’s original LabVIEW code. The hard-coded range is related to the configuration of inclinometer in the mirror assembly.
- get_actuator_positions()¶
Get the actuator positions in millimeter.
- Returns:
numpy.ndarray
Actuator positions in millimeter.
- get_forces_mirror_weight(angle)¶
Get the forces that bear the weight of mirror.
This function is translated from vendor’s original LabVIEW code. This is just an estimation of forces.
- Parameters:
- angle
float
Inclinometer angle in degree.
- angle
- Returns:
- forces
numpy.ndarray
Forces to support the mirror in Newton.
- forces
- is_actuator_force_out_limit()¶
The actuator force is out of limit or not. The result will depend on self.open_loop_max_limit_is_enabled.
- Returns:
bool
True if the actuator force is out of limit. Otherwise, False.
- move_actuator_steps(actuators, steps)¶
Move the actuator steps.
- Parameters:
- actuators
list [int]
ornumpy.ndarray [int]
Actuator IDs to do the movement.
- steps
int
,list [int]
ornumpy.ndarray [int]
Actuator steps to move.
- actuators
- Raises:
ValueError
When the data type is not integer.
RuntimeError
When the actuator force is out of limit.
- pause()¶
Pause the movement.
- read_file_static_transfer_matrix(filepath, skiprows=7)¶
Read the file of static transfer matrix (the size is 78 x 78).
This file comes from the vender’s original project used in the simulation purpose.
- Parameters:
- filepath
str
orpathlib.PosixPath
File path of the static transfer matrix.
- skiprows
int
, optional Number of lines to skip (int) at the start of the file. (the default is 7)
- filepath
- resume()¶
Resume the movement.
- Raises:
RuntimeError
When the movement is done.
- run_steps(steps)¶
Run the steps.
If the requested displacement is done or the actuator force is out of limit, the value of self.is_running will change to False.
- Parameters:
- steps
int
Absolute steps (>=0) to move. The internal calculation will consider the direction of target displacement by itself.
- steps
- Raises:
RuntimeError
When the actuators are not running.
ValueError
When the steps is less than 0.
- start(actuators, displacement, unit)¶
Start the movement.
- Parameters:
- actuators
list [int]
Actuator IDs to do the movement.
- displacement
int
orfloat
Displacement to move.
- unitenum
ActuatorDisplacementUnit
Unit of the displacement.
- actuators
- Raises:
RuntimeError
When the actuators are moving.
ValueError
When no actuators are selected.
- stop()¶
Stop the movement.
- update_actuator_steps(actuator_steps)¶
Update the current actuator steps referenced to the home position.
- Parameters:
- actuator_steps
numpy.ndarray [int]
New current positions of the actuator in steps.
- actuator_steps
- Raises:
ValueError
When the length of actuators does not match.
ValueError
When the data type is not integer.