|
|
@@ -1026,9 +1026,10 @@ static void mc_process_curise(void) {
|
|
|
return;
|
|
|
}
|
|
|
if (PMSM_FOC_Is_CruiseEnabled()) {
|
|
|
- if ((shark_get_seconds() - motor.cruise_time >= 3) && motor.cruise_torque == 0.0f) {
|
|
|
+ u32 cruise_time = shark_get_seconds() - motor.cruise_time;
|
|
|
+ if ((cruise_time >= 3) && motor.cruise_torque == 0.0f) {
|
|
|
motor.cruise_torque = PMSM_FOC_Get()->in.s_targetTorque;
|
|
|
- }else if (motor.cruise_torque > 0.0f){
|
|
|
+ }else if ((cruise_time >= 3) && (motor.cruise_torque > 0.0f)){
|
|
|
float trq_req = get_thro_request_torque();
|
|
|
if (trq_req > motor.cruise_torque * 1.2f) {
|
|
|
PMSM_FOC_PauseCruise(); //需要加速,暂停定速巡航
|