Critique my (simple) motor driver circuit

Hello experts

First of all, I don't often use this forum, and if my thread violates a rule I wasn't aware of, please feel free to educate me :slight_smile:

Ok, down to business.
I'm making a very simple brushed DC motor driver using some MOSFETs and an Arduino Nano.
As the motor will draw quite a bit of current and is a noisy component overall, I imagine that some sort of protection will be necessary for the Nano?

Circuit is attached in pdf form.

What, if any, improvements would you suggest in order to protect the nano board?

foxfet.pdf (35.8 KB)

Why are there two separate driver transistors?

What voltage and current rating is this motor? Why say "quite a bit of current" when
you could have given accurate information by linking the datasheet or product page?
What is the motor power supply?

As for educating you, clearly you should visit the threads that explain how to post usefully.

  • There are two separate driver mosfets because the expected currents will occasionally peak at 60A, 30-40A semi-continuous (meaning typically 5-10 seconds with short breaks of 10-20 in between). I use two mosfets in parallel so they can dissipate the heat better.
    I know you can get mosfets which can handle lots of current, but they tend to be pricey, and I want the choice of going with two cheaper mosfets.

  • Voltage: 13V

  • Current: 60A peak, 30A continuous.

  • I cannot provide a data sheet to the motor because no manufacturers will share them, to my knowledge.
    The driver is for airsoft use, and I have yet to see a data sheet for one of those motors.

Oo, I love being critical!

Even 15 amps is going to be too much for those MOSFETS.

You should be looking for an RDSOn of 0.005 Ohms or less if you wan't to handle 15 amps per FET, these have a RDSOn of 0.044 ohms. For a 15 amp load it will be dissipating 15150.044 = 9.9 WATTS !! ( in reality more than that as the temp will go up to also increasing the resistance)

Look at a mosfet like an IRLB3034 in contrast. with a RDsOn of less than 0.002 Ohms.
You will still want to use two in parallel to handle 30 amps.
IRLB3034

Also you will need good decoupling. I don't see any caps on the diagram.

The switching speed is going to be slow.. You will have to use a low PWM frequency if driving the gates directly from the arduino. If you want to switch at ultrasonic speed with either of these MOSFETS you will need some type of gate driver.

The gate resistors should be sized to keep the current under the arduino safe limits ( less than 30ma).

Thanks, alka :slight_smile:
I had a short practical test today, and the mosfets gave up pretty fast, so you're right about that.
Thank you for a suggestion for the other type, I'll find some of those.

By good decoupling, can you elaborate a little?
I'm guessing you mean an electrolyte of sorts on the battery leads and maybe 100n-ish tantalum close to the board itself?

Did those mosfets have heatsinks ?

Have you considered using mosfet drivers ?

Are you aware that it is not that difficult to design your circuit to monitor the motor current and react accordingly using current shunts and analog inputs ?

Hi raschemmel

No, the mosfets in the first test did not have any heat sinks. In fact, I was hoping that I could do without them. Commercial products are working well with just a single SMD driver mosfet without any dedicated heatsink (although they probably have some cooling via copper on the PCB), and I was hoping I could get away with also not using one.
Small size is a priority, along with robustness, of course. If that cannot be achieved, then I'll resort to heatsinks.

I have considered using mosfet drivers, but again, space is an issue, so I hope I can do without.

Also, while I'm aware that it's possible to monitor the current with current shunts, I have no practical experience with them myself, but since this driver will be timer based and I just assume that the mosfets can run the motor at max speed without a need for current monitoring, I won't try it out in this project.

The most important question right now is:
Provided that the motor and arduino is supplied by the same battery, how do I need to protect the arduino from the motor's noise?

Ok, I've tried to educate myself by reading other threads about the same subject elsewhere on the forum.

It seems that if I want to run the motor and the control circuit with the arduino off the same battery, I will at least need a diode in series with the arduino as well as a capacitor in parallel, so it doesn't reset at strange times.

How do I figure out the necessary capacity of the cap?
And do I need anything else to protect the arduino?

