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
I control a heater voltage based on a temperature reading.
The temperature reading may be NaN if there is a communication issue or if the communication is initialized.
I can off course check for that and only call pid if it is not NaN but it may be good to have a general solution for what happens in this case.
In my case it caused the Integral value to be NaN as well and it did not recover from that.
It was returning NaN which caused the heater to run at full power.
Suggestions:
If the input is NaN it should be ignored and not affect the values of the components.
If the input is NaN a warning should be printed independent of the return value.
pid should never return NaN as this can have unpredictable consequences.
What should be returned when the input is NaN I am not sure. Maybe the minimum allowed value or an additionally defined "save/neutral output value".
The text was updated successfully, but these errors were encountered:
I control a heater voltage based on a temperature reading.
The temperature reading may be NaN if there is a communication issue or if the communication is initialized.
I can off course check for that and only call pid if it is not NaN but it may be good to have a general solution for what happens in this case.
In my case it caused the Integral value to be NaN as well and it did not recover from that.
It was returning NaN which caused the heater to run at full power.
Suggestions:
The text was updated successfully, but these errors were encountered: