PID library

I'd given up on anyone replying to this. Thanks, both of you.