Explorar o código

转把加速扭矩获取处理修改

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui %!s(int64=2) %!d(string=hai) anos
pai
achega
cc0372f67c
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      Applications/foc/core/thro_torque.c

+ 2 - 3
Applications/foc/core/thro_torque.c

@@ -99,10 +99,9 @@ static float _thro_torque_for_accelerate(float ration) {
 	if (torque_acc_ > 0) {
 		float acc_t = mc_get_gear_config()->n_accl_time;
 		step = torque_acc_ / (acc_t + 0.00001f);
-	}else {
-		torque_acc_ = 0;
+		step_towards(&_torque.torque_acc_, torque_acc_, step);
 	}
-	step_towards(&_torque.torque_acc_, torque_acc_, step);
+
 	return (acc_torque + _torque.torque_acc_);
 }