pid-controller-server
pid-controller-server copied to clipboard
Incorrect implementation of differential error calculation
Hi @ussserrr Thanks for sharing this neat library! I use it to control the temperature in an chamber I use for smoking meat. Now while implementing, I looked at your code and I think the calculation of the D error is not done correctly.
You are currently calculating the difference between the input and the last_input. But I think it should be the difference between the Perr and the last Perr. Because we want the D portion to react fast to jumps in the error value.
Do you agree?
Hello! There are many variations of PID algos and implementations, each of them is tweaking some parameter to better suite some specific cases and show better performance on different machines. I believe you're talking about one of these formulas there. Anyway, it was some kind of student project for me long time ago already and I don't really recall such small quirks anymore :)