Skip to main content

Async Python driver for igus dryve D1 motor controllers (Modbus/TCP, CiA 402)

Project description

dryve-d1

CI PyPI Python 3.12+ License: MIT Typed

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 DriveSnapshot caching
  • Pydantic configDriveConfig, ConnectionConfig, MotionLimits, RetryPolicy
  • Pure async — built on asyncio, no blocking calls
  • PEP 561 typed — full type annotations, py.typed marker included
  • Zero heavy deps — only pydantic required (no pymodbus)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dryve_d1-0.2.0.tar.gz (129.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dryve_d1-0.2.0-py3-none-any.whl (73.5 kB view details)

Uploaded Python 3

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

Hashes for dryve_d1-0.2.0.tar.gz
Algorithm Hash digest
SHA256 40f4b9b58c0acc862b19be11a4ec9eaf5a0ecc9946c52001d1efa32541351dcf
MD5 73d7f7daebef5a4ad4a5cbe8f9c9a5ac
BLAKE2b-256 f902f7ce24e225a8cc1db32b2bfa92cb92b9b9adda4b121716077839d9a359a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dryve_d1-0.2.0.tar.gz:

Publisher: publish.yml on AliaksandrNazaruk/dryve-d1

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for dryve_d1-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5179a1ebdabe660c4c7f61dff29aace46f032870ea50f43fe67c687966010350
MD5 1315d644d34299b8edd6f6037a456a55
BLAKE2b-256 5e5d7f568f571997e5f9a058af991cde22d3f83d54300bf39ab010c33061004b

See more details on using hashes here.

Provenance

The following attestation bundles were made for dryve_d1-0.2.0-py3-none-any.whl:

Publisher: publish.yml on AliaksandrNazaruk/dryve-d1

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page