Skip to content

Python Motor Controller

Control motors and automated systems with Python across Windows, Linux and Raspberry Pi. Supports USB, UART and CANopen communication.

logo icon github dark blue

Automate Your Motor Systems

Looking for a versatile way to control motors with Python? SoloPy, supported by All Solo Motor Controllers, is a simple-to-use, vast, and maintained library for managing motors and actuators using the powerful Python programming language.

Articles Tutorials

automation illustration

Guide

1. Choose your OS

Python is supported on several OS and hardware platforms. Here is a list of the systems we cover in our Articles and Tutorials.

windows logo icon white

Connectivity using USB and UART

Windows

linux logo icon white

Connectivity using USB, UART or CANopen through the CANable interface.

Linux

logo icon raspberry pi white

Connectivity using USB, UART or CANopen through the CANable interface or CAN shield.

Raspberry Pi

2. Install SoloPy

SoloPy is fully Open Source and available on GitHub. Install it using PIP in a convenient and standard way.

Pip command in the terminal:
  • Windows: python -m pip install SoloPy
  • Linux: pip install SoloPy
  • Raspberry Pi: pip install SoloPy

3.1. Setup

There are several ways to connect your system to your SOLO motor controller.
Alternatives:

  • USB port [need a USB data Cable]
  • UART pins (TX, RX, GND) [need a USB-to-UART adapter]
  • CAN pins (CH, CL, GND) [need a USB-to-CAN adapter]

Product Specifications

Solo Pico

SOLO Pico connection guide: USB, UART (TX, RX, GND) and CANopen (CH, CL, GND) pins

Solo Mini

SOLO Mini connection guide: USB, UART (TX, RX, GND) and CANopen (CH, CL, GND) pins

Solo Uno

SOLO Uno connection guide: USB, UART (TX, RX, GND) and CANopen (CH, CL, GND) pins

Solo Mega

SOLO Mega connection guide: USB, UART (TX, RX, GND) and CANopen (CH, CL, GND) pins

3.2. Accessories

4. Code Example

Here are some examples. You can also check the Repo/Examples, the Documentation or our Articles to better know our library.

Windows - USB

SoloPy_Windows_USB_Hello.py
import SoloPy as solo
import time

mySolo = solo.SoloMotorControllerUart("COM3")

while True:
    print("Read from SOLO the Board Temperature: " + str(mySolo.get_board_temperature()))
    print("Read from SOLO the Motor Speed: " + str(mySolo.get_speed_feedback()))
    time.sleep(1)

In the example PC is connected to the Motor Controller with a USB data cable.

Linux - USB

SoloPy_Linux_USB_Hello.py
import SoloPy as solo
import time

mySolo = solo.SoloMotorControllerUart("/dev/ttyACM0")

while True:
    print("Read from SOLO the Board Temperature: " + str(mySolo.get_board_temperature()))
    print("Read from SOLO the Motor Speed: " + str(mySolo.get_speed_feedback()))
    time.sleep(1)

In the example PC is connected to the Motor Controller with a USB data cable.

Raspberry Pi - UART

SoloPy_PaspberryPi_UART_Hello.py
import SoloPy as solo
import time

mySolo = solo.SoloMotorControllerUart("/dev/ttyS0")

while True:
    print("Read from SOLO the Board Temperature: " + str(mySolo.get_board_temperature()))
    print("Read from SOLO the Motor Speed: " + str(mySolo.get_speed_feedback()))
    time.sleep(1)

In the example Raspberry Pi UART (TX, RX) and GND pins are connected to the UART (RX, TX) and GND pins of the Motor Controller.

Raspberry Pi - CANopen

SoloPy_PaspberryPi _CANOpen_Hello.py
import SoloPy as solo
import time

#CANOpen module require Raspberry extra configuration + extra command before run the example
mySolo = solo.SOLOMotorControllersCanopen(0)

while True:
    print("Read from SOLO the Board Temperature: " + str(mySolo.get_board_temperature()))
    print("Read from SOLO the Motor Speed: " + str(mySolo.get_speed_feedback()))
    time.sleep(1)


In the example Raspberry Pi Module CAN (CH, CL) and GND pins are connected to the CAN (CH, CL) and GND pins of the Motor Controller

The following CAN transceiver module “PiCAN2” has been used to test the Example

CANopen Logo white

CANopen support

For demanding and industry-standard applications, the library supports the CANopen protocol. It’s as simple to use as UART, with minimal differences, but significantly more robust: high-intensity communication, superior error handling, and full networking capabilities under harsh conditions.
SoloPy is a single library that contains both Serial/UART and CANopen capabilities.

In order to use CANopen, you need a USB-to-CAN adapter such as our CANable V2.0.

Python Articles

article solopy v4.1.0 new python library release d

SOLOPY v4.1.0 : New Python Library Release

Learn More

solo on linux 4

Solo on Linux

Learn More

fastest control brushless motor with raspberry pi using solo 1

Simplest way to control a Fast Brushless Motor with Raspberry Pi using SOLO [+ Code]

Learn More

torque control brushless motor with raspberry pi using solo 1 1

The Easiest way to control the Torque of a BLDC with Raspberry Pi using SOLO with Hall sensors feedback [+ Code]

Learn More

position control brushless motor with raspberry pi using solo 1

Raspberry Pi Brushless Motor Position Control using SOLO and Incremental Encoders [+ Code]

Learn More

speed control brushless motor with raspberry pi using solo

Speed Controlling of BLDC with Raspberry Pi and SOLO using HALL Sensors [+ Code]

Learn More

Drive your next innovation today

Discover our High-Performance Motor Controllers, Test Benches, and Services trusted worldwide.