Control DC motor with transistor 2N3055, pwm from Arduino

I need to control the speed of a dc motor (0.5 A no load, to 10 A full load). In the picture you can see that I'm using a 2n2222 that controls a TIP3055 (or a 2N3055). The circuit works but I'm not sure that is perfectly ok... Can you check it out?
I don't know if I need the two green resistors (with question marks), I didn't use them in the test but I saw that some people use them. What should be the values?
Also: what is the functionality of the 1N4007 diode next to the motor? And do I need to put another diode from the collector to the emitter of the 3055?
Thanks!!!

You don't have to use those resistors; the diode is to protect your 2n3055.

I'd have thought a mosfet driven directly from the PWM signal would have been a much better choice : much lower ON resistance so less heat generated by the control element.

The green resistors speed up the turn off of the transistors - the one for the 3055 is probably needed to prevent
sluggish switching of the 3055, perhaps 100 ohms or so (it discharges the stored minority charge carriers from the base when
going from saturated state to off).

The 2n2222 is a lot faster than the 3055 so its green resistor may not be doing much - 1k would do.

The 75 ohm resistor on the 2n2222 collector needs to be a power resistor, about 3W rating.

Without the 1N4007 the motor could generate hundreds of volts and destroy all the semiconductors in that
circuit - it prevents inductive kick-back at switch-off by routing the current safely as the magnetic field
collapses. However it needs to be a bigger diode - it will be carrying the same current as the motor, 10A,
but in pulses - perhaps something rated 3 to 5A is a good compromise.

You must have a fuse between the battery and your motor driver circuit BTW.

A word of caution: switching 10amp is no small matter. You want to look into 2n3055's datasheet to make sure that it is up to it.

I would also look into what value-add, if any, that little capacitor is doing. It is forming an lc tank with your motor and can cause ringing.

dhenry:
A word of caution: switching 10amp is no small matter. You want to look into 2n3055's datasheet to make sure that it is up to it.

I would also look into what value-add, if any, that little capacitor is doing. It is forming an lc tank with your motor and can cause ringing.

Its sort of a snubber cap, since the 1N4007 is a slow rectifier it does the initial job of absorbing the spike till the diode catches up,
also will reduce RF interference from brush-sparking.

But you are right to warn caution of the 2N3055 - it can handle 10A, but the current gain drops to 5 at that current level, the 2N2222
can't drive 2A!

Its a venerable and ancient power transistor, more modern devices will be far more suitable, quick search suggests MJ15003 as
possible part (gain 25 at 5A...). However a MOSFET might be a more sensible choice, or a Darlington if you can afford the voltage
drop.

MarkT:
However a MOSFET might be a more sensible choice

I think a logic-level MOSFET would be the most sensible choice, personally. For all the reasons already given, as well as that at 10A the 3055 is going to need one heck of a heatsink...

VCEsat is also 3V @10A, so there will be 30W of heat to dissipate. Well within the capability of a 2N3055, but it will require a fairly big heatsink nonetheless.

May I suggest an IRL540 MOSFET? It could be used by itself and would not even need a heatsink with a gate drive of 5V and a drain current of 10A. It can handle sustained currents of up to 28A and peak/pulse current over 100A, so it should be able to cope with stall and start conditions fairly well.

giacomomarelli:
I need to control the speed of a dc motor (0.5 A no load, to 10 A full load). In the picture you can see that I'm using a 2n2222 that controls a TIP3055 (or a 2N3055). The circuit works but I'm not sure that is perfectly ok... Can you check it out?
I don't know if I need the two green resistors (with question marks), I didn't use them in the test but I saw that some people use them. What should be the values?
Also: what is the functionality of the 1N4007 diode next to the motor? And do I need to put another diode from the collector to the emitter of the 3055?
Thanks!!!

That circuit is fine. The resistors you highlighted are not necessary.

What the diode does is protect the 2N3055 from inductive kickback. When the motor is energized, a magnetic field forms on the armature. When the current is removed, the magnetic field collapses almost instantly. Faraday's law basically says that the faster a magnetic field changes, the higher the voltage induced in the wire. So, if you put +12 volts into the motor, when you de-energize it (i.e. the PWM goes to the "off" cycle), the magnetic field collapses and can generate hundreds to thousands of volts in the OPPOSITE direction.

So, normally the diode does nothing (reverse biased), But if an inductive kickback occurs, the diode is forward biased and "snubs" the spike.

Picture a rubber band. Say you hold the bottom of the rubber band and stretch the top end higher and higher (more and more "positive"). When you let go of the top, the rubber band will snap DOWN (negative) very fast. The SAME energy (less losses) that you put into the rubber band stretching it is returned when you release it, but because it's faster, the "snap" stings your skin. The energy is the same, the "delta-T" is much smaller.

