EBiCS / EasyDIY-ESC

EV motor controller with space to have customizable electronics and be easy to repair and build.
Other
31 stars 6 forks source link

Two motors with one STM32 microcontroller? #1

Open happytm opened 2 years ago

happytm commented 2 years ago

Is it possible to run 2 motors with one STM32 micro controller by adding 6 more mosfets? Are there enough pin available?

Thanks.

runger1101001 commented 2 years ago

Yes, it is possible!

I think most of the STM32G4 series would be suitable.

Here is an example design I made, with 2x 6-PWM, 2x current sensing and 2x SPI bus for sensors: https://github.com/rosmo-robot/Rosmo_ESC

runger1101001 commented 2 years ago

(but it is not possible using a BluePill or BlackPill MCU board - not enough pins; but I guess one of the big Nucleo boards could do it...)

happytm commented 2 years ago

Thank you @runger1101001 for your insight.

happytm commented 2 years ago

@runger1101001 How about using ESP32 ? Does it have enough pins to run 2 motors?

Thanks.

runger1101001 commented 2 years ago

Pins are always in short supply on the ESP32! It only has relatively few to begin with compared to other MCUs, and then they are so complicated to use... some are input only, some can't be used at the same time as WiFi, and some are only "pretend" pins since they're actually connected to the flash memory and you can't use them at all...

So the answer is: it depends. A DevKit type MCU-board: not really, I don't think so. A ESP32 module or chip with 2x 3-PWM driver: I think it is possible. A ESP32 module or chip with 2x 6-PWM driver and 2x current sense: not sure, but probably.

happytm commented 2 years ago

I think the middle option (A ESP32 module or chip with 2x 3-PWM driver: I think it is possible) seems attractive option for low cost motor controller. I wanted a low cost controller to control 2 250 watts hoverboard motors for my project using SimpleFoc.

Your https://github.com/rosmo-robot/Rosmo_ESC project looks promising if it can use ESP32 and at least 10A drivers and Mosfets.

Thanks.