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
20 num
= [6.59492796e-05, 6.54019884e-05]
21 den
= [1.0, -1.97530991, 0.97530991]
23 tf
= liba
.tf(num
, den
[1:])
24 pid
= liba
.pid().kpid(kp
, ki
, kd
)
37 for i
in range(len(x
)):
38 y1
[i
] = tf(pid
.pos(r
, tf
.output
[0]))
44 for i
in range(len(x
)):
45 y2
[i
] = tf(pid
.inc(r
, tf
.output
[0]))
47 for i
in range(len(x
)):
48 print("%g,%g,%g,%g" % (x
[i
], r
, y1
[i
], y2
[i
]))
53 pid
.summax
= pid
.summax
54 pid
.summin
= pid
.summin
56 pid
.outmax
= pid
.outmax
57 pid
.outmin
= pid
.outmin