Is it possible to control 3 bldc closed loop motor in FOC with a STM32G474 ic

Hi everyone :wave:, I’m new on the SimpleFOC community. I recently discovered SimpleFOC and it’s an amazing project :heart_eyes:!

Here is my problem :expressionless:, I would like to control three bldc motors in close loop FOC control using hall effect sensors and phase current monitoring with the help of the STM32G474 IC. But I’ve searched and some people say that it’s not possible due to too small number of timers and small calculation capability of the stm32G4 family device :sob:, is it true?

On the datasheet on page 2 it says:
“- 3 x 16-bit 8-channel advanced motor
control timers, with up to 8 x PWM
channels, dead time generation and
emergency stop”.

So it has the hardware to do the job…?
Also, should I use 6-pwm or 3-pwm control, there are enough i/o pins to control them via 6-pwm and 3-pwm, but is the mcu’s computing power sufficient?

To give you some context, I am currently designing a custom PCB with two DRV8316CR and one DRV8353RS bldc drivers. And I want to control them via an MCU that would communicate with a Raspberry via USB or UART.

Here is a summary of my post:

  • Is it possible to control in FOC three bldc closed loop motor with a STM32G474?
  • Should I use 6-pwm or 3-pwm for my application?

Any help is welcome! If you need any information, ask me :grinning:

Sorry if my english is terrible :sweat_smile:

Yes, it will work. Advanced motor control timers are only needed for 6PWM, so 3PWM could use the cheaper G431. From a brief look at G474’s datasheet, I think its processing power is the same. G431 can do 15-16KHz in foc_current mode, so 3 motors will be a little over 5KHz update rate. With 6 hall states per electrical revolution, a 7 pole pair motor can theoretically reach 7000RPM. But realistically it may be difficult to get above 4000RPM. Higher pole count motors will have proportionally lower rotor RPM.

Thank you very much @dekutree64 :grin:!
As I’ve already started to design my PCB around the STM32G474 I’ll stick with this one. I’ll repost a message as soon as I’ve assembled the PCB to let you know if it works :grinning:.
Thanks again