Package dics :: Module linear :: Class linear
[hide private]
[frames] | no frames]

Class linear
source code

mechanism.mechanism --+
                      |
                     linear

Class representing a general linear mechanism, based on the generic mechanism class from mechanism.py. It adds software motion limits and a units/gear ratio property, with corresponding move commands enabling moves in terms of physical units rather than motor steps.

Instance Methods [hide private]
  __init__(self, cortex, icu_num, axis_num, base_speed, max_speed, acceleration, deceleration, position, lower_limit, upper_limit, units, name='linear')
Initialiser for linear mechanism class.
  updateConfig(self, config)
Should be called by the parent instrument object's destructor to enable status information to be saved to file on exit.
  setupLinear(self)
Performs an automatic setup procedure.
  getUnits(self)
Return the number of steps per unit of movement
  getLimits(self)
Returns the allowed range of movement of the mechanism as tuple of (lowerLimit, upperLimit), in the units specified by setUnits.
  getMotorParams(self)
Returns a tuple containing the four motor motion parameters, baseSpeed, maxSpeed, acceleration, deceleration, in terms of the units specified with setUnits.
  getPosition(self)
Returns the current mechanism position, in units defined by setUnits().
  moveBy(self, distance)
Move the mechanism by a given distance.
  moveTo(self, newPosition)
Move the mechanism to the given position.
  setUnits(self, units)
Sets the number of steps per unit of movement.
  setLimits(self, lowerLimit, upperLimit)
Set the allowed range of movement of the mechanism.
  setMotorParams(self, baseSpeed, maxSpeed, acceleration, deceleration)
Sets the four motor motion parameters, baseSpeed, maxSpeed, acceleration and deceleration.
  setPosition(self, new_position=0)
Defines the current mechanism position to be equal to the single integer argument.

Method Details [hide private]

__init__(self, cortex, icu_num, axis_num, base_speed, max_speed, acceleration, deceleration, position, lower_limit, upper_limit, units, name='linear')
(Constructor)

source code 

Initialiser for linear mechanism class.

Arguments:
    cortex:      String containing the name of the cortex based
                 ICU daisy chain instance that this mechanism is a
                 part of.
    icuNum:      Which ICU in the chain this mechanism is connected
                 to.
    axisNum:     Which axis of the ICU the mechansism is connected
                 to.
    baseSpeed:   Starting speed (units per sec)
    maxSpeed:    Peak speed (units per sec?)
    acceleration:Acceleration (units per sec^2)
    deceleration:Deceleration (units per sec^2)
    position:    Initial position of the mechanism (units)
    lower_limit: Lower limit of allowed movement range (units)
    upper_limit: Upper limit of allowed movement range (units)
    units:       Number of steps corresponding to one unit of movement
    name:        Label used for logging purposes.

Overrides: mechanism.mechanism.__init__

updateConfig(self, config)

source code 

Should be called by the parent instrument object's destructor to enable status information to be saved to file on exit.

Takes a ConfigParserRT.SafeConfigParser object as argument.
Overrides: mechanism.mechanism.updateConfig

setupLinear(self)

source code 
Performs an automatic setup procedure. It is important that the limit switches are working correctly otherwise this routine might result in damage.

getUnits(self)

source code 
Return the number of steps per unit of movement

getLimits(self)

source code 
Returns the allowed range of movement of the mechanism as tuple of (lowerLimit, upperLimit), in the units specified by setUnits.

getMotorParams(self)

source code 
Returns a tuple containing the four motor motion parameters, baseSpeed, maxSpeed, acceleration, deceleration, in terms of the units specified with setUnits.
Overrides: mechanism.mechanism.getMotorParams

getPosition(self)

source code 
Returns the current mechanism position, in units defined by setUnits().
Overrides: mechanism.mechanism.getPosition

moveBy(self, distance)

source code 
Move the mechanism by a given distance. Units are defined by setUnits()
Overrides: mechanism.mechanism.moveBy

moveTo(self, newPosition)

source code 
Move the mechanism to the given position. Units are defined by setUnits().
Overrides: mechanism.mechanism.moveTo

setUnits(self, units)

source code 
Sets the number of steps per unit of movement.

setLimits(self, lowerLimit, upperLimit)

source code 
Set the allowed range of movement of the mechanism. Takes two arguments, the lower and upper limits of the range. Units are as defined by setUnits.

setMotorParams(self, baseSpeed, maxSpeed, acceleration, deceleration)

source code 
Sets the four motor motion parameters, baseSpeed, maxSpeed, acceleration and deceleration. Takes 4 integer arguments. Units are as defined by setUnits.
Overrides: mechanism.mechanism.setMotorParams

setPosition(self, new_position=0)

source code 
Defines the current mechanism position to be equal to the single integer argument. If no argument is given, the mechanism position is zeroed. Units used are as defined in setUnits().
Overrides: mechanism.mechanism.setPosition