Tuning the PID Library

The point is, sometimes you just have to go with what works. :wink:

Absolutely, the trick is knowing when to throw in the towel on a pid-only solution. It sounds like that's exactly what you did Coding Badly.

On several occasions I have gone to a customer site to fix a poorly performing PID loop and found a long set of pid overrides (Do this on startup BUT not if this, and also THIS, etc.) On most of those I was able to replace the entire thing with a more simple strategy as I suggested above.

But yeah, ultimately the goal is to make it work. Since generally the hobbyist is the only one who needs to really understand what's going on in the code, a little extra complexity is fine. If you're going to share your code it might take a while to explain all the conditionals and why you chose the values that you did.

In general I try to keep things as elegant and simple as possible, as I've learned that minimizes future "why the heck is it doing THAT?!" moments.