| |
- mechanism.mechanism
-
- linear
class linear(mechanism.mechanism) |
|
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. |
|
Methods defined here:
- __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.
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.
- 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().
- getUnits(self)
- Return the number of steps per unit of movement
- moveBy(self, distance)
- Move the mechanism by a given distance. Units are defined by
setUnits()
- moveTo(self, newPosition)
- Move the mechanism to the given position. Units are defined by
setUnits().
- setLimits(self, lowerLimit, upperLimit)
- 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)
- Sets the four motor motion parameters, baseSpeed, maxSpeed,
acceleration and deceleration. Takes 4 integer arguments.
Units are as defined by setUnits.
- setPosition(self, new_position=0)
- 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().
- setUnits(self, units)
- Sets the number of steps per unit of movement.
- updateConfig(self, config)
- 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.
| |