My PID integral part fixes

This commit is contained in:
Julian Oes
2012-12-19 17:54:18 -08:00
parent 28b3ecd9c6
commit 06407b166f
4 changed files with 33 additions and 27 deletions
+6
View File
@@ -183,3 +183,9 @@ __EXPORT float pid_calculate(PID_t *pid, float sp, float val, float val_dot, flo
return pid->last_output;
}
__EXPORT void pid_reset_integral(PID_t *pid)
{
pid->integral = 0;
}
+1
View File
@@ -72,6 +72,7 @@ __EXPORT int pid_set_parameters(PID_t *pid, float kp, float ki, float kd, float
//void pid_set(PID_t *pid, float sp);
__EXPORT float pid_calculate(PID_t *pid, float sp, float val, float val_dot, float dt);
__EXPORT void pid_reset_integral(PID_t *pid);
#endif /* PID_H_ */