Controlling 2 BLDC motor

Hello FOC Community,

I came across a strange situation while implementing simple FOC, The FOC library works perfectly when one BLDC motor is connected. When I connect two BLDC motors the motor works only when the target voltage is 4V or below. Beyond that voltage, the motor starts to cogg/jerks, but when I apply the same higher voltage i.e. greater than 4v on a single motor it works fine and works till the max limit.

The setup I have Arduino Mega, BLDC motors with integrated hall sensors, BLDC driving circuit DRV8302 from Ali Express. Supply voltage 20 V by a DC power source/ battery pack not from a PSU. I am running motors at Torque control mode.

KIndly, if anyone can explain why I am having this problem and how I can resolve it.

Regards,
Moid

Hi,

I think you might be hitting the speed limit of the MCU. The Mega has many pins, but is still only a 8bit 16MHz MCU.
Doing two motors is a challenge for such a processor, it has to run all the calculations x2…
BLDC driving depends on very fast and regular updates of the phase currents, to keep the stator’s electric magnets in sync with the rotor’s permanent magnets. This has to happen in the correct pattern, called “commutation” to make the motor move at the speed and in the direction desired.

In your case (I guess), at some point when the MCU cannot keep up with the speed of the motor the behaviour becomes bad because the commutation pattern is no longer correctly enough applied to the motor.
This is why you see this behaviour with two motors - then you are executing the pattern at half the speed for each motor, and so the break-down point comes earlier, at 4V. When using only one motor the commutation pattern can be changed twice as fast, and you can drive the motor faster than 4V…

Many thanks for your reply. I will try to run the motors with a different Microcontroller i.e STM32 F030R8 and will check how the motor responds to it. Thanks.

If I may recommend, RP2040 like Rasperry Pico or ESP32 are very cheap and fast MCUs.

STM32s I like the best of all, but the powerful ones STM32F4, STM32G4 or better are quite expensive. I would not go for a F0 series for motor control, if possible. It only has one advanced control timer (TIM1) for controlling motors in 6-PWM mode, and while faster than a Mega, it is not very fast.
For controlling 2 motors choose a MCU with support for 2 advanced control timers (normally TIM1 and TIM8 on STM32) and a floating point math coprocessor.

The Metro M4 is a nice board too - with Arduino form factor and a fast SAMD51 MCU.

Many thanks. I will go with the ESP32 and run the motors with it.