pi: use sample weight.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2015-03-26 16:32:17 +01:00 committed by Richard Cochran
parent 5d6c3433f7
commit 32689328f1
1 changed files with 2 additions and 2 deletions

4
pi.c
View File

@ -137,8 +137,8 @@ static double pi_sample(struct servo *servo,
break;
}
ki_term = s->ki * offset;
ppb = s->kp * offset + s->drift + ki_term;
ki_term = s->ki * offset * weight;
ppb = s->kp * offset * weight + s->drift + ki_term;
if (ppb < -servo->max_frequency) {
ppb = -servo->max_frequency;
} else if (ppb > servo->max_frequency) {