1. We will be in Read Only mode (no new threads, replies, registration) for several hours as we migrate the forums to upgraded software.

# DC/AC inverter H-bridge/transformer problem

Discussion in 'The Projects Forum' started by AdamM, Jun 3, 2010.

Mar 7, 2009
30
0
My younger brother has been building a small AC/DC inverter to run off a car battery when the power goes out (which happens rather frequently in these parts). Or rather, he's been trying. He started with this circuit, which didn't work well at all. I posted some queries about it here, and we got several quite useful replies from helpful forum members. Since it's no longer using a 555 (and I didn't see a way to rename the thread) I'm starting a new thread on the subject.

He's rebuilt the circuit, and is now using a PIC microcontroller to generate signals to drive a full H-bridge (rather than the 555-driven half bridge in the original circuit). The problem we're having is that, while the output of the bridge looks quite good with no load (see the first scope picture), as soon as the transformer is attached the waveform turns into a flat line with occasional spikes going here and there in a very unpromising fashion (see picture 2). Needless to say the output from the transformer is quite weak -- 16v RMS roughly.

I've attached a schematic of the circuit. If anyone has ideas about why the bridge output would go to pot when we hook up the transformer, or any other suggestions, we would be grateful indeed!

File size:
8.3 KB
Views:
320
File size:
189.6 KB
Views:
169
File size:
185.7 KB
Views:
137
2. ### Audioguru Expert

Dec 20, 2007
11,251
1,350
Your circuit is missing resistors from base to emitter for the transistors to turn off quickly.
The NPN transistors look like they are not darlingtons so their output current is very low.
Every transistor should have a part number on schematics.

Mar 7, 2009
30
0
Thanks for the suggestions Audioguru, and sorry about the lack of part numbers. Eagle didn't have those parts in the library and I neglected to change them manually. I've attached an updated schematic with part numbers.

What value of resistors would you recommend for the pull up/down resistors on the bases of the power transistors?

It sounds like a good idea to turn the NPNs into darlingtons. We would do that by adding a smaller NPN with its emitter on the base of the larger transistor, and its collector on the collector of the main transistor, correct? And I suppose we would want a resistor in there so that the gate current on the power transistor wouldn't be too high (something we're currently missing on the PNPs).

Do you think this could be the source of the problem we're having? It hardly seems likely that a transformer that's got no load on it would draw more than the transistors were able to supply....

File size:
9.6 KB
Views:
139
4. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
T1 and T2 are pretty low-gain transistors. About the best you can hope for is Ic= 20x base current. Since the base current will be about 13mA, you'll be limited from between 130mA and 260mA current flow in their collectors.

You may need to provide some time in the cycle where both high side transistors are off, and both low side are on. Otherwise, you may experience a phenomenon known as "flux walking" and core saturation.
You might be able to avoid "flux walking" if the alternating cycles are absolutely symmetrical. However, since you're using transistors, all bets are off.

Last edited: Jun 3, 2010
5. ### Audioguru Expert

Dec 20, 2007
11,251
1,350
I guess you know nothing about the details of any transistor that is on its datasheet.
The TIP147 is a darlington PNP transistor and a TIP142 is the same but is NPN.
Their datasheets show that they have built-in base-emitter resistors.

Mar 7, 2009
30
0
@Audioguru:
While it's true I'm not particularly knowledgeable about transistors, the situation isn't quite that bad. I am aware that the TIP147 is a Darlington. The NPN on its base is not to increase the gain, but rather to compensate for the fact that the microcontroller only produces a logic high of 5v or logic low of 0v. There is no way (I know of) for it to either open circuit the base of the PNP or provide enough voltage at the gate to turn it off.

There is no NPN darlington in the circuit I'm aware of, TIP142 or otherwise.

@SgtWookie:
You and Audioguru are right about needing to increase the gain on the NPNs. I'm not sure why I didn't think of this problem -- I suppose my only excuse is that there were no additional transistors on the original circuit, though at this point that's not much of an excuse at all

