Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: ryanastiefes on April 17, 2019, 12:26:59 PM
-
I have a pid struct setup and all is well until pid.output is at 100% for long periods of time, say four or five hours. When PV goes above SP pid.output should start decreasing but is will stay at 100% no matter what the error is. When I look at the pid structure I notice that bias is 102.5%, if I decrese that to under 100% the PID.output will start decreasing.
Attatched is my PID setup.
Is the output not decreasing because the PID.bias is above 100%?
-
The P term is Output = Error*Gain + Bias. Output is clamped at 100%. If Bias Freeze is enabled, the loop doesn't integrate Bias once the Output is at the rails. With a small Error*Gain, a Bias > 100, and Bias Freeze enabled, I think it could hang at 100%.
-
Okay. Maybe try disabling bias freeze would help out the situation?
-
Okay. Maybe try disabling bias freeze would help out the situation?
The key point is that as long as Error*Gain+Bias is > 100 it won't integrate negative Bias, and will stay at 100% until Error*Gain is greater than Bias-100. If you clamped Bias at 100, then any negative Error should allow it to come back.
-
I was seeing some odd behavior back in December 2017 due to the bias getting out of the 0-100% range. I don't know if it is related or ever got addressed, but clamping bias to 0-100% outside of the PID instruction worked around the issue.
https://forum.hosteng.com/index.php?topic=2189.0 (https://forum.hosteng.com/index.php?topic=2189.0)
-
I was seeing some odd behavior back in December 2017 due to the bias getting out of the 0-100% range. I don't know if it is related or ever got addressed, but clamping bias to 0-100% outside of the PID instruction worked around the issue.
https://forum.hosteng.com/index.php?topic=2189.0 (https://forum.hosteng.com/index.php?topic=2189.0)
I could probably be talked into clamping the Bias at 100 when Bias freeze is enabled, but I have some concern as to possible negative affects of changing it.
-
So add another checkbox to enable bias clamping? It does appear to have some issues as-is at least in some otherwise valid configurations.
-
So add another checkbox to enable bias clamping? It does appear to have some issues as-is at least in some otherwise valid configurations.
I would need to see if there is a spare bit in the config word, but if so, this is easy.
-
When I write my own loop, I don't even allow Bias to wind all the way to the rails (so in some edge cases you can't eliminate all error because you need some P to get to the right CV). I typically limit bias to maybe 5% off the min/max.