cancel
Showing results for 
Search instead for 
Did you mean: 

Motor run differently using NUCLEO-F030R8 or NUCLEO-F302R8

crudo
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
GMA
ST Employee

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

View solution in original post

2 REPLIES 2
GMA
ST Employee

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
ST Employee

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