Flux walking looks like it could become a problem, especially since the high side transistors are not both the same part, so we're almost certain to have some asymmetry. (Actually you can see that the high and low portions are not the same shape in the scope photo.)

I could try your suggestion of turning off both high side transistors (and turning both low side on), but I'm finding that I don't have nearly as much flexibility in the microcontroller as I had expected. It's running at 4 Mhz, but for some reason the PICAXE 'firmware' system only seems to allow a minimum of 1ms control on this chip. I might have to ditch the PICAXE bootloader and program the controller directly in Assembly or some such. Would it work to just put a capacitor in series with the transformer's primary to get rid of the flux walk issue?

Do you think that either of these things (flux walk or low current output) could be causing the problem shown in the second scope picture?

Thanks,

Last edited: Jun 4, 2010
7. ### Audioguru Expert

Dec 20, 2007
11,251
1,350
Why don't you use TIP142 NPN darlington transistors to replace the weak NPN ordinary transistors at the low side?

Why do you have four drive signals when only two are needed?

Are you driving a high frequency transformer with a low frequency?

Mar 7, 2009
30
0
We will probably add a small NPN on the base of each of the larger ones to make a darlington pair. We used the transistors that we had on hand -- a TIP142 would have been better.

We're using four separate signals to try to prevent shoot through in the bridge. At each phase change, two transistors are turned off just before the other two are turned on. Looking at the waveform though, I think they're not really turning off quickly enough, and we need to add base-emitter resistors on the three transistors that don't have that built in.

I'm not sure I understand the question entirely. The transformer was from a AC power supply, so it's made to run at 60hz, which is the frequency we're aiming for. Because of the limitations of the controller, we're a little off, but probably not too much for the transformer.

Thanks,

9. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Using Darlington transistors is convenient, but you kind of shoot yourself in the foot as far as efficiency goes, as right off the bat you will lose anywhere from 0.7v to 1.3v per transistor across the collector-emitter junction, as the output transistors don't really saturate.

Since your input is only 12v, losing 1.4v to 2.6v (or even more) is not a very attractive option, as you'd be throwing away 11% to 22% of your available power in just heating up the Darlingtons. This inefficiency does not account for the base current, which is an additional 10% "tax" (nominal) per Darlington. So, you wind up wasting roughly 31% to 42% of your available power in heating up your transistors.

That's why power MOSFETs have become very popular over the last 20 years or so.

