Async Python driver for igus dryve D1 motor controllers (Modbus/TCP, CiA 402)
Project description
dryve-d1
Async Python driver for igus dryve D1 stepper/servo motor controllers over Modbus/TCP. Implements the CiA 402 (CANopen Drive Profile) state machine in pure Python — no pymodbus dependency.
Installation
pip install dryve-d1
Quick Start
import asyncio
from dryve_d1 import DryveD1
from dryve_d1.config.defaults import default_driver_config
async def main():
cfg = default_driver_config(host="192.168.1.100", unit_id=1)
drive = DryveD1(config=cfg)
await drive.connect()
try:
await drive.fault_reset()
await drive.enable_operation()
await drive.home()
await drive.move_to_position(target_position=10000)
finally:
await drive.close()
asyncio.run(main())
Features
- CiA 402 state machine — full lifecycle: enable, disable, quick stop, fault reset
- Profile position — move to absolute/relative position with velocity and acceleration
- Profile velocity — continuous velocity control
- Jog (hold-to-move) — with configurable watchdog TTL and keepalive
- Homing — configurable homing methods with timeout
- Telemetry poller — periodic status polling with
DriveSnapshotcaching - Pydantic config —
DriveConfig,ConnectionConfig,MotionLimits,RetryPolicy - Pure async — built on
asyncio, no blocking calls - PEP 561 typed — full type annotations,
py.typedmarker included - Zero heavy deps — only
pydanticrequired (nopymodbus)
Bundled Simulator
Develop and test without hardware using the included Modbus TCP simulator:
python simulator.py # starts on port 501
Then connect with host="127.0.0.1", port=501, unit_id=0.
Architecture
┌──────────────────────────────────────────┐
│ dryve_d1.api.drive.DryveD1 │ ← async facade
├──────────────────────────────────────────┤
│ dryve_d1.cia402 │ dryve_d1.motion │ ← state machine + motion profiles
├──────────────────────────────────────────┤
│ dryve_d1.protocol │ dryve_d1.od │ ← Modbus/CANopen codec + OD registers
├──────────────────────────────────────────┤
│ dryve_d1.transport │ ← TCP client, session, retry
└──────────────────────────────────────────┘
Development
git clone https://github.com/AliaksandrNazaruk/dryve-d1.git
cd dryve-d1
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# Run tests
pytest tests/unit -m "not simulator"
# Lint & type check
ruff check src/ tests/
mypy src/dryve_d1
License
MIT © 2026 Aliaksandr Nazaruk
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dryve_d1-0.2.0.tar.gz.
File metadata
- Download URL: dryve_d1-0.2.0.tar.gz
- Upload date:
- Size: 129.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40f4b9b58c0acc862b19be11a4ec9eaf5a0ecc9946c52001d1efa32541351dcf
|
|
| MD5 |
73d7f7daebef5a4ad4a5cbe8f9c9a5ac
|
|
| BLAKE2b-256 |
f902f7ce24e225a8cc1db32b2bfa92cb92b9b9adda4b121716077839d9a359a1
|
Provenance
The following attestation bundles were made for dryve_d1-0.2.0.tar.gz:
Publisher:
publish.yml on AliaksandrNazaruk/dryve-d1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dryve_d1-0.2.0.tar.gz -
Subject digest:
40f4b9b58c0acc862b19be11a4ec9eaf5a0ecc9946c52001d1efa32541351dcf - Sigstore transparency entry: 1115759954
- Sigstore integration time:
-
Permalink:
AliaksandrNazaruk/dryve-d1@7d12ead2eed970e69ef7d79c582022b36f1db54c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AliaksandrNazaruk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7d12ead2eed970e69ef7d79c582022b36f1db54c -
Trigger Event:
push
-
Statement type:
File details
Details for the file dryve_d1-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dryve_d1-0.2.0-py3-none-any.whl
- Upload date:
- Size: 73.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5179a1ebdabe660c4c7f61dff29aace46f032870ea50f43fe67c687966010350
|
|
| MD5 |
1315d644d34299b8edd6f6037a456a55
|
|
| BLAKE2b-256 |
5e5d7f568f571997e5f9a058af991cde22d3f83d54300bf39ab010c33061004b
|
Provenance
The following attestation bundles were made for dryve_d1-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on AliaksandrNazaruk/dryve-d1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dryve_d1-0.2.0-py3-none-any.whl -
Subject digest:
5179a1ebdabe660c4c7f61dff29aace46f032870ea50f43fe67c687966010350 - Sigstore transparency entry: 1115759957
- Sigstore integration time:
-
Permalink:
AliaksandrNazaruk/dryve-d1@7d12ead2eed970e69ef7d79c582022b36f1db54c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AliaksandrNazaruk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7d12ead2eed970e69ef7d79c582022b36f1db54c -
Trigger Event:
push
-
Statement type: