Author Topic: DC to AC converter  (Read 54691 times)

0 Members and 1 Guest are viewing this topic.

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20831
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #75 on: September 13, 2010, 11:33:47 am »
Since I'm a beginner at hardware tricks, I'd ask a few questions:
-why a 10k resistor in series with only one of the two PIC's output to gate? Then why such a high value? I'd have used the highest current possible, since slower gate turn-on means higher switching losses, isn't it? If PIC's outputs are typically 25mA capable, 5/25m = 200 Ohm (PIC consumed power is not so much different, since you only have to charge/discharge a gate at each cycle). Even R4/R5 partition values seem swapped (and again, I'd have put lower resistor values).
1) A resistor is required because the PIC's output would be short circuited to 0V when Q5 is on.
2) You're right that a higher resistor value will slow down the turn on time but it's only operating at 50Hz so the switching losses are negligible. I think the power losses in the lower resistor value would probably be higher than those incurred though higher switching losses.

Quote
-is the added diode a sufficient solution to avoid shoot-thru? In the case GP4 is high and GP2 low, MOSFET Vgs will go to Vbus-Vlogic = 24-(5 - Vdiode) = 19.5 V (about), which I suspect means turn-on.
Yes, the diode is a solution to shoot-through.

When GP2 is high, the source of Q5 goes low, pulling the signal from GP4 via the 10k resistor low and cutting off the signal to Q1 and Q6. The diode will have a voltage drop of under 0.6V at the low current used which is below the threshold voltage of the MOSFETs used.

Quote
However, I guess it is needed on the two low-sides of both legs. I think that the red-linked diode in the attached drawing could solve this issue.
Lol, your diode is just placed on the opposite side of the bridge to my schematic and works in exactly the same way, the only difference is when GP4 is high GP2 id effectively disabled.#

Using no resistor or a very low value on the dominant output also ensures that the associated transistors turn on first which makes the shoot-through protection more robust and avoids a race between transistors.

For example, on my schematic, Q5 will turn on first and short Q1 and Q6 to 0V before they have chance to turn on. In your schematic there will be a race because Q6 will turn on at the same rate as Q2 and Q5, although it's unlikely to result in too much shoot-though as Q6 should be fully on before Q3 starts to conduct.

Note that this not a perfect solution to the problem, for example in my circuit: if GP4 is high and GP2 is low, Q1 and Q4 will both be on, then if GP2 is suddenly made high, Q2 will start to turn on for a bit, before Q4 is shut off. I think a resistor should be placed in series with Q2's gate to ensure it doesn't race with Q4, Q5 and Q6, I'd recommend 47k as the delay should be longer than the switching time of the other transistors.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18202
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #76 on: September 13, 2010, 11:48:29 am »
ah yes i did get the resistor values back to front for the high side mosfets
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20831
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #77 on: September 13, 2010, 12:41:47 pm »
No, the resistors were the right way round, whether it was intentional or not.

The IRF9540 is specified with a VGS of -10V, with a supply voltage of 20V the gate voltage will only be -6.25V if you exchange the 10k and 22k resistor positions, at the moment it's 13.8V which is fine.

You may want to go up to 12k though as with 10k and a power supply voltage of 30V, VGS will be -20.6V, which is above the maximum rating of 20V.

 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: DC to AC converter
« Reply #78 on: September 13, 2010, 12:46:33 pm »
1) A resistor is required because the PIC's output would be short circuited to 0V when Q5 is on.
2) You're right that a higher resistor value will slow down the turn on time but it's only operating at 50Hz so the switching losses are negligible. I think the power losses in the lower resistor value would probably be higher than those incurred though higher switching losses.
Although it would make a perhaps negligible difference, I think power loss will be less in the case of high-speed driving.
At each cycle the switching occurs at the same time (and with the same duration of) a gate charging/discharging. Energy loss in gate charging is (for each complete charge+discharge) Vdrive*Idrive*Tturn_(off/on). Each complete turn ON+turn OFF dissipates on a power MOSFET Vbus*Ioutput*Tturn_(on/off) [J]. Since Vbus and Iout both are much higher than Vdrive and Idrive, I guess reducing the more possible T_turn(off/on) would reduce losses. This could be interesting only for the purpose of enclosing the inverter in a small case.

