Trying to figure out why my MOSFET died, and how to prevent it - Page 1
Forum section: electronics / beginners

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 30, 2017, 09:27:13 pm
content: Hi all,I have been attempting to put together a circuit to, under MCU control, vary the charge rate of an existing RC timing circuit. (Previous threadshereandhere.)To summarise my application: The RC timing circuit is used to set a delay for periodic activation of a relay which switches a load (a motor). At the moment, the delay is set by a 0-47K pot in series with a fixed 13K resistor. I cannot modify any parts of the existing circuitry, save for substituting the pot (is external to the board, via 2-pin connector). The load-driven mechanism has a 'home' switch that serves two purposes: a) ensure the mechanism always completes one cycle, regardless of if the user presses the 'start/stop' switch; b) changes the polarity of the timing capacitor, such that when the cycle completes, it is discharged and the charging time can begin again.I simulated the existing circuit:In the sim, I am manually toggling the 'home' switch, but in reality this occurs automatically (due to the mechanism) about 100msec after the relay switches, and again when the mechanism cycle completes. Note the over voltage and negative voltage at the test-point 'TP'.I simulated the new circuit, where I have a P/N-channel pair being PWM-ed to control the current flow to the capacitor by varying the duty cycle. It seemed to work quite well, so I built it up and tested it.Unfortunately, while the circuit initially appeared to work fine, at some point the P-channel MOSFET died.I can't work out why that would be.I started off my testing with the PWM duty cycle quite high - around 90 percent. This produced the desired short cycle time. I then adjusted the duty cycle down to minimum - about 5%. The cycle delay time got much longer (I wasn't timing, but it seemed like about 20 seconds), and when it came to switch the relay, something odd happened. I got a buzzing sound, which I presume was the relay, and the load motor started to move the mechanism, but then abruptly stopped, I think perhaps at the point it would have toggled the 'home' switch. The buzzing was still going on until I hastily shut off power.The P/N MOSFET pair I was using for testing is aDiodes Inc. DMC3028LSDXwith both on the same IC. The N-channel is fine, but the P-channel is a dead short from source to drain, with a resistance of approx. 1 ohm. No visible damage or magic smoke released.Does anyone have any ideas as to what killed the P-channel MOSFET, and what I can do to prevent it?Any help would be most appreciated.I have a hunch that the relay contact buzzing may have been because I turned the duty cycle down too low, such that at my fairly low PWM frequency (122Hz), as the current through the BJT was just approaching the threshold for the relay to turn on, the PWM caused the contact to oscillate. But how that then causes damage the P-channel MOSFET, I have little idea.

author: tautech
author_rank: Super Contributor
timestamp: June 30, 2017, 09:44:38 pm
content: Typical collapsing electromagnetic field back EMF.Don't rely on the FET body diode to always protect the FET, instead always add a reversed bias diode across the relay coil.1N4007 is often a satisfactory choice depending on the size of the relay and beefier diodes need sometimes be used.

