work in progress: line following working

This commit is contained in:
Thomas Gubler
2012-11-05 20:42:43 +01:00
parent 572084f357
commit 5344e89167
2 changed files with 51 additions and 24 deletions
+2 -2
View File
@@ -172,9 +172,9 @@ __EXPORT float pid_calculate(PID_t *pid, float sp, float val, float val_dot, flo
// Calculate the output. Limit output magnitude to pid->limit
float output = (pid->error_previous * pid->kp) + (i * pid->ki) + (d * pid->kd);
//if (output > pid->limit) output = pid->limit;
if (output > pid->limit) output = pid->limit;
//if (output < -pid->limit) output = -pid->limit;
if (output < -pid->limit) output = -pid->limit;
if (isfinite(output)) {
pid->last_output = output;