From bfcb91d2c043989c1595058102aca0020fc56686 Mon Sep 17 00:00:00 2001 From: topquark12 Date: Wed, 6 Jan 2021 09:43:10 +0800 Subject: [PATCH] pytec: remove autotune reset function, autotuner can only be run once --- pytec/autotune.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pytec/autotune.py b/pytec/autotune.py index de51347..b8b8b3d 100644 --- a/pytec/autotune.py +++ b/pytec/autotune.py @@ -56,19 +56,6 @@ class PIDAutotune: self._Ku = 0 self._Pu = 0 - def init_tuner(self, timestamp): - self._peak_type = 0 - self._peak_count = 0 - self._output = 0 - self._initial_output = 0 - self._Ku = 0 - self._Pu = 0 - self._inputs.clear() - self._peaks.clear() - self._peak_timestamps.clear() - self._peak_timestamps.append(timestamp) - self._state = PIDAutotuneState.STATE_RELAY_STEP_UP - def state(self): """Get the current state.""" return self._state @@ -109,7 +96,7 @@ class PIDAutotune: if (self._state == PIDAutotuneState.STATE_OFF or self._state == PIDAutotuneState.STATE_SUCCEEDED or self._state == PIDAutotuneState.STATE_FAILED): - self.init_tuner(now) + self._state = PIDAutotuneState.STATE_RELAY_STEP_UP self._last_run_timestamp = now