Hi,
I modified the universal_motorcontrol_lab_f28002x project with external throttle switch to control IsSet_A for CURRENT control, disable SPEED control, it's weird that every time after power on reset when apply throttle (IsSet_A > 0) the first few time has no response because motorState remain on MOTOR_CL_RUNNING.
see below debug screen capture
0:02 second - throttle start action, IsSet_A > 0, motorState stopped at MOTOR_CL_RUNNING, speed_Hz remain zero, no faults
0:05 second - again throttle action, same thing happened, speed_Hz remain zero
0:14 second - again throttle action, this time motorState can reached MOTOR_CTRL_RUN, and speed_Hz increase
below video shown motor response ...
I also tried different value or even remove the fwcTimeDelay to see if CL_RUNNING can immediately change to MOTOR_CTRL_RUN, but no luck !
if(obj->motorState == MOTOR_CL_RUNNING) { obj->stateRunTimeCnt++; if(obj->stateRunTimeCnt == obj->fwcTimeDelay) /* 2.0s */ { obj->Idq_out_A.value[0] = 0.0f; obj->motorState = MOTOR_CTRL_RUN; } }
EDIT : 2024-02-29 PM 10:34
I just discovered when obj->flagEnableRsRecalc is set to TRUE, the above motorState response will happened, if set to FALSE, power on restart then apply throttle (IsSet_A > 0), motorState can all the way up to MOTOR_CTRL_RUN.
So would like to know what's the reason flagEnableRsRecalc can cause it and how to prevent ?
Danny