This paper has been one of my favorites to recommend when it comes to PID. While it's written for an embedded micro controller system in C the principles are the same and you should be able to gain some deeper understanding from it.
http://www.eetimes.com/design/embedd...-without-a-PhD
The full article PID without a PhD was published in the October 2000 issue of Embedded Systems Programming magazine. It is written to provide the embedded software engineer with a simple design method for writing a PID controller in software, without requiring any formal knowledge of control theory.