author: slurry
author_rank: Regular Contributor
timestamp: June 30, 2017, 09:45:30 pm
content: Oscillation? remove 10nF cap in gate and add a low ohm resistor, say 10 to 100 ohms, as close as possible to the gate connection.Not on the schematc but you'll need a diode over the relay coil.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 30, 2017, 09:51:50 pm
content: Quote from: tautech on June 30, 2017, 09:44:38 pmThanks for the suggestion, but let me clarify: the existingBJTtransistor that drives the relay is not part of my additional circuitry, and as you can see from either schematic above, it has a protection diode. Basically, on the second schematic, everything to the left of the 200uF cap, with the exception of the 13K resistor, are my additions.Also, I should mention that none of the existing circuitry (BJT, relay, etc.) has been affected by whatever fault killed my P-FET - when returned to the original configuration (i.e. with the 47K pot) everything works fine still.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 30, 2017, 10:07:22 pm
content: What you may be missing is the speed at which the contacts open and close. Suppose this happens in a fraction of a nanosecond: then how complicated must your model be, to reflect reality?At that kind of speed, the stray inductance and capacitance (or, more generally: transmission line nature) of the connections between transistors and relay contacts matters.That you have a capacitor (very low impedance) and switch contacts (very low impedance to +V/GND) around the PMOS hints that that may be the culprit. Failure would be excessive gate voltage, when the NMOS is holding the gate low (also a low impedance) and the PMOS drain is shoved around hard. Since it's clamped to +V with a diode, it was probably a switching-to-GND event that caused an excessive negative voltage: this is something like ESD, but lower impedance, and dropping right across the PMOS gate to source.Using a diode pair, one from GND to drain as well as from drain to +V, might be a good idea. Now, doing exactly this, would screw with timing, because as you note, the charging node goes below 0V. A zener+diode could be used, so it's clamped at, say, -12V, or an RCD snubber could clamp short spikes without taking too much charge out of the big cap.Better still: rework the circuit, so the relay coil isn't being driven softly up and down. Add a Schmitt trigger, so the coil is switched on and off fully, and so the relay contact does not need to drive large capacitors, but simply connects to a logic input, which is easily smoothed out with resistors and diodes, preventing problems from transients, as well as contact bounce. This saves power dissipation in the relay coil driver, and lets you control timing more precisely (it's just a small RC network, no need for electrolytics).It's not a lot of added hardware -- this is a perfectly acceptable place for a 555 timer.Also suitable would be a comparator (LM393, etc.), or logic (74HC14 inverters being the most likely, or '123 timers, or the like).Tim

author: Andy Watson
author_rank: Super Contributor
timestamp: June 30, 2017, 10:19:13 pm
content: Quote from: HwAoRrDk on June 30, 2017, 09:51:50 pmI see the "protection" diode ... but, unless it's a zener, it appears to be protecting against a non-existent under-shoot. There's nothing there to protect against the (very real) positive overshoot. The bjt may be surviving by some serendipitous mechanism, but this doesn't preclude a HUGE positive spike from being imposed on the remaing circuit.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 30, 2017, 11:58:41 pm
content: Quote from: T3sl4co1l on June 30, 2017, 10:07:22 pmYou're right, I guess any simulation isn't going to model switch contact bounce, etc.Quote from: T3sl4co1l on June 30, 2017, 10:07:22 pmYes, I could see how the 'home' switch may have bounced when the tenuous current flow from an oscillating relay driving the mechanism's motor may have had trouble overriding that little bit of extra resistance of the switch's cam. Such bouncing would rapidly switch the drain back-and-forth between +12V and somewhere at-or-below 0V, plus toggle the relay too, probably compounding the whole situation.The P/N MOSFET I'm using is rated for 30V. Perhaps a higher-rated FET (50V? 100V?) would stand a better chance?Quote from: T3sl4co1l on June 30, 2017, 10:07:22 pmYes, adding a second diode to ground voids the operation of the whole thing; the relay never gets turned off. Could you elaborate on what arrangement you mean by "zener+diode"? I tried in the simulator putting a 12V zener instead for the second diode, but with anode to ground, it has the same effect as a regular diode (relay never shuts off), and in the opposite polarity (cathode to ground), when the drain voltage gets above the zener's forward voltage, it 'steals' all the charge that was otherwise going to the cap.Quote from: T3sl4co1l on June 30, 2017, 10:07:22 pmI can't modify any of the existing circuitry apart from substituting the 47K pot (which as I said before, is off-board, connected by a header).I'm starting to think it may be feasible to perhaps replace the whole existing board, although that'd be a lot of work, as there's other functionality on it. Although, it would mean I would be able to directly control the relay and do all timing on the MCU, rather than trying to 'steer' an existing analogue RC timing circuit. I am presently trying to acquire a spare unit so that it can be sacrificed for tear-down without affecting my usage of the current one, so maybe we'll see what's possible then.Quote from: Andy Watson on June 30, 2017, 10:19:13 pmHmm, could well be a zener. I can't see any markings on it, and it looks like your regular 1N4148 diode. The BJT is a Rohm 2SD2227S - nothing special as far as I can see. Whatever the diode is, it works well, and has done for the last 10+ years.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 01, 2017, 01:13:02 pm
content: Quote from: HwAoRrDk on June 30, 2017, 11:58:41 pmContacts never bounce back-and-forth, just on-and-off. Bounce can occur when opening a contact, but usually it's on closing only.Because, more transmission line effects: the contact slams into the other contact, and a wave is launched down the contact support arms. The wave goes at the speed of sound in the arm material. The wave bounces off the pivot end, whips back to the contacts, the contacts come apart briefly, then slam back together, launching another wave on top of the wave that's still bouncing around, and so on. Eventually, mechanical losses absorb the waves and everything settles down. The waves won't always make the contacts bounce, because it takes a minimum amplitude to overcome the spring force holding them closed. You normally get a couple of bounces, spaced by milliseconds (the rate is the resonant frequency of the arms), and then it's stable.Each time a contact touches, though, the electrical speed of that contact is impressively fast: fractional nanoseconds. You might not be able to use this in circuit, because the circuit's no good at ~GHz -- but if you're unlucky, it can generate the same effect as above, but of electromagnetic waves, bouncing around at light speed in your wiring, and causing your transistors to "bounce"!The simplest insurance against that: add series resistance (or resistance parallel with inductance, if you need low DCR) to each contact, and/or R+C across the contacts, so that the EM wave is absorbed by the resistance, and not passed on to your circuit.QuoteNo -- if it's doing what I think it's doing, the pulse is applied gate to source. You can't get a MOSFET rated for more than 30V G-S. You need to limit it with external components.QuoteTake a regular diode, and a zener diode, and connect them head-to-head (antiseries). Use this to clamp negative transients.Alternately, replace your +12V clamping diode with antiseries zeners (maybe 24V parts). This will limit transients to (+12V) - (24V) = -12V just the same. Make sure +12V is bypassed to GND very near the diode(s) and transistors (0.1uF will do).Tim

