mirror of
https://github.com/esphome/esphome.git
synced 2024-12-25 23:14:54 +01:00
Fix PIDController::in_deadband() to give correct result when error is zero (#5078)
This commit is contained in:
parent
a539197bc4
commit
9344d85414
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ float PIDController::update(float setpoint, float process_value) {
|
|||
bool PIDController::in_deadband() {
|
||||
// return (fabs(error) < deadband_threshold);
|
||||
float err = -error_;
|
||||
return ((err > 0 && err < threshold_high_) || (err < 0 && err > threshold_low_));
|
||||
return (threshold_low_ < err && err < threshold_high_);
|
||||
}
|
||||
|
||||
void PIDController::calculate_proportional_term_() {
|
||||
|
|
Loading…
Reference in a new issue