UP | HOME

LadybugFlightController

ladybug.jpg

This is a small (20 x 28 mm) open-source flight controller for small quadrotors using brushed DC motors. The heart of the flight controller is the 32-bit STM32L432KC MCU, based on the Ladybug development board, running at 80 MHz with a single-precision floating point unit. And like the Ladybug, the Ladybug Flight Controller is programmable via USB with an Arduino IDE. There are convenient buttons on the board for MCU reset and placing the STM32L4 in BOOT mode, and the BOOT button can be used as a user button connected to GPIO pin D44.

The flight controller power is supplied by a one-cell (1S) LiPo battery and there is a battery monitor (27 K/100 K voltage divider) on STM32L4 pin A3 for low battery detection by the MCU. The battery connects to a port on the side of the flight controller with the anode marked by a +.

The flight controller uses PWM on STM32L4 pins A2, D3, D11, and D13 to control the four motor circuits (similar to the Crazy Flie design); the DMN2041L-7 N-channel MOSFETs have very low (20 mOhm) on-resistance and high continuous (6.4 A) and peak (30 A) currents for efficient power transfer to the motors. The board is protected from back EMF by CDSQR4148 switching diodes with peak reverse voltage breakdown of 100 V. The DC motors are attached using Picoblade Molex connectors to simplify quadcoptor construction. Of course, you can just solder the motor leads to the board without using connectors.

The board uses the MPU9250 as inertial motion sensor and the MS5637 as barometer with the EM7180 motion co-processor (interrupt on pin D12) as the sensor master and sensor fusion engine as described here. This absolute orientation engine is essentially the same as the popular Ultimate Sensor Fusion Solution (USFS) sold separately on Tindie. The USFS routinely provides 2-degree heading accuracy which, embedded in this flight controller, enables stable, headless flight control. The barometer is also managed by the EM7180 motion coprocessor so that quaternions, scaled acceleration, rotation, and magnetic field as well as absolute pressure are all available by simple I2C register reads from the EM7180 in the main loop of the STM32L4 flight control sketch.

At the non-USB end of the flight controller board is radio receiver input (3V3, GND, RX1) that can accomodate most popular radio receivers.

There is a blue led indicator on STM32L4 pin A4 for communication of controller status to the user.

Lastly, the board exposes 3V3 and 5V power and ground as well as I2C, SPI, and UART ports along with five free STM32L4 GPIOs so that additional sensors or peripherals (displays, cameras) might be added by the user.

We went way beyond the usual gyro-only or accel/gyro combo inertial sensing to the most accurate 3D absolute orientation engine available at this size and price range. The resulting flight stability is superb, and headless flight makes flying fun!

Everything is open-source, and we have created a detailed how-to guide as well as all the flight control software you will need to get started constructing and customizing your own quadcopter using this flight controller.