Repurposing quad-copter controller for Simple FOC?

I had this idea for a low-cost driver board. re-program a commercially available ESC that was being sold for use with quad copters. Some of these sell for as low as $10 and can handle 20+ amps. I think they is just some mosfets and an STM32 chip. Many are setup so they are be re-flashed with new firmware.

A typical form factor is a board just under 40 mm square that can drive four motors (12 output pins) and has one serial input for control. What I think is lacking is (1) per-pin current sensing and (2) encoder inputs. So my plan was to design another 40mm square board that stacks and has the missing parts. I don’t know if communication between the two boards could be fast enough. I might be able to use SPI? It depends on if the pins on the existing uP can be repurposed.

In summary, I think the most economical SimpleFOC board might be a low-cost commercial product that could be repurposed.

What I’m looking for now is for people to tell me why this cannot be done. Then I’ll have a larger list of problems to research.

The Flight Computer itself also looks like a good platform for robotics. Many of them have a high-end uP in a small package and they stack on the ESC. And because they are mass-produced the cost is reasonable.

I’ve looked into this! I had exactly the same thought.

The F4 and F7 flight-stacks do look attractive at first glance, but unfortunately once you dig into their schematics you find they don’t work. The connection from the controller board to the ESC has one PWM line per motor, and the motors turn in one direction only. So you can only control the speed of 4 motors uni-directionally, not much good for robots, and not at all compatible with FOC control, which needs to control each motor phase independently.

Almost all the boards I looked at used Fortior Tech drivers which are designed for this job: unidirectional 1-PWM control, with BEMF-driven trapezoidal commutation IIRC. You can’t use them another way.

So to make this work you’d have to find a better flight control board. Check out the Zubax boards, available at Holybro: Kotleta20,UAVCAN ESC
Those look like they could handle SimpleFOC, but of course at $55, that’s no longer the price-point we were imagining when we saw the F4 boards, right?

If you find a F4 flight stack ESC that has a better driver, or exposes the individual phases in 3-PWM or 6-PWM control then it could work. But so far I haven’t found anything like that. And the existing boards are so dense it doesn’t seem realistic to hack into them and attach other drivers to the FETs…

Yes, agreed on that, although price-wise they don’t really beat an ESP32, Arduino or Nucleo board. There’s really no shortage of MCU boards in all shapes and sizes. It’s robotics ESCs at reasonable prices that are a rarer commodity.

Doable, and educational.

At the end you will end up putting the whole board together by yourself, mosfets and mcu and all that, tossing the cheap ESC board you started with in a drawer, all mangled and dirty, looking back at yourself, and smiling… ah… youth and enthusiasm.

Only adding current sensing will be more difficult and that’s what I need so yeah …