Number of simplefoc shields/ simplefoc minis that can be attached to one ardiuno

can you only attach two simplefoc boards to a single arduino? (and therefore drive two motors)
is it possible to drive many more motors or would you need another type of board, or many arduinos? can nucleo run more than two?
thankyou

Hi @kennethkneebone ,

I think we had a chat about this on discord also.

There are two problems:

  1. The number of pins on the MCU - BLDC motor control requires quite a few pins, and doing it in “a pro way” with 6-PWM control, current sensing and a sensor for closed loop control, we’re talking 10-15 pins per motor. A simple setup with 3-PWM and no sensing will still need at least 5 pins or so with the sensor.
    The pins can’t just be any pins - for the PWM they need to support the right kind of PWM, and be connected to timers in the right way. For the sensors, you need SPI pins, or maybe I2C or analog. For sensing you need analog pins.
    So most MCUs can manage only a single motor due to the pins and peripherals available. Some can manage 2. Only relatively few MCU models have sufficient pins, timers and inputs to have the theoretical ability to connect 3 or more motors.

  2. MCU speed - the FOC algorithm is demanding, and SimpleFOC is a simple, easy to understand implementation thereof, not highly optimised performance on any MCU type. Many MCUs (like the 8-bit Arduinos) struggle to run even a single motor, and have only limited performance.
    Only a fast MCU like a STM32G4 or ESP32 will have the power to run 2 motors, and perhaps the fastest MCUs could do even more.

Note that there are also software limitations in the library currently, like that we don’t support current sensing on more than one motor at the moment.

For simplicity and performance there is a strong argument to be made for one MCU per motor…
Running two is possible with careful choice of hardware and some effort. Running more than two is definately advanced usage, and unlikely to succeed quickly unless you’re quite experienced.