2 from __future__
import print_function
5 path
= os
.path
.dirname(__file__
)
6 path
= os
.path
.dirname(path
)
7 sys
.path
.insert(0, path
)
9 sys
.stdout
= open(sys
.argv
[1], "w")
11 import liba
# type: ignore
21 num
= [6.59492796e-05, 6.54019884e-05]
22 den
= [1.0, -1.97530991, 0.97530991]
24 tf
= liba
.tf(num
, den
[1:])
25 pid
= liba
.pid().set_kpid(kp
, ki
, kd
)
38 for i
in range(len(x
)):
39 y1
[i
] = tf(pid
.pos(r
, tf
.output
[0]))
45 for i
in range(len(x
)):
46 y2
[i
] = tf(pid
.inc(r
, tf
.output
[0]))
48 for i
in range(len(x
)):
49 print("%g,%g,%g,%g" % (x
[i
], r
, y1
[i
], y2
[i
]))
54 pid
.summax
= pid
.summax
55 pid
.summin
= pid
.summin
57 pid
.outmax
= pid
.outmax
58 pid
.outmin
= pid
.outmin