Quote
-is the added diode a sufficient solution to avoid shoot-thru? In the case GP4 is high and GP2 low, MOSFET Vgs will go to Vbus-Vlogic = 24-(5 - Vdiode) = 19.5 V (about), which I suspect means turn-on.
Yes, the diode is a solution to shoot-through.
...
Lol, your diode is just placed on the opposite side of the bridge to my schematic and works in exactly the same way, the only difference is when GP4 is high GP2 id effectively disabled.#
Yes, my circuit is the same as yours. Sorry, really didn't understand your solution at first, but the fact that "independently" we arrived at the same guess (only reversed) certainly means it's right :)

Using no resistor or a very low value on the dominant output also ensures that the associated transistors turn on first which makes the shoot-through protection more robust and avoids a race between transistors.

For example, on my schematic, Q5 will turn on first and short Q1 and Q6 to 0V before they have chance to turn on. In your schematic there will be a race because Q6 will turn on at the same rate as Q2 and Q5, although it's unlikely to result in too much shoot-though as Q6 should be fully on before Q3 starts to conduct.

Note that this not a perfect solution to the problem, for example in my circuit: if GP4 is high and GP2 is low, Q1 and Q4 will both be on, then if GP2 is suddenly made high, Q2 will start to turn on for a bit, before Q4 is shut off. I think a resistor should be placed in series with Q2's gate to ensure it doesn't race with Q4, Q5 and Q6, I'd recommend 47k as the delay should be longer than the switching time of the other transistors.
Yes, even if one tried to put the same "shoot-trhough prevention" diode on both PIC outputs, a different delay should be put on the two paths to prevent a race.
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18202
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #79 on: September 13, 2010, 04:52:29 pm »
well i now have the fun of coping with back EMF, while not dangerous it seems to be upsetting the pump.

