Dlloydev / QuickPID

A fast PID controller with multiple options. Various Integral anti-windup, Proportional, Derivative and timer control modes.
MIT License
195 stars 50 forks source link

Replaces time comparrison by SetSampleTimeUs #42

Closed SinisterRj closed 2 years ago

SinisterRj commented 2 years ago

In my opinion a better way of doing it.

Dlloydev commented 2 years ago

Hello and thanks for the pull request. An issue I see here (unless I'm missing something) would be that the output would work once only since windowStartTime is never shifted for the next window and next compute cycle. Also, might need to synchronize both. I see what you're trying to achieve ... I'll be able to do some hardware testing with this once some components I have on order arrive.

SinisterRj commented 2 years ago

Hello and thanks for the pull request. An issue I see here (unless I'm missing something) would be that the output would work once only since windowStartTime is never shifted for the next window and next compute cycle. Also, might need to synchronize both. I see what you're trying to achieve ... I'll be able to do some hardware testing with this once some components I have on order arrive.

Yes you are right, I forgot to shift the windowStartTime.