From f175bf99abc678b60cf947e7c132d41791cd23c6 Mon Sep 17 00:00:00 2001 From: Anton Kumaihorodski Date: Fri, 5 Dec 2025 07:04:03 +0200 Subject: [PATCH] Add a method to fully reset PID state Includes resettingboth integral and derivative states. --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index f66f94a..64f0f1b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -258,6 +258,11 @@ where } } + pub fn reset(&mut self) { + self.reset_integral_term(); + self.prev_measurement = None; + } + /// Resets the integral term back to zero, this may drastically change the /// control output. pub fn reset_integral_term(&mut self) {