Bipolar junction transistors (bjt's) aka NPN, PNP transistors, are current-controlled devices. When used as a saturated switch, you supply 10% of the desired collector current to the base. That 10% is "overhead", sort of a cost of doing business.

Darlington pairs have much greater gain that single transistors, because the gains of the two transistors are multiplied by each other. However, the output transistor never achieves a low Vce due to how it's configured. Increasing the base current won't decrease the Vce below a certain point.

Power MOSFETs are voltage controlled devices. They are normally used as switches. Below the threshold voltage, there is very little current flow between the source and drain terminals. Once the gate is charged to the Vgs specified in the datasheet, the resistance between the source and drain terminals (specified as Rds(on) in datasheets) is very low. The gate is electrically isolated from the source and drain terminals.

It takes a small amount of current to charge or discharge the gate, but once the gate is charged or discharged, practically no current is required to maintain the state of the gate's charge. As a result, the concept of gain does not really apply to MOSFETs, as once the gate charge is established, no current is required to maintain the source-drain connection. Drain current (Id) / 0 gate current will give you an indeterminate result.

So, consider using power MOSFETs and an H-bridge gate driver.

Let's talk about batteries for a couple of minutes.

Automotive batteries are designed to provide brief bursts of current (several hundred Amperes for up to 1 minute), and then be immediately re-charged.

If you attempt to use automotive-type batteries to power an inverter, you will have a very short service life from the battery. It will simply fall apart inside.

You need to use deep-cycle type batteries. Even then, discharging deep-cycle batteries below 70% of their rated AH capacity will shorten their service life.

If deep-cycle batteries are routinely discharged to 50% capacity, their service life will be decreased to 1/3 that, if they were discharged to 70% of capacity.

Let's talk about how much power output you were hoping to get from this thing.

Did you have any design goals?

Let's say (just for example) that you can build an inverter that is about 85% efficient, which would be very good.

Let's also say that you want to power five 60 Watt incandescent bulbs from the inverter. You'd need 300 Watts output from the inverter as a minimum.
I=P/E, or Current = Power / Voltage
I = (60*5)/120 = 300/120 = 2.5 Amperes at 120 VAC.

So, how much current will it take at 12v to get 2.5A from your 85% efficient inverter?
300W / 85% = 353 Watts input needed.
353W / 12v = 29.42 Amperes current.

So roughly, for every 100W of your output load, you will need 10A of current at 12v in.
If you run a 24v battery bank, then you halve the current requirement because your voltage is doubled.

Mar 7, 2009
30
0

I think my brother would be happy if the inverter put out 100 watts. We have several small 300 w inverters, and one of them running off a car battery will run a laptop or a couple of lights intermittently for several days. The batteries were all picked up for free at the local dump, so we're not overly concerned about shortening their lifespan. Hooking up two, for 24v would not be a bad idea. If we confirmed that the components are rated for that much, perhaps we could even have two different transformers so it could run on either 12 or 24. We'll have to look into that.

For 10 years or so we lived completely off the grid, so I'm familiar with the challenges of batteries (in the first year we thoroughly did in a whole set of big 2-volt cells from ignorant over discharging).

MOSFETs would be better. My brother's got a few IRF634B N-channel MOSFETS (rated for 32.4A pulsed, 8A continuous - see http://www12.fairchildsemi.com/ds/IR/IRF634B.pdf), which he pulled out of a broken inverter. Maybe we'll put those in instead of NPN darlingtons. A gate driver would be handy, but could we get away with driving them directly from the PIC for simplicity?

I wasn't aware that a darlington was so inefficient -- thanks for the lesson! There's one thing about that I don't quite understand: why would you lose 10% in base current? If each transistor has an HFE of, say, 30, then for a darlington the overall gain should be roughly 30 x 30 = 900. So only 10 mA into the base of the first transistor should give a collector-emitter current in the main transistor of 9 A or so, shouldn't it? And how is that a 'loss', since the current is going where you want it anyhow?

Does any of this explain what happened when we hooked the transformer up to the existing circuit, do you think?

11. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
I hope it proves useful.

That's a reasonable goal.
That's if you have a transformer that's wound for that kind of ratio. Winding your own transformer is a rather involved process.

The basic idea is that the higher voltage you have available on the primary side (your battery bank), the less current you need to have flowing for the same amount of power input. Less current means you can use smaller gauge wiring for similar losses.

How many does he have? Note that they are rated for 8.1A continuous if the junction temp is 25°C, but 5A at 100°C. Unless you have a really, really, really good heat sink available, plan on 5A or less per MOSFET.

No, you cannot. Those MOSFETs require Vgs=10 in order to be fully turned on. A PIC cannot get there by itself. Besides that, the limited current that a PIC can output will cause for slower turn-on/turn-off times for the MOSFETs, which will make them dissipate more power as heat during their slow transitions.

Don't forget that all of the emitter current from the input transistor, which will be the sum of the collector and base current, is flowing into the output transistor's base - which all winds up flowing to ground or V+ via the output's emitter. With a packaged Darlington, you normally can't measure the collector current of the input transistor, as it's made common with the output transistors' collector.

The collector of the output transistor is where the useful current is sunk from or sourced to. But, since your Vce in the output will be at least 0.7v, and if the load current is high, perhaps several volts - then you get a lot of power dissipation in the transistor.

Well, you mainly were getting very poor sink current through the lower side of the bridge; maybe 300mA or so at best.

That combined with the Vce losses for both the upper and lower sides would make for not much current through the transformer's winding.

Last edited: Jun 5, 2010
12. ### Audioguru Expert

Dec 20, 2007
11,251
1,350
The IRF634B Mosfets are rated for a high voltage and a low current which is the opposite to what you need. Also they need a gate signal of 10V but your PIC produces only 5V. You should use logic-level high current Mosfets for the low side switches.

The TIP147 and every other darlington transistor is spec'd to saturate when its base current is 1/250th of its collector current even though its minimum hFE is 500 when it is used as a linear amplifier (not as a saturated switch).

Could you show all four PIC signals syncronized on a single photo so we can see the timing?

Mar 7, 2009
30
0

Turns out my brother's got two brand new IRFZ48N N-channel MOSFETS which I think will be much better suited than the 634Bs. They are rated for 45A continuous at 100 degrees C, which should be plenty. Their Rds (on) is only 14 m$\Omega$. Vgs(th) is 2-4V, so it seems like we should be able to drive them with a PNP from +5v.

Here's a schematic with the changes we're planning to make to the circuit. (Posting the schematic before getting out the soldering iron this time )

Aside from adding the MOSFETS, and two small PNP transistors to drive them, we're also planning to add pull up/down resistors to the gates of Q2, Q3, and T3 to shorten the turn off time. Is 100k a suitable value for these resistors?

I thought we would also add some resistors (R10 and R11) to reduce the current going through T4 and T5, which were heating up quite a bit when we were testing it. I suppose this will reduce the effectiveness of T3 somewhat -- too much, do you think? Would 100 Ω be the right value?

I could put together a composite photo of the 4 signals out of the MCU, but it's almost too simple to be worth it: basically each half-cycle takes 8ms. (This makes for a theoretical frequency of 62.5hz -- not perfect, but as close as I could get.) At the beginning of each half cycle, there is 1ms where all the switches are turned off. Then one high-side and one low-side transistor are turned on for 7ms, then all off for 1ms, then the other two on, etc. Is that enough information? I can get a picture if that would be helpful.

Thanks for your help -- one day soon this thing will work!

Cheers,

File size:
12.2 KB
Views:
273
14. ### Audioguru Expert

Dec 20, 2007
11,251
1,350
No.
They also need a gate voltage of 10V to completely turn on.
Don't look at the "threshold voltage" because that is when they are just barely turned on with a current of only 0.25mA.

No.
Mosfets that conduct high currents have a very high gate capacitance. 100k would take all day to discharge it so the Mosfet ramps slowly and gets extremely hot. Use 100 ohms for the collector load resistors of the small PNP transistors so that the Mosfets turn off quickly.

Your R10 and R11 are supposed to be between T5 and T3 and also between T4 and Q1.
You need to calculate the amount of base current needed in the darlington output transistors instead of just guessing on a resistor value.

Mar 7, 2009
30
0
Thanks for your reply Audioguru. After another look at the datasheet I feel rather silly not to have looked more closely the first time. (Though according to the Vds/Vgs/Id plots, once the junction temp was up to 125 C we'd have barely enough current @ Vgs 4.5 -- but that's not something to count on!)

So without a gate driver, could we drive each mosfet with an NPN and a PNP, something like what's in the attached (updated) schematic? Would it work to limit the current through T1 and T2 (if needed) by adjusting the values of R1 and R3?

What about using an op-amp as a gate driver?

This would be a resistor between the collector of the NPN and the gate of the mosfet, correct? How would a collector load resistor help the mosfet discharge quickly without adding somewhere for the charge to go? Am I misunderstanding what you meant by a load resistor?

Thanks for your help. This initially small troubleshooting project has (as I'm sure you've noticed) gone way beyond my knowledge. It has been very informative though, and it's great to have such helpful folks on the forum.

File size:
12.4 KB
Views:
81
16. ### Audioguru Expert

Dec 20, 2007
11,251
1,350
In your new schematic, Q4 and Q5 do not have a base-emitter resistor to turn them off quickly.

R7 and R8 should be about 100 ohms to turn off the Mosfets quickly.