MockControlOpenLoop

class lsst.ts.m2com.MockControlOpenLoop

Bases: object

Mock open-loop control.

Attributes

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.

Methods Summary

get_steps_to_move(steps)

Get the steps to move.

is_actuator_force_out_limit(actuator_force)

The actuator force is out of limit or not.

pause()

Pause the movement.

resume()

Resume the movement.

start(actuators, displacement, unit)

Start the movement.

stop()

Stop the movement.

Methods Documentation

get_steps_to_move(steps: int) ndarray[Any, dtype[int64]]

Get the steps to move.

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.

Returns

actuator_stepsnumpy.ndarray [int]

78 actuator steps.

Raises

RuntimeError

When the actuators are not running.

ValueError

When the steps is less than 0.

is_actuator_force_out_limit(actuator_force: ndarray[Any, dtype[float64]]) tuple[bool, list[int], list[int]]

The actuator force is out of limit or not. The result will depend on self.open_loop_max_limit_is_enabled.

Notes

If the force is out of limit, stop the running of open-loop control.

Parameters

actuator_forcenumpy.ndarray

Actuator forces in Newton.

Returns

is_triggeredbool

True if the actuator force is out of limit. Otherwise, False.

limit_switch_retractlist

Triggered retracted limit switches.

limit_switch_extendlist

Triggered extended limit switches.

pause() None

Pause the movement.

resume() None

Resume the movement.

Raises

RuntimeError

When the movement is done.

start(actuators: list[int], displacement: int | float, unit: ActuatorDisplacementUnit) None

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

Stop the movement.