Derivative calculation was wrong all along

This commit is contained in:
topquark12 2020-12-29 17:00:48 +08:00
parent 8c9e12587f
commit d4513e56d2
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ impl Controller {
None =>
0.0,
Some(last_input) =>
f64::from(self.parameters.kd) * (input - last_input) / time_delta,
f64::from(self.parameters.kd) * (last_input - input) / time_delta,
};
self.last_input = Some(input);