Skip to main content

dicot

Controls Futaba Command-Type Servo motors. It is developed and tested with RS204MD.

Installation

$ pip install dicot

Usage

Create the serial port connection, enable the torque, and set the motor angle:

>>> improt dicot
>>>
>>> cnx = dicot.open('COM1')
>>>
>>> motor = cnx.motor(1)  # id = 1
>>> motor.torque_enabled = True
>>>
>>> motor.angle = 45  # degree

Or set with duration:

>>> motor.rotate(90, msec=5000)  # with duration

Can get and set various parameters through the attributes:

>>> motor.angle
90  # degree
>>>
>>> motor.load
6  # mA
>>>
>>> motor.temperature
30  # Celsius
>>>
>>> motor.voltage
5.2  # V
>>>
>>> motor.max_torque = 80  # %
>>> motor.pid_coeff = 100  # %

The value set in the ROM area must be written by executing motor.rom.write() in order to retain it even after the motor is turned off:

>>> motor.torque_enabled = False
>>> motor.rom.cw_angle_limit = 100  # degree
>>> motor.rom.ccw_compliance_margin = 0.2  # degree
>>> motor.rom.ccw_compliance_slope = 20  # degree
>>> motor.rom.write()

Can also change the ID:

>>> motor.rom.id = 2
>>> motor.rom.write()

MotorList can handle multiple motors collectively:

>>> motors = dicot.MotorList([motor, cnx.motor(2), cnx.motor(3)])
>>> motors.torque_enabled = True
>>> motors.angles = [30, 60, 90]

The connection object supports the with statement:

import dicot

with dicot.open('COM1') as cnx:
    motor = cnx.motor(1)
    print(motor.firm_version)

Metadata

Release files for dicot 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dicot 0.1.0
File Size Uploaded
dicot-0.1.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dicot 0.1.0
File Interpreter ABI Platform
dicot-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / dicot-0.1.0.tar.gz

Download URL dicot-0.1.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
55db4ffb9e284e03c85ef6f908e29e2bd1c9ade84c16aa73ce6cf705eb89e1ff
BLAKE2b-256 checksum
How to use checksums
f0331ed274242514bba29294a52e85bd83db3a3064fa8d5039685876f7f247ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.2 Windows/10

Release files / dicot-0.1.0-py3-none-any.whl

Download URL dicot-0.1.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56d108e519711df48da65412547996f300b1f8f3359d243b5138a2b533d4806d
BLAKE2b-256 checksum
How to use checksums
332471fe6e0159a94939fe6bc9f36e93352c957e2df6e5ba45cc82ed12a3be0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.2 Windows/10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page