# Questions about PWM controlled DC Motor

Discussion in 'General Electronics Chat' started by John5788, Apr 2, 2009.

1. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0
I have a 12V motor that I am trying to drive with a PWM signal from a PIC, and I've successfully gotten the circuit to work with an NTE 2986 N-Channel MOSFET. I just have a few questions that came up while I was doing the research on figuring out how to do this (this is my first PWM motor project).

How do we determine the proper frequency of the PWM? I first had the PWM set at 2KHz which did not drive the motor very well, made the MOSFET get hot, and the motor whined at low RPMs. After doing some reading, I hear that most DC motors should be run at 20KHz with PWM, which I set and now the motor seems to work just fine, no whining, and the MOSFET doesn't get hot.

The other question is, what determines the value of the capacitor (bypass capacitor?) that you run in this circuit? I haven't actually put one in yet, but I'm reading values somewhere around 1000uF and rated for twice the voltage that the motor runs at.

Last question, how does putting the diode in parallel with the motor help with anything?

I apologize if any of these questions seem stupid

2. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
726
Diode across motor: When current is switched off, the magnetic field around the coil windings inside the motor collapses, creating a large voltage spike. The diode routes that voltage away from the transistor.

Which bypass capacitor? Do you have a schematic of your circuit? Easily drawn with Tina-TI (free download).

PWM Frequency is best found through trying different frequencies, although it can be calculated given enough data about the motor and driver. Generally, between 100 and 300Hz, or 14kHz-40kHz. The larger the motor, the higher the inductance, which forces a lower PWM frequency. The 100-300Hz range is for larger motors, where the noise made from them moving is typically louder than switching frequency noise.

There isn't really a "lower bound" to PWM frequency, other than to keep it out of ranges where hearing is sensitive 20-15kHz, approx, up to 20kHz for younger people.

3. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0
here is the circuit

thanks for clearing up the PWM frequency thing. So the higher the inductance of the motor, the lower I should set the frequency? I still have to set it out of audible range of human ears to avoid whining right?

what kind of diode should I be using?

4. ### jjet New Member

Apr 2, 2009
3
0
The cap is to prevent oscillation in your supply voltage, in case there is a length between the supply and the motor. 100uF should be enough. a 30 ohm resister between the gate and the PIC will help also. With a small motor and low voltage the frequency isn't that important, but it helps to get it above audible range. The diode is important. An MUR110 is a nice one. A very fast recovery diode is needed. If your worried about the frequency, a scope across MOSFET while it's running will show you what the square wave looks like. Try a few different frequencies to see the difference.

5. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
726
Yes, although some motors do not make that much noise from the PWM. Try to get the best efficiency, If it is audible, try changing it a bit. Some frequencies, especially those in the voice range, seem louder than they actually are. if you can stay on the edge of a sensitive band, it's a good tradeoff.

To decide the filter capacitor, the amount of current drawn needs to be known.

The actual formula is $C=\frac{\Delta V}{\Delta t}\cdot I$

Using batteries, Voltage drop is calculated with internal resitance and wire lengths. Using a power supply, the "Ripple Formula" is used.

Super Quick "Stiffening Capacitor" overkill Rule of thumb is ≈0.2uF per mA for PWM > 10kHz.

Plugging in values: $\Delta T = 50\scriptsize\mathsf{E}\normalsize10^{\small -6}$ I = 1 A time is from 20kHz, Current is a guess.

What is left is to decide voltage drop. This is dependent on the power source. If it is a large battery, 1A may only drop 0.2V from internal resistance. Using a worse case scenario, a 9V transistor battery, or 9 AA batteries in series, the internal resistance is 1.5Ω, which would create a 1.5V drop (11.5V output) during switching. To "Stiffen" that source, the capacitor would need to be 33uF using the equation above, or a 50uF using the rule of thumb.

You will also want to add a 100nF (0.1uF) cap across the motor to reduce EMI, as well as a 100nF(0.1uF) cap between V+ and GND on the PIC. Both of these should be NPO/Mono ceramics, or a film cap. A 0.1uF Electrolytic has too high of an ESR for effective decoupling.

6. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0
is it ok to use the MUR110 on a high current motor? I am trying to power at motor that runs at 25-30A on full load

7. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0
Another question: can anyone recommend a good mosfet for this application? (driving a 30A 12v motor). The NTE 2395 got really hot when I used it with the motor and I think the motor killed it because all the pins are shorted out.

8. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
726
You will need a High Side Driver for the MOSFET to switch that level of current on and off efficiently. The link above is an example of one that should work.

There are high side/low side drivers available, but to overcome capacitance on the single FET at a high frequency, A low capacitance, and solid drive will help with efficiency.

WITH a driver, This looks to be a good chioce, low gs, and low RDSon.:
IRFU3711Z

9. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0
Thanks for the top thatoneguy,

I'm still learning this kind of stuff so I always have questions if you dont mind

How does the high side driver work? Why do I need it / what does it do for my circuit? What are the downsides of not using it in my circuit?

is it just because the signal from the PIC is weak (~25mA) and I am trying to use the signal to switch something large around 30A?

10. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0
I finally got around to putting the MOSFET on a breadboard and trying to power my motor. Even though the MOSFET was rated for 35A continuous and 152A pulsed (http://www.alliedelec.com/Images/Products/Datasheets/BM/NTE_ELECTRONICS/935-7042.PDF), the MOSFET got really hot, started smoking, and eventually the internals shorted out.

Is there something I am missing from my circuit or is this MOSFET just not good enough for the job?

11. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
726
If the MOSFET is getting extremely hot, it is operating in linear mode, rather than switching mode. A higher current in the driver fix this.

This post by SgtWookie explains the reasons very well, along with simulations.

wstay90 likes this.

Aug 7, 2008
4,727
510

13. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0
ahh ok thanks. Question, I since I don't have the high side driver right now, instead I have a few npn transistors along with some darlington pairs. Could I just put the PIC signal to the base of the transistor, then link the emitter to the gate of the MOSFET? I'll draw this up if it's hard to visualize.

would this circuit work?

I do have a heatsink on it, but it is a small heatsink. It is the NTE 497 heatsink for TO-220 packages.

i dont think its sufficient, but I'm just kind of prototyping. it should at least work for a little while.

14. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0

(Ground for the PIC is same ground as for the DC motor)

here is the schematic I am talking about with using an NPN transistor to increase the current to the gate of the mosfet.

also, I was looking around and I saw other PWM circuits implement this idea where they use two MOSFETs, probably to split up the load so it doesn't overload a single MOSFET. do you think this is a good idea?

15. ### DrNick Active Member

Dec 13, 2006
110
2
First of all, the high side drive will not necessarally produce higher efficiency. It depends on the fet you are useing. The high side drive however can be more fault tollerant.

The fet probably smoked due to switching loss (and/or lack of heat sinking). Although your fet datasheet may say it can handle 30 A, the power rating quoted on the datasheet is assuming there is perfect heatsinking from case to ambient temp (I.e. the case stays at approx. 20 C). In real systems this is impossible. Therefor you need, let's say, a 60A fet to switch the current and good heatsinking to prevent the device from becoming a smoke bomb.

Also it sounds like you are driving the fet with a logic output. These typically have a pull up resistor of a relatively lare impedance. The fet has capacitance from gate to drain that has to be charged before it really turns on (and has the quoted Rds(on) from the data sheet. Once the command to turn on is given the gate charge begins to fill up. At this point the current flowing thru the armature begins to flow thru the fet as well. During the time that you are charging the gate you have Pfet = Iarm * rds(on) power in the fet. This can be a substantial amoun of power. This power surge will cause the fet to overheat. This phenominon is referred to as switching loss. As you increase the switching frequency this can get to be the majority of the loss.

The way to fix this is to buffer the logic output with complametery emitter followers or what is commonly called a 'gate drive'.

To make a long story short, get a higher current device, heat sink it, and insert a gate drive circuit to reduce switching time and thus reduce switching loss.

16. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
726
The collector of the transistor should be connected to the +13V supply for a better turn on speed, and a few low value resistors on the transistor base and gates.

The paralleled MOSFET both increase current handling, and reduce the effective RDSon value (resistors in parallel, so to speak).

ETA, the driver mentioned above using two emitter followers would be better.

17. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0
I had some time this weekend to play with my circuit some more. I made something new like this:

I was using whatever BJT's i had laying around and I don't think they were sufficient enough to act as drivers for the MOSFET because the MOSFET still got hot very quickly and smoked.

NPN, KSP44: http://www.vakits.com/datasheets/Transistors/KSP44.pdf
PNP, KSP94: http://www.pokong.net/MoBack/files/2007810163114KSP94.pdf

Its either the driver I made was sucky or the MOSFETs just aren't rated well enough for the 30A load. Maybe I should try some MOSFETs rated for 80A like this:

http://www.st.com/stonline/books/pdf/docs/8260.pdf

Either way I need to buy new parts, and I might as well get a driver instead of trying to find the right combination of parts to make one. I was looking into high side vs low side drivers, and it sounds like I need a low side driver for what I am trying to do? I am switching the ground part of the motor, not the power.

I've been looking around and found this driver which looks promising

what do you guys think about coupling that driver with the 80A ST MOSFET i mentioned earlier?

18. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
726
I'd suggest getting the ST MOSFET Driver that matches the Devices you will be using. They are often referenced in both the driver datasheet, and as an example application in the MOSFET datasheet.

When testing, and ALL voltages are below 50V, Start the circuit for 1 second, turn it off, then feel for anything hot. Then go to 5, repeat. Up until you run 30 seconds.

With teh circuit above, there isn't anything limiting base current on either transistor, which would give good drive as well as a possibility of a 3 legged diode. A 470-1k resistor in series with the base lead will sill allow enough current through for full saturation of most BJTs, check your datashet if you have a "Freak" grab bag model.

The D1 across the motor is Absolutely required, and should be a Speedy high voltage fast swtching diode. "Fast" means switching speed at voltage/current used is at least equal to and preferable shorter than switching time of MOSFET.

There's a couple other things with your circuit that cause issues, but they've drifted away. One was related to simulation of the invention. The second is about the size of the motor. One diode might not cut it if you are killing parallel MOSFETS. Have you simply "run" the motor with a MOSFET "power switch" for on/off, rathr than PWM? That might be a good start.

19. ### John5788 Thread Starter Active Member

Apr 2, 2009
54
0
I didn't see anything in the data sheet that tells me which driver matches the STP80NF55, but I did email ST technical support, maybe they can give me an answer.

I went ahead and got a couple of different drivers. I got the MCP1404 from microchip and UCC37324 from TI, ill try both.

I'll also try your suggestion for testing, running the motor for short periods of time until it is stable at 30s.

For D1 I am using NTE589, and I have a few other types laying around here somewhere like the MUR110 and 1N4004

How do we determine how much current we need for the gate?

I = Q / t ?

Q = total gate charge
t = half of the PWM frequency? (20KHz, means t = 0.0001s ?)

20. ### Darren Holdstock Active Member

Feb 10, 2009
262
11
John, your MOSFET gate-source voltage is being driven at 3 V over the absolute maximum rating, which won't help. Add some series resistors to the gates and a zener diode across the gate-source junctions to clamp it. Normally the resistor is a few 10s or 100s of ohms, but this might have to be increased a bit so the zener doesn't dissipate too much. Even without the zener the gate resistor damps down the ringing that's a product of the interaction between the g-s capacitance and trace inductance, and that can increase the dissipation in a PWM MOSFET by operating it in the linear region for longer. It might not explain all the heat (it's may be mostly switching losses from driving a big MOSFET with a large gate capacitance at high frequencies), but it won't help either. If winding the frequency down reduces the heat, then that's the clincher.

If you haven't got a 'scope handy, then you can generally tell the difference between a clean and ringing PWM motor drive signal by the sound it makes. Even at ultrasonic frequencies the undertones are often slightly audible.