Skip to content

Commit 5f4c438

Browse files
committed
autotune: fix discrete-time PID polynomial
Almost no visual difference, but correct when using the substitution described in the comments
1 parent 71d6aa6 commit 5f4c438

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

autotune/pid_design.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ def gainsToNumDen(kc, ki, kd, dt):
109109
kIp = dt * kI / 2
110110
kDp = kD / dt
111111

112-
b0 = kc + kIp + kDp
113-
b1 = -kc + kIp - 2*kDp
114-
b2 = kDp
112+
b0 = kDp
113+
b1 = kc + kIp - 2*kDp
114+
b2 = -kc + kIp + kDp
115115

116116
num = [b0, b1, b2]
117117
den = [1, -1, 0]

0 commit comments

Comments
 (0)