module documentation

File contains all the functions used to measure the range of motion.

The range of motion is measured by first taking 5 'medium' sized steps which gives enough positions to predict future z positions. Next, one 'big' step is taken followed by 3 'small' steps to test that the stage is still moving as expected and has not reached the edge. Once the edge has been found and to account for the possibility that the edge was reached during a "big" step, the stage is moved in a sequence of steps in the opposite direction until motion is detected. This is position is taken as the true final position.

Throughout the test, parasitic motion (motion in the axis not being measured) is tracked and an error is raised if it exceeds a minimum amount. Currently this is 10% of the expected motion is the measured axis.

Class RangeofMotionThing A class used to measure the range of motion of the stage in X and Y.
Class RomDataTracker Class for tracking range of motion data.
Class RomDeps Grouped dependencies for the Range of motion Thing.
Exception ParasiticMotionError Custom exception raised when parasitic motion is detected.
Constant BIG_STEP Undocumented
Constant DETECT_MOTION_TOL Undocumented
Constant MEDIUM_STEP Undocumented
Constant PARASITIC_MOTION_TOL Undocumented
Constant SMALL_STEP Undocumented
Variable AutofocusDep Undocumented
Variable CSMDep Undocumented
Function _axis_from_movement_dict Return the axis that a given movement dictionary moves in.
Function _parasitic_motion_detected Compare desired movement to measured offset, report if parasitic motion was detected.
BIG_STEP: int = (source)

Undocumented

Value
200
DETECT_MOTION_TOL: float = (source)

Undocumented

Value
0.65
MEDIUM_STEP: int = (source)

Undocumented

Value
50
PARASITIC_MOTION_TOL: float = (source)

Undocumented

Value
0.1
SMALL_STEP: int = (source)

Undocumented

Value
20
AutofocusDep = (source)

Undocumented

Undocumented

@overload
def _axis_from_movement_dict(movement: dict[str, float], return_other: Literal[False]) -> str:
@overload
def _axis_from_movement_dict(movement: dict[str, float], return_other: Literal[True]) -> tuple[str, str]:
@overload
def _axis_from_movement_dict(movement: dict[str, float]) -> str:
(source)

Return the axis that a given movement dictionary moves in.

For example: _axis_from_movement_dict({"x": 10, "y":0}) will return x.

Parameters
movement:dict[str, float]The movement dictionary.
return_other:boolIf True return a tuple with the first value being the movement axis and the second being the other axis. Default is False
Returns
str | tuple[str, str]The movement axis (and optionally the other axis) as strings.
def _parasitic_motion_detected(movement: dict[str, float], offset: dict[str, float]) -> bool: (source)

Compare desired movement to measured offset, report if parasitic motion was detected.

Parameters
movement:dict[str, float]The movement dictionary in image coordinates.
offset:dict[str, float]The offset calculated from correlation.
Returns
boolTrue if too much parasitic motion is detects. False if movement is as expected.