I'd be happy to put together pseudo-code because the source code is proprietary. The most difficult part of the project was putting together the hardware from scrap and Home Depot parts with minimal tools and space. The 2nd most difficult part was quelling the IR range sensor noise. Programming the PID controller was not too difficult. Tuning Kp, Ki & Kd was difficult, but you see the immediate effects once you download your code and run the bot. Here's some pseudo-code:
main
let t = current time
let x = IR range sensor distance
let s = setpoint distance
let ilim = Integral-control limiter
error = s - x
vel = x/(t-told)
P = Kp * error
I = I + Ki * error * t
D = Kd * vel
if I>ilim, then reset I=ilim or zero or other
K = P + I + D
motor_throttle(K)
told = t
end main