We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
float MotorController::limitSpeed(){ if(!initialized_){ return -1.0; } float surplus; //Iゲイン自動整合用の余剰制御量を算出 surplus = speed_ - max_speed_;
// speed_ を範囲内に調整 if(speed_ > max_speed_){ speed_ = max_speed_; //Serial.println("更新+: " + String(speed_)); return surplus; }else if(speed_ < -max_speed_) { speed_ = -max_speed_; //Serial.println("更新-: " + String(speed_)); return surplus; } else { return 0.0; }
}
surplus = speed_ - max_speed_;
正回転時はsurplusは記述の通りの計算となるが、逆回転時、
speed < 0となるため、
surplus = speed_ + max_speed_;
とならなければならない
The text was updated successfully, but these errors were encountered:
No branches or pull requests
float MotorController::limitSpeed(){
if(!initialized_){
return -1.0;
}
float surplus; //Iゲイン自動整合用の余剰制御量を算出
surplus = speed_ - max_speed_;
// speed_ を範囲内に調整
if(speed_ > max_speed_){
speed_ = max_speed_;
//Serial.println("更新+: " + String(speed_));
return surplus;
}else if(speed_ < -max_speed_) {
speed_ = -max_speed_;
//Serial.println("更新-: " + String(speed_));
return surplus;
} else {
return 0.0;
}
}
surplus = speed_ - max_speed_;
正回転時はsurplusは記述の通りの計算となるが、逆回転時、
speed < 0となるため、
surplus = speed_ + max_speed_;
とならなければならない
The text was updated successfully, but these errors were encountered: