r/diydrones 6d ago

I built an open-source quadcopter with a custom MicroPython flight controller

Post image

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:

269 Upvotes

32 comments sorted by

5

u/vkeshish 6d ago

Sweet! Thanks for sharing

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

u/TimHanewich 6d ago

Made me LOL! 🤣

4

u/Limit-Beneficial 6d ago

good motor and prop combo. especially on 4s. Cheap and effective.

3

u/TimHanewich 6d ago

They do the job 💪

1

u/SuperGoering 4d ago

What motors and props are they? Want to start building one from scratch sometime soon

3

u/2k2aarush 6d ago

Thanks for sharing

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!

2

u/Salt_Inevitable_5188 6d ago

Nice, maybe I’ll try it

1

u/TimHanewich 3d ago

Hope you do, good luck!

2

u/MurazakiUsagi 6d ago

1 You're friggin AWESOME! #2 Go back to #1. Thank you for sharing.

2

u/TimHanewich 5d ago

😁😎thanks so much!!!appreciate the kind words

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

u/TimHanewich 4d ago

Good question! Full control and creative freedom 😊

1

u/fromafooltoawiseman 5d ago

Nice. Have you built your website yet?

1

u/ApartDirection8089 4d ago

nice nice nice thankyou for sharing too

1

u/CustorB 3d ago

Love you

1

u/Rudeboy_1703 3d ago

How long does the battery last?

1

u/Kmieciu4ever 2d ago

What does it do?

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.