pietervdb said:
Input: wanted (theoretical calculated) 50%, feedback from loadcell (calculated) 47%
Output: PID output value, for example, is 3%. Speed given to drive 53%.
Feedback from loadcell gets better because the drive increases his speed. Calculated feedback from loadcell is now 51%. PID reacts and output value from the PID is now -1%. Speed given to drive is 49%.
Feedback from loadcell is getting worse because the drive decreases his speed. calculated feedback from loadcell is now 45%. PID reacts and output value from the PID is now +5%. Speed given to drive is now 55%.
And so on.
When we miscalulate the theoretical speed, the result is even worse.
It shouldn't be....We'll take the case of no bias for now.
Input: Wanted 50% (theoretical)
Actual Measured: 50%
PID Output: 0%
Drive Output: 50%
Input: Wanted 50% (theoretical)
Actual Measured: 47%
PID Output: 3% (Actually could be anything, and I think this is where your misunderstanding of PIDs lies).
Drive Output: 53% (adding the 3% to your 50%)
Now, the total output to the drive is 53% and the error is 0%.
Input Wanted 50%
Actual Measured: 50%
PID Output: 3%!!! It stays at 3% because it has driven the error to 0. It DOES NOT go back to 0%.
Drive Ouput: STILL 53%
What you are describing is a linear offset, NOT A PID.
Now, the case W/ Bias.
Input: Wanted 50%
Actual Measured 50%
Bias: 50%
PID Error Calc: 0%
PID Ouput (w/ Bias): 50%
Drive Speed: 50%
Input: Wanted 50%
Actual Measured: 47%
Bias: 50%
PID Error Calc: Whatever it takes to get the error to 0, but we'll assume 3% for consitency.
PID Error Calc: 3%
PID Output (w/ Bias): 53%
Drive Speed: 53%
Input: Wanted 50%
Actual Measured: 50%
Bias 50%
PID Error Calc: STILL 3% (the KP and Ki are no longer changing the last equation as the error is ZERO)
PID Output (w/ Bias): 53%
Drive Speed: STILL 53%
Now, you change the setpoint.
Input: Wanted 60%
Actual Measured: Should jump to 60% or so if linear
Bias:
60%
PID Error Calc: STILL 3%
PID Output (w/ Bias): 63%
Drive Speed: 63%
If you do understand the PID operation (I re-read your post, and can't determine one way or another), then the over/under shoot is a matter of tuning and inherent in any PID operation.