3 ms·
Yes, you're correct. I think you never see them in practice since MCU's are cheaper, but it is totally doable.
by wildekek 3y ago
Yes, you're correct. I think you never see them in practice since MCU's are cheaper, but it is totally doable.
- cjbgkagh 3y agoThere might be other reasons for wanting a MCU but PID controller chips are cheaper and so are the diy PID circuits. Drone PIDs are hard, and a lot of that to do with the quickly moving targets which is not the case in many (most?) scenarios PIDs are used.
- the__alchemist 3y ago> Drone PIDs are hard, and a lot of that to do with the quickly moving targets which is not the case in many (most?) scenarios PIDs are used. You can write a flyable PID in a few lines, and a full PID in a few more. Set the error term to the range-mapped input - angular rate measurement, for each axis. (Assuming you have the control inputs, gyro/acc inputs, and motor output IO setup)
- cjbgkagh 3y agoI'm talking industrial PID and other consumer goods. Drones are just one place PIDs are used, though probably the most frequent place for interaction for software engineers on HN. As for them being hard for drones... PIDs are built into the software which is easy enough to write but the drone characteristic is specific to both the configuration of the drone and the flight preference of the pilot. It can be hard to find an optimal PID setting for both, which is where it seems that most people are finding PID settings to be difficult.
- nihzm 3y agoIndeed, most modern approaces to controlling drones use other more advanced techniques that (ab)use the computational power of modern MCUs, PIDs are used only near the actuators to keep the motor torque within an optimal range or things like that. For the flight trajectory fancy drones use things like model predictive control combined with convex optimization algorithms to avoid obstacles very reliably (see for ex. [1]). [1]: https://youtu.be/mHDQcckqdg4 https://youtu.be/mHDQcckqdg4
- the__alchemist 3y agoThat video and the results are astounding. And, circling back to your point about where to use the PID: I think that perhaps we need to split things more finely: The fancy part of that video was WRT overall flight trajectory planning. (See also your obstacle avoidance descriptor). You might still use PID for the angular rate control (or not), while feeding those target rates from a higher-level algorithm that commands attitudes, flight paths etc. (Or flight path -> attitude -> angular rates etc) I went down a rabbit whole of constant angular jerk and time-to-correct targets for a while, but wasn't able to get it working. So, there are multiple layers involved for something like in the video. A properly-tuned PID works well for manual angular-rate controls, and autopilot commands that reduce down to angular-rate controls. But PID tuning can be tricky; and/or can be done automatically; or replaced with something more sophisticated.