Skip to main content

Python module for Spectral BLDC motor controllers

Project description

Spectral-BLDC

License: MIT Issues release

Python lib for controlling Spectral BLDC motor controllers over CAN bus. For more info about this API and all available commands check DOCS

Related projects

| Product | Description | Links |

|---|---|---|

| Spectral Micro BLDC Controller | Compact brushless motor controller with CAN bus, position/velocity/torque/impedance control modes | GitHub |

| SSG-48 Adaptive Electric Gripper | Adaptive electric gripper controllable over CAN bus | GitHub |

| MSG Gripper | Compliant AI stepper gripper with force control, open-source firmware, GUI and Python API; designed for assembly tasks and AI training | Store · GitHub · Docs |

| STEPFOC Stepper Controller | FOC-based stepper motor controller that turns low-cost steppers into high-performance robotic servos; CAN & UART, 14-bit encoder, open-source | Store · GitHub · Docs |

How to install

pip install Spectral-BLDC

Basic example

import Spectral_BLDC as Spectral

import time





Communication1 = Spectral.CanCommunication(bustype='slcan', channel='COM41', bitrate=1000000)

Motor1 = Spectral.SpectralCAN(node_id=0, communication=Communication1)



while True:



    Motor1.Send_Respond_Encoder_data()



    message, UnpackedMessageID = Communication1.receive_can_messages(timeout=0.2)



    if message is not None:



        Motor1.UnpackData(message,UnpackedMessageID)

        print(f"Motor position is: {Motor1.position}")

        print(f"Motor speed is: {Motor1.speed}")



    else:

        print("No message after timeout period!")

    print("")

    time.sleep(1 )

More examples

Check out the Examples folder for more examples!

Available examples:

  • Send_respond_1

  • Get_encoder_data

  • SSG48_gripper_test

This project is entirely open-source and free for all to use. Any support, whether through donations or advice, is greatly appreciated. Thank you!

General badge

General badge

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

spectral_bldc-1.20.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

spectral_bldc-1.20-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file spectral_bldc-1.20.tar.gz.

File metadata

  • Download URL: spectral_bldc-1.20.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for spectral_bldc-1.20.tar.gz
Algorithm Hash digest
SHA256 9ab8591cc1f387a62c20da31055fd399997e3b0bf49fafc0eccea43e7efafbd8
MD5 5366fc532398a2a128df12efaf54180d
BLAKE2b-256 b4168b86467724d9381fc089151e959eb3856b9b7318e69b6828587caf1c87da

See more details on using hashes here.

File details

Details for the file spectral_bldc-1.20-py3-none-any.whl.

File metadata

  • Download URL: spectral_bldc-1.20-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for spectral_bldc-1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 9c6cc713ea1196b6967e886089a519b954c1f47c3f1f87e56e254c469e50ba8b
MD5 31f8b60cbda8a9ee59b7e091475bf31d
BLAKE2b-256 388be35863a990ed3ad99847c8d11a83e41219aa3bc8b2588c8e4ff6c6cb6bc8

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