mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
[pid] Fix inverted debug log conditions and broken smoothing formula (#15240)
This commit is contained in:
@@ -101,10 +101,10 @@ PIDAutotuner::PIDAutotuneResult PIDAutotuner::update(float setpoint, float proce
|
||||
if (!zc_symmetrical || !amplitude_convergent) {
|
||||
// The frequency/amplitude is not fully accurate yet, try to wait
|
||||
// until the fault clears, or terminate after a while anyway
|
||||
if (zc_symmetrical) {
|
||||
if (!zc_symmetrical) {
|
||||
ESP_LOGVV(TAG, "%s: ZC is not symmetrical", this->id_.c_str());
|
||||
}
|
||||
if (amplitude_convergent) {
|
||||
if (!amplitude_convergent) {
|
||||
ESP_LOGVV(TAG, "%s: Amplitude is not convergent", this->id_.c_str());
|
||||
}
|
||||
uint32_t phase = this->relay_function_.phase_count;
|
||||
|
||||
@@ -59,7 +59,7 @@ class PIDSimulator : public PollingComponent, public output::FloatOutput {
|
||||
delayed_temps.erase(delayed_temps.begin());
|
||||
float prev_temp = this->delayed_temps[0];
|
||||
float alpha = 0.1f;
|
||||
float ret = (1 - alpha) * prev_temp + alpha * prev_temp;
|
||||
float ret = (1 - alpha) * prev_temp + alpha * temperature;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user