Arduino Forum

Using Arduino => General Electronics => Topic started by: nickgammon on Jan 29, 2015, 10:17 pm

Title: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 29, 2015, 10:17 pm
Introduction

I find I learn a lot by writing tutorials, because when you write a tutorial you want to explain exactly why you did something, rather than something else. Also it helps you clarify concepts in your mind (my mind, that is).

I am working on a page about interfacing with a high-side driver (ie. to source current rather than sink it) using a P-channel MOSFET.

There are some great YouTube videos about this subject, but I find at times that I want to just "glance at a circuit" rather than sit there watching a video for 10 minutes, to try to find the part where they explain about the relationship between current, RDSOn and heat.

Schematic

Below is the proposed schematic:

(http://www.gammon.com.au/images/Arduino/MOSFET_high_side_driver.png)

For testing, the MOSFET is a FQP47P06 (http://www.farnell.com/datasheets/1725683.pdf) and the transistor is a 2N3904 (http://www.farnell.com/datasheets/1685026.pdf).

You are welcome to make suggestions about the values of the components (eg. R1 and R2).

Also D1, I am using a 1N4148 for a 300 mA motor. Would this be adequate? Would a Schottky be better, or is that overkill? I believe the 1N4148 is a fast (4nS) recovery, 200 mA, 100V diode.


I have tested with a 2 ohm load, driving the whole thing from a power supply limited to 1 amp. The input pin is a 1 kHz square wave (at 5V).

Overall results are:

(http://www.gammon.com.au/images/Arduino/mosfet_test7.png)


The blue trace is the Gate of Q2 and the yellow trace is the Drain of Q2.

As expected, the FET turns on when the gate becomes more negative, and turns off when the gate becomes less negative. In particular:

(http://www.gammon.com.au/images/Arduino/mosfet_test8.png)

The delta there is around 2V which agrees with the datasheet which quotes VGS(th) as -2V mininum.




Turn-off time

Once concern I have is the fairly lengthy turn-off time:

(http://www.gammon.com.au/images/Arduino/mosfet_test6.png)

That is around 58 µS which seems a lot. It also accounts for, I think, that the FET is getting hot (around 30 °C) because it is running unsaturated for quite a while.

Would a lower value for R2 help here? Any suggested values? If R2 was lower, then R1 might need to be lower too to provide adequate current to sink the gate to 0V when required. Would that be right?




Turn-on time

Turn-on time seems to be somewhat faster (around 1 µS) which seems OK to me:

(http://www.gammon.com.au/images/Arduino/mosfet_test5.png)




Power consumption and heat

I calculate the power through the load as being I2R where I is 1 and RDS(on) is 0.021, thus:

Code: [Select]

power = 1 * 1 * 0.021 = 0.021 watts


The "Thermal Resistance Junction to Ambient" (RØJA) is 62.5 °C/W, thus I expect a rise of:

Code: [Select]

0.021 * 62.5 = 1.3125  °C  (over ambient)


Does that sound right? However I am measuring more like 10 degrees rise.




Any other comments or suggestions?
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 29, 2015, 10:46 pm
Yes, a lower R2. 10k is a pretty high resistance to discharge the gate charge.

Unless you are on a tight current budget from the Arduino pins, I think I'd start with a 1k resistor for R1, and 470 ohms for R2.

Using a 200mA rated diode on a 300mA motor seems unwise. I'd use at least a 1A diode. As has already been discussed, a 1N400X diode is fast enough turn-on time, it is the turn-off time that is slow.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 29, 2015, 10:48 pm
Come to think of it, I think the description of R2 on the schematic ("R2 is pull-up") is wrong. More precise wording is solicited. :)
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 29, 2015, 10:52 pm
Hm. Well, it -is- a pull-up in the sense that we consider positive voltage on a schematic to be "up".

Its job is to discharge the charge built up on the Gate-Source "capacitor". It is -not- there in case of high impedance. It is there so that when Q1 is turned OFF, the gate is discharged and Q2 turns off. Otherwise it will stay on for a long time, perhaps never turning off once it is turned on due to Q1 leakage.

Or if not Q1 not turned on, Q2 may eventually start drifting into conduction due to Q2 gate charging from Q1 leakage current.
Title: Re: Comments requested on MOSFET high-side driver
Post by: Grumpy_Mike on Jan 29, 2015, 10:53 pm
I would make R2 smaller, say 1K to reduce the turn off time of the FET.

I would also use a 1N4001 diode, that one is just a signal diode.

Cheers
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 29, 2015, 11:01 pm
Quote
I think I'd start with a 1k resistor for R1, and 470 ohms for R2.
So to do the maths:

1k resistor for R1 and assuming a gain of 100 (actually HFE = 300 on the datasheet) would give:

Code: [Select]

(5 - 0.7) / 1000 * 100 = 0.43  (430 mA)


So Q1 can sink 430 mA.

470 ohms for R2, means to drop 12V:

Code: [Select]

12 / 470 = 0.026  (26 mA)


Power through R2:

Code: [Select]

0.026^2 * 470 = 0.318  (318 mW)


Thermal resistance of Q1 (RØJA = 200):

Code: [Select]

 0.318 * 200 = 63.6 °C


That seems a bit hot, or did I get my calculations wrong?
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 29, 2015, 11:21 pm
Incorrect. You never use the linear small signal beta to calculate saturation current.

Use more like 10 or 20. For a 2N3904, the datasheet says 10x.

Page 3, it rates saturation VCE for IC = 10mA when IB = 1mA, and IC = 50mA when IB = 5mA.
http://www.physics.csbsju.edu/~awhitten/phys358/reference/2N3904_4.pdf (http://www.physics.csbsju.edu/~awhitten/phys358/reference/2N3904_4.pdf)

So for 4.3mA, don't count on more than 43mA IC through Q2.

You should always get a resistor with a power rating at least 2x the power that will be dissipated.

It looks like you just took the power in R2 and used it to calculate heat in Q1.

Q1 power is the sum of power from the base and the collector currents and drops:
0.95 * 0.0043 + 0.2 * 0.026 = 9.285mW
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 29, 2015, 11:22 pm
In fact, from the datasheet 200mV drop VCE is maximum. It is usually less than that. But plan for the maximum.
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 29, 2015, 11:24 pm
I would have said "Power -in- R2".
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 29, 2015, 11:44 pm
OK just to make sure:

Quote
Q1 power is the sum of power from the base and the collector currents and drops:
0.95 * 0.0043 + 0.2 * 0.026 = 9.285mW
VBE(sat) = 0.95
5V (at pin) - VBE(sat) / 1k  =  (5 - 0.95) / 1000 = 0.00405 (4.05 mA)
VCE (sat) = 0.2
26 mA to sink through the resistor

Thus:

Power =  0.95 * 0.00405 + 0.2 * 0.026 = 0.0090475 (9.05 mW)

Heat gain =  0.0090475 * 200 = 1.81 °C


Does that sound right?
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 30, 2015, 12:07 am
Whoops, forgot to correct the base current with the higher VBE.    :-[

That looks right.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 30, 2015, 01:37 am
Changing R2 to 470 ohms seems to have reduced the rise time at the gate to 5.5 µS.

(http://www.gammon.com.au/images/Arduino/mosfet_test9.png)
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 30, 2015, 01:40 am
From 58uS to 5.5uS. Sounds about right.

One of the problems you run into with a MOSFET is drain to gate capacitance. So as the gate is discharging (going high), the drain is going low, and the capacitance between gate and drain slows the discharge of the gate by providing some charging current.

That is probably part of why a 20:1 change in resistance only resulted in an 11:1 change in Off switching time.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 30, 2015, 01:47 am
So it would be reasonable to suggest, other things being equal, that if we are doing PWM, to reduce the frequency, so that these "edge cases" happen less often? Obviously this problem goes away if we are switching infrequently, like turning garden lights on and off.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 30, 2015, 04:27 am
I have finished the tentative tutorial, which is at http://www.gammon.com.au/forum/?id=12737 (http://www.gammon.com.au/forum/?id=12737).

There is more explanation in the tutorial than I had above, plus a low-side driver (to sink current). If you spot any mistakes please let me know.

@polymorph - I scaled R2 back to 1k, it seemed we were getting diminishing returns on low-value resistors, and that would keep the current drain on Q1 down. The switching time is now about 7.5 µS.
Title: Re: Comments requested on MOSFET high-side driver
Post by: Coding Badly on Jan 30, 2015, 05:19 am

How is the MOSFET temperature with the new resistors?

Title: Re: Comments requested on MOSFET high-side driver
Post by: dlloyd on Jan 30, 2015, 05:37 am
I use MOVs when switching transformers and solenoids and believe you could get much greater speed improvement with your MOSFET high-side motor driver. The speed improvement comes from clamping higher than the 0.7V of a diode. I haven't used MOVs across a motor, but I wonder what speed improvements could be had with an MOV rated for 16V DC such as this:
http://www.digikey.com/product-detail/en/B72210S1140K551/495-6514-1-ND/4931646 (http://www.digikey.com/product-detail/en/B72210S1140K551/495-6514-1-ND/4931646)

Also check this post:
http://forum.arduino.cc/index.php?topic=294268.msg2064128#msg2064128 (http://forum.arduino.cc/index.php?topic=294268.msg2064128#msg2064128)
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 30, 2015, 05:45 am
Good trade-off.

Yes, if the application is fine with a slower PWM, that saves switching losses and the other losses associated with it like driver current losses.

The 1N4001 is not a fast switching diode. It is a garden variety line frequency rectifier, but it switches On fast enough to absorb most inductive transients. What dlloyd is referring to is more of an issue with the speed of magnetic field collapse in a coil. This is an issue with relays as a low clamp voltage can cause contact burning as it slows release. In that case, adding a resistor in series with the clamping diode can speed that up.

For a motor, it is going to generate a voltage as it continues to turn, but it will be in the same polarity as the voltage applied and not spike up any higher. Well, except a motor is also made of inductors, so I'd still keep the diode.

For your MOSFET power calculations, I'd say 2^2 rather than 4. It is clearer, then, that the number is 2A squared.

I try, as a general rule, to keep device temperatures under 75C when possible. 150C may be a maximum, but by mentioning, you may be unintentionally giving people the impression that it doesn't really have any drawbacks.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 30, 2015, 05:50 am
How is the MOSFET temperature with the new resistors?
Well, it still got up to around 32 °C, which I am not that impressed with, but I think my test conditions are not helping. With a fixed current from the lab supply it is dropping the voltage to around 3.6V which then means I think it is not properly switching on.

I think I'll retry with a lower current, thus allowing the voltage to rise.

Quote
For your MOSFET power calculations, I'd say 2^2 rather than 4. It is clearer, then, that the number is 2A squared.
Fixed.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 30, 2015, 05:53 am
Ach, make that a higher current, allowing the voltage to rise. But then the higher current heats the thing up more.

It's tricky setting up good test conditions.
Title: Re: Comments requested on MOSFET high-side driver
Post by: dlloyd on Jan 30, 2015, 05:58 am
Missed the fact that the traces were generated using a 2 ohm resistive load ... would be different with inductance included.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 30, 2015, 06:02 am
Ah, I thought that was a general recommendation. I haven't used MOVs before, would you just put it across the load like the diode? And what specs would apply in this case?
Title: Re: Comments requested on MOSFET high-side driver
Post by: dlloyd on Jan 30, 2015, 06:16 am
Yes, directly across the load is best. I've used them successfully for many applications - mainly transformers in AC circuits. Since a transformer and motor are closely related ... hence my suggestion. For sizing, the first spec. I look at is the working voltage. In a 120VAC circuit, I use MOVs rated for 150VAC continuous, the clamping voltage is higher. Then I look at the surge current rating and energy rating.

If the 12V supply is regulated, then any MOV with a continuous DC voltage a few volts higher than this would be OK. They're even simpler to use than a diode because polarity doesn't matter.

Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 30, 2015, 06:23 am
So as a working recommendation, the one you mentioned (B72210S1140K551) with:

Quote
Varistor Voltage (Min) 19.8V
Varistor Voltage (Typ) 22V
Varistor Voltage (Max) 24.2V
Current - Surge 500A
... would probably be OK for a 12V motor?

But what does this mean?

Quote
Maximum DC Volts 16VDC
Is that basically saying that it is basically open circuit up to 16V but then conducts (up to 500A) starting at 19.8V?
Title: Re: Comments requested on MOSFET high-side driver
Post by: dlloyd on Jan 30, 2015, 06:30 am
Yes, that's how I understand it ... it works like back to back 16V zener diodes with a bit of series resistance. There are some detailed graphs somewhere SIOV metal oxide varistors (http://www.epcos.com/inf/70/db/var_11/SIOV_Leaded_Automotive.pdf)
Title: Re: Comments requested on MOSFET high-side driver
Post by: larryd on Jan 30, 2015, 07:21 am
Quote
back to back zener diodes
See Transorbs:
http://en.wikipedia.org/wiki/Transient-voltage-suppression_diode (http://en.wikipedia.org/wiki/Transient-voltage-suppression_diode)

http://en.wikipedia.org/wiki/Transient_voltage_suppressor (http://en.wikipedia.org/wiki/Transient_voltage_suppressor)
Title: Re: Comments requested on MOSFET high-side driver
Post by: JoeN on Jan 30, 2015, 07:43 am
Aren't the tradeoffs being discussed exactly why many manufacturers offer MOSFET gate driver ICs?  Maybe something to add at some point is how performance characteristics change when using one of those, though choosing one that is representative of driver ICs as a whole might be difficult.
Title: Re: Comments requested on MOSFET high-side driver
Post by: zoomkat on Jan 30, 2015, 07:50 am
Quote
Would a lower value for R2 help here? Any suggested values?
Have you tried using a pot to vary the resistance to see if you can find a "sweet spot" for the resistance?

Also have you tried reducing the value of R1 some?
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 30, 2015, 11:44 pm
This might be a bit confusing now, zoomkat, as he's modified the schematic to reflect changes made. Originally, both R1 and R2 were 10k.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 31, 2015, 12:01 am
See Transorbs:
http://en.wikipedia.org/wiki/Transient-voltage-suppression_diode (http://en.wikipedia.org/wiki/Transient-voltage-suppression_diode)

http://en.wikipedia.org/wiki/Transient_voltage_suppressor (http://en.wikipedia.org/wiki/Transient_voltage_suppressor)
Well, the interesting thing to come out of this discussion has been the transient suppression. Like many people I have read all over the place to "put a diode over an inductive load" but now there are lots of suggestions about types of suitable diodes, MOVs and now Transient-voltage-suppression diodes.

http://en.wikipedia.org/wiki/Flyback_diode (http://en.wikipedia.org/wiki/Flyback_diode)
http://en.wikipedia.org/wiki/Snubber (http://en.wikipedia.org/wiki/Snubber)
http://zone.ni.com/reference/en-XX/help/375472A-01/switch/inductive_load/ (http://zone.ni.com/reference/en-XX/help/375472A-01/switch/inductive_load/)
http://electronics.stackexchange.com/questions/31014/where-should-i-put-the-kickback-diode-in-a-transistor-switch (http://electronics.stackexchange.com/questions/31014/where-should-i-put-the-kickback-diode-in-a-transistor-switch)

From the above page:

Quote
On a side note: 1N4001 is a bit slow for this application. I usually see 1N4148
I initially had a 1N4148 however:

I would also use a 1N4001 diode, that one is just a signal diode.
So it seems that agreement on the diode type is hard to reach.




Other pages mention how useful the diode is without specifying how to choose one:

http://www.sealevel.com/support/article/AA-00470/0/How-to-Switch-Highly-Inductive-Loads-Using-Digital-I-O.html (http://www.sealevel.com/support/article/AA-00470/0/How-to-Switch-Highly-Inductive-Loads-Using-Digital-I-O.html)

Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Jan 31, 2015, 12:02 am
Have you tried using a pot to vary the resistance to see if you can find a "sweet spot" for the resistance?
I am trying to have a mathematical basis for choosing values, so that if someone has a different size load (eg. 500 mA or 5A) they have a way of calculating what ought to work, without just using trial and error.
Title: Re: Comments requested on MOSFET high-side driver
Post by: zoomkat on Jan 31, 2015, 12:10 am
If I had an o-scope I'd use pots so I could make adjustments and see what is going on real time. I'd try driving the 2N3904 base with maybe a 250 ohm resistor to ensure that the voltage drop across the 2N3904 collector/emitter is as low as possible. This would help keep the PNP MOSFET gate at its lowest possible voltage.   
Title: Re: Comments requested on MOSFET high-side driver
Post by: zoomkat on Jan 31, 2015, 12:23 am
Quote
I am trying to have a mathematical basis for choosing values,
I hope you are good with calculus and differential equations. Any of the components whose electrical characteristics are expressed as "curves" will involve complex math to get hard numbers.
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Jan 31, 2015, 01:27 am
Rules of thumb and merely looking at the curves can get you pretty close.

If your transistor switching circuit is so touchy regarding parts values, you've done something wrong.
Title: Re: Comments requested on MOSFET high-side driver
Post by: michinyon on Feb 02, 2015, 11:13 pm
It seems to me,  your calculation in reply #5 needs to include the apparent capacitance of the FET gate.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Feb 03, 2015, 12:25 am
How would you factor that in?
Title: Re: Comments requested on MOSFET high-side driver
Post by: dlloyd on Feb 03, 2015, 01:53 am
This P-Channel MOSFET is fast and powerful (and well, uhm, costs more):

Parameter             FQP47P06  IXTH96P085T   Units
Turn-On Delay Time         110           23      ns  
Turn-On Rise Time          910           34      ns
Turn-Off Delay Time        210           45      ns
Turn-Off Fall Time         400           22      ns
RDS(on)                     26           13      mΩ
ID                         -23.5        -96       A
VDSS                       -60          -85       V


Digi-Key (http://www.digikey.com/product-detail/en/IXTH96P085T/IXTH96P085T-ND/1995381)     IXTH96P085T Datasheet (http://ixdev.ixys.com/DataSheet/DS100025B(IXTA-TH-TP96P085T).pdf)
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Feb 03, 2015, 02:27 am
Ouch! $6. Not much point in getting a stinking fast MOSFET if the circuit driving it isn't going to switch it faster than 5uS anyway.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Feb 03, 2015, 03:53 am
I've added more to my thread (http://www.gammon.com.au/forum/?id=12737&reply=3#reply3) describing using BJTs for switching, if anyone wants to check the calculations.
Title: Re: Comments requested on MOSFET high-side driver
Post by: dlloyd on Feb 03, 2015, 05:07 am
Ouch! $6. Not much point in getting a stinking fast MOSFET if the circuit driving it isn't going to switch it faster than 5uS anyway.
Hmm ... I thought it was the slow MOSFETs that begin to "stink"
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Feb 03, 2015, 04:15 pm
My point was about diminishing returns.
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Feb 03, 2015, 04:17 pm
BTW, that rule of thumb of base current being 1/10th collector current is in the datasheet for the 2N2222 and 2N3904. It isn't that the gain is 10. It is higher than that, albeit much less than the linear hfe. It is that we need the transistor heavily overdriven into saturation, taking into account that you may have a transistor on the low end of the specs regarding gain, and gain drift with time and temperature.

https://www.fairchildsemi.com/datasheets/PN/PN2222A.pdf (https://www.fairchildsemi.com/datasheets/PN/PN2222A.pdf)

https://www.fairchildsemi.com/datasheets/2N/2N3904.pdf (https://www.fairchildsemi.com/datasheets/2N/2N3904.pdf)
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Feb 03, 2015, 08:48 pm
BTW, that rule of thumb of base current being 1/10th collector current is in the datasheet for the 2N2222 and 2N3904. It isn't that the gain is 10.
Where in the datasheet?
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Feb 03, 2015, 08:55 pm
Ctrl-F type in saturation.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Feb 03, 2015, 09:29 pm
Out of the 3 datasheets I have I could only see one reference to 10 and that was on the graph for "Base-Emitter Saturation Voltage vs. Collector Current" where it mentioned β = 10.

Is that what you are referring to?
Title: Re: Comments requested on MOSFET high-side driver
Post by: polymorph on Feb 03, 2015, 11:10 pm
They both specify current ratios of 1:10 for base and collector current when specifying the saturation VCE and VBE.

Also note the actual gain with the CE not quite saturated at 1.0V, hfe is 40 at 500mA for the 2N2222, and 30 at 100mA for the 2N3904.
Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Feb 04, 2015, 02:35 am
BTW, that rule of thumb of base current being 1/10th collector current is in the datasheet for the 2N2222 and 2N3904. It isn't that the gain is 10.
OK, I reworded that paragraph to get rid of the "rule of thumb" and back it up with figures. I hope the rest comes out as making a reasonable amount of sense.
Title: Re: Comments requested on MOSFET high-side driver
Post by: michinyon on Feb 04, 2015, 04:05 am
How would you factor that in?
When your circuit is turned on,  you want the gate voltage of the FET to be as negative as possible, with respect to the 12V supply.   For a given amount of current that you can sink through Q1,   this means the higher the value of the pull-up resistor,   the better.

But when you turn Q1 off,  you want the gate voltage of the FET to rise as quickly as possible.   This would be best achieved with a smaller value for the pull-up resistor.

One solution is to have another transistor to actively pull up the FET gate as fast as possible,  but that would be overcomplicating things.

The data sheet that was linked there,  implies a gate charge of 180 nanocoulombs for a Vgs of -10 volts,  which is about what you get if you can pull the collector voltage of Q1 down to about 2 volts.

It is possible to calculate how much current has to flow through your pull-up resistor for what period of time,  in order to discharge that capacitance.   For that to be useful,   you'd also need to figure out how quickly Q1 really turns off.



Title: Re: Comments requested on MOSFET high-side driver
Post by: michinyon on Feb 04, 2015, 04:16 am
On the subject of using the varistor instead of the diode,  I am doubtfull.

When the Mosfet is turned off,   the current flowing through the load, I,  drops rapidly.   If the load is an inductive load,   this will tend to cause the potential at the connection between the mosfet and the load to be large and negative,  with respect to the ground.

If you are using a diode,   then as soon as the potential at the connection between the mosfet and the load falls to -0.7V with respect to the ground,     then the diode will start to conduct forward,   feeding current back into the entry side of the load.    This mitigates the rate dI/dt at which the load current is dropping,   and therefore mitigates the negative potential at the connection between the mosfet and the load.

The reason you don't want a large negative potential there,  is that there is still +12V on the supply side of the mosfet.  If you got say -50V at the connection between the mosfet and the load,  you would have 62 V across the mosfet and exceed its forward breakdown voltage.

If you had a perfect diode,  using the diode limits the maximum forward voltage across the mosfet to 12.7 volts.   It will be worse than this for real diodes with actual turn-on time.

If you use the varistor,   the varistor is not going to conduct until the potential at the connection between the mosfet and the load falls to about -18 or -19 volts,  relative to the ground.    When that happens,  you are going to have a forward voltage of more than 30 volts across the mosfet.    It seems to me,  that is not such a good outcome.

Title: Re: Comments requested on MOSFET high-side driver
Post by: nickgammon on Feb 04, 2015, 04:36 am
Thanks for the comments. Can you put figures on a way to choose a diode? We've seen comments so far that some diodes either don't have the current-handling capacity, or switch too slowly.

Given a datasheet, eg. for the 1N4001, what parameters would you say are relevant to this application, and for what sort of motor? I presume at some stage (eg. higher voltage) it would be time to choose a different diode.
Title: Re: Comments requested on MOSFET high-side driver
Post by: michinyon on Feb 04, 2015, 06:04 am
According to the datasheet that was linked to ( which might not be the same mosfet you used ), the gate charge at Vgs=-10V  would be 180 nanocoulombs.   It is not actually linear,  but if it was,   that would be be 18 nC/V === 18 nF  ( by the definition of a farad ).

To consider how long this takes to discharge through the resistor R2,   consider the timeconstant of an RC series circuit is T=RC.   Here,  if your R2 was 1k,   then your time constant would be 1k x 18 nF = 18 microseconds.   If you think it takes about 3 time constants to discharge your capacitance to a negligible value,  looks like about 54 microseconds.   

If your R2 was 10k,  it would take ten times that long.   
Title: Re: Comments requested on MOSFET high-side driver
Post by: michinyon on Feb 04, 2015, 06:25 am
Looking at the vishay datasheet for 1N4001 diode,  this is what I see:

The maximum reverse voltage that the diode is going to see,  is 12V.    That would be when the motor is running,   the mosfet Vds is as small as you can make it,   and the ground is good.   The maximum reverse voltage for the diode is 50V,  or 35 V RMS  ( which as far as I can tell is more or less the same thing ),  so you are good there.

When the mosfet interrupts the flow of current though the motor,   the maximum circulating current through the diode starts at a maximum value of whatever the load current was,    and falls from that value back towards zero.     The diode current is not going to be more than the load current.

Looking at the datasheet,  the peak forward current for the diode is around 30 to 50 amps depending on the duration - in the order of a few milliseconds.         If your load was 2 ohms,   you'd be looking at a maximum motor current around 6 A ?   That would mean a peak diode current of less than 6 amps,  for less than a millisecond.     It would appear that is not going to overload the diode.

The diode also has an average forward rectified current of 1 amp.   Depending on the duty cycle of your PWM  and the inductance of the motor,   you might come close to this.      You'd have to have 6 amps ( peak ) flowing through the diode  for the equivalent of 1/6 of your total duty cycle,    to create a forward current (  and diode heating load ),  as large as 1 amp.

If you know the inductance L of the motor,   and you assume that when the mosfet turns off,  the +ve terminal of the motor falls to say -0.8 volts relative to ground,   enough to turn the diode fully "on",      then you can estimate dI/dt,   and therefore estimate how long the diode current event lasts.