Skip to content

Commit 6e621db

Browse files
committed
autotune: only recompute PID based on GMVC if GMVC tak active
1 parent 24bedcd commit 6e621db

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

autotune/autotune.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,16 @@ def updateModel(self):
567567
def computeController(self):
568568
if not self.is_system_identified:
569569
return
570-
sigma = self.rise_time # rise time
571-
delta = self.damping_index # damping property, set between 0 and 2 (1 for Butterworth)
572-
lbda = self.detune_coeff
573-
(self.kc, self.ki, self.kd) = computePidGmvc(self.num, self.den, self.dt, sigma, delta, lbda)
574-
#TODO:find a better solution
575-
self.ki /= 5.0
576-
static_gain = sum(self.num) / sum(self.den)
577-
self.kff = max(1 / static_gain, 0.0)
570+
571+
if self.tuning_tabs.tabText(self.tuning_tabs.currentIndex()) == "GMVC":
572+
sigma = self.rise_time # rise time
573+
delta = self.damping_index # damping property, set between 0 and 2 (1 for Butterworth)
574+
lbda = self.detune_coeff
575+
(self.kc, self.ki, self.kd) = computePidGmvc(self.num, self.den, self.dt, sigma, delta, lbda)
576+
#TODO:find a better solution
577+
self.ki /= 5.0
578+
static_gain = sum(self.num) / sum(self.den)
579+
self.kff = max(1 / static_gain, 0.0)
578580

579581
self.updateKIDSliders()
580582
self.updateClosedLoop()

0 commit comments

Comments
 (0)