Skip to content

RaccoonlabDev/mini_v2_node

Repository files navigation

Code Smells Lines of Code cyphal_sitl dronecan_sitl code_style build_and_deploy

Cyphal/DroneCAN application

This repo introduces a ready-to-use Cyphal/DroneCAN application for RL Mini v2 and RL Mini v3 nodes.

Please, refer Wiki for details:

1. KEY FEATURES

  • Both Cyphal/CAN and DroneCAN protocols or one of them in a single firmware,
  • You can try the software in Software-In-The-Loop (SITL) mode,
  • Small firmware image and software is friendly for customization,
  • Redundant CAN interface (node v3),
  • MPU-9250 IMU (node v3).
  • CAN terminator resistors control (node v3).

Not supported or tested yet / In Roadmap:

  • Cyphal/DroneCAN Bootloader,
  • Dynamic Node Allocation (DNA),
  • Vibration Analysis: estimate dominant frequency and magnitude of vibrations for diagnosing mechanical issues or ensuring smooth operation in drones or robotic platforms in real time.
  • AS5600 I2C sensor encodetor for servo position estimation

2. TARGET HARDWARE

The software supports RL v2 nodes (stm32f103, 128 KBytes flash) and v3 nodes (stm32g0b1, 512 KBytes flash).

Name View Pinout STM32CubeMX
Mini v2
stm32f103
128 KBytes flash
drawing drawing drawing
Mini v3
stm32g0b1
512 KBytes flash
drawing drawing drawing

3. USE CASES

This node is a versatile device integrating PWM control, IMU sensing, and dual CAN bus communication, suitable for various applications in robotics, drones, and other embedded systems. Below are the detailed use cases for different scenarios.

Use case Description
drawing 1. Basic ESC and Servo Control
PWM1-4 to control PWM ESCs via Cyphal/DroneCAN.
PWM1-2 to control 5V servos.
DroneCAN interface: RawCommand / ArrayCommand.
Cyphal/CAN interface: UDRAL setpoint
drawing 2. Advanced ESC Control with Feedback
PWM3-4 for controlling PWM ESCs
UART or ADC feedback on the FB pin.
DroneCAN interface: esc.Status / actuator.Status.
Cyphal/CAN interface: UDRAL Feedback
drawing 3. CAN-I2C Converter
PWM1 and PWM2 as I2C pins.
Cyphal/DroneCAN adapter for I2C peripherals.
DroneCAN examples: range_sensor.Measurement.
4. Cargo Gripper
PWM1-2 to control servo-based cargo grippers.
UAV payload management systems.
DroneCAN interface: hardpoint.Command.
5. CAN-CAN converter
CAN1 for Cyphal/DroneCAN.
CAN2 for another CAN protocol.
Cyphal/DroneCAN adapter for another CAN device.
Examples: KST/CAN servo, CANopen motor, CAN BMS.
Keep a consistent CAN network.
Supported only on Mini v3 node.
6. Servo Position Estimation with I2C Encoder
PWM3-4 for a servo
PWM1-2 for a AS5600 I2C encoder.
Estimate the angular position of the servo.
DroneCAN interface: actuator.Status.
7. Vibration Analysis with IMU
Utilize the onboard IMU (MPU-9250)
Monitor vibrations in your system.
Estimate dominant frequency and magnitude of vibrations.
Crucial for diagnosing mechanical issues
or ensuring smooth operation in drones or robotic platforms.
DroneCAN interface: ahrs.RawIMU.

4. SOFTWARE PREREQUISITES

The following table outlines the compatibility of the project with different operating systems, modes, and support timelines.

Operating System DroneCAN Support Cyphal Support Notes
Manjaro (latest) ✅ Supported ✅ Supported Latest Manjaro LTS version.
Ubuntu 24.04 ✅ Supported ✅ Supported Latest Ubuntu LTS version.
Ubuntu 22.04 ✅ Supported ✅ Supported Fully supported for both modes.
Ubuntu 20.04 ❌ Not Supported ❌ Not Supported Deprecated in 2025-04-15.
Windows (2022) ✅ Supported ✅ Supported Current "latest" Windows version.

5. QUICK START

Installation (Ubuntu, Manjaro, Windows):

# 1. Make a fork of the repository and clone the repository with submodules
git clone git@github.com:RaccoonlabDev/mini_v2_node.git --recursive

# 2. Install python requirements
pip install -r requirements.txt

# 3. Install other requirements (toolchains, etc.)
./scripts/install.py

Build (examples):

# DroneCAN firmware:
make dronecan_v2
make dronecan_v3

# Cyphal firmware:
make cyphal_v2
make cyphal_v3

Upload:

make dronecan_v2 upload
# or:
make dronecan_v3 upload

SITL (Software-In-The-Loop):

make sitl_dronecan run
# or:
make sitl_cyphal run

GUI Tool

For full interaction with the node use:

6. Q&A

If you are struggling with the software building, please refer to the build workflow build_and_deploy.yml for a hint. If it doesn't help, you can open an issue.

7. More examples

Consider the following projects as examples:

  1. RL UAV Lights node
  2. IU VTOL PMU node
  3. IU Airspeed+rangefinder+lights+PWM node
  4. IU Fuel tank node

About

Mini v2 node Cyphal/DroneCAN application example

Topics

Resources

License

Stars

Watchers

Forks

Contributors 6