Skip to main content
JKong.3
Associate III
August 25, 2023
Solved

M1_BEMF_V not configured in six-step Algorithm in MCWorkbench 6.1.2 generated project

  • August 25, 2023
  • 1 reply
  • 1020 views

Hi, I am figuring out how 6-step algorithm works. 

I generated a project using 6-step algorithm with B-G431B-ESC1.

In the ADC settings, 

ADC1 consisted of 2 regular channel (Vbus, Temp) and 1 Injected channel (Bemf_W)

So I thought ADC2 should be consisted of 2 injected channel (BEMF_U and BEMF_V).

However, there was only 1 Injected Channel enabled (Channel 17 -> BEMF_U)

here's screenshot for stm32cubemx

JKong3_0-1692929830451.png

Can someone tell me is it not necessary to sample Bemf_V? or is there an additional code to sample this?

Thanks 

 

 

    This topic has been closed for replies.
    Best answer by Gael A

    Hello JKong.3,

    As you mentioned, the ADC2 channel 5 (the one used for BEMF_V as you can see on the Pinout on CubeMx) is not configured in ADC_Injected_ConversionMode. However, it does not mean we do not sample BEMF_V : the ADC is reconfigured by FW depending on which step the rotor is. Even though the sampling time is not configured via CubeMx, it is then hardcoded in g4xx_bemf_ADC_fdbk in BADC_Init().

    1 reply

    Gael A
    Gael ABest answer
    ST Employee
    September 4, 2023

    Hello JKong.3,

    As you mentioned, the ADC2 channel 5 (the one used for BEMF_V as you can see on the Pinout on CubeMx) is not configured in ADC_Injected_ConversionMode. However, it does not mean we do not sample BEMF_V : the ADC is reconfigured by FW depending on which step the rotor is. Even though the sampling time is not configured via CubeMx, it is then hardcoded in g4xx_bemf_ADC_fdbk in BADC_Init().

    If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.Hope this will help,Gaël A.