Skip to main content

Host library and CLI for the CoDrive motor controller

Project description

CoDrive

Python host library and CLI for the CoDrive motor controller.

CoDrive is a compact, high-performance motor controller designed for precise velocity, position, and torque control. This package lets you integrate CoDrive into any Python application and provides a ready-to-use command-line interface for quick commissioning and diagnostics.

Installation

pip install codrive

Quickstart

Python API

from codrive import Controller

with Controller("COM3") as ctrl:          # or /dev/ttyUSB0 on Linux
    ctrl.enable()
    ctrl.set_velocity(300)                # 300 RPM
    t = ctrl.get_telemetry()
    print(f"{t.velocity_rpm:.1f} RPM  {t.temperature_c:.1f} °C")
    ctrl.disable()

CLI

# Enable the drive
codrive COM3 enable

# Spin at 500 RPM
codrive COM3 velocity 500

# Move to 90°
codrive COM3 position 90

# Read live telemetry
codrive COM3 telemetry

# Emergency stop
codrive COM3 estop

Control modes

Command Description
set_velocity(rpm) Closed-loop speed control
set_position(degrees) Absolute position control
set_torque(nm) Direct torque / current control

Telemetry

Controller.get_telemetry() returns a Telemetry dataclass with:

  • velocity_rpm — measured shaft speed (RPM)
  • position_deg — absolute shaft angle (°)
  • torque_nm — estimated output torque (N·m)
  • temperature_c — controller board temperature (°C)
  • fault_flags — bitmask of active faults

Requirements

  • Python 3.10+
  • pyserial
  • CoDrive controller connected via USB–serial or UART adapter

License

MIT © Cosyne

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

codrive-0.1.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

codrive-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file codrive-0.1.1.tar.gz.

File metadata

  • Download URL: codrive-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for codrive-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ca1140f5406420fa301d414109eb53fdbe9a0ade7157b02968c9df845c2e83ee
MD5 0a7cd03910a8be554a0db65e6ea71aa5
BLAKE2b-256 d27336b3bb7086477aa9bf7e2b00c6956429b11c9a16f1a3b41061be63f7900e

See more details on using hashes here.

File details

Details for the file codrive-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: codrive-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for codrive-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a6b3ce012c5c7ddc7183cc0aee313e29b7df86be224b375c1ce341f9e458a5b
MD5 2da07abe3e9ef515a4150f085af936ed
BLAKE2b-256 89e15c98092b670c6cdf92ff195efc8b0a66d5a5585eaae40d6832c1b4671c5a

See more details on using hashes here.

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