pytec: remove inputValue in init_tuner
This commit is contained in:
parent
6ea41d5cc8
commit
29b8a4a6f4
@ -56,6 +56,19 @@ 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
|
||||
@ -96,7 +109,7 @@ class PIDAutotune:
|
||||
if (self._state == PIDAutotuneState.STATE_OFF
|
||||
or self._state == PIDAutotuneState.STATE_SUCCEEDED
|
||||
or self._state == PIDAutotuneState.STATE_FAILED):
|
||||
self.init_tuner(input_val, now)
|
||||
self.init_tuner(now)
|
||||
|
||||
self._last_run_timestamp = now
|
||||
|
||||
@ -217,19 +230,6 @@ class PIDAutotune:
|
||||
return True
|
||||
return False
|
||||
|
||||
def init_tuner(self, input_value, 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 main():
|
||||
# Auto tune parameters
|
||||
|
Loading…
Reference in New Issue
Block a user