Skip to content

Commit 6728fbd

Browse files
padalevOwez
authored andcommitted
Added Functionality to manually set the integral term. This might be important to set controller to previous state after an interruption or crash.
1 parent 16daae4 commit 6728fbd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ where
263263
pub fn reset_integral_term(&mut self) {
264264
self.integral_term = T::zero();
265265
}
266+
267+
/// Set integral term to custom value. This might be important to set pid
268+
/// controller to previous state after an interruption or crash
269+
pub fn set_integral_term(&mut self, integral_term: impl Into<T>) -> &mut Self {
270+
self.integral_term = integral_term.into();
271+
self
272+
}
266273
}
267274

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

0 commit comments

Comments
 (0)