With Faraday's law, the delta-T is in the denominator, so the less time it takes for the magnetic field to collapse, the higher the voltage is.

Make sense?

DirtBiker:
VCEsat is also 3V @10A, so there will be 30W of heat to dissipate. Well within the capability of a 2N3055, but it will require a fairly big heatsink nonetheless.

May I suggest an IRL540 MOSFET? It could be used by itself and would not even need a heatsink with a gate drive of 5V and a drain current of 10A. It can handle sustained currents of up to 28A and peak/pulse current over 100A, so it should be able to cope with stall and start conditions fairly well.

A MOSFET would be a MUCH better device to use. The Rds (saturated) is only a fraction of an ohm on power devices, and the gate can be driven directly from the Arduino port (no 2N2222 or even resistor needed).

Excellent advice.

Ok. So if I just swap the 3055 with the Mosfet it should work... Is the circuit in the drawing correct? Do I need a resistor (1K?) from the arduino to the mosfet?
The mosfet only needs a small heatsink, with a fan?
If this is the final solution I just need to order a couple of IRL540.

Thanks for the help!!

IRL540 is not a good mosfet to use for switching 10A, its Rds(on) is 0.077 ohms max so it will dissipate around 7.7W when carrying 10A. Look for a mosfet with much lower Rds(on), such as IRLU8726PBF (0.008 ohms max).

Use 150 ohm resistor between Arduino pin and MOSFET gate to limit the current (a MOSFET gate looks like a capacitor of several nF).

What frequency of PWM were you contemplating BTW? Switching losses are proportional to PWM frequency.

The PWM frequency is the one normally generated by an arduino mega, I prefer not to change it because I'm using several other devices with it. It is also going to communicate through serial usb with a computer. I know that changing the pwm frequency changes the clock frequency of the arduino.
Otherwise if changing it isn't a problem, what would be the best pwm frequency?

I'm a bit confused on wich mosfet to use... It has to be a IRL series with very low Rds(on)... Correct?
The problem is that a IRLU8726PBF is not so easy to buy online. (I live in italy), IRL540 is more common, also on ebay..

dc42:
IRL540 is not a good mosfet to use for switching 10A, its Rds(on) is 0.077 ohms max so it will dissipate around 7.7W when carrying 10A. Look for a mosfet with much lower Rds(on), such as IRLU8726PBF (0.008 ohms max).

Hi dc42, no offense intended here, but I think you made a little error on the math. The dissipation would be .77W.

@giacomomarelli, the IRL540 should work but it will get a little hot. With an RDS ot 0.077ohms will give about .77W at 10A which will mean a rise in temperature of about 48C degrees C over ambient. With an ambient of 20C, that would give a temperature just under 70C which should be quite safe at that current where the maximum allowable case temperature is about 155C. Although the IRLU8726 would probably be a lot cooler.

As stated a small gate resistor might be a good idea for PWM use to reduce current draw from the MCU a bit, the value of 150ohms seems okay and is not critical, use something between 150 and 470 and you should be fine. Other capacitances should be negligible for your use.

Isn't power= intesity x intesity x resistance?
So 10x10x0.077= 7.70W

I measured again. The motors actually need from 2.5 to 7.6 A each (peak is about 9A)
This means 4.44W with 7.6A and 0.077ohms
Is it too much? A normal heatsink with a pc fan (60mm x60) shuold work to keep the temperature to resonable levels...

Actually you're right. My apologies to yourself and dc42.

For some odd reason I had it in my mind that 0.077 was the VSD and not the resistance.

Yes, I think that heatsink would be capable of keeping things cool enough.

giacomomarelli:
This means 4.44W with 7.6A and 0.077ohms
Is it too much? A normal heatsink with a pc fan (60mm x60) shuold work to keep the temperature to resonable levels...

Yes, if you are happy to use a heatsink (and a fan if necessary). But unless you already have the IRF540s, why not choose a mosfet that won't need a heatsink?

Is a IRLZ44N mosfet a good solution? It's the best I found from a seller near by.
Rds is 0.022 ohm
Ids is 47A

What about the IRF series? Are they ok for driving a motor from 5V pwm? Some people say the only difference is the voltage applied on the gate.. 5V with IRL, 10V with IRF. Is that correct or is there a more substantial difference?

Let me know so I can purchase it.
Thanks!

IRF can work here. They have lower Rds but high Vgs(th) than the logic level mosfets. Since you are powering the motor from 12v, you can easily drive the IRF from that, solving the problem.