4 base
= os
.path
.dirname(__file__
)
5 path
= os
.path
.dirname(base
)
6 sys
.path
.insert(0, path
)
8 sys
.stdout
= open(sys
.argv
[1], "w")
10 import liba
# type: ignore
22 num
= [6.59492796e-05, 6.54019884e-05]
23 den
= [1.0, -1.97530991, 0.97530991]
25 tf
= liba
.tf(num
, den
[1:])
26 pid_neuro
= liba
.pid_neuro().kpid(k
, kp
, ki
, kd
).wpid(wp
, wi
, wd
)
36 for i
in range(len(x
)):
37 y
= tf(pid_neuro
.inc(r
, y
))
38 print("%g,%g" % (x
[i
], y
))
40 pid_neuro
.k
= pid_neuro
.k
41 pid_neuro
.kp
= pid_neuro
.kp
42 pid_neuro
.ki
= pid_neuro
.ki
43 pid_neuro
.kd
= pid_neuro
.kd
44 pid_neuro
.wp
= pid_neuro
.wp
45 pid_neuro
.wi
= pid_neuro
.wi
46 pid_neuro
.wd
= pid_neuro
.wd
47 pid_neuro
.outmax
= pid_neuro
.outmax
48 pid_neuro
.outmin
= pid_neuro
.outmin