pykinisi
Python package for kinisi motor controller. This package is used to control the kinisi motor controller via serial interface.
Description of the commands can be found in Kinisi Motion Controller framework documentation
This version uses messages API 2.1.0, which is incompatible with API 1.x firmware and clients. Connecting exchanges board identity and completes clock setup before returning. See initialization, time sync, and errors for details.
Installation
Install pykinisi with pip:
pip install pykinisi
Controlling Single Motor
This example shows how to connect to the motor controller and control a single motor.\
import time
from pykinisi import *
port = "COM3"
controller = KinisiController()
if not controller.connect(port):
print(f"Can't connect to {port}: {controller.last_error}")
exit()
# Motor test
motor_index = MotorIndex.Motor0
speed = 40 # Signed PWM value, -840..840
# Is motor reversed
is_reversed = False
try:
controller.initialize_motor(motor_index, is_reversed)
# Set motor speed to speed
controller.set_motor_speed(motor_index, speed)
time.sleep(5)
finally:
try:
controller.stop_motor(motor_index)
finally:
controller.disconnect()
More Examples
There are several examples in the examples folder which show how to use the pykinisi package to control the kinisi motor controller.
Run the examples with:
cd examples
python <example_file> <serial_port>
Initialization.py reports board identity and clock status without enabling motors. Use python Initialization.py <serial_port> --uptime when the host has no valid wall clock.
Package Development
Install pykinisi for development:
pip install -e .
Update KinisiCommands.py file:
cd tools
python update-commands.py --schema ../../kinisi-motor-controller-firmware/commands.json
The command above uses a sibling firmware checkout. Use --branch=<firmware-branch> to fetch a firmware branch containing the API v2 schema instead.
Run tests from the project root with python -m unittest discover -s tests.
Links
Metadata
Release files for pykinisi 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pykinisi-2.1.0.tar.gz | 47.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pykinisi-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.2 kB
Release files / pykinisi-2.1.0.tar.gz
| Download URL | pykinisi-2.1.0.tar.gz |
|---|---|
| Size | 47.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e33b7f9ea563fc8b046a7cfc9cdf6a922ab793e9d9f8613708f02a7b22aa9b56
|
|
BLAKE2b-256 checksum How to use checksums |
17e570586e2cec19f8878967689676e4c0295a42803d5cd5780a91e6a31e4a6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0
|
Release files / pykinisi-2.1.0-py3-none-any.whl
| Download URL | pykinisi-2.1.0-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19980373c40dbb83d6a22bcbf49a5831f597489a3aa5a8195a5afc0f1c8c2ebc
|
|
BLAKE2b-256 checksum How to use checksums |
9b80cc8fe7b7a5d544185f83e29ea8c6458b16e639b754cb8ccc4ffd5c63f615
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0
|