3$ BLDC and Stepper FOC driver - L298N

I have bunch of DRV 8833 and some cheapo gimbal motors will test later on today it’s behaviour in FOC.

50Khz PWM freq and 500mA per bridge can’t expect it to side with l6432 but can try. Will keep y’all posted.IMG_20211117_083131

1 Like

I am looking forward to hear about it!
You might need to do a similar thing @CREGIS21 has proposed for this to work though.

Because according to this table as for the table in the @CREGIS21 case, it is not possible to have two phases (of each half-bridge) on at the same time. Which means that you cannot use 3 out of 4 phases of this driver like it was possible for the L298N.
Now you will be able to use 2 drv8833 drivers and use 3 half-bridges out of 4 and for each one of them use only one output.


However an important thing to note is that this driver will work perfectly with a stepper motor :smile:

That was my initial plan use 2x8833 (since their relative small size factor) stacked on top of another. Use each half bridge to drive one phase and then not utilize 4th one at all. Would give me what approx 500mA per phase rms max which on paper is quite ok to drive something like 2208.

Any updates on your tests?

There are 2 errors in the above which I had to get worked out before I could try it: one, where it says ```
ControlType it should say MotionControlType, and the second is that the wiring diagram shows that one of the poles of the motor is connected to an output which is the output 4, not output 3. The silkscreen on the bottom of the board should show it.

At 3 volts limit in the code and an actual 12 volts power supply with a 32mm diameter gimbal motor it draws 250 ma. It’s super jerky though for some reason, which I have to get figured out.

Is it as simple as just embedding this chip in a PCB? I’m thinking of trying it. However, I see that the L298N breakout has caps, resistors, etc. How can I figure out which ones I need and don’t need? Thank you!

Well, that question isn’t so simple to answer… it depends what you want to achieve?

First question is, what’s wrong with the breakout boards? Any product you can get at a price of $1.50 has to have some problems before you consider spending hundreds of $$ to roll your own?

And the next question, if you want to make your own PCB, why on earth would you use this ancient chip which has terrible performance for driving BLDC motors? Why not use a newer, better driver IC?

But the L298N version with its long legs is actually breadboard-able, so if you wanted to you could set up a test circuit on a breadboard first, and would not have to risk the expense & time of making a PCB for it…

And yes, you do need some external components, at minimum two 100nF capacitors on the supply voltages, but in practice you might need more than this on the motor supply. And as to why, this would be a bit much for me to type… but if interested, you could look up “Bulk capacitance” and “Bypass capacitance” on google/YouTube.

Good point. As @Jan_Donker pointed out it’s based on NPN bipolar transistors. That’s like putting a steam locomotive on a Shinkansen.

Just found this https://lcsc.com/product-detail/Motor-Driver-ICs_RZ-Wuxi-Smart-Microelectronics-TA6586_C128851.html could two of them work?

As the driver does not support both high(H H) and both low(L L) combination, in order to make it work you’ll need three of them. One per phase.
And even that would be tricky, you’d need to use 6pwm control to do it. :slight_smile:

Probably you could Frankenstein a 3phase driver out of three. Is it worth it? No.

Hi Antun,

Have you ever tried to establish Simplefoc for L298N + DC motor with encoder?

Hey @Rhinotek_Suhail,

Here in simplefoc we are concentrating almost exclusively on BLDC and Stepper motors. For now there is no integration of the DC motors in this framework. However, I’d be in to collaborate over this and integrate the support for DC motors as well.

I did at some point port an old version of the library (including encoder class) for the DC motors. Here is the github repo:

It is an old version of the library but I will probably work for your case :smiley:

Thanks for your helping, i will try to test this repo., as this is using one PWM pin and i need to look for the h-bridge using one PWM pin.

Is 3 of this suitable for SimpleFOC? It is cheap solution @ $ 0.30 in quantity of 30 if it can work with SimpleFOC.


Hey @happytm,

If you use 6pwm control and if you use three of them this could work.

However, this driver is relatively slow. If had turbo and turn off times of several microseconds, which could in term limit the pwm frequency to just a few kilohertz. The similar story as for btn8982 and IFX007t.

So I would say, it could work, but don’t expect too good performance and smoothness at high (normal) pwm frequency >20khz.

1 Like

@Antun_Skuric Thank you for your quick reply. You are right about the speed.

Hi community,
Here is a demo of simpleFOC with the small driver based on two tb6612 connected as I detailed above.


hi @CREGIS21 thankyou so much for sharing your work, I was wondering if there is a way to control two gimbal motors using two TB6612s?, or do we have to use 4 TB6612s to control two motors?

@Antun_Skuric thanks for sharing this! I was excited to find this thread. I’m trying to get a 3-phase brushless motor running with an L298N, and am trying to work through the commutation logic manually… I’m used to thinking of controlling a motor with 3 x 1/2 H-bridges with 6PWM inputs, and I can’t quite make sense of how it is possible to properly commutate with the L298N & 3PWM signals.