pytec: remove autotune reset function, autotuner can only be run once
This commit is contained in:
parent
29b8a4a6f4
commit
bfcb91d2c0
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user