MockControlClosedLoop¶
- class lsst.ts.m2com.MockControlClosedLoop¶
Bases:
object
Mock closed-loop control.
- Attributes:
- is_running
bool
The closed-loop control is running or not.
- temperature
dict
Temperature of mirror in degree C.
- axial_forces
dict
Forces of the axial actuators in Newton.
- tangent_forces
dict
Forces of the tangent actuators in Newton.
- hardpoints
list
List of the hardpoints. There are 6 actuators. The first three are the axial actuators and the latter three are the tangent links.
- in_position_hardpoints
bool
Hardpoints are in position or not.
- is_running
Attributes Summary
Methods Summary
apply_forces
(force_axial, force_tangent)Apply the actuator forces.
calc_look_up_forces
(lut_angle)Calculate look-up table (LUT) forces using current system state (position and temperature).
check_axial_force_limit
([applied_force])Check if axial forces are out of bounds.
check_tangent_force_limit
([applied_force])Check if tangent forces are out of bounds.
Get the data of force balance system.
Get the total net forces in Newton.
Get the total net moments in Newton * meter.
handle_forces
([force_rms, force_per_cycle])Handle forces and check the actuators are in position or not based on the demanded forces, hardpoint correction, and measured forces.
Cell temperature is high or not.
load_file_cell_geometry
(filepath)Load the file of cell geometry.
load_file_hardpoint_compensation
(filepath[, ...])Load the file of hardpoint compensation.
load_file_lut
(filepath)Load the look-up table (LUT) files.
Reset the force offsets.
set_measured_forces
(force_axial, force_tangent)Set the measured actuator forces.
Simulate the temperature change and update the internal value.
Attributes Documentation
- LIMIT_FORCE_AXIAL = 444.82¶
- LIMIT_FORCE_TANGENT = 4893.04¶
Methods Documentation
- apply_forces(force_axial, force_tangent)¶
Apply the actuator forces.
- Parameters:
- force_axial
list
ornumpy.ndarray
Force of the axial actuators in Newton.
- force_tangent
list
ornumpy.ndarray
Force of the tangent actuators in Newton.
- force_axial
- calc_look_up_forces(lut_angle)¶
Calculate look-up table (LUT) forces using current system state (position and temperature).
- Parameters:
- lut_angle
float
Angle used to calculate the LUT forces of gravity component.
- lut_angle
- check_axial_force_limit(applied_force=None)¶
Check if axial forces are out of bounds.
- Parameters:
- applied_force
numpy.ndarray
orNone
, optional Forces to apply in Newton. If
None
use current setup. (the default is None.)
- applied_force
- Returns:
- demanded_axial_force
numpy.ndarray
Array with the combined total force per actuator in Newton.
- demanded_axial_force
- Raises:
RuntimeError
If force limit is out of range.
- check_tangent_force_limit(applied_force=None)¶
Check if tangent forces are out of bounds.
- Parameters:
- applied_force
numpy.ndarray
orNone
, optional Forces to apply in Newton. If
None
use current setup. (the default is None.)
- applied_force
- Returns:
- demanded_tanget_force
numpy.ndarray
Array with the combined total force per actuator in Newton.
- demanded_tanget_force
- Raises:
RuntimeError
If force limit is out of range.
- get_force_balance()¶
Get the data of force balance system. This contains the net forces (in Newton) and net moments (in Newton * meter).
- Returns:
- force_balance
dict
Data of the force balance system.
- force_balance
- get_net_forces_total()¶
Get the total net forces in Newton.
- Returns:
dict
Total net forces in Newton.
- get_net_moments_total()¶
Get the total net moments in Newton * meter.
- Returns:
dict
Total net moments in Newton * meter.
- handle_forces(force_rms=0.5, force_per_cycle=5)¶
Handle forces and check the actuators are in position or not based on the demanded forces, hardpoint correction, and measured forces.
If the closed-loop control is running, the measured force will be updated based on the “force_per_cycle” as well to decrease the force error. This update will add a random error based on “force_rms”. Therefore, even in the convergend condition, the “in_position” might be False, which is an expected behavior for the real hardware.
This function makes sure the forces are inside range and compute the forces dynamics.
- is_cell_temperature_high()¶
Cell temperature is high or not.
- Returns:
bool
True if the cell temperature is high. Otherwise, False.
- load_file_cell_geometry(filepath)¶
Load the file of cell geometry.
- Parameters:
- filepath
pathlib.PosixPath
File path of cell geometry.
- filepath
- load_file_hardpoint_compensation(filepath, skiprows=7)¶
Load the file of hardpoint compensation.
- Parameters:
- filepath
pathlib.PosixPath
File path of hardpoint compensation.
- skiprows
int
, optional Number of lines to skip (int) at the start of the file. (the default is 7)
- filepath
- load_file_lut(filepath)¶
Load the look-up table (LUT) files.
- Parameters:
- filepath
pathlib.PosixPath
File path of LUT directory.
- filepath
- reset_force_offsets()¶
Reset the force offsets.
This will put the applied force to be zero.
- set_measured_forces(force_axial, force_tangent)¶
Set the measured actuator forces.
- Parameters:
- force_axial
numpy.ndarray
Axial force in Newton.
- force_tangent
numpy.ndarray
Tangential force in Newton.
- force_axial
- Raises:
ValueError
When the input dimensions of forces are wrong.
- simulate_temperature_and_update(temperature_rms=0.05, max_temperature=28.0, min_temperature=0.0)¶
Simulate the temperature change and update the internal value.