author: HwAoRrDk
author_rank: Super Contributor
timestamp: July 01, 2017, 04:41:59 pm
content: Quote from: T3sl4co1l on July 01, 2017, 01:13:02 pmLike this?Quote from: T3sl4co1l on July 01, 2017, 01:13:02 pmAnd like this?Although I'm not sure I precisely understand what you meant by the bypass capacitor placement. The purpose of the capacitor is to buffer any transients to/from ground?Will a single bidirectional TVS diode serve the same purpose? As I understand it, they're effectively two back-to-back zeners. I don't have any 12V zeners handy, but I do have some P6KE18CA (15 VRWM, 25 VC) TVS diodes. Although, I suppose if the idea is to not exceed +/-20 VGSof my MOSFETS, it's probably not ideal...Thank you very much for your help, T3sl4co1l.To everyone else telling me to put a diode across the relay coil... Yes, a thousand times yes, I understand that is the de-facto solution to inductive spikes, and had I actually designed that part of the circuit myself, I would have done so.But I did not design nor construct that part of the circuit.And I cannot change it.I think Andy Watson is right, and that the existing diode across the BJTmustbe a zener, and must be providing perfectly adequate protection - otherwise, I can't see how the existing board would have continued to work for 10+ years! In fact, if it's a zener and is used to clamp the inductive spikes to ground, I think that explains why it is mounted on the board as it is. It is mounted vertically (well, not quite - more of an 'A') with a long length of lead, but nothing about the PCB layout spacing seems to require that, so I think it must have been done for heat dissipation reasons.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 01, 2017, 04:58:12 pm
content: Quote from: HwAoRrDk on July 01, 2017, 04:41:59 pmClose, but that clamps to +12V or +(V_zener + 0.7)V. Flip the diode+zener.Then it'll clamp +12V or -(V_zener + 0.7)V.QuoteYes!Even more to the point, the cap and diode ground, and NMOS ground, should be as close as possible, as well.That keeps the ground reference stable between those points.At high frequencies, "ground" isn't ground, it's springy and loose. It's not enough to simply run a length of wire; the length becomes a variable, just as important as any other component value. Keeping the lengths short ensures that the impedance (and therefore voltage drop) between +V, GND, and the clamped node, stays within reasonable bounds.QuoteYup! A P6KE is kind of big for this, but will definitely do the job. I doubt you'll be hitting it with the peak current that's required to reach Vc, so it'll be fine. The Vgs rating is also a conservative value: the rating might be 20V, while real parts fail as high as 80V. Or some fail as low as 30V. It's not a very consistent thing to manufacture, so they stay on the safe side. I would be fine with a 25V worst-case peak being applied to a 20V part. You only ever need about 15V to get the thing fully "on", anyway, so it's plenty.Tim

