You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would (imo) be better to just keep the error sum as is (not resetting and not adding new error)
Example:
green is the I-term and yellow-dotted the output - which should be driven to its upper bound - but the I-term keeps resetting and thus oscilliating.
After the red line i made this code change:
// Figure out what we're doing with the error.
if (minOutput != maxOutput && !bounded(output, minOutput, maxOutput)) {
// NOP
// keep the error sum as is to ensures a smooth transition when the P term
// decreases enough for the I term to start acting upon the controller
// From that point the I term will build up as would be expected
} else if (outputRampRate != 0 && !bounded(output, lastOutput - outputRampRate, lastOutput + outputRampRate)) {
errorSum = error;
} else if (maxIOutput != 0) {
errorSum = constrain(errorSum + error, -maxError, maxError);
// In addition to output limiting directly, we also want to prevent I term
// buildup, so restrict the error directly
} else {
errorSum += error;
}
The text was updated successfully, but these errors were encountered:
At line https://github.com/tekdemo/MiniPID-Java/blob/master/src/com/stormbots/MiniPID.java#L304 you reset the error sum, if the output reaches a limit - but if the output reached the limit because of the I-term going (correctly) towards the limit, then this causes oscillations.
It would (imo) be better to just keep the error sum as is (not resetting and not adding new error)
Example:
green is the I-term and yellow-dotted the output - which should be driven to its upper bound - but the I-term keeps resetting and thus oscilliating.
After the red line i made this code change:
The text was updated successfully, but these errors were encountered: