changes to error calculation, polarity of kP and kI will be flipped

This commit is contained in:
topquark12 2020-12-26 11:06:52 +08:00
parent 50a1b9f52d
commit 3afe34b95f
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ impl Controller {
let time_delta = time_delta.get::<second>(); let time_delta = time_delta.get::<second>();
// error // error
let error = input - self.target; let error = self.target - input;
// proportional // proportional
let p = f64::from(self.parameters.kp) * error; let p = f64::from(self.parameters.kp) * error;