Closed
Description
Hi martin,
i'm using a similar PID implementation on a raspberry pi in a production environement (PID code is also based Brett Beauregard's code at ).
Turns out that both time.time()
and datetime.datetime.now()
are non-monotonic time signals. I.e. if a system service or the user turns the time back, the PID will see negative time differences. This happens on many systems (in particular the raspberry pi) regularly which has given me rare, but quite erratic behavior of the machine.
Fixed the problem using time.monotonic()
which is available since python 3.3. Maybe this is helpful to your code too.
Best,
Deniz
Activity