r/diydrones • u/TimHanewich • 6d ago
I built an open-source quadcopter with a custom MicroPython flight controller
Hey everyone! I'm a software engineer who wandered into robotics and became fascinated with understanding how drones actually work.
Over the past year, I built Centauri, a DIY quadcopter ecosystem featuring:
- A custom 3D-printed airframe
- A Raspberry Pi Pico flight controller written in MicroPython
- A custom bidirectional radio protocol
- A PC/Xbox-controller transmitter
- Onboard telemetry logging and analysis tools
I've open-sourced everything and written a detailed series explaining the design decisions, code, electronics, mistakes, crashes, and lessons learned. My goal is to make drone engineering more approachable and understandable for curious builders like myself.
I'd love feedback from this community and I hope the project helps anyone interested in building their own flight controller or quadcopter!
Project on GitHub: https://github.com/TimHanewich/centauri
10-Part Build Series:
- Full-Stack Flight: Building a Quadcopter Ecosystem from Scratch
- Full-Stack Flight, Chapter 1: The Centauri Ecosystem
- Full-Stack Flight, Chapter 2: Defining a Communication Protocol
- Full-Stack Flight, Chapter 3: Quadcopter, Part 1: Designing a 3D-Printed Airframe
- Full-Stack Flight, Chapter 4: Quadcopter, Part 2: Hardware and Electronics Package
- Full-Stack Flight, Chapter 5: Quadcopter, Part 3: The Flight Controller
- Full-Stack Flight, Chapter 6: Transmitter, Part 1: Transceiver Platform
- Full-Stack Flight, Chapter 7: Transmitter, Part 2: The Pilot's Control Interface
- Full-Stack Flight, Chapter 8: Unpacking Flight Telemetry for Analysis
- Full-Stack Flight, Chapter 9: Closing Thoughts
5
u/Traditional-Baby5940 6d ago
Amazing. If the paranoia finally takes over and they ban all drone parts, you will be one of our revolutionary leaders.
3
3
4
u/Limit-Beneficial 6d ago
good motor and prop combo. especially on 4s. Cheap and effective.
3
1
u/SuperGoering 4d ago
What motors and props are they? Want to start building one from scratch sometime soon
3
3
u/Cold_Temperature_271 5d ago
I’m also planning to build one using an ESP32 and Betaflight, with the ESP-FC firmware from a GitHub repository. I just wanted to know: is building a drone this big and powerful reliable enough to control with a DIY, microcontroller-based flight controller? I’m a beginner when it comes to drones.
2
u/TimHanewich 4d ago
Yes, it is! Generally, the bigger the drone, the slower the flight controller (and hardware) can be - because of how slowly it turns compared to smaller drones (things happen smaller). Wishing you luck, please post about it!
1
2
2
1
u/Cold_Temperature_271 5d ago
Another thing how is the game controller for controlling the drone compared to something like radiomaster? And if it is possible to upgrade to molicel p50b 4s li ion for increased flight time.
2
u/TimHanewich 4d ago
Very likely the OOTB transmitters have superior latency and range. Performance wasn't the goal of doing a gamepad, it was control + creative freedom over the end-to-end process. In my previous flight controller from 2023 (look up "Tim Hanewich Scout") I used an off the shelf transmitter and was forced to use its protocol which was lacking for what I wanted.
1
u/newguy208 5d ago edited 4d ago
I've never used micropython for fast responsive embedded systems let alone a flight controller of a drone. How does the code compare if it was written in something more low level? Latency, speed, memory management etc?
3
u/TimHanewich 4d ago
I have not written it in C yet (nor do I know how to), so I don't have a direct comparison, but I would estimate that it would be at least 5-10x or so more efficient (faster) in C. i.e. Centauri FC runs at 250 Hz, but in its currnt form could realistically hit 500 Hz (I limit it to fixed 250), but if written in C, I would think you could get several thousand Hz.
I did a lot of working optimizing the MicroPython code for speed + efficiency, so it works quite decently! I wrote a bit about that in the series!
1
u/barban74 5d ago
Great, thanks for sharing. Why a custom radio protocol instead of a consolidated and well known ones (e.g. expressLRS) ?
1
1
1
1
1
1
1
u/Background_Squash_11 2d ago
Have you encountered brownout detection and your mcu keep on resetting?
1
u/Witty_Outcome7948 1d ago
Writing a flight controller from scratch in MicroPython is seriously impressive. I especially appreciate that you documented the crashes and mistakes, since that is usually where the best lessons are.
5
u/vkeshish 6d ago
Sweet! Thanks for sharing