News:

  • September 24, 2026, 01:49:31 PM

Login with username, password and session length

Author Topic: PID.Bias going above 100  (Read 13004 times)

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
PID.Bias going above 100
« 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%?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: PID.Bias going above 100
« Reply #1 on: April 17, 2019, 12:49:57 PM »
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%.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Re: PID.Bias going above 100
« Reply #2 on: April 17, 2019, 01:56:24 PM »
Okay. Maybe try disabling bias freeze would help out the situation?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: PID.Bias going above 100
« Reply #3 on: April 17, 2019, 02:02:58 PM »
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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Mike Nash

  • Hero Member
  • *****
  • Posts: 655
Re: PID.Bias going above 100
« Reply #4 on: April 17, 2019, 02:05:56 PM »
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

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: PID.Bias going above 100
« Reply #5 on: April 17, 2019, 02:31:42 PM »
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

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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Mike Nash

  • Hero Member
  • *****
  • Posts: 655
Re: PID.Bias going above 100
« Reply #6 on: April 17, 2019, 02:42:03 PM »
So add another checkbox to enable bias clamping? It does appear to have some issues as-is at least in some otherwise valid configurations.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: PID.Bias going above 100
« Reply #7 on: April 17, 2019, 03:01:20 PM »
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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: PID.Bias going above 100
« Reply #8 on: April 17, 2019, 03:53:54 PM »
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.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.