Bare-Metal Flight Control: Neodrone Firmware
Exploring the custom SAMD21 firmware for the Neodrone flight controller.
Custom Firmware: SAMD21 Bare-Metal
The neodrone-firmware is built for the more specialized ATSAMD21G1BA (ARM Cortex-M0+). This allows for a very lightweight, bare-metal C implementation without the overhead of an RTOS.
Repository Status
Check out the live stats from the GitHub repository below. I’ve been pushing a few updates so far to have the boilerplate working.
Core Features
1. The PID Controller (WIP)
Implemented in pid.c, the controller now supports:
- Proportional (P) and Integral (I) terms.
- Anti-windup logic: Prevents the integral term from accumulating too much error during saturation.
- 4kHz Loop: Synchronized with the IMU interrupt for minimal latency.
2. Sensor Integration (IMU)
Communication with the IMU is handled via SPI. I just added the initial boilerplate for handling sensor data ready signals and basic register configuration.
3. Radio Input (RX)
The receiver module connects via UART. The firmware will decode the RC signals to map them to target Roll, Pitch, and Yaw rates.
Implementation Details
The code is written in strictly bare-metal C. No RTOS is used, which means the scheduler is a simple but precise loop that handles motor PWM updates, sensor reads, and radio input in a deterministic manner.
- MCU: ATSAMD21G1BA
- Language: C (Bare-Metal)
- Status: Core loop, PID and IMU integration in progress.
Check out the latest code on GitHub.