MockControlClosedLoop

class lsst.ts.m2com.MockControlClosedLoop

Bases: object

Mock closed-loop control.

Attributes:
is_runningbool

The closed-loop control is running or not.

temperaturedict

Temperature of mirror in degree C.

axial_forcesdict

Forces of the axial actuators in Newton.

tangent_forcesdict

Forces of the tangent actuators in Newton.

hardpointslist

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_hardpointsbool

Hardpoints are in position or not.

Attributes Summary

LIMIT_FORCE_AXIAL

LIMIT_FORCE_TANGENT

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_force_balance()

Get the data of force balance system.

get_net_forces_total()

Get the total net forces in Newton.

get_net_moments_total()

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.

is_cell_temperature_high()

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_force_offsets()

Reset the force offsets.

set_measured_forces(force_axial, force_tangent)

Set the measured actuator forces.

simulate_temperature_and_update([...])

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_axiallist or numpy.ndarray

Force of the axial actuators in Newton.

force_tangentlist or numpy.ndarray

Force of the tangent actuators in Newton.

calc_look_up_forces(lut_angle)

Calculate look-up table (LUT) forces using current system state (position and temperature).

Parameters:
lut_anglefloat

Angle used to calculate the LUT forces of gravity component.

check_axial_force_limit(applied_force=None)

Check if axial forces are out of bounds.

Parameters:
applied_forcenumpy.ndarray or None, optional

Forces to apply in Newton. If None use current setup. (the default is None.)

Returns:
demanded_axial_forcenumpy.ndarray

Array with the combined total force per actuator in Newton.

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_forcenumpy.ndarray or None, optional

Forces to apply in Newton. If None use current setup. (the default is None.)

Returns:
demanded_tanget_forcenumpy.ndarray

Array with the combined total force per actuator in Newton.

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_balancedict

Data of the force balance system.

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.

Parameters:
force_rmsfloat, optional

Force rms variation in Newton. (the default is 0.5)

force_per_cyclefloat, optional

Force per cycle to apply in Newton. (the default is 5)

Returns:
in_positionbool

M2 assembly is in position or not.

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:
filepathpathlib.PosixPath

File path of cell geometry.

load_file_hardpoint_compensation(filepath, skiprows=7)

Load the file of hardpoint compensation.

Parameters:
filepathpathlib.PosixPath

File path of hardpoint compensation.

skiprowsint, optional

Number of lines to skip (int) at the start of the file. (the default is 7)

load_file_lut(filepath)

Load the look-up table (LUT) files.

Parameters:
filepathpathlib.PosixPath

File path of LUT directory.

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_axialnumpy.ndarray

Axial force in Newton.

force_tangentnumpy.ndarray

Tangential force in Newton.

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.

Parameters:
temperature_rmsfloat, optional

Temperature rms variation in degree C. (the default is 0.05)

max_temperaturefloat, optional

Maximum temperature in degree C. (the default is 28.0)

min_temperaturefloat, optional

Minimum temperature in degree C. (the default is 0.0)