Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: optWingforHAPS_Eigen hexaTest_Eigen
Diff: PIDcontroller.cpp
- Revision:
- 3:c99dfa48b606
- Parent:
- 2:a05ba9d3be55
- Child:
- 4:462dd38db926
--- a/PIDcontroller.cpp Thu Aug 26 04:26:47 2021 +0000
+++ b/PIDcontroller.cpp Thu Aug 26 04:28:32 2021 +0000
@@ -82,8 +82,8 @@
if (!(prevControllerOutput_ >= 1 && Error_ > 0) && !(prevControllerOutput_ <= 0 && Error_ < 0)) {
accError_ += (Error_ + prevError_) / 2.0 * tSample_; //偏差の積分値の計算
}
- if(accError_> accErrorMax_){accError_= accErrorMax_}
- if(accError_< -accErrorMax_){accError_= -accErrorMax_}
+ if(accError_> accErrorMax_){accError_= accErrorMax_;}
+ if(accError_< -accErrorMax_){accError_= -accErrorMax_;}
//偏差の微分値の計算(不完全微分が有効な場合,偏差の不完全微分値を計算)
float diffError = usingIncompleteDifferential ? calcIncompleteDifferential() : (Error_ - prevError_) / tSample_;