Looking for general PID code for the Arduino

I'm looking for the code for a general PID (proportional, integral, differential) control algorithm for the Arduino. Anyone know of any?

Thank you.

http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=pid&domains=http%3A%2F%2Farduino.cc%2Fplayground&sitesearch=http%3A%2F%2Farduino.cc%2Fplayground

http://www.arduino.cc/playground/Code/PIDLibrary
http://www.arduino.cc/playground/Code/PIDLibraryAdvancedMethods
http://www.arduino.cc/playground/Main/BarebonesPIDForEspresso

http://arduino.cc/forum/index.php/topic,7019.0.html
http://arduino.cc/forum/index.php/topic,6998.0.html

Thank you.

I see I have been "smitten" using the new forum function. Well deserved, I guess, for not having found the PID library myself. My only excuse is that I have not visited this forum for a few weeks, and was surprised to find the new look. Plus I think I typed PDI in the search box by mistake.

But the links Coding Badly posted helped. There is a full and expertly written PID library that seems to get good reviews. But for me, the PID library requires more knowledge than I had. I wanted to understand what was being done, and why. That was a little hard to do from that code. (I don't mean to criticize the PID library by saying this.)

These two things helped me more:

http://www.eetimes.com/ContentEETimes/Documents/Embedded.com/2000/f-wescot.pdf This article "PID Without a PhD" goes into the theory behind PID and gives sample code.

http://www.atmel.com/dyn/products/app_notes.asp?family_id=607 You need to scroll down to Atmel Application Note 221 "Discrete PID controller on tinyAVR and megaAVR devices". Then you can find download links for a pdf file with notes and a software file with sample code.

With these two resources, I was quickly able to write a simple PID program that meets my needs. And that I know how to tune and work with.

Others with more demanding applications may find the PID library more helpful.