How do you diagnose a PID controller that seems to work perfectly for a few minutes, then decays?
I've tuned a PID controller using the Ziegler–Nichols method. I found my Ku of -1 and Tu of 1.142. I then plugged these values into the classic ZN PID formula. My process variable is a target speed, and within seconds of starting it, the controller maintains this speed perfectly. However, I log the errors for each component, and after a few minutes, the integral error slowly builds. When it reaches around 7, after about 15 minutes of running, then the controller quickly decays, and the velocity drops to zero.
I've tried adjusting my Ku and Tu, and re-running through ZN, but the same thing happens. I'm not sure what I'm doing wrong, especially since it runs virtually perfect at the start. It has almost no over or undershoot, but yet the integral errors builds up. Is this a rounding error? Should I reset this periodically or would that be a hack? What might I be doing wrong?