chose PID library implement PID (weight is NOT determined)
Dependents: optWingforHAPS_Eigen hexaTest_Eigen
Diff: PIDcontroller.cpp
- Revision:
- 3:c99dfa48b606
- Parent:
- 2:a05ba9d3be55
- Child:
- 4:462dd38db926
diff -r a05ba9d3be55 -r c99dfa48b606 PIDcontroller.cpp --- 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_;