Hacker News new | ask | show | jobs
by asciimike 2224 days ago
> Another problem I've seen is people gloss over tuning a PID controller properly too.

This, a million times. My senior design project in college was building a quadcopter from scratch (including the control software)[1].

We basically built a test harness out of two poles with strings attached to the quadcopter so once we lifted it off, we could just test different PID parameters until it was stable. I think we eventually built an app to vary them in flight, which was definitely a terrible idea, and we crashed many, many quadcopters this way.

I think the answer is basically "build a simulated quadcopter with the same parameters as yours and test parameters in the simulation", but that probably would have been an equivalent senior project... IIRC, this is basically what you have to do for state-variable feedback, so it's much, much more effort than simply do what we did (especially when the cost of failure is low).

The control loop code is actually fairly straightforward [2], it was mapping what exactly the PID controller was controlling to the real world application (turning motors on and off).

[1]: https://github.com/Rose-Hulman-ROBO4xx/1314-BeagleBone-Quadc... [2]: https://github.com/Rose-Hulman-ROBO4xx/1314-BeagleBone-Quadc...