# pyOrcas
A Python package for communicating with the Orca motor using Modbus.
## Installation
```sh
pip install pyOrcas
```
## The Actuator Structure
The Actuator class in pyOrcas provides a modbus driven interface to interact with the Orca motors. Here's an overview of its structure and the available methods:
### Initialization
To initialize the Actuator object, provide the COM port and baud rate:
```sh
from pyOrcas import Actuator
actuator = Actuator(port='COM3', baudrate=9600)
#Update com port and baud rate to match the motor. Higher baud rates enable higher speeds.
```
### Closing the Port
Closing the serial port is important to ensure continued capability. When the object is deleted, it automatically closes the port. Recommendations:
1. At the end
#### Properties
The Actuator class has several properties for reading various states and parameters:
1. position: Gets or sets the position of the actuator in micrometers.
2. force: Gets or sets the force exerted by the actuator in milliNewtons.
3. power: Gets the current power consumption of the actuator.
4. temperature: Gets the current temperature of the actuator.
5. voltage: Gets the current voltage of the actuator.
6. errors: Gets any error codes from the actuator.
7. op_mode: Gets the current operation mode of the actuator.
### Methods
The Actuator class provides several methods for communication and control:
1. close(): Closes the Modbus connection.
2. read_register(register_address, num_registers): Reads Modbus registers.
3. write_registers(registers_start_address, register_data): Writes multiple values to consecutive Modbus registers.
4. write_stream(registers_start_address, width, value): Writes a stream to the Modbus.
5. read_stream(register_address, width): Reads a stream from the Modbus.
Refer to the following user guide for documentation on the commands. https://irisdynamics.com/hubfs/Website/Downloads/Orca/Approved/UG210912_Orca_Series_Modbus_RTU_User_Guide.pdf
6. sleep(): Puts the motor to sleep.
7. Tune_PID(saturation, p_gain, i_gain, dv_gain, de_gain): Tunes the PID controller.
#### Haptic Mode
The Actuator class has a nested _HapticMode class for handling haptic effects. Here are the available methods:
1. enable(): Enables the haptic mode.
2. set_spring(ID, gain, center, deadzone, saturation, coupling=0, enable=None): Sets the parameters of a spring effect. ID: 0, 1, 2
3. toggle_spring(ID, enable=True): Enables or disables a spring effect.
4. set_oscillator(ID, gain, osctype, freq, duty, enable=None): Sets the parameters of an oscillator effect. ID: 0, 1
5. toggle_oscillator(ID, enable=True): Enables or disables an oscillator effect.
6. set_force(gain, enable=None): Sets a constant force effect.
7. toggle_force(enable=True): Enables or disables the constant force effect.
8. set_damper(gain, enable=None): Sets a damper effect.
9. toggle_damper(enable=True): Enables or disables the damper effect.
10. set_inertia(gain, enable=None): Sets an inertia effect.
11. toggle_inertia(enable=True): Enables or disables the inertia effect.
12. toggle_effects(f=False, s0=False, s1=False, s2=False, d=False, i=False, o1=False, o2=False): Toggles multiple haptic effects at once.
#### Kinematic Mode
The Actuator class has a nested _KinematicMode class for handling kinematic motions. Here are the available methods:
1. enable(): Enables the kinematic mode.
2. set_motion(ID, position, time, delay, nextID, autonext, motion_type=0): Sets the parameters of a kinematic motion.
3. trigger(ID): Triggers a kinematic motion by its ID.
## Updating the PyPI Release
To update the PyPI release of pyOrcas, follow these steps:
1. Update the version number in setup.py.
2. Build the distribution:
```sh
python setup.py sdist bdist_wheel
```
3. Upload the package to PyPI:
```sh
twine upload dist/*
```
Make sure you have twine installed and configured with your PyPI credentials.
Raw data
{
"_id": null,
"home_page": "https://github.com/dralexan/pyOrcas",
"name": "pyOrcas",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Daniel Alexander",
"author_email": "dalexander@irisdynamics.com",
"download_url": "https://files.pythonhosted.org/packages/55/a2/c172ae5bdd940c4acb38fc362a26f72911095d8f59c4de9afedc52247ac4/pyorcas-0.1.7.tar.gz",
"platform": null,
"description": "# pyOrcas\r\n\r\nA Python package for communicating with the Orca motor using Modbus.\r\n\r\n## Installation\r\n\r\n```sh\r\npip install pyOrcas\r\n```\r\n\r\n## The Actuator Structure\r\n\r\nThe Actuator class in pyOrcas provides a modbus driven interface to interact with the Orca motors. Here's an overview of its structure and the available methods:\r\n\r\n### Initialization\r\n\r\nTo initialize the Actuator object, provide the COM port and baud rate:\r\n\r\n```sh\r\nfrom pyOrcas import Actuator\r\n\r\nactuator = Actuator(port='COM3', baudrate=9600)\r\n#Update com port and baud rate to match the motor. Higher baud rates enable higher speeds.\r\n\r\n```\r\n### Closing the Port\r\n\r\nClosing the serial port is important to ensure continued capability. When the object is deleted, it automatically closes the port. Recommendations:\r\n\r\n1. At the end \r\n\r\n#### Properties\r\n\r\nThe Actuator class has several properties for reading various states and parameters:\r\n\r\n1. position: Gets or sets the position of the actuator in micrometers.\r\n2. force: Gets or sets the force exerted by the actuator in milliNewtons.\r\n3. power: Gets the current power consumption of the actuator.\r\n4. temperature: Gets the current temperature of the actuator.\r\n5. voltage: Gets the current voltage of the actuator.\r\n6. errors: Gets any error codes from the actuator.\r\n7. op_mode: Gets the current operation mode of the actuator.\r\n\r\n### Methods\r\n\r\nThe Actuator class provides several methods for communication and control:\r\n\r\n1. close(): Closes the Modbus connection.\r\n2. read_register(register_address, num_registers): Reads Modbus registers.\r\n3. write_registers(registers_start_address, register_data): Writes multiple values to consecutive Modbus registers.\r\n4. write_stream(registers_start_address, width, value): Writes a stream to the Modbus.\r\n5. read_stream(register_address, width): Reads a stream from the Modbus.\r\n\r\nRefer to the following user guide for documentation on the commands. https://irisdynamics.com/hubfs/Website/Downloads/Orca/Approved/UG210912_Orca_Series_Modbus_RTU_User_Guide.pdf\r\n\r\n6. sleep(): Puts the motor to sleep.\r\n7. Tune_PID(saturation, p_gain, i_gain, dv_gain, de_gain): Tunes the PID controller.\r\n\r\n#### Haptic Mode\r\n\r\nThe Actuator class has a nested _HapticMode class for handling haptic effects. Here are the available methods:\r\n\r\n1. enable(): Enables the haptic mode.\r\n2. set_spring(ID, gain, center, deadzone, saturation, coupling=0, enable=None): Sets the parameters of a spring effect. ID: 0, 1, 2\r\n3. toggle_spring(ID, enable=True): Enables or disables a spring effect.\r\n4. set_oscillator(ID, gain, osctype, freq, duty, enable=None): Sets the parameters of an oscillator effect. ID: 0, 1\r\n5. toggle_oscillator(ID, enable=True): Enables or disables an oscillator effect.\r\n6. set_force(gain, enable=None): Sets a constant force effect.\r\n7. toggle_force(enable=True): Enables or disables the constant force effect.\r\n8. set_damper(gain, enable=None): Sets a damper effect.\r\n9. toggle_damper(enable=True): Enables or disables the damper effect.\r\n10. set_inertia(gain, enable=None): Sets an inertia effect.\r\n11. toggle_inertia(enable=True): Enables or disables the inertia effect.\r\n12. toggle_effects(f=False, s0=False, s1=False, s2=False, d=False, i=False, o1=False, o2=False): Toggles multiple haptic effects at once.\r\n\r\n#### Kinematic Mode\r\n\r\nThe Actuator class has a nested _KinematicMode class for handling kinematic motions. Here are the available methods:\r\n\r\n1. enable(): Enables the kinematic mode.\r\n2. set_motion(ID, position, time, delay, nextID, autonext, motion_type=0): Sets the parameters of a kinematic motion.\r\n3. trigger(ID): Triggers a kinematic motion by its ID.\r\n\r\n## Updating the PyPI Release\r\n\r\nTo update the PyPI release of pyOrcas, follow these steps:\r\n\r\n1. Update the version number in setup.py.\r\n\r\n2. Build the distribution:\r\n```sh\r\npython setup.py sdist bdist_wheel\r\n```\r\n3. Upload the package to PyPI:\r\n```sh\r\ntwine upload dist/*\r\n```\r\n\r\nMake sure you have twine installed and configured with your PyPI credentials.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package for communicating with the Orca motor using Modbus.",
"version": "0.1.7",
"project_urls": {
"Homepage": "https://github.com/dralexan/pyOrcas"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e81c0b1707e4291ef475892eeae1f1a793ac8b13bb38822234909d5fb5822abd",
"md5": "edba4858024f7c43a305033f0c78f770",
"sha256": "9cd11e47eb053f5b01c50e86a37e8715b664be91a6cc7d0f67a8164d54753278"
},
"downloads": -1,
"filename": "pyOrcas-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "edba4858024f7c43a305033f0c78f770",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 14261,
"upload_time": "2024-08-01T01:48:46",
"upload_time_iso_8601": "2024-08-01T01:48:46.866654Z",
"url": "https://files.pythonhosted.org/packages/e8/1c/0b1707e4291ef475892eeae1f1a793ac8b13bb38822234909d5fb5822abd/pyOrcas-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "55a2c172ae5bdd940c4acb38fc362a26f72911095d8f59c4de9afedc52247ac4",
"md5": "77ec178522375deaa59b2b3e0cda6e0d",
"sha256": "fcb1b85695406520f92bccfd76bc054371e848404ea08a610a4ac9940f7a5812"
},
"downloads": -1,
"filename": "pyorcas-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "77ec178522375deaa59b2b3e0cda6e0d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14467,
"upload_time": "2024-08-01T01:48:48",
"upload_time_iso_8601": "2024-08-01T01:48:48.112176Z",
"url": "https://files.pythonhosted.org/packages/55/a2/c172ae5bdd940c4acb38fc362a26f72911095d8f59c4de9afedc52247ac4/pyorcas-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-01 01:48:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dralexan",
"github_project": "pyOrcas",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyorcas"
}