This part confuses me. There will always be some SP-PV error when switching back to auto, so I thought the whole point of bumpless transfer was to back-calculate the integral value to the exact amount to offset the proportional action. Why would there be any proportional action left if this was done properly?
This is an important question, and I will try to answer using some theory and a couple examples.
The theory part goes to the "positional" form of the PID equation in the Allen-Bradley PID instruction. (This does not apply to the PIDE instruction which implements the "velocity" form.) At each scan of the PID, it conceptually computes the controller output in Auto mode as follows:
Error = Set Point - Process Variable
Output = P-Gain * Error + I-Gain * Acc. Error + D-Gain * Error ROC + Bias
Acc. Error is accumulated error since the loop went to Auto.
ROC is error Rate-of-Change.
This is the "independent" gain form, and leaves out some details not directly relevant to this discussion. I will just add that "positional/velocity" form and "independent/dependent(ISA)" form are separate topics, creating four different expressions: PID-Ind, PID-Dep, PIDE-Ind, PIDE-Dep.
For the following examples consider a temperature control application, such as an oven, where increasing the controller output adds heat and raises the measured temperature. The target, Set Point, temperature is 100 degrees.
Example #1: The loop is in manual and the operator adjusts the heater to get the oven temperature right at 100 degrees before switching the loop to auto. Let's say this manual adjustment is 70%. If there is
no "bumpless" compensation, the initial PID output is conceptually computed as:
Error = Set Point - Process Variable = 100 - 100 = 0
Output = P-Gain * 0 + I-Gain * 0 + D-Gain * 0 + Bias = Bias
If there is no Bias, the output suddenly goes from 70% to zero because there is no error, acc. error, or error ROC. The oven will then start to cool, which causing the output to increase. Eventually the output will work its way back to where the operator maually adjusted it, 70%, assuming no process disturbance during the recovery and stable tuning. However, there will be a temperature "bump" due to the output going to zero.
Fix #1: Make all manual output adjustments through the PID instruction so it "knows" the heater setting when the loop goes from manual to auto. Use this knowledge to start out in auto at this output, and avoid the temperature "bump" caused by the output going to zero and then working its way back to the starting point. The AB PID instruction does this by calculating an accumulated error to make the integral contribution equal to the output at the manual-to-auto transition. (If I-Gain is zero, it will use the Bias value if enabled.) Using the 70% manual output, zero Error, and zero Bias:
Error = Set Point - Process Variable = 100 - 100 = 0
Output = P-Gain * 0 + I-Gain * (70/I-Gain) + D-Gain * 0 + 0 = 70
In this situation, the output stays at 70% after the careful manual adjustment, and there is no "bump."
Example #2: The loop is in manual and the operator adjusts the heater using the loop's Set Output, but only gets to 90 degrees before switching the loop to auto. Let's say this manual adjustment is 65%. With "bumpless" compensation, the initial PID output is conceptually computed as:
Error = Set Point - Process Variable = 100 - 90 = 10
Output = P-Gain * 10 + I-Gain * [(65/I-Gain) + 10] + D-Gain * 0 + 0 = P*10 + 65 + I*10
(Note: For AB-PID, this example assumes an engineering unit scaling of 0 to 100 degrees = 0 to 100 percent full scale. Important, but not to this discussion.)
So the output will start with the 65% from the manual starting point plus some additional action because of the non-zero error going into the P and I terms. This control action will continue to increase ("bump") the output from its starting point (65%) until the error goes to zero.
Fix #2: Force the error to zero at the manual-to-auto transition. This can be done with an AB-PID feature called Process Variable Tracking (PVT), which moves the Process Variable value into the Set Point at every loop update while in manual. It is also possible to do this with a one-time move in logic when triggering the manual-to-auto transition.
However, this "fix" may change the Set Point to something other than the desired target. In the case of Example #2, the Set Point becomes 90 degrees instead of the desired 100 degrees. It would then be necessary to increase the Set Point to 100, thus increasing the output. So, with this fix there will eventually be a "bump" unless the output is carefully adjusted in manual to have zero error, as was the case with Example #1.
PVT is most useful when the loop set point is allowed to float, such as with the inner loop of a cascade arrangement.
This explanation got a bit longer than expected. Hopefully the examples help to understand the PID behavior at the manual-to-auto transition.