Closed glucenag closed 4 years ago
Any ideas anyone ? Struggling with this ...
Hello,
First off, sorry for the slow response.
The library does not officially support passing an array as input to the PID. The library deliberately has no dependencies (such as numpy) to keep it light and simple. The fact that it worked at all in some cases was just a happy accident I'm afraid.
You should be able to get around this pretty easily though. If I understand you correctly, you want your output (cv
) to be an array containing one value for each value in pv
, right? If so, you could use
cv = np.array([pid(x) for x in pv])
or something similar depending on what you want exactly.
That said, I might look into what it would take to support taking arrays as input if I have time sometime. It might be possible to implement support without actually requiring numpy to be installed.
Hey there. No worries. I implemented it like you suggested. Easy workaround. Thanks for answering!
Glad I could help!
Hey there,
I'd like to call pid on a (2,) numpy array (say), as in:
This works fine UNLESS I set
pid.output_limits = (-10, 10)
which itself works fine when pid is called on singletons. Otherwise I get the error:
Any hints ?
Thanks !
Gustavo