MockControlOpenLoop

class lsst.ts.m2com.MockControlOpenLoop

Bases: object

Mock open-loop control.

Attributes:
inclinometer_anglefloat

Inclinometer angle in degree.

open_loop_max_limit_is_enabledbool

The maximum limit of open-loop control is enabled or not.

is_runningbool

The open-loop control is running or not.

actuator_stepsnumpy.ndarray [int]

Current positions of the actuator in steps referenced to the home position.

Attributes Summary

LIMIT_FORCE_AXIAL

LIMIT_FORCE_TANGENT

MAX_LIMIT_FORCE_AXIAL

MAX_LIMIT_FORCE_TANGENT

STEP_TO_MM

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

Get the actuator positions in millimeter.

get_forces_mirror_weight(angle)

Get the forces that bear the weight of mirror.

is_actuator_force_out_limit()

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:
forcesnumpy.ndarray

Actuator forces in Newton.

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:
forcesnumpy.ndarray

Actuator forces in Newton.

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:
stepsnumpy.ndarray [int]

Actuator 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.

Parameters:
anglefloat

Inclinometer angle in degree.

offsetfloat, optional

Offset in degree. The default value is hard-coded in the LabVIEW’s project. (the default is 0.94)

Returns:
angle_correctfloat

Corrected inclinometer angle in degree.

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:
anglefloat

Inclinometer angle in degree.

Returns:
forcesnumpy.ndarray

Forces to support the mirror in Newton.

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:
actuatorslist [int] or numpy.ndarray [int]

Actuator IDs to do the movement.

stepsint, list [int] or numpy.ndarray [int]

Actuator steps to move.

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:
filepathstr or pathlib.PosixPath

File path of the static transfer matrix.

skiprowsint, optional

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

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:
stepsint

Absolute steps (>=0) to move. The internal calculation will consider the direction of target displacement by itself.

Raises:
RuntimeError

When the actuators are not running.

ValueError

When the steps is less than 0.

start(actuators, displacement, unit)

Start the movement.

Parameters:
actuatorslist [int]

Actuator IDs to do the movement.

displacementint or float

Displacement to move.

unitenum ActuatorDisplacementUnit

Unit of the displacement.

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_stepsnumpy.ndarray [int]

New current positions of the actuator in steps.

Raises:
ValueError

When the length of actuators does not match.

ValueError

When the data type is not integer.