cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 single shunt FOC

Ondrej Meca
Associate II

Hi,

Using STM32F429VET trying to achieve FOC with single shunt resistor over 3phase bldc motor.
I am using TIM1 and corresponding CC2, CC3, CC4 as PWM channels. CC1 is used to trigger ADC in regular mode reading current over shunt resistor in S1 and S2. The PCLK2 is at 96MHz, ADC divided by 4. That all seems not to be enough.

I am struggling to achieve precise and yet fast enough reading. The final PWM frequency is 20kHz in center aligned mode. The motor has to move in 1/100 duty but that seems to be unable to achieve because of timing windows to read ADC. Dead time is at overall 500ns, given that the overall 25uS I have in center aligned mode, all time is crucial.
I am already doing all the magic stuff like using DMA to trigger ADC reading based on CC1, DMA to do TIM CCx updates upon Update events (shadowing CCx).

I heard about FOC control from MC Workbench but am I supposed to do incredible stuff to create my own board and inverter through declarations to get it? This seems ridicoulous when ST isn't offering something more usable for custom precise controls. What is the point showing a few random EVAL boards?

1 REPLY 1
GMA
ST Employee

Hello @Ondrej Meca,

As mentioned in the release note available through Workbench tool > About > Documentations, the STM32F429V microcontroller is not supported on the MCSDK tool.
Refer to the Single shunt with phase shift current sensing overview chapter of the User Manual document available through Workbench tool > About > Documentations > Documentation for single shunt current sensing description. Additionally, you can take advantage of an MCSDK STM32F4-generated project.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA