Skip to content

Commit 525df5e

Browse files
committed
Add method for reading the integral term
1 parent 55f0ee2 commit 525df5e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/lib.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,20 @@ 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, this may drastically change the control
268+
/// output.
269+
///
270+
/// This might be important to set pid controller to previous state
271+
/// after an interruption or crash
269272
pub fn set_integral_term(&mut self, integral_term: impl Into<T>) -> &mut Self {
270273
self.integral_term = integral_term.into();
271274
self
272275
}
276+
277+
/// Get the integral term.
278+
pub fn get_integral_term(&self) -> T {
279+
self.integral_term
280+
}
273281
}
274282

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

0 commit comments

Comments
 (0)