cancel
Showing results for 
Search instead for 
Did you mean: 

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

JKong.3
Associate III

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 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Gael A
ST Employee

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.

View solution in original post

1 REPLY 1
Gael A
ST Employee

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.