High power, all in one Arduino shield

Hi there, I’m wanting to use SimpleFOC to control two high speed, high current BLDCs with Arduino. I’ve noticed that there isn’t an off-the-shelf hardware solution to do this yet. I found the Power Shield but it looks like that project is defunct now, and also it wouldn’t have worked for very high speed motors with the Arduino anyway because of MCU processing speed constraints and lack of interrupts.

I’m wondering is anyone working on / interested in working on an all-in-one high power, dual motor shield for Arduino with an inbuild high speed MCU like an STM32?

I’m thinking the shield would run OpenFOC directly on the onboard STM32, and be programmed directly via USB port. Then the Arduno underneath it can send a single PWM signal to the shield to control speed or position or torque. The shield would have a standard sketch pre-programmed, with easily understandable constants for all of the motor’s main characteristics. So, a complete package that can control virtually any motor!

Is it doable?

@Jeremiah_Rose

Welcome to the community.

Yes its possible.

Cheers,
Valentine

Sorry, I don’t understand the reason to stack two microcontrollers like this? If you are going to have to program a microcontroller for motor control anyway, why not just do all on the STM32?

The dual motor/ high power part already exists with hoverboard controllers, but I’m not so sure about high speed.
I never tried to run low pole count/ high kV motors on them.

I think if you’re running a FOC algorithm for two motors simultaneously at high speed, with interrupts, there won’t be any clock cycles left on the STM32 to run any other application logic. The FOC main loop needs to run at the fastest frequency possible.

If the BLDC shield has its own MCU, that frees up the Arduino for the user to do whatever they want on it.

Sure, but the STM32 is quite fast, several orders of magnitude faster than the Arduino (unless you’re on the new R4). @Copper280z has proven there is more than enough bandwidth for even more than 2 motors on the STM32G4!

Not to say you shouldn’t do it, just that the motivation to me is not fully clear :slight_smile:

For high KV motors running at high speeds e.g 40,000rpm? I’d like to see that.

I would sum up the motivation as follows:

  • People prefer Arduino over STM32 because of the enormous level of hardware, software and community support.
  • There isn’t currently a BLDC shield for Arduino that works for high power/fast motors as far as I’m aware.
  • Running the FOC algorithm on the Arduino itself isn’t an option due to processor speed and lack of interrupts (including on the R4).
  • The FOC algorithm prevents you from using the the MCU for general purpose code (e.g you can’t use sleep calls or wait for IO in the main loop), so putting it on a separate MCU makes sense.

The beauty of SimpleFOC is that you can do whatever the heck you want :slight_smile:

Here’s a good thread from a couple weeks ago discussing high speed Issues with going above a certain speed - hardware support - SimpleFOC Community

We’ve recently discussed the Arduino Giga board: It has a dual core STM32.
But I eat my shoes if arduino IDE is able to run both cores at their full potential.

I’ve done 20,000rpm, but not 40,000, I haven’t set things up with appropriate safety to try that.

With one motor there’s plenty of time left over to do lots of interesting stuff if you schedule things efficiently. 2 motors is doable, even with high loop rates/HFI sensorless. That scheduling isn’t trivial though, and I’d say is somewhat outside of the scope of what I’d expect a normal arduino user to do/deal with. Especially with their love of sleep calls. If you were interested, I’d suggest you look at the SuperSimpleTasker project, search for it on GitHub.

I would say that you’re much better off using i2c, spi, uart, or can for this, rather than pwm, or using a pair of bg431esc boards. The control loops for each motor will be application specific, so the user will need to change those parameters either at runtime from their host mcu, or at compile time for the “esc” firmware. If you’re only giving a pwm interface, you force that to be compile time.

Hey, just a note that ST Micro has some higher power motor shields like this:
https://www.st.com/en/ecosystems/x-nucleo-ihm08m1.html

As does TI:

And Infineon:
https://www.infineon.com/cms/en/product/evaluation-boards/bldc_shield_tle9879/

YMMV of course and these products might not be exactly what you’re looking for.

In our forums, there are also some designs that you might be interested in, even if they aren’t in the form factor of an Arduino shield:

And it’s also worth mentioning Moteus a solid product at a good price, and open source:

Or if you like the Arduino form factor, the Solo motor controllers, but their firmware isn’t open source:

2 Likes

Perhaps I misunderstand your comment, but I believe you might be mixing the software framework/toolchain (Arduino) with an MCU family (ST Micro’s line of hardware).

You mean there isn’t such a shield that sits on top of Microchip ATmega328P microcontroller in the “Arduino” footprint? Yes, there isn’t. The 328P isn’t fast enough to support this and the footprint is too small to allow for such a shield. We did develop something like close to that though, you may want to have a look:

Again, perhaps we are mixing AT386p with Arduino toolchain?

Any real-time control algorithm will prevent you from doing that, as it would disrupt the motor control loop.

Cheers,
Valentine

Thanks Valentine and everyone for such detailed replies. This is a thriving community!

Valentine, your power shield D beta looks great. I’m also keen to obtain one of these when they are available: SimpleFOC DriveShield - A big (more powerful) brother of the SimpleFOCSheild - #3 by CarelsberghStijn

Neither of these have an embedded MCU, but perhaps I can get away with just using 2 Arduinos for now instead of one, or an STM32 Nucleo for the motor control plus an Arduino for the rest. The lack of 3 interrupts on the Arduino R4 is a real bummer.

If the interrupts are for hall sensors, that is no longer necessary. Candas1 added some code recently so HallSensor will just poll the sensor pins each frame if you don’t call enableInterrupts. Works great.

Thank you. You may also want to check @Antun_Skuric 's latest power shield, too.

I don’t sell anything so you need to make those yourself. Contact Antun if you want to buy off shelf.

Or go for qvadrans for mcu integrated board.

Cheers,
Valentine