author: HwAoRrDk
author_rank: Super Contributor
timestamp: July 01, 2017, 06:37:17 pm
content: Okay, great.I'll make these changes to my test circuit and give it another try with a fresh MOSFET.I think also I will increase my PWM frequency quite a bit, in case that was causing any problem with the relay at low duty cycle. Probably just need to change the clock divider on the PWM timer. IIRC the steps up are 488Hz and 3-point-something kHz. I don't think there's any harm in going for broke and just using the kHz option.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: July 02, 2017, 06:03:54 pm
content: I tried the changes today, and it works properly now! I wasn't able to kill the MOSFET by turning the PWM duty cycle down too low and buzzing the relay.However, it's not all good news. Was disappointed to find that I just can't get the timing range that I was hoping to achieve.I can't turn the duty cycle down below 40-something percent without the charge rate being too slow to not have the relay contacts buzz instead of switching cleanly. And the lowest duty cycle for proper operation doesn't yield a long enough delay period - only about 8-9 seconds, where I was hoping for >10.Incidentally, this was with the PWM jacked up to 3.9kHz, so a higher frequency doesn't appear to have helped as I was hoping in that regard.Is there anything I can do to help achieve proper relay switching at longer delay periods? I am puzzled as to why I cannot match the timing range of the existing purely analogue 47K pot. That tops out at around 11.5 seconds without any problems. Will an even higher PWM frequency help? I can go to 7.8, 15.6 or even 31.25 kHz if needed.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 02, 2017, 07:28:59 pm
content: Try a resistor in series with the NMOS drain.Tim

author: HwAoRrDk
author_rank: Super Contributor
timestamp: July 02, 2017, 08:33:01 pm
content: In series with what, the PMOS gate? What kind of value? 10K?What effect will this have? It will limit the current into the PMOS gate, right? But I don't know how that affects anything else.

author: mikerj
author_rank: Super Contributor
timestamp: July 02, 2017, 08:50:23 pm
content: The 10k may be delaying the switch off of the P-channel MOSFET, limiting the minimum pulse width. You could try halving the value to see if you get any improvement in maximum delay, though obviously there will be a trade off with power dissipation. A high current buffer or gate driver would be better still.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 02, 2017, 08:54:03 pm
content: Just the drain. So, between drain and PMOS gate.1-10k should be reasonable. Try different values.Presumption is this: the NMOS pulls PMOS gate to GND, so as long as PMOS drain is < -Vgs(th)*, source will be ~ -Vgs(th), and Ids will be set by the 13k resistor.*Using the convention that Vgs(th) is a negative number for PMOS devices. Most datasheets call it out this way, some don't (which is kind of erroneous, because it's "gate to source", not "source to gate" voltage). Just to be clear!But if drain voltage is higher, PMOS is saturated, and less current flows (because less voltage drops across the 13k).Raising the gate voltage, and dropping the 13k (say, ~halving the gate voltage, and halving the resistor, to give the same typical current), keeps that current stable over a wider voltage range.Bipolar transistors would be better here, as Vbe ~ 0.6V is smaller, and more stable, than Vgs(th) (about 0.8 to 2V for most smallish transistors like that). 2N3904/6 would be fine. I don't know if there's a complementary dual package handy for that type; there are some duals sold for gate driver duty (ZXTC and ZXGDxxxx) that are really just NPN and PNP pairs.Tim

