PID-Feature computes with outdated temperature values #17636
Labels
enhancement
Type - Enhancement that will be worked on
fixed
Result - The work on the issue has ended
PROBLEM DESCRIPTION
A clear and concise description of what the problem is.
This problem report refers to the PID-feature implemented in xdrv_49_pid.ino.
The PID algorithm is called at the time intervals specified by the PID-command PidUpdateSecs. The temperature for the algorithm is updated by TelePeriod time slice.
If the time interval of TelePeriod is greater then the time interval from PidUpdateSecs the temperature value for the PID algorithm is outdated.
Code analysis
To run the PID algorithm, the function
is called.
The temperature for the algorithm is transmitted within the function
If the time interval of TelePeriod is greater then the time interval from PidUpdateSecs
the temperature value for the PID algorithm is outdated.
To fix the problem change:
to
by adding the line
if (Pid.run_pid_now == false) PIDShowSensor(); // set actual process value
That calls P IDShowSensor() if it wasn't triggered by PIDShowSensor() itself.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:Status 0
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:TO REPRODUCE
Steps to reproduce the behavior:
na
EXPECTED BEHAVIOUR
A clear and concise description of what you expected to happen.
The PID algorithm should not run with outdated temperature data.
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
TelePeriod 300
PidUpdateSecs 1
The picture shows a time/temperature diagram of a step function (setpoint 25 ->30 °C) after the software fix.
ADDITIONAL CONTEXT
Add any other context about the problem here.
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: