Skip to content

Commit bd7c8f0

Browse files
committed
Add unit tests
Add 7 unit tests for saturation and anti-windup feature.
1 parent d8208af commit bd7c8f0

File tree

2 files changed

+426
-20
lines changed

2 files changed

+426
-20
lines changed

src/pid.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ double Pid::compute_command(double error, double error_dot, const double & dt_s)
274274
gains.trk_tc_ = gains.p_gain_/gains.i_gain_;
275275
}
276276
i_term_ += dt_s * (gains.i_gain_ * error + 1/gains.trk_tc_ * (cmd_ - cmd_unsat_));
277-
} else if (gains.antiwindup_strat_ == "conditioning_technique") {
277+
} else if (gains.antiwindup_strat_ == "conditioning_technique" && gains.i_gain_ != 0) {
278278
if (gains.trk_tc_ == 0.0) {
279279
// Default value for tracking time constant for conditioning technique
280280
gains.trk_tc_ = gains.p_gain_;

0 commit comments

Comments
 (0)