Skip to main content
crudo
Associate II
June 28, 2024
Solved

Motor run differently using NUCLEO-F030R8 or NUCLEO-F302R8

  • June 28, 2024
  • 3 replies
  • 1549 views

Hello, I build two different projects with MCSDK version 6.3, one with use the NUCLEO-F302R8 and the other one the NUCLEO-F030R8, the motor and the power board are the same, I use FOC and for both projects I use the same parameter set, in particular in the Regular execution time is set to  3 PWM.
When I run the motor the behavior of the two nucleo boards is different.
When I use the NUCLEO-F302R8 the behavior is as expected.
When I use the NUCLEO-F030R8 the motor speed read from STM Motor Pilot (V.1.2.9) is different from the measured motor speed with an external instrument, when I set a speed of 1000 RPM the speed feedback read from Motor Pilot is 1000 RPM but the motor run at 600 RPM. Moreover the motor is not able to run at maximum speed with the load, around 1150 RPM, but it runs at 1020 RPM maximum.

Attached the two MC workbench projects.

Any suggestion to solve this issue?

Best answer by GMA

Hello @crudo,

Issue has been located in r1_ps_pwm_curr_fdbk.c file, please replace following line:

/**
 * @brief This function handles motor DMAx TC interrupt request.
 * Required only for R1 with rep rate > 1
 * @param pHdl: handler of the current instance of the PWM component
 */
__weak void *R1_DMAx_TC_IRQHandler(PWMC_R1_Handle_t *pHandle)
{
 DMA_TypeDef *DMAx = pHandle->pParams_str->DMAx;
 LL_DMA_ClearFlag_HT(DMAx, pHandle->pParams_str->DMAChannelX);
 pHandle->TCCnt++;
// if (pHandle->TCCnt == pHandle->pParams_str->RepetitionCounter)
 if (pHandle->TCCnt == (pHandle->pParams_str->RepetitionCounter + 1)>>1)

 

3 replies

GMA
Technical Moderator
July 10, 2024

Hello @crudo;

Thank you for your report. We will start working on a fix and we will come back to you shortly once we know more about it.
In the meantime, is-it possible for you to use PWM=5K and a Rate=1 instead? RPM should be aligned in this case...

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
GMA
GMABest answer
Technical Moderator
August 12, 2024

Hello @crudo,

Issue has been located in r1_ps_pwm_curr_fdbk.c file, please replace following line:

/**
 * @brief This function handles motor DMAx TC interrupt request.
 * Required only for R1 with rep rate > 1
 * @param pHdl: handler of the current instance of the PWM component
 */
__weak void *R1_DMAx_TC_IRQHandler(PWMC_R1_Handle_t *pHandle)
{
 DMA_TypeDef *DMAx = pHandle->pParams_str->DMAx;
 LL_DMA_ClearFlag_HT(DMAx, pHandle->pParams_str->DMAChannelX);
 pHandle->TCCnt++;
// if (pHandle->TCCnt == pHandle->pParams_str->RepetitionCounter)
 if (pHandle->TCCnt == (pHandle->pParams_str->RepetitionCounter + 1)>>1)

 

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

Hello @crudo ,

 

This issue has been fixed with the solution proposed above in our new MCSDK 6.4.0 release,
so feel free to download it and try if it solved correctly your issue reported in this post.

Kind Regards.