shata
Diff: MotorController.cpp
- Revision:
- 2:113b6a35d37c
- Parent:
- 1:76da1a46652f
diff -r 76da1a46652f -r 113b6a35d37c MotorController.cpp --- a/MotorController.cpp Mon Oct 25 10:20:35 2021 +0000 +++ b/MotorController.cpp Fri Dec 10 14:04:16 2021 +0000 @@ -111,6 +111,7 @@ { ///////////////////////////////////////////////加速度制限 double target_omega=target_omega_input; + present_target_omega = target_omega; if((target_omega_input-pre_target_omega)>acceleration_max) { target_omega=pre_target_omega+acceleration_max; } else if((target_omega_input-pre_target_omega)<-acceleration_max) { @@ -120,6 +121,7 @@ ec_->calOmega(); double omega = ec_->getOmega(); double devia = target_omega - omega; + present_devia_omega = devia; double pid = sc_pid->calP_D(devia,ec_->getAcceleration()); double duty_; if (target_omega > 0.0) {