Skip to content

Commit

Permalink
fix: 一次遅れフィルタの式をシステムに合った形に改良
Browse files Browse the repository at this point in the history
  • Loading branch information
miyashita64 committed Oct 19, 2023
1 parent 342c72b commit c714c9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/Calculator/Pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ double Pid::calculatePid(double currentValue, double delta)
// 時定数が0の時の無駄な計算を避ける
if(timeConstant != 0.0 && gain.kp != 0.0) {
// D値に一次遅れフィルタを適用
d = d / (1.0 + timeConstant * (fabs(d) / gain.kp));
d = d / (0.1 + timeConstant * (fabs(d) / gain.kp));
}

// 操作量 = P制御 + I制御 + D制御
Expand Down

0 comments on commit c714c9e

Please sign in to comment.