Skip to content

Commit b3ed55b

Browse files
committed
autotune: add correct delay in model used for step response
1 parent d643084 commit b3ed55b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

autotune/autotune.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,11 @@ def updateClosedLoop(self):
514514
kc = self.kc
515515
ki = self.ki
516516
kd = self.kd
517+
Gd = ctrl.TransferFunction([1], np.append([1], np.zeros(self.sys_id_delays)), dt)
517518
Gz2 = ctrl.TransferFunction(num, den, dt)
518519
(pid_num, pid_den) = gainsToNumDen(kc, ki, kd, dt)
519520
PID = ctrl.TransferFunction(pid_num, pid_den, dt)
520-
Gcl = ctrl.feedback(PID * Gz2, 1)
521+
Gcl = ctrl.feedback(PID * Gd * Gz2, 1)
521522
t_out,y_out = ctrl.step_response(Gcl, T=np.arange(0,1,dt))
522523
self.plotClosedLoop(t_out, y_out)
523524
w = np.logspace(-1, 3, 40).tolist()

0 commit comments

Comments
 (0)