Skip to content

Commit 126e3d5

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

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,16 @@ 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
273+
274+
/// Get the integral term.
275+
pub fn get_integral_term(&self) -> T {
276+
self.integral_term
272277
}
273278
}
274279

0 commit comments

Comments
 (0)