I have spent a few decades implementing the PID control algorithm, as well as more advanced techniques. Some information can be found at:
www.jashaw.com/pid
Some information is there for free, I have more in a downloadable book and a downloadable Excel based simulation, both for a small...