2022-07-15 12:47 AM
(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 + Low Voltage BLDC motor with Encoder
(Control Mode)
Speed Control
(What I found)
In "stm32f4xx_mc_it.c", there is TIMx_BRK_M1_IRQHandler() as follows.
Notice, here MC_Scheduler() is called as commented.
========================================================
void TIMx_BRK_M1_IRQHandler(void)
{
if (LL_TIM_IsActiveFlag_BRK(PWM_Handle_M1.pParams_str->TIMx)) {
LL_TIM_ClearFlag_BRK(PWM_Handle_M1.pParams_str->TIMx);
R3_2_BRK_IRQHandler(&PWM_Handle_M1);
}
/* Systick is not executed due low priority so is necessary to call MC_Scheduler here.*/
MC_Scheduler();
}
========================================================
(Question)
Once BRK interrupt(over current) happened, we need to handle this fault immediately.
While MC_Scheduler() is for normal medium task(speed controller), TSK_SafetyTask() that is for fault processing should be called rather than MC_Scheduler()?
Solved! Go to Solution.
2022-07-28 01:13 AM
Hello @THA.1 ,
If the error is permanent, (for instance if the polarity of the break signal is not correct), and if the BRK IRQ priority is higher than sysTick, the call to MC_Scheduler guarantee that you will still have the communication link with the motor Pilot.
Cedric
2022-07-18 02:19 AM
Hello @THA.1 ,
When the break occurs, all the safety measures are taken by the HW itself. The timer immediately stop driving the PWM and put your H-Bridge in safety mode.
The TSK_SafetyTask is a normal task checking the temperature and the VBus. It is not designed to be executed under BRK interrupt.
Regards
Cedric
2022-07-20 07:15 PM
Thank you for your reply !
I understood your point, then could you tell me why MC_Scheduler() should be executed in BRK interrupt?
Regards,
THA.1
2022-07-27 05:50 PM
Hi Cedric,
Could you answer my question above?
I think MC_Scheduler() is not necessary in BRK IRQ Handler either, even it might worse.
2022-07-28 01:13 AM
Hello @THA.1 ,
If the error is permanent, (for instance if the polarity of the break signal is not correct), and if the BRK IRQ priority is higher than sysTick, the call to MC_Scheduler guarantee that you will still have the communication link with the motor Pilot.
Cedric
2022-07-28 05:41 PM
Hi Cedric,
Thank you for your answer !
Regards,
THA.1