pid_calibrate: Update for improved python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
9406baf40b
commit
5cce7f4d55
|
@ -130,7 +130,7 @@ class ControlAutoTune:
|
||||||
def calc_final_pid(self):
|
def calc_final_pid(self):
|
||||||
cycle_times = [(self.peaks[pos][1] - self.peaks[pos-2][1], pos)
|
cycle_times = [(self.peaks[pos][1] - self.peaks[pos-2][1], pos)
|
||||||
for pos in range(4, len(self.peaks))]
|
for pos in range(4, len(self.peaks))]
|
||||||
midpoint_pos = sorted(cycle_times)[len(cycle_times)/2][1]
|
midpoint_pos = sorted(cycle_times)[len(cycle_times)//2][1]
|
||||||
return self.calc_pid(midpoint_pos)
|
return self.calc_pid(midpoint_pos)
|
||||||
# Offline analysis helper
|
# Offline analysis helper
|
||||||
def write_file(self, filename):
|
def write_file(self, filename):
|
||||||
|
|
Loading…
Reference in New Issue