20
20
P = c2d (ss (tf (1 , [1 , 1 ])), Ts)
21
21
22
22
# # P control
23
- C = c2d (ControlSystems. pid (kp = K ), Ts)
23
+ C = c2d (ControlSystems. pid (K, 0 ), Ts)
24
24
res = step (feedback (P* C), 3 )
25
25
res2 = lsim (P, ctrl, 3 )
26
26
@@ -31,7 +31,7 @@ res2 = lsim(P, ctrl, 3)
31
31
# # PI control
32
32
Ti = 1
33
33
pid = DiscretePID (; K, Ts, Ti)
34
- C = c2d (ControlSystems. pid (kp = K, ki = Ti, series = true , time = true ), Ts)
34
+ C = c2d (ControlSystems. pid (K, Ti ), Ts)
35
35
res = step (feedback (P* C), 3 )
36
36
res2 = lsim (P, ctrl, 3 )
37
37
@@ -79,7 +79,7 @@ ctrl = function(x,t)
79
79
u = pid (r, y)
80
80
end
81
81
82
- C = c2d (ControlSystems. pid (kp = K, ki = Ti, series = true , time = true ), Ts)
82
+ C = c2d (ControlSystems. pid (K, Ti ), Ts)
83
83
res = step (feedback (P* C), Tf)
84
84
res2 = lsim (P, ctrl, Tf)
85
85
@@ -128,7 +128,7 @@ ctrl = function(x,t)
128
128
r = 1
129
129
u = pid (r, y)
130
130
end
131
- C = c2d (ControlSystems. pid (kp = K ), Ts)
131
+ C = c2d (ControlSystems. pid (K, 0 ), Ts)
132
132
res = step (feedback (P* C), 3 )
133
133
res2 = lsim (P, ctrl, 3 )
134
134
0 commit comments