The best way (tm :-) to tune PIDs is by looking at the open loop response of the system. This isn't terribly hard to measure in a live system but unfortunately very few PID implementations actually support this. You can do this with some commercial controllers. Once you do that (and assuming a close to linear system) you can see your stability margin and actually see the impact of changing the loop parameters on those. ( http://www.mathworks.com/help/slcontrol/ug/open-loop-respons... ) Without this it is very difficult to figure out the limiting factor.
A lot of systems need additional filters over the PID. Expensive commercial motion controllers implement those in their control loops. Without those additional filters the performance you can get using PID in those systems will be very limited.
Lastly feed-forward can really help closed loop systems. The closer you can get the system to follow your command using feed-forward the less your closed loop controller needs to deal with. The simplest example is acceleration feed-forward in motion control.
I started reading the O'Reilly book "Feedback Control for Computer Systems" by Philipp K. Janert about applying feedback control to software systems, and I liked what I read so far a lot: http://shop.oreilly.com/product/0636920028970.do
PID is in there, along with lots of other techniques.
I think this is a good introduction to PID for people who don't want to have to dive into the nitty gritty. Linear feedback controls is a complex but complete theory and it would take at least a semester at a university to understand the theory behind time and frequency domain design and the effects of discretization.
The ideas of PID theory are really useful in a lot of operational/automation contexts.
For example, if your business is using any sort of machine learning model to govern a process, and you have some sort of idea of how you want this process to run throughout the day, you can build a PID system to change the model thresholds automatically to govern that plan.
An example might be any sort of retention/marketing strategy where you want to reach out to customers based on some factors X, and have a certain quota/capacity to do so during a day, and the expected number of customers with the best factors X can change throughout the day/week or is just erratic.
You're using it every time you buy airline tickets. The vast majority of Dynamic Pricing algorithms are just PID algorithms that are designed to maintain sales rates such that the last ticket is sold at flight time.
Last Fall my roommate was taking a class on computer networks, he ended up inventing PID as a flow-control algorithm, though he didn't know to call it PID.
Oddly enough I too unknowingly implemented a PID controller without prior exposure to the theory. I was trying to make a stable hovering platform using only thrusters in Garry's Mod. I remember once I tweaked the parameters just right it was amazingly responsive and stable. I only realized what I had actually done years later.
Imagine a currency that supports the creation of 'K' units of currency upon the presentation of any form of wealth with a market-determined price, and then uses a PID loop to automatically adjusts 'K' to guarantee no inflation or deflation.
Perhaps a path toward the removal of "Usury" as the foundation of the monetary system?
Experimenting with these concepts required a robust Python PID loop implementation, which was (surprisingly) difficult to find. A useful Python PID implementation is available in ownercredit.pid (get it with: pip install ownercredit).
The best way (tm :-) to tune PIDs is by looking at the open loop response of the system. This isn't terribly hard to measure in a live system but unfortunately very few PID implementations actually support this. You can do this with some commercial controllers. Once you do that (and assuming a close to linear system) you can see your stability margin and actually see the impact of changing the loop parameters on those. ( http://www.mathworks.com/help/slcontrol/ug/open-loop-respons... ) Without this it is very difficult to figure out the limiting factor.
A lot of systems need additional filters over the PID. Expensive commercial motion controllers implement those in their control loops. Without those additional filters the performance you can get using PID in those systems will be very limited.
Lastly feed-forward can really help closed loop systems. The closer you can get the system to follow your command using feed-forward the less your closed loop controller needs to deal with. The simplest example is acceleration feed-forward in motion control.