Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,9 @@ dmypy.json
# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# IDE
.idea/
.vscode

# PyPI configuration file
.pypirc
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ for device_id, desc in devices:
device_key = ("192.168.29.100", 10005, 2)
print("Now on device 2:", controller.get_idn(device_key))

# Check if axis '1' is referenced
is_referenced = controller.is_controller_referenced(device_key, '1')
# Check if axis '1' is referenced (homed)
is_referenced = controller.is_homed(device_key, '1')
print("Axis 1 referenced:", is_referenced)

# Perform a reference move (home) on axis '1'
success = controller.reference_move(device_key, '1', method="FRF", blocking=True, timeout=30)
# Perform a home (reference move) on axis '1'
success = controller.home(device_key, '1', method="FRF", blocking=True, timeout=30)
if success:
print("Reference move completed successfully.")
print("Home completed successfully.")
else:
print("Reference move failed or timed out.")
print("Home failed or timed out.")

# Move axis 1 to position 12.0
controller.set_position(device_key, '1', 12.0)
controller.set_pos(12.0, device_key, '1')

# Save current position as "home"
controller.set_named_position(device_key, '1', 'home')
Expand All @@ -72,21 +72,21 @@ controller.disconnect_all()
| `get_idn(device_key)` | Get the controller identification string |
| `get_serial_number(device_key)` | Get the serial number from the IDN |
| `get_axes(device_key)` | Return available axes |
| `get_position(device_key, axis_index)` | Get current position of axis by index |
| `servo_status(device_key, axis)` | Check if the servo on an axis is enabled |
| `get_pos(device_key, axis)` | Get current position of axis |
| `is_loop_closed(device_key, axis)` | Check if the servo on an axis is enabled |
| `get_error_code(device_key)` | Get the controller's last error code |
| `halt_motion(device_key)` | Stop all motion on the controller |
| `set_position(device_key, axis, position)` | Move an axis to a position |
| `set_pos(pos, device_key, axis)` | Move an axis to a position |
| `set_named_position(device_key, axis, name)` | Save a position under a named label |
| `go_to_named_position(name)` | Move to a previously saved named position |
| `disconnect_device(device_key)` | Disconnect a single device |
| `disconnect_all()` | Disconnect all devices |


## Logging
By default, the controller logs info and error messages to the console. You can suppress logs (except warnings/errors) by passing quiet=True:
By default, the controller logs info and error messages to the console. You can disable logging by passing log=False:
```python
controller = PIControllerBase(quiet=True)
controller = PIControllerBase(log=False)
```

## 🧪 Testing
Expand Down
Loading