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.3.0.tar.gz (260.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.3.0-py3-none-any.whl (75.4 kB view details)

Uploaded Python 3

File details

Details for the file dryve_d1-0.3.0.tar.gz.

File metadata

  • Download URL: dryve_d1-0.3.0.tar.gz
  • Upload date:
  • Size: 260.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dryve_d1-0.3.0.tar.gz
Algorithm Hash digest
SHA256 46fd54de9aa769ddb0a321fe36cf655667f427a923cd702ab5a1e0aa1deb303c
MD5 cb5aa0fba8407a1de812e4b936edc928
BLAKE2b-256 0de4bc26eced1da2f7d063b0f35152e05fce8de6926fd004cd8d5591097026c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dryve_d1-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: dryve_d1-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 75.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dryve_d1-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 300486b45a9976352a9fc477801f9ad1a398f5415a41843d4a50279655e56ac0
MD5 9a56c7520e0d67e1c04fcafd47a15739
BLAKE2b-256 2ce226b5b38a35a5a1f679b32681ed58c6b81ba538b079a356005d6d67429806

See more details on using hashes here.

Provenance

The following attestation bundles were made for dryve_d1-0.3.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