Home | Trees | Index | Help |
---|
|
|
|||
__init__(self,
portname,
units,
name='cortex')
Arguments: |
|||
__basicCommand(self,
command)
Function used to send any command that expects the basic '# ' response, and parses the response received. |
|||
__intCommand(self,
command)
Function used to send any command that expects an integer N in a 'N# ' response, parses the response received, and returns the integer. |
|||
getInput(self,
cortex_num=1)
Gets the status of the 4-bit input of the Cortex Controller, returning it as an integer in the range 0-15. |
|||
getLimitStatus(self,
cortex_num=1)
Queries the limit switch status, returns -1 if lower limit made, +1 if upper limit made and 0 is neither is. |
|||
getParams(self, cortex_num=1) | |||
getPosition(self,
cortex_num=1)
Requests the current motor position from the controller, in steps from the datum and returns it as an integer. |
|||
getRemaining(self,
cortex_num=1)
Requests the number of steps left to go in the current move from the controller and returns the reply as an integer. |
|||
isActive(self,
cortex_num=1)
Requests the motor status from the controller, returns True if the motor is active, False otherwise. |
|||
saveParams(self,
cortex_num=1)
Writes all current controller parameters to EEPROM, if fitted. |
|||
setCurrent(self,
current=160,
cortex_num=1)
Sets the motor current, in mA. |
|||
setDatum(self,
position=0,
cortex_num=1)
Change the coordinate system so that the current position is equal to the argument. |
|||
setDefaults(self,
cortex_num=1)
Return all parameters to their default values, with the exception of the newline parameter on the first controller in the chain (newlines are required for communication using pySerial). |
|||
setJoystick(self,
jitter=4,
deadband=20,
slowband=10,
sense=0,
cortex_num=1)
Sets the joystick parameters. |
|||
setLocalMode(self,
yes=True,
cortex_num=1)
Toggles local/manual mode. |
|||
setMicrostepping(self,
ratio,
cortex_num=1)
Set the microstepping ratio using the numeric codes described in the Cortex controller documentation. |
|||
setMotorParams(self,
baseSpeed=1000,
maxSpeed=60000,
acceleration=30000,
deceleration=120000,
cortex_num=1)
Sets the motor motion parameters, base speed, maximum speed, acceleration and deceleration. |
|||
__setNewline(self,
yes=True,
cortex_num=1)
Toggles the addition of newlines to the replies from the Cortex controller. |
|||
setOutput(self,
output,
cortex_num=1)
Sets the state of the four bit optocoupler output of the Cortex controller. |
|||
setSpeed(self,
speed=150,
cortex_num=1)
Sets the constant speed for moveConst, moveConstAbs and moveConstLimit commands. |
|||
halt(self,
cortex_num=1)
Smoothly halts the motor. |
|||
move(self,
steps,
cortex_num=1)
Move a given number of steps (<2000000000) with acceleration (uses motion parameters defined by setMotorParams). |
|||
moveAbs(self,
position,
cortex_num=1)
Move to a given position, with acceleration (uses motion parameters defined by setMotorParams). |
|||
moveConst(self,
steps,
cortex_num=1)
Move a given number of steps (<2000000000) at a constant speed (uses speed set via setSpeed). |
|||
moveConstAbs(self,
position,
cortex_num=1)
Move to a given position at a constant speed (used speed set via setSpeed). |
|||
moveConstLimit(self,
direction,
cortex_num=1)
Move to a given limit at a constant speed (uses speed set via setSpeed). |
|||
moveLimit(self,
direction,
cortex_num=1)
Move to a given limit with acceleration (uses motion parameters defined with setMotorParams). |
|||
stop(self,
cortex_num=1)
Emergency stop. |
|||
trigger(self,
input=-1,
cortex_num=1)
Delay move until given a given input goes high. |
|
Arguments: portname: device name of the serial port to use units: number of cortex units in the chain name: name to be used as a label in the logs |
Function used to send any command that expects the basic '# ' response, and parses the response received. If the standard response is not received an appropriate exception is raised. Arguments: command - string containing the command to send. |
Function used to send any command that expects an integer N in a 'N# ' response, parses the response received, and returns the integer. If the expected response is not received an appropriate exception is raised. Arguments: command - string containing the command to send. |
Gets the status of the 4-bit input of the Cortex Controller, returning it as an integer in the range 0-15. Arguments: cortex_num - which controller of a daisy chain to query, default 1. |
Queries the limit switch status, returns -1 if lower limit made, +1 if upper limit made and 0 is neither is. Note, this command ALWAYS stops the motors, use isActive() first to determine if the motors are in motion. Arguments: cortex_num - which controller of a daisy chain to query, default 1. |
|
Requests the current motor position from the controller, in steps from the datum and returns it as an integer. Arguments: cortex_num - which controller of a daisy chain to query, default 1. |
Requests the number of steps left to go in the current move from the controller and returns the reply as an integer. Arguments: cortex_num - which controller of a daisy chain to query, default 1. |
Requests the motor status from the controller, returns True if the motor is active, False otherwise. Arguments: cortex_num - which controller of a daisy chain to query, default 1. |
Writes all current controller parameters to EEPROM, if fitted. Arguments: cortex_num - which controller of a daisy chain to command, default 1. |
Sets the motor current, in mA. Allowed range is 0-600mA, in steps of 40mA (intermediate values, if given, are rounded down to the nearest multiple of 40). N.B. Do not exceed 160mA in continous use unless a heatsink is fitted. Arguments: current - motor current, in mA, integer in range 0-600. cortex_num - which controller of a daisy chain to command, default 1. |
Change the coordinate system so that the current position is equal to the argument. Arguments: position - value to assign to the current position, default 0. cortex_num - which controller of a daisy chain to command, default 1. |
Return all parameters to their default values, with the exception of the newline parameter on the first controller in the chain (newlines are required for communication using pySerial). The default values are given in the Cortex controller doumentation. Arguments: cotrex_num - which controller of a daisy chain to reset to defaults, default 1. |
Sets the joystick parameters. No sanity checking of arguments implemented yet. Arguments: jitter - allowable joystick noise, default 4 deadband - joystick deadband, default 20 slowband - slow motion band, default 10 sense - joystick not reversed, default 0 cortex_num - which controller in a daisy chain to command, default 1. |
Toggles local/manual mode. If the first argument is True sets local mode on, if False sets local mode off. Arguments: yes - boolean, if True set local mode on, and vice versa, default True cortex_num - which controller in a daisy chain to command, default 1. |
Set the microstepping ratio using the numeric codes described in the Cortex controller documentation. The argument ratio should be an integer in the range 0-63. Arguments: ratio - microstepping ratio code, integer in range 0-63. cortex_num - which controller in a diasy chain to set, default 1. |
Sets the motor motion parameters, base speed, maximum speed, acceleration and deceleration. Arguments: baseSpeed - starting speed for move, moveAbs and moveLimit commands, default 1000. maxSpeed - top speed, default 60000 acceleration - acceleration, default 30000 deceleration - deceleration, default 120000 cortex_num - which controller in a daisy chain to set, default 1. |
Toggles the addition of newlines to the replies from the Cortex controller. If the first argument is True sets newlines on, if False sets newlines off. In order for proper communications with the first cortex controller in the chain it must have newlines set to True. For inter-controller communications to work all other controllers (if present) should have newlines False. Arguments: yes - boolean, if True set local mode on, and vice versa, default True cortex_num - which controller in a daisy chain to command, default 1. |
Sets the state of the four bit optocoupler output of the Cortex controller. Arguments: output - integer in range 0-15 corresponding to desired state of the 4 bit output. cortex_num - which controller in a chain to set, default 1. |
Sets the constant speed for moveConst, moveConstAbs and moveConstLimit commands. Arguments: speed - required speed in steps/sec, integer in range 62-60000 cortex_num - which controller in a chain to set, default 1. |
Smoothly halts the motor. For emergency stops use the stop command. Arguments: cortex_num - which controller in a chain to halt, default 1. |
Move a given number of steps (<2000000000) with acceleration (uses motion parameters defined by setMotorParams). Arguments: steps - number of steps to move, integer in range -2000000000:+2000000000 cortex_num - which controller to instruct to move, default 1. |
Move to a given position, with acceleration (uses motion parameters defined by setMotorParams). Arguments: position - position, measure in steps from the datum to move to. cortex_num - which controller to instruct to move, default 1. |
Move a given number of steps (<2000000000) at a constant speed (uses speed set via setSpeed). Arguments: steps - number of steps to move, integer in range -2000000000:+2000000000 cortex_num - which controller to instruct to move, default 1. |
Move to a given position at a constant speed (used speed set via setSpeed). Arguments: position - position, measure in steps from the datum to move to. cortex_num - which controller to instruct to move, default 1. |
Move to a given limit at a constant speed (uses speed set via setSpeed). Arguments: direction - the direction to move in, 1 for towards the upper limit, -1 for towards the lower limit, or 0 for, er, something else (Cortex documentation doesn't explain this). cortex_num - which controller to instruct to move, default 1. |
Move to a given limit with acceleration (uses motion parameters defined with setMotorParams). Arguments: direction - the direction to move in, 1 for towards the upper limit, -1 for towards the lower limit, or 0 for, er, something else (Cortex documentation doesn't explain this). cortex_num - which controller to instruct to move, default 1. |
Emergency stop. Arguments: cortex_num - which controller in a chain to stop, default 1. |
Delay move until given a given input goes high. If no input is specified then moves occur as they are requested. Arguments: input - the number of the input to trigger on, integer in the range 0-3 (I think). If omitted triggering is suspended. cortex_num - which controller in a chain to set triggering for, default 1. |
Home | Trees | Index | Help |
---|
Generated by Epydoc 3.0alpha2 on Sun Jun 11 16:26:27 2006 | http://epydoc.sf.net |