Skip to main content
Quentin Ch
Associate III
September 27, 2022
Question

[Bug Report MCSDK 6.0.0] Overvoltage and overcurrent flags inverted when overvoltage protection is disabled

  • September 27, 2022
  • 0 replies
  • 903 views

Hello,

Actual behavior:

While I have deactivated the overvoltage protection in Motor Control Workbench, I still get the overvoltage fault flags that is sometimes set (when my motors brakes abruptly).

My setup: 4-poles BLDC motor, MCSDK 6.0.0, Nucleo G474RE + IHM08M1 configured in 3-shunt for FOC.

Expected behavior:

The overvoltage flags should never be set if the overvoltage protection is disabled

Root cause and fix:

By looking at the generated code, there is still a function that set the overvoltage flag to true

/**
 * @brief It contains the TIMx Break1 event interrupt
 */
__weak void *R3_2_BRK_IRQHandler(PWMC_R3_2_Handle_t *pHandle)
{
 ...
 pHandle->pParams_str->TIMx->BDTR |= LL_TIM_OSSI_ENABLE;
 pHandle->OverVoltageFlag = true; 
 pHandle->BrakeActionLock = true;
 ...
}

Also when I check my generated CubeMX project, I see that on the only BKIN input activated is on TIM1, and that BKIN2 is deactivated.

And that in the same file there is the function R3_2_BRK2_IRQHandler() that do set the overcurrent flag.

Aren't the two BKIN inputs/functions swapped ? Can you at ST confirm this is bug ?

0693W00000SwMPfQAN.png 

NB1: In R3_2_IsOverCurrentOccurred(PWMC_Handle_t *pHdl) the overvoltage flags is also set, while the description of the function is only about overcurrent. Why is this ? This is confusing.

NB2: I see LL code while I selected HAL at code generation.

Thanks

This topic has been closed for replies.