We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f4c438 commit 729f724Copy full SHA for 729f724
1 file changed
autotune/autotune.py
@@ -544,9 +544,17 @@ def updateClosedLoop(self):
544
kff = self.kff
545
Gd = ctrl.TransferFunction([1], np.append([1], np.zeros(self.sys_id_delays)), dt)
546
Gz2 = ctrl.TransferFunction(num, den, dt)
547
- (pid_num, pid_den) = gainsToNumDen(kc, ki, kd, dt)
548
- PID = ctrl.TransferFunction(pid_num, pid_den, dt)
549
- Gcl = (kff * Gd * Gz2 + PID * Gd * Gz2) / (1 + PID * Gd * Gz2)
+ Gi = ctrl.TransferFunction([ki * dt, ki * dt], [2, -2], dt)
+
+ if True:
550
+ # PI controller without zero
551
+ Gcp = ctrl.feedback(kc * Gz2, [1])
552
+ Gcl = ctrl.feedback(ctrl.series(Gi, Gcp), [1])
553
+ else:
554
+ # Standard PI controller
555
+ pi = ctrl.series(kc, ctrl.parallel([1], Gi))
556
+ Gcl = ctrl.feedback(ctrl.series(pi, Gz2), [1])
557
558
t_out,y_out = ctrl.step_response(Gcl, T=np.arange(0,1,dt))
559
self.plotClosedLoop(t_out, y_out)
560
w = np.logspace(-1, 3, 40).tolist()
0 commit comments