STOPPING PMSM MOTOR
Hi,
We are using MCSDK_v5.Y.4.
We would like to implement Stall Detection and are considering using the measured iq current (used in FOC) for detecting a motor stall. We intend to use a Stall_Detection_Threshold, which is just below the "Current_Limit" to detect when the iq current exceeds this threshold for a given duration of time: stall_time.
We would like to know if the following function, TSK_MF_StopProcessing(), is recommended to use for stopping the motor,
/**
* @brief Performs stop process and update the state machine.This function
* shall be called only during medium frequency task
*/
void TSK_MF_StopProcessing( MCI_Handle_t * pHandle, uint8_t motor)
{
#ifdef REV_1
R3_2_SwitchOffPWM(pwmcHandle[motor]);
#else
ICS_SwitchOffPWM(pwmcHandle[motor]);
#endif
FOC_Clear(motor);
MPM_Clear((MotorPowMeas_Handle_t*) pMPM[motor]);
TSK_SetStopPermanencyTimeM1(STOPPERMANENCY_TICKS);
Mci[motor].State = STOP;
return;
}
or is there a more immediate "process" or function to use to stop the motor.
From the description in the code, "the MCI_StopMotor() command is used just to begin the
stop motor procedure moving the state to ANY_STOP ".
Thanks and Best wishes,
Jocelyn
