cancel
Showing results for 
Search instead for 
Did you mean: 

(Bug Report / MC_SDK) R3_2_SwitchOffPWM() and R3_2_TurnOnLowSides()

THA.1
Associate II

(Environment)

MC_SDK 5.Y.3 + STM32CubeMX 6.3.0 with HAL + IAR EWARM 8.5

(Hardware)

custom board based on F446RE + custom power board(3-shunt) + Low Voltage BLDC motor

(Control Mode)

Speed Control

(What I found)

  • When going motor start(PWM ON), there is a state for charging the boot capacitor, where R3_2_TurnOnLowSides() is executed and wait for a while.
  • In R3_2_TurnOnLowSides(), LL_TIM_EnableAllOutputs(TIMx) is called, where Timer MOE is set to 1 and PWM output signals(CH1, CH2, CH3 turn on each low side) are activated.
  • CC4 output signal is, however, activated as well. Why? CCER CC4E is almost always enabled after motor stop. R3_2_SwitchOffPWM() is usually executed between TIM UP IRQ and ADC_IRQ at medium freq task. In R3_2_SwitchOffPWM(), Timer MOE is set to 0 then ADC_IRQ is not triggered and PWM OFF while CCER CC4E keeps enabled at the last TIM UP IRQ.
  • CC4 output signal trigger ADC and its IRQHandler (high freq task).
  • High freq task changes each PWM output value of CH1, CH2, CH3 , which are not the intended value to turn on low sides.
  • Though CC4 is deactivated after just one high freq task execution, PWM output value of CH1, CH2, CH3 are kept remaining through charging time (10 ms).
  • This might cause some unexpected results. Especially, current spike might happen in case that FOC variables are not cleared - some error cases.

(Workaround)

  • Add the following code in R3_2_SwitchOffPWM()

 /* disable ADC trigger source */

 LL_TIM_CC_DisableChannel(TIMx, LL_TIM_CHANNEL_CH4); 

(Question)

  • The above workaround is good enough?
  • I also added FOC_Clear() at FAULT_OVER state in TSK_SafetyTask_PWMOFF(). While FOC_Clear() already exists at FAULT_NOW state, why was it dropped off at FAULT_OVER state (any reason)?

1 REPLY 1
THA.1
Associate II

Hi ST team,

May I get answers for my questions above? I would like make it sure my finding is correct and the workaround is valid without any side effect.

Regards,

THA.1