The idea of using Pico in such manner is certainly interesting. I have never used Pico. Can you first ensure SimpleFOC supports Pico, and if the code supports current sensing using i2c as a protocol? Perhaps reading the documentation would really help you in your desicion. I am not an expert in Pico or Simplefoc but have this feeling that you may hit a few bumps on that road. Hopefully others will contribute to your question more productively.
The normal arduino has a 9600khz adc sampling speed(or 9,6ksps) so anything significantly faster than that and with a faster i2c speed should be fine. The propagation delay of the adc does impose limitations on how fast the foc loop can run, however.
I’ve looked at faster, better adcs for current sensing and a reading for two over spi takes around 40 clock cycles, or about a microsecond at 40Mhz. That shouldn’t limit anything. Though it’s good to keep in mind.
Reading i2c with pico isn’t a problem, however, is current sensing using i2c sensors supported by the library? If it’s not then you need at least two analog pins for each motor. Pico has only 3 analog pins, so you may have a problem there. Could you please check?
I’ve done something similar in the past, where I had four motors, so I ended up controlling four individual motor boards (each with small MCUs) with a central powerful MCU (600MHz NXP Cortex-M7) which did the complex calculations and communications, and sent simple commands to the four motor boards. Using a single MCU to control five motors may be possible, however, @miraclemelon will probably need at least one of the high-end STM32 M7 144 pin MCUs. Plenty of pins to work with. Something like STM32H743ZI, or dual core STM32H747 or any other from the H line.
teensy 4.1 could probably do it. it has 35 pwm pins, 18 analog inputs and a very fast processor. though using your approarch with one mcu per motor would definitely be the simpler one.
How did this go? I think 5 BLDCs is very ambitious, just from the point of view of running the FOC algorithm 5 times, even on a fast MCU like the Pico. I’d love to know if you made it work.
I think a significant problem would be reading 5 AS5047 sensors quickly enough - you’d have to make the SPI work asynchronously I think.
An idea I had for this, which I am slowly working up to testing (got the hardware almost ready, need to find time for the software), is to use SSI based sensors (like the AEAT-8800-Q24 or MA732) and try to read them using the Quad-SPI peripherals some of the MCUs have. Not sure how realistic that is.
The Pico also has its programmable PIO units though - perhaps those could be used to read 4 or 5 sensors via SSI in parallel…