mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-18 20:23:27 +02:00
Fix PIDController::in_deadband() to give correct result when error is zero (#5078)
This commit is contained in:
@@ -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_() {
|
||||
|
||||
Reference in New Issue
Block a user