It turns out that the pump is 12V not 24V as it is only a sample (duh I've never known such a dumb lot) so my gate resistors are not optimized for 12V but it coped, I suspect the abrupt fall off of pump performace at 12V was because the mosfets were not driven hard enough.

if i used 2 X 10K resistors I should be good to 40V ? and 30 is our limit
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20831
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #80 on: September 13, 2010, 07:00:37 pm »
Although it would make a perhaps negligible difference, I think power loss will be less in the case of high-speed driving.
At each cycle the switching occurs at the same time (and with the same duration of) a gate charging/discharging. Energy loss in gate charging is (for each complete charge+discharge) Vdrive*Idrive*Tturn_(off/on). Each complete turn ON+turn OFF dissipates on a power MOSFET Vbus*Ioutput*Tturn_(on/off) [J]. Since Vbus and Iout both are much higher than Vdrive and Idrive, I guess reducing the more possible T_turn(off/on) would reduce losses. This could be interesting only for the purpose of enclosing the inverter in a small case.
But then the power dissipation due to the ridiculously low resistor values would be higher so you gain nothing. I think you've forgotten that the circuit works by shorting the MOSFET gates to 0V to turn them on.

Reducing the gate resistors to Q5 and Q6 shouldn't increase the switching speed much because of R2 to R4 will slow things down too much. Incidentally the gate resistor of the submissive input will only cause high power dissipation, when both PIC outputs are high, so it's not a problem.

R2 to R4 need to be reduced as well, to have any effect. Suppose you set the values so the current it 25mA (a total resistance of 960R), the power dissipation due to them would be 0.6W.

Although the instantaneous power dissipation will be quite high (12W, assuming a current of 1A and a power supply voltage of 24V) that condition will only occur for a short time each cycle so the average power dissipation will be tiny.

What do you think the switching speed of the MOSFETs will be?

I've never done this calculation before so I'll guess.

The maximum gate capacitance of the IRL540 is 1.96nF, with a resistor is 10k, the time constant is only 19.6µs for the bottom MOSFETs

The maximum gate capacitance for the IRL9540 is 1.3nF so with 22k the discharge time constant is only 28.6µs and the charging time constant will be 10k|22k = 6.67k*1.3nF = 8.67µs

I don't see how such short gate RC time constants can slow the MOSFETs down enough to cause significant power dissipation.

Even if the MOSFETs took 100µs (over three times the longest RC time constant) to both turn on and off the power dissipation should be under 0.6W.

I = 1A
Tswitch = 100-6s
F = 50Hz
V = 24V

P = 0.5I*V*Tswitch*2F

The current is halved because MOSFETs are current controlled so act like constant current loads when operating in the active region.
The frequency is doubled because it swichs twice per cycle.

So it can be simplified to P = I*V*Tswitch*F
100*10-6*24*100 = 0.24W and don't forget that's spread over four transistors in TO-220 packages not mostly in an LM78L05 which is in a tin TO-92 package.

I don't see how it could switch any slower than that, the chances are it'll be faster, if you know the correct calculation and think it'll be slower then please demonstrate it.

Quote
Yes, even if one tried to put the same "shoot-trhough prevention" diode on both PIC outputs, a different delay should be put on the two paths to prevent a race.
The diode method won't work on both outputs, it only works with one being the dominant and the other being submissive.

The best way of doing it is to logic gates so if both inputs go high, the output will be low, even then there's a risk of race so there should be the correct number of gates, have them clocked or use RC time constants to make sure the inputs change when they should.

You could use a quad NOR gate IC, Schmitt trigger is probably best, I'll post the circuit if you or Simon are interested but I don't see the point: it's an extra IC to provide protection against an unlikely catastrophic event.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18202
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #81 on: September 13, 2010, 08:37:18 pm »
Well I've changed the 22K resistors for 10K ones and the circuit is working much better, the pump not works (actually pumps water) on 12V as the high side mosfets are being driven properly, it's a pity I can't get more voltage to the low side mosfets but that would mean introducing another pair of signal mosfet drivers.

I have the pump (that i borrowed from work) running now on my board and the mosfets are quite cool with the 300 mA load

The back EMF problem is pretty much gone but there are signs of it in the switchover points, I've also borrowed the original driver board and from what I can tell there is on each output point a reversed based diode with a 47 ohm resistor in series connected to the negative
 

Offline TechGuy

  • Regular Contributor
  • *
  • Posts: 79
Re: DC to AC converter
« Reply #82 on: September 13, 2010, 09:51:22 pm »
attached is my design, probably crude and I've omitted the back EMF diodes for the minute I'll probably go with an output TVS diode at 40v if need be. There may yet be changes after i test it tomorrow, if anyone wants the software (in mikroe basic) or layout I'll post that too.

Some red flags:
1. No gate pull down resistors. Each MOSFET should have a 10k pull down resistor.
2. Driving MOSFETs with Vgs of 10V with a 5V TTL output. Your not turning on the MOSFETs all the way when you only apply 5Vs to the Gate. You should use MOSFET drivers for this circuit!
3. No Gate resistors on the low side MOSFETs
4. No Snubbers to disappate inductance leakage spikes & reverse recovery. Add two RC snubbers on both sides of the bridge.
5. Your P-Channel Gate resistors are awfully high a gate resistor should in in 10's of ohms not 10,000's of ohms.  Having such a high resistance will take for ever for the gate to fully turn on or off. MOSFETS gates are essentially capacitors. You should use MOSFET drivers for this circuit! if your VInput is 24V, your will also exceed the VGS for the P-Channel MOSFETs.
6. You need a low value ceramic decoupling cap between Vdd and ground on the PIC. and the leads should be very short. You want a ceramic cap that is about 0.1uf with a voltage of 25V or less so that it has very low ESR. Otherwise internal switching to the MCU can cause the VDD to drop too low causing erratic behavior or abruptly reset the MCU.
7. MCLR should have a pull high resistor (10K) so that noise doesn't cause it to trip, unless you disabled it using the PIC control register ( not sure if this is an option with the PIC12 series).
8. There should be a PTC fuse between the J1, pin1 and the 100uf/TVS diode. A large power surge could blow the TVS diode. the PTC will provide some protection. TVS diode will get fried if the user connect the input backwards (PTC fuse would prevent that)
9. No Overvoltage\undervoltage lock out. This is very simple using the PIC. Just use one of the ADC with a Resistor-Resistor voltage divider to drop the input voltage below 5V, and measure the input voltage. Two resistors is and a zener to prevent overvoltage from exceeding the ADC voltage range. a small cap (0.1uf) across the low side resistor would be helpful to avoid false readings (ie because of a temperory input voltage change when a large load is suddenly turned on or off)
10. Should include a Rsense resistor to measure the current. Use the other ADC channel to measure the bridge current.

If your going to do this project, do it right!


 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20831
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #83 on: September 13, 2010, 10:48:33 pm »
1. No gate pull down resistors. Each MOSFET should have a 10k pull down resistor.
That's right, if the MCU's output acidentally gets configured as an input, the MOSFET's gate will float, potentially biasing it into its active region causing a high power dissipation.

Quote
2. Driving MOSFETs with Vgs of 10V with a 5V TTL output. Your not turning on the MOSFETs all the way when you only apply 5Vs to the Gate. You should use MOSFET drivers for this circuit!
I think it will probably be all right, the current is only 1A (see the graphs on page 3 of the datasheet) but yes I know the datasheet gives typical not wore case so using drivers would improve things. I wouldn't bother though, I think it would be better to swap them for logic level MOSFETs such as the IRL540.

Quote
3. No Gate resistors on the low side MOSFETs
Yes, it's always a good idea to include them.

Quote
4. No Snubbers to disappate inductance leakage spikes & reverse recovery. Add two RC snubbers on both sides of the bridge.
That will work or he could use diodes.


Quote
5. Your P-Channel Gate resistors are awfully high a gate resistor should in in 10's of ohms not 10,000's of ohms.  Having such a high resistance will take for ever for the gate to fully turn on or off. MOSFETS gates are essentially capacitors.
So what it's only running at 50Hz?

The switching losses will be negligible even if the switching times are 100µs or worse, see my previous post: using resistors with such low values will cause a much higher power dissipation.

Quote
You should use MOSFET drivers for this circuit! if your VInput is 24V, your will also exceed the VGS for the P-Channel MOSFETs.
At 24V no, do the potential divider calculations, the VGS is only -13.8V with the supply voltage at 24V.

The supply voltage has to exceed 29V before the maximum VGS of the IRF9540N (20V) rating is exceeded so yes, change the values if it needs to run off such a high voltage.

Quote
6. You need a low value ceramic decoupling cap between Vdd and ground on the PIC. and the leads should be very short. You want a ceramic cap that is about 0.1uf with a voltage of 25V or less so that it has very low ESR. Otherwise internal switching to the MCU can cause the VDD to drop too low causing erratic behavior or abruptly reset the MCU.
You're perfectly right, you should always put a ceramic capacitor in parallel with the PIC's power supply rails, the 10µF capacitor on the LM78L05 will have much to high an ESR to be effective.

Quote
7. MCLR should have a pull high resistor (10K) so that noise doesn't cause it to trip, unless you disabled it using the PIC control register ( not sure if this is an option with the PIC12 series).
Yes, there is an option to disable MCLR, even on the basline PICs (12F508) so I'm pretty sure it's possible with the more advanced 12F629.

Quote
8. There should be a PTC fuse between the J1, pin1 and the 100uf/TVS diode. A large power surge could blow the TVS diode. the PTC will provide some protection. TVS diode will get fried if the user connect the input backwards (PTC fuse would prevent that)
Yes, always include a fuse, it's also possible that some idiot could connect the power in the reverse direction

Quote
9. No Overvoltage\undervoltage lock out. This is very simple using the PIC. Just use one of the ADC with a Resistor-Resistor voltage divider to drop the input voltage below 5V, and measure the input voltage. Two resistors is and a zener to prevent overvoltage from exceeding the ADC voltage range. a small cap (0.1uf) across the low side resistor would be helpful to avoid false readings (ie because of a temperory input voltage change when a large load is suddenly turned on or off)
Yes, I read about this in one of the PIC tutorials I've been studying, not sure if the zener is needed though: surely if the voltage exceeds the ADC's maximum rating, the PIC would already be toast? And that shouldn't happen unless the LM7805 fails which is unlikely.

Quote
10. Should include a Rsense resistor to measure the current. Use the other ADC channel to measure the bridge current.
Are you talking about short circuit protection? If there's a short, the power supply voltage is likely to fall so quickly that the PIC resets before it has chance to turn both MOSFETs off and if that happens both inputs will default to high impedance and the MOSFETs will turn off anyway, providing the appropriate pull down resistors are used of course.

Why not get rid of the 2N7000s altogether and use the bottom transistors to pull-down the top?

Attached is an example circuit I designed to illustrate this point to someone else so would need to be changed for your application
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18202
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #84 on: September 14, 2010, 06:47:29 am »
all points noted and many of them are planned changes (like gate resistors), my aim was to get something running first and show him how small it will be, I think if it grows 50% he won't have a problem with that. the original driver uses some sort of diode and resistor snubber, 2 off from the output to ground, i may just copy this but back EMF has pretty much been resolved now that I'm driving the top mosfets correctly and the mosfets with the intended pump run quite cool (I can't actually say they were getting even warm). I've now made both resistors 10K so thats -6V on 12V and -12 on 24V, at worst case of 30V thats -15V which is well withing the 20V spec but I may readjust that later when we go into 24v production.

The MCLR is dissabled in software.

the idea of using the low side mosfets to drive the high side ones is a very good idea for space constraints, in fact if i can get rid of the high side driving mosfets i could use them to drive the low side mosfets so keeping the same part count (well couple more resistors) and driving everything properly.

Yes it's only 50Hz so the on/off times of the mosfets are really not worth worrying about.

As for voltage and current sensing: err, this is meant to be fairly simple, I'll implement some sort of fuse but I'm not bothering with voltage protection, I'm afraid if they want to screw it that's their problem, provided it gets reasonable supply voltage nothing bad will happen.

Using a high side sense resistor for current will just introduce the need for another chip and that's going too far
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: DC to AC converter
« Reply #85 on: September 14, 2010, 08:57:01 am »
What do you think the switching speed of the MOSFETs will be?

I've never done this calculation before so I'll guess.

The maximum gate capacitance of the IRL540 is 1.96nF, with a resistor is 10k, the time constant is only 19.6µs for the bottom MOSFETs

The maximum gate capacitance for the IRL9540 is 1.3nF so with 22k the discharge time constant is only 28.6µs and the charging time constant will be 10k|22k = 6.67k*1.3nF = 8.67µs

I don't see how such short gate RC time constants can slow the MOSFETs down enough to cause significant power dissipation.

Even if the MOSFETs took 100µs (over three times the longest RC time constant) to both turn on and off the power dissipation should be under 0.6W.

I = 1A
Tswitch = 100-6s
F = 50Hz
V = 24V

P = 0.5I*V*Tswitch*2F

The current is halved because MOSFETs are current controlled so act like constant current loads when operating in the active region.
The frequency is doubled because it swichs twice per cycle.

So it can be simplified to P = I*V*Tswitch*F
100*10-6*24*100 = 0.24W and don't forget that's spread over four transistors in TO-220 packages not mostly in an LM78L05 which is in a tin TO-92 package.

I don't see how it could switch any slower than that, the chances are it'll be faster, if you know the correct calculation and think it'll be slower then please demonstrate it.


Power MOSFETs' datasheets report gate charge curve, which shows how gate behaves. Because of the Miller effect (between gate and drain), on the gate at switching you see a much larger capacitance than the Cgs+Cgd, since Cgd get multiplied by voltage gain. In fact, it is easy to calculate turn ON/OFF time when considering a constant current source on the gate (you simply take the charge required at the desired gate voltage Qg @ Vgs and divide by the current charging/discharging) while it is a more complex if you consider a constant voltage source (in fact, equivalent capacitance changes when Vgs changes).
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: DC to AC converter
« Reply #86 on: September 14, 2010, 09:06:26 am »
the idea of using the low side mosfets to drive the high side ones is a very good idea for space constraints, in fact if i can get rid of the high side driving mosfets i could use them to drive the low side mosfets so keeping the same part count (well couple more resistors) and driving everything properly.
That seems a good idea, but as TechGuy pointed out, your driving voltage (5V) is quite low, a driver IC won't be so bad, but even a SOT-23 transistor could be a low-cost and low-space consuming solution.

I've now made both resistors 10K so thats -6V on 12V and -12 on 24V, at worst case of 30V thats -15V which is well withing the 20V spec but I may readjust that later when we go into 24v production.

If voltage would be higher, you could also put a zener there to be sure max Vgs gets not exceeded.
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20831
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #87 on: September 14, 2010, 09:54:39 am »
all points noted and many of them are planned changes (like gate resistors), my aim was to get something running first and show him how small it will be, I think if it grows 50% he won't have a problem with that. the original driver uses some sort of diode and resistor snubber, 2 off from the output to ground, i may just copy this but back EMF has pretty much been resolved now that I'm driving the top mosfets correctly and the mosfets with the intended pump run quite cool (I can't actually say they were getting even warm). I've now made both resistors 10K so thats -6V on 12V and -12 on 24V, at worst case of 30V thats -15V which is well withing the 20V spec but I may readjust that later when we go into 24v production.

The MCLR is dissabled in software.

the idea of using the low side mosfets to drive the high side ones is a very good idea for space constraints, in fact if i can get rid of the high side driving mosfets i could use them to drive the low side mosfets so keeping the same part count (well couple more resistors) and driving everything properly.

Yes it's only 50Hz so the on/off times of the mosfets are really not worth worrying about.

As for voltage and current sensing: err, this is meant to be fairly simple, I'll implement some sort of fuse but I'm not bothering with voltage protection, I'm afraid if they want to screw it that's their problem, provided it gets reasonable supply voltage nothing bad will happen.

Using a high side sense resistor for current will just introduce the need for another chip and that's going too far

Have you actually measured what the conduction losses are for the top and bottom transistors using a 'scope?

Don't forget that the lower transistors have a lower resistance anyway.

Maybe you could just use the IRF540s for the prototype and switch to IRL540s, which are logic level and are designed to work from 5V inputs, for production?

What about the switching times/losses?

Power MOSFETs' datasheets report gate charge curve, which shows how gate behaves. Because of the Miller effect (between gate and drain), on the gate at switching you see a much larger capacitance than the Cgs+Cgd, since Cgd get multiplied by voltage gain. In fact, it is easy to calculate turn ON/OFF time when considering a constant current source on the gate (you simply take the charge required at the desired gate voltage Qg @ Vgs and divide by the current charging/discharging) while it is a more complex if you consider a constant voltage source (in fact, equivalent capacitance changes when Vgs changes).
All right, so what sounds like a  reasonable estimate of the switching time?

I'll have a play with LTSpice.

the idea of using the low side mosfets to drive the high side ones is a very good idea for space constraints, in fact if i can get rid of the high side driving mosfets i could use them to drive the low side mosfets so keeping the same part count (well couple more resistors) and driving everything properly.

I don't think it'll be too bad, the datasheet says the conduction loss is only 0.1V with a VGS of 5V and an ID of 1A, even at 175°C. I know datasheets tend to only give graphs for typical devices but the ones he's using seem fine, he's only using the IRF540s because he's already got loads of them and he can switch to logic level devices for production.

 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: DC to AC converter
« Reply #88 on: September 14, 2010, 10:58:48 am »
Well, in this case power is perhaps so low with respect to the huge transistor used that it makes not much difference.

However, it is interesting to see how gate charge happens.
If you look at fig.6 of the datasheet (http://www.irf.com/product-info/datasheets/data/irf540n.pdf) you can see that starting from zero, until about 4.5V voltage is linear with charge, which means (Q = C*V) that on the gate there is a simple equivalent capacitor. Its value should be Ciss = Cgd+Cgs, and if you look at fig.5 you will see that for a Vds above 20V Ciss = 2nF, that matches the fact that at Vgs=4.5V you have about 9nC. If you think of the superimposing principle, you short DC components and see what happens at a variation on the gate voltage. Drain and source are constant, so all voltage variations on the gate go charging the parallel of the two capacitances like drain and source were both to gnd.
Now, above 4.5V the transistor starts counducting, so drain is no more constant. The curve above that threshold becomes almost horizontal, since a voltage increase on the gate makes the drain to lower (because reduces rds resistance), so the Cgd cap gets bounded to an almost constant value (there's a sort of feedback that "amplifies" capacitance, called the Miller effect). In practice, gate equivalent cap is very large, one can assume it is infinite until charge reaches the other value (here about 23nC) where the transistor is really in triode region. This last curve segment, above 4.5V and 23nC, is characterized by an equivalent cap of about 4.4nF (from the graph).
So, for each of the three segments:
- 0 to 4.5V : RC charge at constant voltage source -> T = 2.3 * R*C = 2.3*10k*2n = 46us
- 9 to 23 nC : C charge at constant current -> I = (Vhigh - Vg) / R = (5-4.5) / 10k = 50uA , T = DeltaQ / I = (23n-9n)/50u = 280us
- 4.5 to 5 V : RC charge at constant voltage source -> T = 4 * R*C = 5 * 10k*4.4n = 176us
Of course in this case the charge to 4.5V will be sufficient and is quite short, but if we had a larger output current, and then we really needed to charge our gate to at least 5V (the graphs show that there is a big difference in resistance between 4.5 and 5V), the turn on/off time will be quite long.
« Last Edit: September 14, 2010, 11:01:30 am by scrat »
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline TechGuy

  • Regular Contributor
  • *
  • Posts: 79
Re: DC to AC converter
« Reply #89 on: September 14, 2010, 05:51:57 pm »
I've got a better idea, since Current demand is low, Speed is low, and you're not aiming for high efficency. Ditch the MOSFETs and go with PNP-NPN totem pairs for the bridge. You can drive them at 5Volts. Can you can go with Surface mount packages (DFN, TO-252, or SOT224), which will be far smaller than the four TO-220 mosfets choosen.
The small Vce-sat voltage drop is irrelevent in this design.

Quote
The supply voltage has to exceed 29V before the maximum VGS of the IRF9540N (20V) rating is exceeded so yes, change the values if it needs to run off such a high voltage.

Your assuming that the input voltage will always remain below 29V. We can't assume that it will remain so. There could be a power surge that causes the input voltage to rise above the limit, frying the gates. All it takes is a short voltage surge to blow them.


Quote
Are you talking about short circuit protection? If there's a short, the power supply voltage is likely to fall so quickly that the PIC resets before it has chance to turn both MOSFETs off and if that happens both inputs will default to high impedance and the MOSFETs will turn off anyway, providing the appropriate pull down resistors are used of course.

No, against saturation of the solenoid or some unforseen issue that is causing excessive power demand. Flux walking, or perhaps the pump becomes clogged or something I can't see or predict. I would use one of the spare PIC pins with an LED to indicate status, ie Pump is running (steady on), Under\over voltage - slow pulsing LED, Over current -fast pulsing LED,etc.



 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18202
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #90 on: September 14, 2010, 06:18:23 pm »
the pump and driver will be inside an airconditioning case and the soldiers riding in the vehicle will have better things on their minds than reverse engineering their air con system  ;D

won't there be more dissipation from a BJT ? as there is a fixed Vce of 0.2 volts ?

I chose a TO-220 package so that it would not heat up at all as it is big enough to act as it's own heat sink. bearing in mind the circuit will be put into it's own little case and possibly potted which might even help dissipation ? as the compound will absorb the heat and take it to the case walls and out ? or maybe thats not the case
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20831
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #91 on: September 14, 2010, 07:47:48 pm »
I agree, I would think that BJTs would give greater losses than MOSFETs.

To saturate properly, the base current will also probably need to be higher than the PIC's output pins can provide.

Maybe MOSFETs could be used for the low side and BJTs for the high side?

The MCU could drive logic level MOSFETs which have a high gate impedance and can easily pull down the BJT transistor's bases on the high side.

By the way, for production you could use the PIC10F200 to save both space and money - it comes in a tiny SMT SOT-23 package and costs very little.

 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18202
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #92 on: September 14, 2010, 09:57:10 pm »
yes I'll be looking at different pics although a couple of things have been put forward that I need to have resources available for. Although he wants to ditch bothering to detect water he is considering using the difference in temp in and out to determine when the air con system is putting out cold air (as it also has a blow only function) which is a rough guide to if there is condensed water to be pumped out. I think microchips temp sensors that output 10 or 19.5 mV/C will do nicely but then I'll be needing an ADC so need to watch which pic i choose because I'm not writing software every five minutes over 20p difference.

He insists on having it made by a subcontractor and my guess is such a sub contractor will not be able to handle SMD stuff or will just mess it up, he's happy with through hole, I showed him an SMD chip soldered to another circuit and I think it scared him off them, my guess it also that I'll be programming the chips and at the moment it is DIP8 in my zif socket or SMD with a header but if he's going to keep changing his mind about stuff then i might put a header in anyhow so I can modify the firmware later.

I will be changing the low side mosfets for logic level ones such as the IRL540 which looks like an almost direct replacement for the IRF540 but for the lower gate threshold but I'm yet to read all of the datasheet and have found that the IRL540 seems to have different gate specs to the IRL540NPbp, I think most of the back EMF will be solved by driving the mosfets with sufficient strength, the IRF540 have a threshold as high as 4 V and I know that a pic can put out as low as 4.5V so not a good match and not a fully switched on mosfet, working off the back of experience and lessons learnt with the high side fets that will cure it.

The original boards back EMF protection seems to amount to a diode and resistor in series put across the low side mosfets, essentially taking the burden off the built in diodes so really I should already be free of back EMF and guess that the on resistance needs reducing in order to drive the signal in the right direction over riding back EMF
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20831
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #93 on: September 15, 2010, 07:53:01 am »
There's no difference between the Pb-free versions of the IRL540 and Pb versions, other than compliance with the RoHS legislation.
http://www.vishay.com/docs/91300/91300.pdf

If your contractor are too rubbish to cope with SMT you shouldn't be using them in the first place, even if you only want to use through hole components.

You can get six pin MCUs which contain an ADC.
http://ww1.microchip.com/downloads/en/devicedoc/41270a.pdf

I thought one of the advantages of using a high level language, such as BASIC is supposed to be that you don't have to rewrite all of you code to change from one processor to another?

Yes, using in circuit programming is probably still a good idea, even if you end up going though hole, another idea is to use a socket for the PIC.

Why not get rid of all the MOSFETs and use an IC h-bridge?

There are plenty of different solutions available which also have shoot through protection and some even have protection diodes built-in, the SN754410, L293, L298 seem to be most common and as all the transistors are on one IC they'll be matched meaning you should be able to parallel unused outputs for more current capability or a lower voltage loss.


« Last Edit: September 15, 2010, 12:29:45 pm by Hero999 »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18202
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #94 on: September 15, 2010, 11:49:00 am »
the L298 looks interesting as we are now looking to drive two pumps on the same circuit but using BJT's i'm wondering what sort of heat dissipation it has. at the end of the day it costs a little more than the 4 mosfets and will take just a little less space.
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: DC to AC converter
« Reply #95 on: September 15, 2010, 12:35:20 pm »
L6201 will fit your needs, integrates drivers (so eliminates the need for the two MOSFETs for the high-side, has shoot-through protection (dead-time), thermal shutdown and an active-high enable input. RdsON, as a drawback, is at least 3 times the one of IRL540 (however, IRL540 is quite huge for the purpose, so you could choose something smaller and cheaper).
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20831
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #96 on: September 15, 2010, 01:35:52 pm »
I suppose ICs with bootstapping have the added advantage of limiting how long the high side transistors can be on for, so if the PIC freezes the pump won't be connected to DC power for long before the bootstrap capacitors discharge and turn off the top transistor.
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: DC to AC converter
« Reply #97 on: September 15, 2010, 01:56:20 pm »
I suppose ICs with bootstapping have the added advantage of limiting how long the high side transistors can be on for, so if the PIC freezes the pump won't be connected to DC power for long before the bootstrap capacitors discharge and turn off the top transistor.

For L6201: although there is a "charge pump" in the principle schematic, recommendation for bootstrap cap lets guess that what you say is true.

I have to apologize for a previous post I made about switching losses: the presence of the diode makes power dissipated during turn on negligible (soft switching), while turn off is a hard switching (e.g. voltage and current involved in the worst case are Vbus and maximum load) and then the device dissipates a sensible amount.
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline TechGuy

  • Regular Contributor
  • *
  • Posts: 79
Re: DC to AC converter
« Reply #98 on: September 16, 2010, 06:50:55 pm »
the pump and driver will be inside an airconditioning case and the soldiers riding in the vehicle will have better things on their minds than reverse engineering their air con system  ;D

won't there be more dissipation from a BJT ? as there is a fixed Vce of 0.2 volts ?

I chose a TO-220 package so that it would not heat up at all as it is big enough to act as it's own heat sink. bearing in mind the circuit will be put into it's own little case and possibly potted which might even help dissipation ? as the compound will absorb the heat and take it to the case walls and out ? or maybe thats not the case

It will get pretty darn hot quickly if you drive  10Vgs MOSFETs with 5volts and high value resistors. Ideally you want to use surface mount (TO-252 or TO-263), not heatsink mount MOSFETs without heatsinks, with surface mount devices, heat is disappated into PCB board. Better dissapation with a surface mount transistor can be achieved using oversize pads. A TO-220 without a heatsink is a disaster in the making. Bigger case size does not mean more effective in disappating heat. To get good efficient and low thermal disappation you need to keep switching loss very low. Thats why all commericial MOSFET designs use gate drivers and low value gate resistors.

the Vce will not be as big a deal than if you drive the MOSFETs using 5V and high value resistors. Either add gate drivers, or go with BJTs.

Quote
For L6201: although there is a "charge pump" in the principle schematic, recommendation for bootstrap cap lets guess that what you say is true.

The L6201 motor driver can remain on a switched state indefinately. The pump charge selfs renews the cap charge using a built in oscillator. I use the L6201 in a Fire Alarm controller to power 4 wire fire alarm sensors. The Fire alarms sounder is triggered by reversing the polarity of the input voltage supply.
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: DC to AC converter
« Reply #99 on: September 17, 2010, 12:02:27 am »
Quote
For L6201: although there is a "charge pump" in the principle schematic, recommendation for bootstrap cap lets guess that what you say is true.

The L6201 motor driver can remain on a switched state indefinately. The pump charge selfs renews the cap charge using a built in oscillator. I use the L6201 in a Fire Alarm controller to power 4 wire fire alarm sensors. The Fire alarms sounder is triggered by reversing the polarity of the input voltage supply.

Since I didn't read very well the datasheet, I suspected this because of the app schematic showing DC motor fwd/rev, but then thought this had to be done by PWM under current control. Why did they put the recommendation saying that bootstrap cap has to be much larger than MOS capacitance? Is it only for ensuring good driving voltage at turn on start?
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf