Qudi
Public Member Functions | List of all members
aptmotor.APTStage Class Reference

Control class for an arbitrary collection of APTmotor axes. More...

Inheritance diagram for aptmotor.APTStage:
Inheritance graph
[legend]
Collaboration diagram for aptmotor.APTStage:
Collaboration graph
[legend]

Public Member Functions

def on_activate (self)
 Initialize instance variables and connect to hardware as configured.
 
def on_deactivate (self)
 Disconnect from hardware and clean up.
 
def get_constraints (self)
 Retrieve the hardware constrains from the motor device. More...
 
def move_rel (self, param_dict)
 Moves stage in given direction (relative movement) More...
 
def move_abs (self, param_dict)
 Moves stage to absolute position (absolute movement) More...
 
def abort (self)
 Stops movement of the stage. More...
 
def get_pos (self, param_list=None)
 Gets current position of the stage arms. More...
 
def get_status (self, param_list=None)
 Get the status of the position. More...
 
def calibrate (self, param_list=None)
 Calibrates the stage. More...
 
def get_velocity (self, param_list=None)
 Gets the current velocity for all connected axes. More...
 
def set_velocity (self, param_dict)
 Write new value for velocity. More...
 
- Public Member Functions inherited from core.module.BaseMixin
def __init__ (self, manager, name, config=None, callbacks=None, kwargs)
 Initialise Base class object and set up its state machine. More...
 
def log (self)
 Returns a logger object.
 
def is_module_threaded (self)
 Returns whether the module shall be started in a thread.
 
def on_activate (self)
 Method called when module is activated. More...
 
def on_deactivate (self)
 Method called when module is deactivated. More...
 
def getStatusVariables (self)
 Return a dict of variable names and their content representing the module state for saving. More...
 
def setStatusVariables (self, variableDict)
 Give a module a dict of variable names and their content representing the module state. More...
 
def getConfiguration (self)
 Return the configration dictionary for this module. More...
 
def get_connector (self, connector_name)
 Return module connected to the given named connector. More...
 
- Public Member Functions inherited from core.module.ModuleMeta
def __new__ (cls, name, bases, attrs)
 Collect declared Connectors, ConfigOptions and StatusVars into dictionaries. More...
 

Additional Inherited Members

- Public Attributes inherited from core.module.BaseMixin
 module_state
 
 connectors
 

Detailed Description

Control class for an arbitrary collection of APTmotor axes.

The required config file entries are based around a few key ideas:

For example, a config file entry for a single-axis rotating half-wave-plate stage would look like:

hwp_motor: module 'motor.aptmotor.APTStage' dll_path:\ 'C: Files\' axis_labels:

A config file entry for a linear xy-axis stage would look like:

hwp_motor: module 'motor.aptmotor.APTStage' dll_path 'C:\Program Files\Thorlabs\' axis_labels:

Member Function Documentation

◆ abort()

def aptmotor.APTStage.abort (   self)

Stops movement of the stage.

◆ calibrate()

def aptmotor.APTStage.calibrate (   self,
  param_list = None 
)

Calibrates the stage.

Parameters
dictparam_list: param_list: optional, if a specific calibration of an axis is desired, then the labels of the needed axis should be passed in the param_list. If nothing is passed, then all connected axis will be calibrated.
Returns
int: error code (0:OK, -1:error)

After calibration the stage moves to home position which will be the zero point for the passed axis. The calibration procedure will be different for each stage.

◆ get_constraints()

def aptmotor.APTStage.get_constraints (   self)

Retrieve the hardware constrains from the motor device.

Returns
dict: dict with constraints for the motor stage hardware. These constraints will be passed via the logic to the GUI so that proper display elements with boundary conditions can be made.

Provides all the constraints for each axis of a motorized stage (like total travel distance, velocity, ...) Each axis has its own dictionary, where the label is used as the identifier throughout the whole module. The dictionaries for each axis are again grouped together in a constraints dictionary in the form

{'<label_axis0>': axis0 }

where axis0 is again a dict with the possible values defined below. The possible keys in the constraint are defined in the interface file. If the hardware does not support the values for the constraints, then insert just None. If you are not sure about the meaning, look in other hardware files to get an impression.

◆ get_pos()

def aptmotor.APTStage.get_pos (   self,
  param_list = None 
)

Gets current position of the stage arms.

Parameters
listparam_list: optional, if a specific position of an axis is desired, then the labels of the needed axis should be passed as the param_list. If nothing is passed, then from each axis the position is asked.
Returns
dict with keys being the axis labels and item the current position.

◆ get_status()

def aptmotor.APTStage.get_status (   self,
  param_list = None 
)

Get the status of the position.

Parameters
listparam_list: optional, if a specific status of an axis is desired, then the labels of the needed axis should be passed in the param_list. If nothing is passed, then from each axis the status is asked.

◆ get_velocity()

def aptmotor.APTStage.get_velocity (   self,
  param_list = None 
)

Gets the current velocity for all connected axes.

Parameters
dictparam_list: optional, if a specific velocity of an axis is desired, then the labels of the needed axis should be passed as the param_list. If nothing is passed, then from each axis the velocity is asked.
Returns
dict : with the axis label as key and the velocity as item.

◆ move_abs()

def aptmotor.APTStage.move_abs (   self,
  param_dict 
)

Moves stage to absolute position (absolute movement)

Parameters
dictparam_dict: dictionary, which passes all the relevant parameters, which should be changed. Usage: {'axis_label': <a-value>}. 'axis_label' must correspond to a label given to one of the axis. A smart idea would be to ask the position after the movement.

◆ move_rel()

def aptmotor.APTStage.move_rel (   self,
  param_dict 
)

Moves stage in given direction (relative movement)

Parameters
dictparam_dict: dictionary, which passes all the relevant parameters, which should be changed. With get_constraints() you can obtain all possible parameters of that stage. According to this parameter set you have to pass a dictionary with keys that are called like the parameters from get_constraints() and assign a SI value to that. For a movement in x the dict should e.g. have the form: dict = { 'x' : 23 } where the label 'x' corresponds to the chosen axis label.

A smart idea would be to ask the position after the movement.

◆ set_velocity()

def aptmotor.APTStage.set_velocity (   self,
  param_dict 
)

Write new value for velocity.

Parameters
dictparam_dict: dictionary, which passes all the relevant parameters, which should be changed. Usage: {'axis_label': <the-velocity-value>}. 'axis_label' must correspond to a label given to one of the axis.

The documentation for this class was generated from the following file: