Qudi
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
aptmotor.APTMotor Class Reference

Class to control Thorlabs APT motor. More...

Public Member Functions

def __init__ (self, path_dll, serialnumber, hwtype, label='', unit='m')
 
def getNumberOfHardwareUnits (self)
 Returns the number of connected external hardware (HW) units that are available to be interfaced.
 
def getSerialNumberByIdx (self, index)
 Returns the Serial Number of the specified index.
 
def setSerialNumber (self, SerialNum)
 Sets the Serial Number of the specified index.
 
def initializeHardwareDevice (self)
 
def getHardwareInformation (self)
 Get information from the hardware.
 
def get_stage_axis_info (self)
 Get parameter configuration of the stage. More...
 
def set_stage_axis_info (self, pos_min, pos_max, pitch, unit=1)
 Set parameter configuration of the stage. More...
 
def getHardwareLimitSwitches (self)
 
def setHardwareLimitSwitches (self, switch_reverse, switch_forward)
 Set the Switch Configuration of the axis. More...
 
def getVelocityParameters (self)
 Retrieve the velocity parameter with the currently used acceleration. More...
 
def get_velocity (self)
 Get the current velocity setting.
 
def setVelocityParameters (self, minVel, acc, maxVel)
 Set the velocity and acceleration parameter. More...
 
def set_velocity (self, maxVel)
 Set the maximal velocity for the motor movement. More...
 
def getVelocityParameterLimits (self)
 Get the current maximal velocity and acceleration parameter. More...
 
def get_home_parameter (self)
 Get the home paramete.
 
def set_home_parameter (self, home_dir, switch_dir, home_vel, zero_offset)
 Set the home parameters. More...
 
def get_pos (self)
 Obtain the current absolute position of the stage. More...
 
def move_rel (self, relDistance)
 Moves the motor a relative distance specified. More...
 
def move_abs (self, absPosition)
 Moves the motor to the Absolute position specified. More...
 
def mcRel (self, relDistance, moveVel=0.5e-3)
 Moves the motor a relative distance specified at a controlled velocity. More...
 
def mcAbs (self, absPosition, moveVel=0.5)
 Moves the motor to the Absolute position specified at a controlled velocity. More...
 
def move_bc_rel (self, relDistance)
 Moves the motor a relative distance specified, correcting for backlash. More...
 
def mbAbs (self, absPosition)
 Moves the motor to the Absolute position specified. More...
 
def get_status (self)
 Get the status bits of the current axis. More...
 
def identify (self)
 Causes the motor to blink the Active LED. More...
 
def cleanUpAPT (self)
 Releases the APT object. More...
 
def abort (self)
 Abort the movement. More...
 
def go_home (self)
 
def set_backlash (self, backlash)
 Set the provided backlash for the apt motor. More...
 
def get_backlash (self)
 Ask for the currently set backlash in the controller for the axis. More...
 

Public Attributes

 aptdll
 
 Connected
 
 verbose
 
 label
 
 SerialNum
 

Static Public Attributes

dictionary hwtype_dict = {}
 
dictionary error_code = {}
 
dictionary status_code = {}
 

Detailed Description

Class to control Thorlabs APT motor.

This class wrapps the low level commands from a dll library in python methods.

Member Function Documentation

◆ abort()

def aptmotor.APTMotor.abort (   self)

Abort the movement.

◆ cleanUpAPT()

def aptmotor.APTMotor.cleanUpAPT (   self)

Releases the APT object.

Use when exiting the program.

◆ get_backlash()

def aptmotor.APTMotor.get_backlash (   self)

Ask for the currently set backlash in the controller for the axis.

Returns
float: backlash in m or degree, depending on the axis config.

◆ get_pos()

def aptmotor.APTMotor.get_pos (   self)

Obtain the current absolute position of the stage.

Returns
float: the value of the axis either in m or in degree.

◆ get_stage_axis_info()

def aptmotor.APTMotor.get_stage_axis_info (   self)

Get parameter configuration of the stage.

Returns
list: with the 4 entries: float Minimum position in m or degree float Maximum position in m or degree int 1=m and 2=degree float The angular distance to the next teeth in the stepper motor. That determines basically the precision of the movement of the stepper motor.

This method will handle the conversion to the non SI unit mm.

◆ get_status()

def aptmotor.APTMotor.get_status (   self)

Get the status bits of the current axis.

Returns
tuple(int, dict): the current status as an integer and the dictionary explaining the current status.

◆ getVelocityParameterLimits()

def aptmotor.APTMotor.getVelocityParameterLimits (   self)

Get the current maximal velocity and acceleration parameter.

Returns
list: with 2 entries: float maximum acceleration in m/s^2 or degree/s^2 float maximal velocity in m/s or degree/s

◆ getVelocityParameters()

def aptmotor.APTMotor.getVelocityParameters (   self)

Retrieve the velocity parameter with the currently used acceleration.

Returns
list: with 4 entries: float minimal velocity in m/s or degree/s float currently set acceleration in m/s^2 or degree/s^2 float maximal velocity in m/s or degree/s

◆ identify()

def aptmotor.APTMotor.identify (   self)

Causes the motor to blink the Active LED.

◆ mbAbs()

def aptmotor.APTMotor.mbAbs (   self,
  absPosition 
)

Moves the motor to the Absolute position specified.

Parameters
floatabsPosition: Position desired in m or degree

◆ mcAbs()

def aptmotor.APTMotor.mcAbs (   self,
  absPosition,
  moveVel = 0.5 
)

Moves the motor to the Absolute position specified at a controlled velocity.

Parameters
floatabsPosition: Position desired in m or degree.
floatmoveVel: Motor velocity, m/s or degree/s

◆ mcRel()

def aptmotor.APTMotor.mcRel (   self,
  relDistance,
  moveVel = 0.5e-3 
)

Moves the motor a relative distance specified at a controlled velocity.

Parameters
floatrelDistance: Relative position desired in m or in degree
floatmoveVel: Motor velocity, m/s or in degree/s

◆ move_abs()

def aptmotor.APTMotor.move_abs (   self,
  absPosition 
)

Moves the motor to the Absolute position specified.

Parameters
floatabsPosition: absolute Position desired, in m or degree.

◆ move_bc_rel()

def aptmotor.APTMotor.move_bc_rel (   self,
  relDistance 
)

Moves the motor a relative distance specified, correcting for backlash.

Parameters
floatrelDistance: Relative position desired in m or in degree
Note
Be careful in using this method. If interactive mode is on, then the stage reacts immediately on both input for the relative movement, which prevents the proper execution of the first command!

◆ move_rel()

def aptmotor.APTMotor.move_rel (   self,
  relDistance 
)

Moves the motor a relative distance specified.

Parameters
floatrelDistance: Relative position desired, in m or in degree.

◆ set_backlash()

def aptmotor.APTMotor.set_backlash (   self,
  backlash 
)

Set the provided backlash for the apt motor.

Parameters
floatbacklash: the backlash in m or degree for the used stage.

◆ set_home_parameter()

def aptmotor.APTMotor.set_home_parameter (   self,
  home_dir,
  switch_dir,
  home_vel,
  zero_offset 
)

Set the home parameters.

Parameters
inthome_dir: direction to the home position, 1 = Move forward 2 = Move backward
intswitch_dir: Direction of the switch limit: 4 = Use forward limit switch for home datum 1 = Use forward limit switch for home datum.
floathome_vel = default velocity
floatzero_offset: the distance or offset (in mm or degrees) of the limit switch from the Home position.

◆ set_stage_axis_info()

def aptmotor.APTMotor.set_stage_axis_info (   self,
  pos_min,
  pos_max,
  pitch,
  unit = 1 
)

Set parameter configuration of the stage.

Parameters
floatpos_min: minimal position of the axis in m or degree.
floatpos_max: maximal position of the axis in m or degree.
floatpitch: the pitch determines the full step angle of a stepper magnet motor. That is the resolution of the stepper motor.
intunit: unit of the axis, possible values: 1 = m 2 = degree

This method will handle the conversion to the non SI unit mm.

◆ set_velocity()

def aptmotor.APTMotor.set_velocity (   self,
  maxVel 
)

Set the maximal velocity for the motor movement.

Parameters
floatmaxVel: maximal velocity of the stage in m/s or degree/s.

◆ setHardwareLimitSwitches()

def aptmotor.APTMotor.setHardwareLimitSwitches (   self,
  switch_reverse,
  switch_forward 
)

Set the Switch Configuration of the axis.

Parameters
intswitch_reverse: sets the switch in reverse movement
intswitch_forward: sets the switch in forward movement

The following values are allowed: 0x01 or 1: Ignore switch or switch not present. 0x02 or 2: Switch makes on contact. 0x03 or 3: Switch breaks on contact. 0x04 or 4: Switch makes on contact - only used for homes (e.g. limit switched rotation stages). 0x05 or 5: Switch breaks on contact - only used for homes (e.g. limit switched rotations stages). 0x06 or 6: For PMD based brushless servo controllers only - uses index mark for homing.

◆ setVelocityParameters()

def aptmotor.APTMotor.setVelocityParameters (   self,
  minVel,
  acc,
  maxVel 
)

Set the velocity and acceleration parameter.

Parameters
flaotminVel: the minimum velocity at which to start and end a move in m/s or degree/s
floatacc: the rate at which the velocity climbs from minimum to maximum, and slows from maximum to minimum current acceleration in m/s^2 or degree/s^2
floatmaxVel: the maximum velocity at which to perform a move in m/s or degree/s
Note
The minVel parameter value is locked at zero and cannot be adjusted.

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