Derivative-on-error not calculated correctly
tarenergy opened this issue · 2 comments
in QuickPID::compute():
peTerm = kpe * error;
....
deTerm = kde * error;
This is two times calculating a proportional term, just with different coefficients
Should be:
deTerm= kde*(error-lasterror)
Thank you for pointing this out and I agree with your deTerm calculation. By default, QuickPID uses derivative on measurement (DOn=0) which is the same as Arduino PID_v1, which has no issue, so for now I suggest leaving DOn at its default setting.
Presently, I'm working on a major update (starting with AutoTune) and this will also include an update to compute. With the derivative terms, I'll be referring to this when doing some testing.
Published a new release (Quickpid 2.4.10) with the fix and updated documentation.