I found Your program and try to use it in my project. But there was found a 'bug', as a result system work incorrectly.
I suggest You to make the following changes:
PID.h
63 float lasterror; //!< Last error value for differential term
PID.c
64 float dinput = error - pid->lasterror;
73 pid->lasterror = error
I found Your program and try to use it in my project. But there was found a 'bug', as a result system work incorrectly.
I suggest You to make the following changes:
PID.h
63 float lasterror; //!< Last error value for differential termPID.c
64 float dinput = error - pid->lasterror;73 pid->lasterror = error