From 24006d17bf020cce869ff84bd94815ab2d1496c3 Mon Sep 17 00:00:00 2001 From: atse Date: Tue, 12 Sep 2023 17:37:20 +0800 Subject: [PATCH] Only log the autotuned params --- pytec/autotune.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pytec/autotune.py b/pytec/autotune.py index bf12432..c7d4dda 100644 --- a/pytec/autotune.py +++ b/pytec/autotune.py @@ -222,20 +222,20 @@ class PIDAutotune: # calculate ultimate gain self._Ku = 4.0 * self._outputstep / \ (self._induced_amplitude * math.pi) - print('Ku: {0}'.format(self._Ku)) + logging.debug('Ku: {0}'.format(self._Ku)) # calculate ultimate period in seconds period1 = self._peak_timestamps[3] - self._peak_timestamps[1] period2 = self._peak_timestamps[4] - self._peak_timestamps[2] self._Pu = 0.5 * (period1 + period2) / 1000.0 - print('Pu: {0}'.format(self._Pu)) + logging.debug('Pu: {0}'.format(self._Pu)) for rule in self._tuning_rules: params = self.get_pid_parameters(rule) - print('rule: {0}'.format(rule)) - print('Kp: {0}'.format(params.Kp)) - print('Ki: {0}'.format(params.Ki)) - print('Kd: {0}'.format(params.Kd)) + logging.debug('rule: {0}'.format(rule)) + logging.debug('Kp: {0}'.format(params.Kp)) + logging.debug('Ki: {0}'.format(params.Ki)) + logging.debug('Kd: {0}'.format(params.Kd)) return True return False