Switch mode inverter, totem-pole MOSFET driver, need help - Page 1
Forum section: electronics / projects

author: baoshi
author_rank: Regular Contributor
timestamp: April 20, 2014, 04:00:35 am
content: Hi,I'm prototyping a MCU based switch mode inverter. The testing circuit is attached below.The circuit works fine for driving frequency at 250-300kHz at duty < 60%, with VCC at 5V, output -27V.However, if I further increase the duty to 70%, the circuit enters into a lockup condition:1. VCC has been pulled down to 0.8V (I'm powering using 5V/2A current limited PSU), current reaches limit.2. The gate of MOSFET stays at 0.8V (somewhere near AO3400A's minimal threshold voltage)3. The totem pole transistor's base are at 1.5V, no PWM signal is seen, although the MCU is still outputing PWM signal.I suspecting it is a driving speed problem. AO3400A's total gate charge is 7nC, with Ciss at 630pF.Please enlighten me what is happening here. Any help will be appreciated.

author: peter.mitchell
author_rank: Super Contributor
timestamp: April 20, 2014, 04:38:33 am
content: MCU pwm probably can't drive the totempole fast/hard enough directly, buffer it.

author: johansen
author_rank: Super Contributor
timestamp: April 20, 2014, 05:42:21 am
content: if you don't have an oscope to figure out what is going on, reduce the frequency to half what it is now.

author: baoshi
author_rank: Regular Contributor
timestamp: April 20, 2014, 06:47:57 am
content: Yes reduce the frequency and increase inductor does the trick, but at the cost of PCB real estate. It looks as though the totem pole does not sink enough current for the mosfet to cut off in time, just like peter has said earlier.I'm more interested to know what caused the lock up. Maybe I can prevent it by switching some parts ?Sent from my iPhone using Tapatalk

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 20, 2014, 08:35:14 am
content: This is not how a buck-boost (inverting) circuit is made.Using an MCU is also the wrong choice. If its output decides to latch on, you get, well... what you've got, more or less. If it hasn't destroyed itself already, it will sooner or later.Tim

author: baoshi
author_rank: Regular Contributor
timestamp: April 20, 2014, 08:44:34 am
content: Quote from: T3sl4co1l on April 20, 2014, 08:35:14 amAgree. This is a charge pump inverter. A buck-boost inverter requires a high side switch, which is harder to drive.Using MCU is probably a bad choice for a SMPS but this particular PIC16F1509 has some interesting peripherals (NCO and CLC) that enable SMPS control without CPU involve. That's why I wanted to try.Sent from my iPhone using Tapatalk

author: baoshi
author_rank: Regular Contributor
timestamp: April 20, 2014, 02:16:05 pm
content: Quote from: 3roomlab on April 20, 2014, 11:41:43 am3roomlab, if you're interested, attached is my simulation. The D trigger part is to simulate the MCU CLC. The regulation is working on pulse-skipping-mode

author: Marco
author_rank: Super Contributor
timestamp: April 20, 2014, 02:36:29 pm
content: The microcontroller can source/sink 25 mA ... but not through that huge 2K base resistor ... try 200.At that point the transistors become a limiting factor though ... zetex/diodesinc has some integrated NPN/PNP pairs for MOSFET gate driving, 50 cents on digikey for singles.

author: dannyf
author_rank: Super Contributor
timestamp: April 20, 2014, 03:45:42 pm
content: QuoteThe totem pole drivers cannot deliver enough current to the mosfet. I would use a gate driver here, or reduce the base / gate resistors - they look appropriate for linear applications.

author: TerminalJack505
author_rank: Super Contributor
timestamp: April 20, 2014, 05:21:40 pm
content: Quote from: Marco on April 20, 2014, 02:36:29 pmBBM.This is good advice. That should increase the bandwidth by roughly an order of magnitude. According to my simulator, the bandwidth, as-is, is about 800kHz.On another note, you're probably pushing your luck using a 30V MOSFET in this particular application.

author: Zero999
author_rank: Super Contributor
timestamp: April 20, 2014, 07:13:28 pm
content: I don't see any need for a base resistor. Get rid of it. The minimum resistance seen by the MCU's output pin will be equal to the transistors' beta multiplied R3 so should be high enough, not to cause any problems.

author: Marco
author_rank: Super Contributor
timestamp: April 20, 2014, 07:32:19 pm
content: Question is how high is the current while the base travels the 1.2 volt necessary for the transistor to actually start behaving like an emitter follower?

author: baoshi
author_rank: Regular Contributor
timestamp: April 21, 2014, 05:44:36 am
content: Well thanks for everyone pointing out the driving current issue of the base resistor. That makes sense. I wake up early this morning did some quick test, the MOSFET gate waveform seems improved a lot after reducing the resistor value.However the lock up situation still persists: if I power MCU first, then power VCC from a current limited power supply, the VCC is pulled down again at 0.8-0.9V and maximum current is drawn. I guess during the initial contact, excessive inrush current causes VCC to drop below base voltage, then some lockup condition occurs. Does it make sense?

author: baoshi
author_rank: Regular Contributor
timestamp: April 21, 2014, 05:48:19 am
content: Quote from: 3roomlab on April 21, 2014, 02:48:19 amYour source is 4700/5000ns, meaning 94% duty? That explains why the output is so high.

author: peter.mitchell
author_rank: Super Contributor
timestamp: April 21, 2014, 06:55:47 am
content: Put some decoupling on your totempole and/or run it from a different supply to the actual inverter, i'd hazard a guess the inverter is pulling the supply to the totempole too low when the duty cycle is high.

author: Zero999
author_rank: Super Contributor
timestamp: April 21, 2014, 09:45:16 am
content: Quote from: Marco on April 20, 2014, 07:32:19 pmIt always acts as an emitter follower with a 10 Ohm resistor and the MOSFET gate capacitance connected to the output.

author: Marco
author_rank: Super Contributor
timestamp: April 21, 2014, 12:03:05 pm
content: When the NPN is on the PNP has a Veb of -0.6, to start pulling the gate down Vbe for the NPN will first have to go to -0.6 and Veb for the PNP to 0.6. During this transition the load on the MCU would not act like an emitter follower, neither transistor is in it's active region, more like a capacitor.

author: Zero999
author_rank: Super Contributor
timestamp: April 21, 2014, 01:03:28 pm
content: Quote from: Marco on April 21, 2014, 12:03:05 pmWhen the output voltage is in-between the active regions of the BJTs, it will see an open circuit as neither transistor will be on. As soon as either transistor starts to conduct, it acts as an emitter follower.At an infinite frequency, the output current progresses towards (1/2VCC-VBE)/R3. The input current will depend on the beta, probably about 10mA maximum.

author: diyaudio
author_rank: Frequent Contributor
timestamp: April 21, 2014, 01:38:01 pm
content: Quote from: baoshi on April 20, 2014, 04:00:35 amim sorry to say this, without a scope you not going very far, even if you do manage to get it working.You don't need a gate driver (it seems like over kill) do the Math, a 7 nC of gate drive doesn't require alot of energy to charge the channel.Fsw = 300kHzQg = 7QgVGS(th) 1.45 V, 5.0V will give you full saturation. 20mOhms @ 10ampsGate Drive Power = V * Fsw * QgP = (5 * 300 * 10 ^3 * 7 * 10 ^-9)P = 0.01 WattsWithout a scope you cannot assume or make reliable decisions.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 21, 2014, 01:43:35 pm
content: Like I said, you're trying to do buck-boost with a circuit that isn't.Use current mode feedback instead, and get rid of the voltage doubler (it's not a charge pump, at least not exclusively, with that inductor there).If you insist on a charge pump, you must use a current limited switch. A 10A MOSFET is only going to destroy power supplies or at least cause resets, exactly like you're seeing here.Tim

author: diyaudio
author_rank: Frequent Contributor
timestamp: April 21, 2014, 02:37:21 pm
content: Quote from: AcHmed99 on April 21, 2014, 02:04:14 pm@300Khz of course !, You speak of timings (I deliberately omitted this) ,he has no scope to authenticate our finding and proves. besides is it even on a PCB? 300Khz on a breadboard is sure to show some dynamics of its own (that we cannot blindly prove)

author: baoshi
author_rank: Regular Contributor
timestamp: April 21, 2014, 02:40:53 pm
content: Thanks for everyone who helped. It was overwhelming.Though I like the discussion about totem pole driver, just let me segway back to the inverter topic.To T3sl4co1l: You're right. The circuit I designed is not correct. I pluck this from LT1617 datasheet without fully understand it. I've redesigned a buck-boost convert, please see the attached if it is any good. Can I still use voltage feedback, does it impose any danger?To diyaudio, I'm curious to understand the calculation of MOSFET switching loss too.

author: baoshi
author_rank: Regular Contributor
timestamp: April 21, 2014, 03:17:43 pm
content: Quote from: diyaudio on April 21, 2014, 02:37:21 pmI'm a bit lost here. What you want me to measure. I have a scope.Sent from my iPhone using Tapatalk

author: baoshi
author_rank: Regular Contributor
timestamp: April 22, 2014, 01:19:15 am
content: If I'm understanding correctly, here are some waveforms with or without totem-pole stage.Driving frequency is 380kHz at 10% duty.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 22, 2014, 06:01:02 am
content: Quote from: baoshi on April 21, 2014, 02:40:53 pmAhh, much better!I wouldn't bother with the fancy gate driver -- or, rather, I wouldn't bother with anything fancier than usual. The supply is so low that you don't need level translation between the MCU's output and the gate voltage.The complementary emitter follower you had isn't too bad. It's a little marginal when used with logic-level FETs, because the base-emitter voltage drop prevents Vgs pulling below 0.6V or so (at least, with any speed). Still not usually a problem.You could use a large logic buffer (a few "bus driver" size gates in parallel), a proper gate driver chip, or "build-your-own" with a 2N7002 and BSS84 (CMOS inverter on steroids).QuoteNo, and yes. At least, you shouldn't use it. The inductor current is an independent variable, and also the one that causes transistors to explode. A poorly designed voltage-mode PWM circuit will gladly drive 100% PWM, because it doesn't have any way of knowing that it is a dangerous condition. At best, you have to add an explicit duty cycle limit or dead time to prevent it from shorting the supply into the transistor into the inductor, but this still leaves no control over excessive inductor currents; if the output is shorted, the inductor current will continue to blindly build up.Instead, by regulating on inductor current, you prevent such a situation, implicitly. If the error amplifier commands maximum output, all the current regulator can do is deliver maximum current: no more, no less. The PWM % doesn't matter in this case; it can be 0 or 100% and everything is perfectly happy. It may spike to 100% (i.e., staying on for a few cycles), which is just to say, it's trying to drive as much current into the inductor as quickly as possible to keep up with demand; it stops once it reaches maximum. Handy, eh?Buck-boost is particularly nice, because you have one end of the inductor grounded, so all you need is a shunt resistor (and possibly a current sense amplifier, to save on voltage drop) and the current control op-amp. The voltage regulator op-amp goes outside, so it's an inner loop controlled by an outer loop.It's much easier to do once you've seen some circuits. I don't have a block diagram handy, but this is one of many examples:http://seventransistorlabs.com/Images/UC3808-2.pngThe UC3808 is a peak current mode controller (essentially a push-pull version of a UC3842, most often used for isolated flyback converters), so it's not regulating the average voltage on the shunt resistor, but turning on until the current reaches a threshold; the effect is generally the same however. The TL431 feeds back an error signal, from the output voltage, through an optoisolator. The 3808's error amp is wired for -1 gain so it acts as merely a current source, but if isolation is not required, it can be used and no TL431, opto, etc. is needed.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 23, 2014, 01:08:40 am
content: Quote from: 3roomlab on April 22, 2014, 08:37:05 amFrom a 5V supply, CD40107 has an equivalent output resistance around 500 ohms, and switches in 200ns or so. Dreadfully slow, and weaker than American piss beer!A simulation code model may not correctly simulate the output pin driver. Supposedly, LTSpice treats all digital logic, by default, as 1V supply. VDD, what's that?Quote from: AcHmed99 on April 22, 2014, 12:10:05 pmIf one assumes the current rises linearly, then the voltage falls linearly (typical of an inductive hard switching turn-on event), and vice versa (inductive turn-off), the power dissipation will spike in a triangle shape, of width T1+T2 (where T1 and T2 are the rise/fall times of current and voltage, respectively), a peak power of Vcc * Isw, and thus a total energy of 0.5 * Vcc * Isw * (T1+T2). Quick example: a buck converter, CCM, 100V input, 10A output. If the switching takes 100ns, the energy per edge is 0.5 * 100V * 10A * 0.1us = 50uJ. The total per cycle, of course, is simply double, or 100uJ. At 100kHz, this is 100u * 0.1M = 10W average, or P = Tsw * Vcc * Isw * F.Note that Tsw = T1 + T2 is NOT the risetime of a given waveform in the circuit. If you measure only the drain voltage, you are getting literally half the story.The same waveform is typical of capacitive loads as well, though these are uncommon in switching power supplies. A pure resistive load has voltage falling, while current is rising, proportionally, and therefore has a quadratic power waveform, with a peak power of Vcc * Isw / 4, and an enclosed area (energy) of Vcc * Isw * Tsw / 6 (a dash of calculus proves the /6).With a snubber, or resonant or quasi-resonant design, the switching losses can be considerably different, because the voltage and current are no longer inductive at all times.QuoteNot really; in fact, your example illustrates this better than merely showing the magnitude of capacitive losses. The comparison is this:Your 24W switcher might dissipate 400V * 1.1A * 0.5 * 0.05us * 0.1 MHz = 2.2W in switching losses.Note the 0.5 is back, because the flyback is probably doing most of the switching losses during turn-off. Note also that 400V is the flyback waveform peak, not "Vcc"; this is the correct equivalent to the buck example's Vcc. You didn't mention peak current; assuming a maximum 50% duty cycle in DCM, 0.448A RMS is 1.1A peak. You also didn't mention switching time, so I'm making a SWAG. Often, that's about the best you can do without actually building and measuring the thing, anyway. So, the resulting number is of course proportionally uncertain.Even if Tsw is vastly shorter (it can't be too much shorter; Rg is specified as 16 ohms on that device, so you shouldn't gain more than fourfold or so with an ideal gate driver), it's still more than the estimated conduction (0.16W) and capacitive (0.27W) losses.QuoteBeware that many devices do not specify Eoss. Onecannotuse Coss to estimate Eoss, because Coss is measured at one voltage only! It varies extremely strongly with bias voltage (the AOD11S60 datasheet being a prime example of modern "super junction" transistors, which are more nonlinear than ever!)...Quote from: 3roomlab on April 22, 2014, 01:28:47 pm...So as you can see, a mistake which can easily be madeSee  Fig.15. Do you think a capacitor that varies like that will actually absorb 82nJ worth of energy? Is it more, is it less? What is it really? Hard to say, without a spec in the datasheet, and without doing calculus on the graph (bah!). Fortunately it's small enough to ignore, for the most part.QuoteWhat are you looking at? Neither of the datasheets referenced mention those terms? Anyway, avalanche is about excessive voltage causing breakdown. Which can damage the transistor in spots if it occurs quickly, or thermal failure if it occurs more slowly (which is why they say "single pulse" or whatever, and specify what temperature the transistor was at to start with). Manufacturers almost always provide the second kind, because the number looks better, while the first kind generally beguiles the unprepared switcher novice.Tim

author: diyaudio
author_rank: Frequent Contributor
timestamp: April 23, 2014, 09:00:17 am
content: QuoteYou can switch any FET at high speeds.. however...at these speeds the FET`s parasitic components come into play things such as,device bonding leads, *PCB* layout and package geometry, all of these parasitic components can realistically be modelled as a RLC network, (undetectable at low speeds, barely noticeable with simple circuits with low di/dt) I've never seen anyone reliably switch at these speeds without doing the necessary preparation work.

author: mzzj
author_rank: Super Contributor
timestamp: April 23, 2014, 01:52:13 pm
content: Quote from: 3roomlab on April 23, 2014, 12:17:47 pmSounds about right, 13Mhz is awful high switching frequency for anything power related.

author: diyaudio
author_rank: Frequent Contributor
timestamp: April 23, 2014, 01:57:47 pm
content: Quote from: AcHmed99 on April 23, 2014, 11:42:05 amOkay I think you didn't understand me. Switching at 10A @ 13Mhz is a challenge that's my point, I'm NOT disagreeing with with you. I expected you from all people to have noticed the RLC statement but, you didn't

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 23, 2014, 11:21:43 pm
content: Quote from: 3roomlab on April 23, 2014, 05:00:28 pmHmm, that looks quite nice actually. Qg and C's low, and the time test was measured with a reasonable gate resistance (4.7 ohm, suggesting a mere 2A peak -- you need a gate driver almost as fast, of course -- most are in the 20ns range).Except for the TO-220 package. Lead inductance 2.5-7.5nH, per pin -- depending on how deep it goes into the board!But yeah, still, 13MHz. If you have to ask about it, or you're confused by numbers that might be guesses, or don't even know how those guesses were arrived at... you're going to make a delicious ball of smoke.Also, your D3 snubber diode is backwards...For all the knowledge I have, I haven't even built a large converter over 2MHz. The more you know, the more you know you don't knowQuote from: AcHmed99 on April 23, 2014, 07:02:03 pmEmphasis addedEven trickier when you consider Coss, diode Cj and various other elements serve the same purpose on smaller time or energy scales. Which makes designing something like a 13MHz converter, exactly, from the ground up, basically impossible.In your waveform, it looks like the point in time where the yellow and blue traces cross is where the RCD snubber kicks in, and therefore where most of the turn-off losses occur. Which is well below full voltage, which is good.Turn-on may be similar, or it might be a little worse (diode recovery if any; inductor/winding capacitance). Also depends if you have a diode across the gate resistor, which is often used.QuoteLooks good. I haven't read any before, but I recognize the name: I've come across many SPICE models by the author!QuoteIf you can get a coax soldered directly across that current sense resistor, and toss in some damping on all those resonances, I bet the waveforms would be a lot easier to scrutinize. Could also do a 10x "no probe" probe for the gate voltage -- 450 ohms (or something near enough) from gate to coax to ground. Leads as short as possible, of course (hide the 450 ohm resistor under the coax shield if you can?). Even then, a couple feet difference in probe cables is significant here, so be careful.Tim

author: dannyf
author_rank: Super Contributor
timestamp: April 24, 2014, 12:46:32 am
content: QuoteAgreed. One of those golden rules of life.