My first use of the Arduino PID.

The entire program is 3000 lines long.

That is the problem. Or large part of the problem.