mirror of
https://github.com/esphome/esphome.git
synced 2024-11-29 02:04:13 +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() {
|
bool PIDController::in_deadband() {
|
||||||
// return (fabs(error) < deadband_threshold);
|
// return (fabs(error) < deadband_threshold);
|
||||||
float err = -error_;
|
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_() {
|
void PIDController::calculate_proportional_term_() {
|
||||||
|
|
Loading…
Reference in a new issue