cancel
Showing results for 
Search instead for 
Did you mean: 

Motor sometimes fails to start and goes out of control during the startup sequence.

EDokm
Associate III

I am working on a project to drive a door using a PMSM motor in position control mode.

I've encountered a problem I can't solve. When the motor is positioned at some specific rotor positions, it fails to start properly and tends to spin out of control during the startup sequence.

There are very similar 2 posts titled “Loss of control whenever the motor starts at some specific points” (https://community.st.com/t5/stm32-mcus-motor-control/loss-of-control-whenever-the-motor-starts-at-some-specific/td-p/143892) and “Motor sometimes starts in wrong direction, because of wrong sign of Iq measured” (https://community.st.com/t5/stm32-mcus-motor-control/motor-sometimes-starts-in-wrong-direction-because-of-wrong-sign/td-p/64553).

Has anyone found a solution? If so, could you please share it with us?

Thanks in advance for your help.

 

Details:

ST MCW Ver            : 6.4.0

STM32CubeIDE Ver : 1.19.0

Driving algorithm       : FOC

Control board            : Nucleo-G474RE

Power board              : STEVAL-IHM023V3

Bridge                        : X-NUCLEO-IHM09M2

PMSM                         : 10 pairs

Encoder                      : Incremental, 1024, without index pin (Ch Z)

1 ACCEPTED SOLUTION

Accepted Solutions
EDokm
Associate III

I have solved the problem. I have added current and RPM limits to the first function involving MC_ProgramPositionCommandMotor1(). In case the current or RPM exceeds their limit values, I call the functions PWMC_SwitchOffPWM(), PWMC_TurnOnLowSides(), and HAL_NVIC_SystemReset(). Code snippet is given below. Note: I have added this code to the TSK_MediumFrequencyTaskM1() function in the mc_tasks_foc.c file (under switch (Mci[M1].State), case RUN).

 

if ((measuredCurrent >= 5.0f) && (fabs(measuredRPM) > 30.0)) // Project specific variables
{
	encAligErrCounter++;
}

if (encAligErrCounter >= 10)   // Project specific variable
{
        encAlignOk = false;    // Project specific variable
        PWMC_SwitchOffPWM(pwmcHandle[M1]); 	/* Required before PWMC_TurnOnLowSides */
        PWMC_TurnOnLowSides(pwmcHandle[M1], 0UL); 	/* Turn on Low side switches */
        HAL_Delay(300);
        HAL_NVIC_SystemReset();
}

 

View solution in original post

2 REPLIES 2
EDokm
Associate III

I have solved the problem. I have added current and RPM limits to the first function involving MC_ProgramPositionCommandMotor1(). In case the current or RPM exceeds their limit values, I call the functions PWMC_SwitchOffPWM(), PWMC_TurnOnLowSides(), and HAL_NVIC_SystemReset(). Code snippet is given below. Note: I have added this code to the TSK_MediumFrequencyTaskM1() function in the mc_tasks_foc.c file (under switch (Mci[M1].State), case RUN).

 

if ((measuredCurrent >= 5.0f) && (fabs(measuredRPM) > 30.0)) // Project specific variables
{
	encAligErrCounter++;
}

if (encAligErrCounter >= 10)   // Project specific variable
{
        encAlignOk = false;    // Project specific variable
        PWMC_SwitchOffPWM(pwmcHandle[M1]); 	/* Required before PWMC_TurnOnLowSides */
        PWMC_TurnOnLowSides(pwmcHandle[M1], 0UL); 	/* Turn on Low side switches */
        HAL_Delay(300);
        HAL_NVIC_SystemReset();
}

 

Hello @EDokm,

Thank you for your feedback.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA