devices.owis:Ps10
Owis PS10 motor controller class for stepper motor control.
Usage
devices.owis:Ps10(
interface,
microsteps=50,
steps_per_rev=200,
gear_ratio=180,
angle_conv=360,
**kwargs,
)Provides an interface to control Owis PS10 motor controllers, particularly for DMT100 stepper motors. It supports both absolute and relative movement modes.
Parameters
interface: str-
VISA address, e.g. ASRL/dev/ttyUSB0::INSTR
microsteps: int = 50-
Number of microsteps per full step, default is 50
steps_per_rev: int = 200-
Number of full steps per motor revolution, default is 200
gear_ratio: float = 180-
The gear ratio of the motor, default is 180
angle_conv: float = 360-
The full angle for conversion (degrees), default is 360
**kwargs-
Additional parameters passed to VisaDevice:
write_termination : str Line termination for write commands, default is “ read_termination : str Line termination for read commands, default is” cmdpers : int Commands per second, default is 20 baud_rate : int Serial baud rate, default is 115200
Notes
The DMT100 motor configuration uses 50 microsteps, 200 steps per motor revolution, and a 180:1 gear ratio by default.
Methods
| Name | Description |
|---|---|
| getMode() | Get the current movement mode. |
| getMoving() | Check if the motor is currently moving. |
| getReferenced() | Check if the motor is referenced. |
| id() | Get the device version identification. |
| init() | Initialize the motor axis. |
| moveAngle() | Move the motor by a specified angle. |
| moveSteps() | Move the motor by a specified number of steps. |
| query() | Query the device with automatic retry. |
| query_int() | Query an integer from the device with error checking. |
| readAngle() | Read the current motor angle. |
| readSteps() | Read the current motor position in steps. |
| setMode() | Set the movement mode. |
| setMotorState() | Set the motor power state. |
| startReferenceDrive() | Start the reference drive procedure. |
| stop() | Stop all motor movement immediately. |
| waitUntilMoved() | Wait until the motor has stopped moving. |
getMode()
Get the current movement mode.
Usage
getMode()Returns
str- Current mode, either “ABSOL” or “RELAT”
getMoving()
Check if the motor is currently moving.
Usage
getMoving()Returns
bool- True if the motor is moving, False otherwise
getReferenced()
Check if the motor is referenced.
Usage
getReferenced()Returns
int- 1 if referenced, 0 if not
id()
Get the device version identification.
Usage
id()Returns
str- Version information from the device
init()
Initialize the motor axis.
Usage
init()Must be called after connecting to the motor.
moveAngle()
Move the motor by a specified angle.
Usage
moveAngle(angle)In absolute mode, moves to the absolute angle. In relative mode, moves by the specified angle from current position.
Parameters
angle: float- Target angle in degrees
moveSteps()
Move the motor by a specified number of steps.
Usage
moveSteps(steps)In absolute mode, moves to the absolute position. In relative mode, moves by the specified amount from current position.
Parameters
steps: int- Target position in steps
query()
Query the device with automatic retry.
Usage
query(
msg,
depth=0,
)Parameters
msg: str-
Command message to send to device
depth: int = 0- Current recursion depth for retries, by default 0
Returns
str- Device response
Notes
Will retry up to 5 times if an empty response is received.
query_int()
Query an integer from the device with error checking.
Usage
query_int(
msg,
depth=0,
)Parameters
msg: str-
Command message to send to device
depth: int = 0- Current recursion depth for retries, by default 0
Returns
int- Integer value from device response
Notes
Will retry if value cannot be converted to an integer.
readAngle()
Read the current motor angle.
Usage
readAngle()Returns
float- Current angle in degrees
readSteps()
Read the current motor position in steps.
Usage
readSteps()Returns
int- Current position in steps
setMode()
Set the movement mode.
Usage
setMode(mode)Parameters
mode: str- Movement mode, must be either “ABSOL” or “RELAT”
setMotorState()
Set the motor power state.
Usage
setMotorState(state)Parameters
state: bool- True to turn motor on, False to turn motor off
startReferenceDrive()
Start the reference drive procedure.
Usage
startReferenceDrive()Goes to the reference position and sets position counter to 0 using reference mode 4.
stop()
Stop all motor movement immediately.
Usage
stop()waitUntilMoved()
Wait until the motor has stopped moving.
Usage
waitUntilMoved()Polls the motor status and blocks until the movement is complete.