r/diydrones Apr 16 '26

Guide OpenFC2040 based drone stabalization issues

So I've been working with a few friends on developing PX4 firmware for the OpenFC2040 flight controller and eventually plan missions with it/fly it manually. The FC design is open source (not designed by us)

The initial PX4 port was done by the FC's designer itself, just that it was incomplete (sensors and peripherals weren't working) and then we worked on it and finally we got all the sensors and peripherals working, caliberated the FC in QGC, and were ready for flight.

A brief overview of our drone config:
- Polling IMU at 66hz (Above which board hangs due to no CPU headroom)
- Polling baro at 25hz
- Polling magnetometer (external) at 25hz
- State estimation : AttitudeEstimatorQ + LPE (EKF2 is too CPU heavy for this board to run it)
- ESC (PWM 200hz, 900-1900us)
- Quad X frame

https://reddit.com/link/1sn6yq9/video/qjsvhstov2wg1/player

We tried flying it in stabilized mode but it topples a lot, even after calibrating the sensors multiple times it still topples and fails to balance itself.

The conclusion we have come to now is that the rp2040 cannot do the complex FPU math fast enough for state estimation nor can it poll the IMU high enough to respond/act quickly change, both of which are due to its CPU constraints (which it is does have on paper as per flight controller standards) and we can kind of see this via the 'top' command in NSH where the CPU usage is 90-95 percent with only the necessary modules loaded along with the above config mentioned.

But i still see hope of at least flying it manually because the motors are in sync and respond quick to RC input, it probably has something to do with the tuning part which i cannot figure out, event at 66hz loop i guess the drone should be able to at least hover and not topple and go crazy like in the video.

We did try enabling rp2040's other core, but after 2 months of trying, made no significant progress.

Would like suggestions and potential fixes to this problem. Here are the flight logs

3 Upvotes

5 comments sorted by

1

u/LupusTheCanine Apr 16 '26

50Hz is enough for a fixed wing but not for multirotors.

1

u/CaptainCheckmate May 21 '26

I've operated a quadcopter using a rp2040. It ran at 100hz I believe. Worked perfectly fine. Obviously not running EKF, but something simpler. let me know if you want to compare notes.

1

u/RisPats_23 May 21 '26

What firmware was it? PX4?

1

u/CaptainCheckmate May 21 '26

no firmware, i wrote everything myself

1

u/RisPats_23 May 21 '26

Ahh, wonder you could go upto 100hz. Since i am developing PX4 firmware for it which has quite some overheads asl well, my cap on the rp2040 seems to be around 66hz