author: HwAoRrDk
author_rank: Super Contributor
timestamp: July 02, 2017, 11:07:09 pm
content: Sorry - and this may be because it's late and I'm tired - but I'm terribly confused now.I tried putting a 10K resistor between the drain of the NMOS and gate of the PMOS, but it didn't seem to have any effect whatsoever.And then you're talking about raising the gate voltage (how? I only have 12V supply) and then halving the gate voltage in the same sentence...Also, I'm stuck with the 13K resistor. It is part of the existing circuitry, and I can't change it (or rather, it is obviously notimpossible, but I do not want to alter the existing hardware).Finally, I still don't fully understand what the overall effect is of whatever is supposed to be accomplished here. Raising the current flow for any given PWM duty cycle value? But that will shorten charge times overall, surely? I don't need anything faster, I need to get a slower capacitor charge rate and still achieve a clean relay switch.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 02, 2017, 11:15:29 pm
content: Quote from: HwAoRrDk on July 02, 2017, 11:07:09 pmSorry, halving towards +12V -- it's a resistor divider.QuoteWell, if you can touch +12V and PMOS source, you can put resistors in parallel...QuoteThe resistor, and divider, set current flow for any given PWM.You can't go any slower than 0%. What is the observed rate at low PWM?You can't expect "clean switching" in this circuit, for very low bias currents. I don't know why you can't change the rest of the circuit, but that's the next step...That, or leaving it, but adding a Schmitt trigger in front so the old circuit is only driven when your timer circuit says so.Tim

author: HwAoRrDk
author_rank: Super Contributor
timestamp: July 04, 2017, 11:40:02 pm
content: After leaving my brain to percolate for a while, I think I now realise what you were talking about.You meant a circuit arrangement like this, right?And of course - durr, me stupid- now I realise that I can put another resistor in parallel to the 13k to change the overall effective resistance. I also realise that I don't even need to go with a parallel arrangement - there's nothing stopping me simply not connecting up that pin of the old pot's connector, and having my own choice of resistor to +12V.So, the effect of this is to 'plateau' the current charging the capacitor for longer? So, whereas before it was doing this:And now (with the values pictured above, anyway) it will do this:However, I'm not sure how this is supposed to help. It appears to just shorten the capacitor charge time for any given PWM duty cycle.To restate the problem I'm having: it's not that the minimum duty cycle I can achieve doesn't result in a long enough delay (it's way longer than I need, actually), it's that when Idoset the duty cycle low enough to get the long delay time I want, the relay does not switch cleanly.Now, if you're saying that it will be impossible with this circuit, then fair enough. But I'm still puzzled as to how the original circuit setup of the existing hardware manages to operate in a similar manner (with such a low charge rate) trouble-free.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 05, 2017, 08:24:08 am
content: Probably the fact that the pot is a voltage divider helps: at low settings, the capacitor charges up towards so-and-so voltage eventually; when that voltage is near the relay threshold, you get time delays that are hyperbolic with voltage (i.e., as the divider's voltage gets closer and closer to the threshold, the delay goes up inversely proportional to the difference).A CCS won't have quite the same eventual voltage level, because circuit resistance is higher. It should still be able to balance against the base resistors. It'll be no less sensitive to temperature variation, electrical (including internal) noise, and indeed, mechanical vibration too (biasing a relay near its trip point simply isn't a good idea).Tim