# devices.owis:Ps10


Owis PS10 motor controller class for stepper motor control.


Usage

``` python
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()](#getMode) | Get the current movement mode. |
| [getMoving()](#getMoving) | Check if the motor is currently moving. |
| [getReferenced()](#getReferenced) | Check if the motor is referenced. |
| [id()](#id) | Get the device version identification. |
| [init()](#init) | Initialize the motor axis. |
| [moveAngle()](#moveAngle) | Move the motor by a specified angle. |
| [moveSteps()](#moveSteps) | Move the motor by a specified number of steps. |
| [query()](#query) | Query the device with automatic retry. |
| [query_int()](#query_int) | Query an integer from the device with error checking. |
| [readAngle()](#readAngle) | Read the current motor angle. |
| [readSteps()](#readSteps) | Read the current motor position in steps. |
| [setMode()](#setMode) | Set the movement mode. |
| [setMotorState()](#setMotorState) | Set the motor power state. |
| [startReferenceDrive()](#startReferenceDrive) | Start the reference drive procedure. |
| [stop()](#stop) | Stop all motor movement immediately. |
| [waitUntilMoved()](#waitUntilMoved) | Wait until the motor has stopped moving. |

------------------------------------------------------------------------


### getMode()


Get the current movement mode.


Usage

``` python
getMode()
```


#### Returns


`str`  
Current mode, either "ABSOL" or "RELAT"


------------------------------------------------------------------------


### getMoving()


Check if the motor is currently moving.


Usage

``` python
getMoving()
```


#### Returns


`bool`  
True if the motor is moving, False otherwise


------------------------------------------------------------------------


### getReferenced()


Check if the motor is referenced.


Usage

``` python
getReferenced()
```


#### Returns


`int`  
1 if referenced, 0 if not


------------------------------------------------------------------------


### id()


Get the device version identification.


Usage

``` python
id()
```


#### Returns


`str`  
Version information from the device


------------------------------------------------------------------------


### init()


Initialize the motor axis.


Usage

``` python
init()
```


Must be called after connecting to the motor.


------------------------------------------------------------------------


### moveAngle()


Move the motor by a specified angle.


Usage

``` python
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

``` python
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

``` python
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

``` python
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

``` python
readAngle()
```


#### Returns


`float`  
Current angle in degrees


------------------------------------------------------------------------


### readSteps()


Read the current motor position in steps.


Usage

``` python
readSteps()
```


#### Returns


`int`  
Current position in steps


------------------------------------------------------------------------


### setMode()


Set the movement mode.


Usage

``` python
setMode(mode)
```


#### Parameters


`mode: str`  
Movement mode, must be either "ABSOL" or "RELAT"


------------------------------------------------------------------------


### setMotorState()


Set the motor power state.


Usage

``` python
setMotorState(state)
```


#### Parameters


`state: bool`  
True to turn motor on, False to turn motor off


------------------------------------------------------------------------


### startReferenceDrive()


Start the reference drive procedure.


Usage

``` python
startReferenceDrive()
```


Goes to the reference position and sets position counter to 0 using reference mode 4.


------------------------------------------------------------------------


### stop()


Stop all motor movement immediately.


Usage

``` python
stop()
```


------------------------------------------------------------------------


### waitUntilMoved()


Wait until the motor has stopped moving.


Usage

``` python
waitUntilMoved()
```


Polls the motor status and blocks until the movement is complete.
