Skip to content

Commit 281b410

Browse files
committed
Add method for reading the integral term; Update comment on setter
1 parent 55f0ee2 commit 281b410

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,18 @@ where
264264
self.integral_term = T::zero();
265265
}
266266

267-
/// Set integral term to custom value. This might be important to set pid
268-
/// controller to previous state after an interruption or crash
267+
/// Set integral term to custom value.
268+
/// This may drastically change the control output.
269+
/// Use this to return the PID controller to a previous state after an interruption or crash.
269270
pub fn set_integral_term(&mut self, integral_term: impl Into<T>) -> &mut Self {
270271
self.integral_term = integral_term.into();
271272
self
272273
}
274+
275+
/// Get the integral term.
276+
pub fn get_integral_term(&self) -> T {
277+
self.integral_term
278+
}
273279
}
274280

275281
/// Saturating the input `value` according the absolute `limit` (`-abs(limit) <= output <= abs(limit)`).

0 commit comments

Comments
 (0)