Skip to content

CANopen Drone for Efficient Motor Controller

Knowledge & Insights

Introduction

In this article, we will explore the integration of the CANopen protocol with our motor controller in drone technology. By utilizing CANopen, we aim to achieve efficient and reliable communication between the flight controller and motor controllers, resulting in superior performance and stability. Known for its robustness and flexibility, CANopen enhances data exchange, ensuring precise motor control and real-time adjustments. This implementation improves flight efficiency and extends operational life by reducing transmission errors and optimizing power usage. In our tests study highlights the drone’s enhanced capabilities in various applications, from commercial deliveries to agricultural monitoring. Discover how our drone reaches improved results in diverse and demanding environments, showcasing the benefits of CANopen over traditional communication protocols.

Overview of Drone Systems

Drones, or unmanned aerial vehicles (UAVs), rely on sophisticated flight and motor control systems to achieve precise flight maneuvers and stability. Effective communication protocols are crucial in these systems to ensure reliable and efficient data exchange. This article explores the CANopen protocol, a robust communication standard, and its application in drone motor control.

In this block diagram you can see the most important elements of a Drone control system:

GENERAL DRONE ARCHITECTURE

Main Blocks of General Drone System are:

  1. Motors: Typically brushless DC motors provide thrust.
  2. Motor Controllers: The goal of this element is to regulate motor power and speed.
  3. Flight Controller: The drone’s brain, processing inputs and maintaining balance, interfaces with the user with a radio signal and provides the interface to the camera.
  4. Battery: Usually a battery provides necessary electrical power.

NOTE: In the Block diagram you can see the Communication Protocols that make possible the communication between the motor controller and flight controller where we will test CANopen as an alternative.

Importance of Communication Protocols in Drones

The interaction between motor controllers and flight controllers significantly influences communication performance. Slow communication can obstruct the motor controller’s ability to swiftly adjust motor speeds. Therefore, our test aims to evaluate the efficacy of standard ESC control and assess the potential improvements by transitioning to CAN-based communication.

Drone Using ESC

In our initial experiment, we restricted the drone’s movement with a central spear to prevent independent flight. Our objective is to bypass the conventional flight control system and establish direct communication with the ESCs using a straightforward Arduino code. This approach aims to send precise speed commands to the ESCs, enabling the drone to achieve and maintain designated speeds without the need for ongoing adjustments.

ESC Drone Setup

Here is our ESC Drone Setup picture.

Basic drone

Here is a block diagram showing the main elements of our ESC Drone Setup:

OUR ESC TEST ARCHITECTURE

These block are of our ESC Drone Setup:

  1. Motors: Typically brushless DC motors that provide thrust.
  2. ESC : The goal of this element is to regulate motor power and speed.
  3. Arduino: Arduino acts as the brain of the drone, interpreting signals and controlling other components.
  4. Power Supply: Usually a battery providing necessary electrical power .
  5. PC : Sends commands to the Arduino and receives telemetry data for monitoring and controlling the drone in real-time.

Code for ESC Drone

ESC Drone Code Explanation

This Arduino code is designed for drone motor control via serial communication. The script initializes the communication pin 9. It then reads user input from the serial monitor, validating the input within the 1000-2000 microseconds range. Using `Serial.readStringUntil(‘\n’)`, the code handles complete commands, providing feedback for invalid entries.

ESC Drone Test Consideration

Adjusting the values for ESC communication allows us to control the drone, but we face limitations due to resolution constraints. For instance, setting the value at 1300 positions the drone at mid-flight level, while increasing it to 1400 causes the drone to reach the endpoint of the test line. However, values between 1300 and 1400 show no change in motor speed, indicating the Limited Precision of our current control setup.

Drone using CANopen

What is CANopen?

CANopen is a high-level communication protocol based on the CAN (Controller Area Network) bus. Originally developed for industrial automation, it has been adapted for various applications, including drones.

Key Features and Benefits of CANopen

  • Robustness: High reliability in data transmission.
  • Flexibility: Supports complex network architectures.
  • Scalability: Easily integrates with additional nodes and devices.
  • Real-time Communication: Ensures timely data exchange.

CANopen Hardware Requirements

  • CAN Transceiver: Interfaces between the CAN bus and microcontroller.
  • Microcontroller: Processes CANopen protocol stack.
  • ESCs with CANopen support: Ensures compatibility.

CANopen Software Configuration

  • CANopen Protocol Stack: Implemented in the microcontroller firmware.
  • Configuration Tools: Used for network setup and management.

CANopen Drone Setup

As we do for the drone ESC test, for our Drone CANopen Test we restricted the drone’s movement with a central spear to prevent independent flight. Our goal is to bypass the conventional flight control system, reducing complexity and enhancing simplicity.

Drones equipped with CANopen can demonstrate superior stability and performance compared to those relying solely on ESC (Electronic Speed Controller). CANopen’s standardized protocol ensures precise data communication among components like sensors and motors, minimizing latency and enhancing reliability. This capability is crucial for executing complex flight maneuvers and maintaining stable flight paths in varied conditions with minimal latency. We will try to compare this consideration using the following test.

Here is our CANopen Drone Setup Video.

Here is a block diagram showing the main elements of our CANopen Drone Setup:

OUR CAN TEST ARCHITECTURE

These block are of our CANopen Drone Setup:

  • Motors: Typically brushless DC motors that provide thrust.
  • SOLO PICO: Acts as the drone’s brain, processing data from sensors and executing flight control algorithms.
  • KVASER: Uses CAN (Controller Area Network) protocol to connect the flight controller and motor controllers, ensuring reliable data transmission and precise motor control.
  • PC: Sends commands to the Pico and receives telemetry data for monitoring and controlling the drone in real-time.
  • Power supply: Usually providing necessary electrical power sharing between the control units and motors.

Code for CANopen Drone

CANopen Drone CODE EXPLANATION

This C++ code is tailored for drone motor control using the CANopen Kvaser protocol with SOLO Motor Controllers. The script initializes four motor controllers, accepting user input for speed values. By leveraging the `readInput` function, it reads the speed value and sets the motor speeds accordingly using the `setSpeed` function.

CANopen Drone Consideration

We successfully executed basic motions and stabilized the drone at any altitude. During the test the motors were less noisy, however, measuring noise was not within the scope of this experiment focused on communication protocols.

Canopen vs ESC Comparison

comparison

During our initial evaluation, both solutions demonstrated similar performance. However, we observed a decline in performance of the ESC control, resulting in altitude loss. Additionally, controlling the motion was challenging due to low communication resolution, which was probably a consequence of the Arduino library and the approach we used.

Conclusion

In this initial test, we did not find significant performance differences between the ESC and CANopen protocols. The unexpected loss of altitude with the ESC likely stemmed from hardware problems. Further testing is needed to assess potential improvements in flight quality and understand if the protocol capability will result in a better flight experience.

An extra benefit of the CANOpen is the capability of the protocol to offer a notable advantage by providing extensive information exchange between the motor controller and the flight controller. This includes access to temperature, speed, torque, and power consumption data, which can enhance the drone’s capabilities.

Browse all categories

Drive your next innovation today

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