I'm sorry to have to be the one to shatter your fantasy world ( and I am not exagerating when I say "fantasy") but to my knowledge and experience there do not exist any semiconductor devices that can supporr the currents you cited "sans heatsink" ( or "barefoot").
You can abandon any hope yiu had of that happening because it isn't going to happen. The very fact thar you entertained that "delusion" ( again, no exageration), does not bode well for your project. The driving equivilent of your " misconception" is to believe you can take a 90 degree turn at an intersection at 99 miles per hour. If a I told you that I had tried that would you lend me your car ?

Only relays can switch those currents without a heatsink and the contacts would not last very long. When you come back to " reality" we can talk about your other questiion because I'm afraid I don't have much good news there either but there might be a glimmer of hope.

Here's a link to the commercial version I'm using at the moment:
http://gatee.eu/images/gate/instrukcje/merf32-en-2016-05-09.pdf

Maybe I didn't describe the application well enough (probably my own error), which might be the reason why you think I live in a fantasy world, but I can assure you that the above controller works quite well.

In a "realer" reality, how would you protect the arduino when running from the same battery that the motor does?

This has a heatsink. (the PCB has a layer of copper to conduct the heat. The low power disipation is due to low on resistance.

RDSON

Look at this device
P = 900*0.00135= 1.2 W
The very low on resistance 1.35 mohm is the secret.
That's what you need in a Loguc Level versiion.
but it is not a Logic Level Mosfet that yiu can drive with a 5V PWM signal from an arduino.
You need a Logic Level Mosfet with an R(DSon) of < 5 mohm (0.005 ohm)

This is the only part I am familiar with that might work. (RDSON is probably too high by a factor of at least 5)

The power dissipation (of the device ) is P(W) = I2* RDSON
DC Power Formulas

The Mosfet:
so , switching a 12V battery, with a 35 mohm on resistance (0.035 ohm) = (30 A )2 * 0.035 ohm
= 900 A * 0.035 ohms = 31.5 W
The LOAD :
P = I * V = 30A * 12V = 360W

As you can see , that's almost a 10:1 ratio of load power to device power 360W:31.5W (11.4 to be exact)

While 31.5W may not seem much, unless you design a PCB with a THICK INNER layer that acts as a heatsink and LAY the part down FLAT, (as opposed to standing vertical), what I told you is still true.
The way they are able to do it on the product you linked is by combining a device with a very low on resistance (typically 5 mohms (0.005 ohms) and a laminated PCB with an internal heatsink

P = (30A)2 * 0.005 ohms = 4.5W

That doesn't seem like much but hold your fingers on a 7W colored christmas tree light for 60 seconds and you can see how even that would be too much without the internal heatsink in the PCB.

So, yes, if you can find an N-channel mosfet , rated for 40 to 50 A, with an RDSON of 5 mohms (0.005 ohms) AND you make a THICK PCB with an INTERNAL heatsink layer
(note how thick the PCB is compared to all your other arduino modules that don't have power devices.
The ones I have are the thickness of a dime. The one you linked looks the thickness of a Nickel.
That can only be explained by an inner heatsink layer.

I certainly don't disagree with any of what you wrote, and I also assumed that very low RDSon and PCB heatsinking was what the linked controller rely on, even though PCB heat sinking, to my knowledge, is nowhere near as effective as slapping a real heatsink on the mosfet.

Part of the answer is also how the controller is used. Airsoft guns usually run only in bursts with some fairly long breaks in between.
You can unload a high capacity magazine in what... 15 seconds? So "continuous" in this context really isn't that continuous at all.

The TI mosfet you linked looks very promising, although I guess it'll cost an arm and a leg :slight_smile:

Next up is the protection circuit for the arduino running on the same battery as the motor.
I've found this circuit on a motor controller board for a large 3 phase motor, but am not sure what R56 and R57 are doing?

They look like dropping resistors

R(drpping = (Vin - Vload)/I(Load)=(80 V - ?)/?

P= I(Load) * V(Load) = ?

U2 voltage ?
ILoadU2 = ?

ie:
Let VLoad = 12V
RDropping = 360 ohms /2W
PRDropping = 2W

360 ohms = (80V-12V)/ILoad
ILoad = 68V/360 ohms = 0.1888 A (188.88 mA)

P = 2W =ILoad V RDropping
2W/12v = 0.166666 A

Marty_DK:
Hello experts

well this leaves me out...

but I'll participate anyway; I too am interested in the same sorts of things> dc motor control at relatively higher current levels: 20-200A

I'll offer some other low RDSon mosfet choices i've found:
IRLR7843
IRF7832
FDD8896
AOD208
PSMN1R7-30YL
, for your consideration.

Now some comments to maybe help both you and I from those who know better:

I wonder about your 'freewheel' diode from the schema. Is it up to task: my understanding is it must carry the same current as your normal motor current? Perhaps some suggestions for higher current diodes for the flyback would be helpful? (or commentary otherwise)

It seems you have mosfets in parallel to share the load, but each is driven from a different pin on MCU? If these aren't driven at the precise same timing, one or the other mosfet will carry the entire load for some bit of time?

R6, R7 may need to be larger?
5volt / 27ohm = 185milliAmp; I believe too much for 328pins?

alka:
The switching speed is going to be slow.. You will have to use a low PWM frequency if driving the gates directly from the arduino. If you want to switch at ultrasonic speed with either of these MOSFETS you will need some type of gate driver.

This is very curious to me. While I am aware of many dedicated mosfet drivers, ie IR2101, etc. why is it that you can switch faster with one of these than directly from the MCU. I would speculate the driver itself must have some propagation delay ( albeit very tiny ) that must be in addition to what is between the MCU and gate only? I thought these were mainly for the use when you are driving gates at other than logic level, ie 12v?

regards,
Bill

Because the 328 can't source enough cureent to drive the gates at faster speeds due to gate capacitance that must be discharged.

Hello Bill and Raschemmel

First of all, thank you for the help, Raschemmel.
Those resistors on the picture I posted must be dropping resistors, that makes sense.

And thanks to you too, Bill, I'll look into those mosfets you posted.
I'll probably order a couple of mosfet drivers and try them out on my bread board.
Also, the resistor size was a (bad) guesstimate and will be swapped out for some 270R ones instead. That should drop the current to a safe level

I wasn't aware that the freewheeling diode had to carry the same current as the mosfets - I thought that it just sat there to neutralize short voltage spikes from the motor when it is stopping..
The diode I use isn't actually the type shown in the diagram. That was just the symbol I had handy when drawing the schematic. In fact, it's a fairly beefy 3A type - Can't remember the specific name.

Finally, I'm driving the motor with the standard arduino PWM frequency, which I believe is 500Hz.
I was hoping that relatively low switching speed would make a dedicated driver unnecessary - If I also used a suitable mosfet, like the IRL3034, for example..

The choice is yours. If you would rather use 12 to 16 kHz PWM , tha can be arranged as well.

FWIW,
I recently built an almost identical circuit to yours:
2 parallel logic mosfets, direct gate drive from the Arduino, 1 freewheel diode across the motor of the "beefy" type. (just something I robbed off an old pcb that had very thick leads(perhaps .0625"), don't really know what its specs were) PWM was either at ~1000hz or 500hz, don't remember what pins I used.

It was for a small brushed motor for a friends application; locked rotor was near 5A, normal load about 1.5A. He claims it is working great for him. However, before I gave it to him, I tested the controller at higher levels, and near 10+ amps, the diode began smoking, so I backed off, and haven't pushed any further, it wasn't necessary for his app.

I too am trying to get a better understanding of these circuits.

As far as the gate resistors: My understanding is that if you go with dedicated gate drivers, then your 27R resistors may be better than 270R, because the gate drivers are able to switch more quickly with the lower R values, and can handle the higher currents.

I am interested in the mentioned higher pwm levels: +15khz, as the audible switching noise can be a bit annoying on some applications.

Bill

Pretty great insigt.
I have zero experience with pwm motor controllers myself, except the few precious moments using the IRL540 before the motor autonomously accelerated to full speed :slight_smile:

Crazy that the diode would start smoking. Didn't expect that, but thanks, I'll make sure to get a much "beefier" one, pardon the unscientific description.