Skip to content

Commit 6b9c416

Browse files
committed
Add methods for reading writing the integral term
1 parent 9f39e7d commit 6b9c416

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,17 @@ where
263263
pub fn reset_integral_term(&mut self) {
264264
self.integral_term = T::zero();
265265
}
266+
267+
/// Overwrite the integral term, this may drastically change the
268+
/// control output.
269+
pub fn set_integral_term(&mut self, integral: T) {
270+
self.integral_term = integral;
271+
}
272+
273+
/// Get the integral term.
274+
pub fn get_integral_term(&self) -> T {
275+
self.integral_term
276+
}
266277
}
267278

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

0 commit comments

Comments
 (0)