Help with an electronic brake for a DC motor

Thread Starter

Involute

Joined Mar 23, 2008
106
I have a small 12VDC motor (250 mA max.) that I'd like to add an electronic brake to. I control the motor (on/off) from a micro driving a mosfet on the motor's low side (see Brake.jpg for schematic). To brake the motor, I'd like to short the motor's contacts (after turning it off first, of course), which I'm trying to do via a 2N2222. This has no effect, though I've confirmed that physically shorting the contacts immediately after killing the power to the motor has the desired effect. I've attached a shot of the traces from my scope; the points where the probes connect to the circuit are indicated on the schematic by color and number ("T1" is trace 1).

You can see that when the motor is switched off (T4 goes low), the brake switches on (T1 goes high) for 250 ms, but there's no change in the voltage across the motor contacts (T2 and T3). I assume the ramp on T3 after the motor is turned off is the dissipating inductance.

Any ideas what I'm doing wrong? I'm a newbie, so it's probably something dumb and obvious. Thanks for the help.
 

Attachments

Thread Starter

Involute

Joined Mar 23, 2008
106
Good point, I guess nowhere. On the other hand, at one point while trying to get this to work, I theorized the Q1 side of the motor went positive with respect to the 12V side when Q1 shuts off, as the magnetic field collapses and generates back EMF. If so, swapping the emitter and collector in my schematic should get it to work, but it doesn't; the motor still coasts to a stop.
 

THE_RB

Joined Feb 11, 2008
5,438
2N2222 is not suitable to brake a motor running at 250mA as the braking current might be higher than that!

If you change from an NPN to a PNP transistor and drive it with a low signla at the base to turn it on, the circuit should then work fine. Something like a BD140 PNP should be good enough and commonly available.
 

John P

Joined Oct 14, 2008
2,025
...the magnetic field collapses and generates back EMF.
There's a misconception here. When you cut the current flow to a motor that's rotating, there will be two effects.

1) As with any inductor, there is a magnetic field which has the tendency to keep the current flowing in the same direction as it was already flowing. Hence the control transistor needs protection from a voltage spike.

2) The mechanical energy stored in the rotating parts produces back EMF which tries to drive current in the opposite direction relative to the original flow of current. The voltage in this case is limited to the original power supply voltage, and realistically will be quite a bit less.

Generally the electrical time constant, for the motor as an inductor, is much faster than the mechanical time constant.

You don't need that 1K resistor in series with the transistor. That'll pretty much prevent any braking action.
 

Thread Starter

Involute

Joined Mar 23, 2008
106
2N2222 is not suitable to brake a motor running at 250mA as the braking current might be higher than that!
250 mA is the stall current. In any event, I've tested the transistor outside of the circuit and it works fine driving an LED, so it hasn't blown yet. I'm happy to beef it up, but I'd like to get it to work first.

If you change from an NPN to a PNP transistor and drive it with a low signla at the base to turn it on, the circuit should then work fine.
What difference would active hi vs. active low make?
 

SgtWookie

Joined Jul 17, 2007
22,230
Originally Posted by THE_RB
If you change from an NPN to a PNP transistor and drive it with a low signla at the base to turn it on, the circuit should then work fine.
What difference would active hi vs. active low make?
Your logic circuit is limited to 5v, and you'd have to get the base signal to T1 higher than 12v in order to turn it on.

So, you need to replace the transistor across the motor with a PNP transistor; a 2N2907/PN2907 should work fine. Since it might be sinking up to 250mA (motor stall current) you'll need 25mA base current, so use a 430 Ohm resistor from the base of the PNP towards the uC. However, you need to drive that PNP base with an open-collector NPN transistor (or open drain MOSFET) as otherwise the PNP won't turn off. You will also need a base return resistor for the PNP; 2k to +12v should work fine.

So, the open-collector transistor will need to be an NPN, and will need to sink 25mA from the PnP's base resistor. For the NPN, a 1.6k base resistor will work fine.

Note that when the base of the NPN is high (your uC's output is high) the braking action will be on.

You must be certain that the MOSFET is never on at the same time the brake is on, or you will likely see smoke.
 

Thread Starter

Involute

Joined Mar 23, 2008
106
I see what you mean, John P. I was mistaken. Thanks. However, I removed the 1K series resistor and there's still no braking. T1 tracks slightly higher after Q2 is switched off, but otherwise the traces are the same. Which raises another issue (possibly unrelated to the braking). Why doesn't T1 stay low after Q1 is switched off (T1 goes low)? Instead, it appears to track T3 (i.e., the base is following the emitter).
 

Thread Starter

Involute

Joined Mar 23, 2008
106
Thanks for the detailed reply, SgtWookie. Why does the base have to be > 12V to turn on the transistor? When it gets the 5V pulse now, its emitter is at only about 1.5V.
 

John P

Joined Oct 14, 2008
2,025
I don't know where this 0.25 amp braking current comes from. The current which would actually flow, if you could apply a dead short to the motor, is obviously the back EMF produced by the motor (which will be proportional to the motor's speed at that moment) divided by the motor's resistance. Since the back EMF can never be equal to the 12 V that the power supply delivers (it'll be less, determined mostly by the IR voltage drop in the winding plus brush loss), you won't get the full 12 V when the motor's coasting, either. That reduced voltage is the back EMF you start the braking phase with, and it'll decrease as the motor slows down, and as it does, so will the current flow and the energy absorption. What, you say, is the braking torque going to decrease as the motor changes speed? Yes, absolutely. It's really more of a "damping" action than a "braking" action, and it's speed dependent.

If this motor takes .25A stalled on a 12V supply, it must have a resistance of 48 Ohms. Let's say it was running at whatever load it takes to draw 0.1A from the supply, so IR drop is 4.8V and back EMF is 7.2V. Then if you short the motor, you'd have 7.2/48 = .15A flowing, and that would be the peak. It would be less from then on.
 

SgtWookie

Joined Jul 17, 2007
22,230
Thanks for the detailed reply, SgtWookie. Why does the base have to be > 12V to turn on the transistor? When it gets the 5V pulse now, its emitter is at only about 1.5V.
When Q1 turns off, you no longer have the low side of the motor at ground. As the voltage across the motor gets smaller, it gets closer to +12v. With the resistor size you're using for the NPN's base, you'd need to stay 5v or more above the emitter voltage to keep the transistor turned on. That's just not going to happen.
 

Thread Starter

Involute

Joined Mar 23, 2008
106
Hey, SgtWookie. I implemented the circuit you described (I think), and there's actually some braking, though not nearly as mush as from an actual shorting of the contacts. You can see the effect on the attached scope shots. acope shows the previous circuit with the voltage decay on the motor's negative terminal circled in red; it lasts about 400 ms. and starts at a fairly low voltage. bcope shows the current circuit with the decay lasting only about 200 ms. and starting at a slightly higher voltage (reducing the amount that must decay).

My bigger concern is that the 2N2907 heats up real fast; it gets so hot I don't run the circuit for more than about 5 seconds. I've attached the schematic I came up with. Is this what you were describing? The actual resistor values I'm using are all about 10% higher than you suggested, because I don't have the exact values and I thought it better to err on the high side. Thanks loads for getting me this far.
 

Attachments

Thread Starter

Involute

Joined Mar 23, 2008
106
THE_RB:

I've thought of that, and may end up going that way if this becomes too much of a production. I just prefer transistors to relays when possible for reliability.
 
Top