From a943308203a9d80fed959d961119bca5d9d53bf2 Mon Sep 17 00:00:00 2001 From: Astro Date: Tue, 13 Oct 2020 23:55:22 +0200 Subject: [PATCH] pid: never reset --- src/main.rs | 7 ++----- src/pid.rs | 5 ----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 894e160..c590022 100644 --- a/src/main.rs +++ b/src/main.rs @@ -302,11 +302,8 @@ fn main() -> ! { let pid = &mut channels.channel_state(channel).pid; use command_parser::PidParameter::*; match parameter { - Target => { - pid.target = value; - // reset pid.integral - pid.reset(); - } + Target => + pid.target = value, KP => pid.parameters.kp = value as f32, KI => diff --git a/src/pid.rs b/src/pid.rs index c955b3d..b9a706a 100644 --- a/src/pid.rs +++ b/src/pid.rs @@ -81,11 +81,6 @@ impl Controller { output } - pub fn reset(&mut self) { - self.integral = 0.0; - self.last_input = None; - } - pub fn summary(&self, channel: usize) -> Summary { Summary { channel,