Skip to content

C++ Motor Controller

Build high-performance motor control applications with our open-source C++ library. Supports USB and CANopen communication.

logo icon github dark blue

Implement Your Own Algorithms

Looking for a powerful way to control motors with C++?
SOLO motor controllers CPP library, supported by all SOLO Motor Controllers, is a simple-to-use, comprehensive, and maintained library built on top of our Digital Protocol.

Digital Protocol

algorithm illustration

Guide

1. Easy Install

SOLO Motor Controllers CPP library is fully Open Source and available on GitHub. Download it and start building.

Github

Install illustration

2.1. Setup

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

  • USB port [need a USB data Cable]
  • CAN pins (CH, CL, GND) [need Kvaser]

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

2.2. Accessories

3. Code Example

USB

ReadVoltage.cpp
#include <iostream>
using std::cout;
using std::endl;

#include <conio.h>
#include "SOLOMotorControllersSerial.h"

int main(void)
{
    SOLOMotorControllers *solo = new SOLOMotorControllersSerial((char*)"COM3");
    boolean status;
    float readingValue;
   
    //READ INPUT VOLTAGE:
    readingValue = solo->GetBusVoltage();
    std::cout << "Succesfully read from solo, Value: " << readingValue << std::endl;
    
    //DISCONNECT THE SOLO UNIT:
    solo->Disconnect();
}

In the example, the PC is connected to the Motor Controller using the USB port (Data USB Cable needed).

CANopen

ReadVoltage.cpp

#include <iostream>
using std::cout;
using std::endl;

#include <conio.h>
#include "SOLOMotorControllersCanopenKvaser.h"

int main(void)
{
    SOLOMotorControllers *solo = new SOLOMotorControllersCanopenKvaser();
    boolean status;
    float readingValue;
   
    //READ INPUT VOLTAGE:
    readingValue = solo->GetBusVoltage();
    std::cout << "Succesfully read from solo, Value: " << readingValue << std::endl;
    
    //DISCONNECT THE SOLO UNIT:
    solo->Disconnect();
}

In the example, the PC is connected to the Motor Controller using the CANopen protocol (Kvaser needed).

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.
SOLO motor controllers CPP library is a single library that contains both UART and CANopen capabilities.

In order to use CANopen, you need the Kvaser solution.

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

Drive your next innovation today

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