PDA

View Full Version : PC Switch


Neil Stainton
Mar 10, 2005, 02:21 PM
I want to build a PC based batttery discharger, and am looking for a circuit that will switch a 30A current using a 5V digital input.

Any help would be much appreciated!

Neil.

Warske
Mar 10, 2005, 02:51 PM
Power MOSFET with "Logic-Level Gate Drive" should work.

Eg: http://www.digikey.com

IRLZ34-ND
$0.93 ea
30 A
60 V
0.05 ohms
http://www.irf.com/product-info/datasheets/data/irlz34.pdf

Or the IRL3705N-ND is rated 89 Amps for $2.60

Warske

jperch
Mar 10, 2005, 04:04 PM
A MOSFET would work. Make sure you have a large heatsink and perhaps active cooling.

Another idea is a solid state relay (SSR). They are designed for industrial machinery. But they will work on smaller loads. They basically work like a mechanical relay with a 5V digital input. The output can switch AC or DC loads at very high currents. I will see if I can find some info.

Joe

EDIT: Okay, forget what I said about SSR's unless you find a surplus batch or are wealthy! The ones I found at Digikey are +$40 each. You could buy a few MOSFETS and heatsinks for that.

Joe

Neil Stainton
Mar 10, 2005, 05:41 PM
Thanks guys.

Neil.

Warske
Mar 10, 2005, 06:03 PM
A MOSFET would work. Make sure you have a large heatsink and perhaps active cooling.
This is true for the $0.93 MOSFET. It would dissipate about 60 watts.

The $2.60 MOSFET would dissipate about 21 watts.

A $4.08 IRLBA3803P-ND MOSFET would dissipate about 8 watts.

Or, if you don't want to use a heat sink, multiple MOSFETs can be run in parallel.

For example, 10 of the $0.93 MOSFETs in parallel would dissipate about 1.5 watts each, which wouldn't require a heat sink. (You have to look at the spec sheet to see why it isn't 60 / 10 = 6 watts each.)

How to keep your cool when working with power electronics (http://power.ece.uiuc.edu/Balog/images/How%20to%20keep%20your%20cool%20when%20working%20w ith%20power%20electronics.pdf) might be worth a look.

Warske

Warske
Mar 10, 2005, 08:36 PM
I got curious and decided to do a bit more digging, so I went into the IR site and sorted by ON resistance.

Working just with parts available from digikey and staying away from surface mount, it looks like two IRL8113-ND ($1.95 ea) in parallel would do the trick w/o heatsinking.

Warske

jperch
Mar 10, 2005, 09:00 PM
Warske,

Nice work. One comment, I would not recommend putting devices in parallel unless the devices are being used in a digital mode. In other words, the current is fully on or fully off. In reading Neil's initial request, one could assume that this is exactly what he wants to do . However, if he is considering using the devices to regulate the current and maintain a constant 30A flow, then paralleling the devices is not recommended. You can not guarentee that both devices will drive the same current for the same gate drive level unless the devices are carefully matched. Even then, there will be some mismatch.

Of course, if this is what Neil had intended, then my recommendation of an SSR would also not have worked.

Joe

Neil Stainton
Mar 11, 2005, 04:34 AM
Thank you Warske and Jo for your continued help. I live in the UK and the postage on a Digikey order may put the price up too much (I need to check this). I've got an account with Rapid Electronics, did the "Logic-Level Gate Drive" search and came up with these Fully autoprotected power MOSFETs (http://www.rapidelectronics.co.uk/rkmain.asp?PAGEID=80010&CTL_CAT_CODE=&STK_PROD_CODE=M34947&XPAGENO=1) Would the VNP49N04 be OK?

In the meantime I will see if I can source some IRL8113-ND devices here. BTW what does the -ND suffix mean?

BTW2 yes I am just going to use the transistor to switch a resistive load, that will be disipating all the heat - and probably in a bucket of water! However if I could implement a constant load circuit, in the 10A to 40A range, for less than $100 and 10 hours work I would be very interested.

Regards,

Neil.

jperch
Mar 11, 2005, 10:03 AM
Neil,
If I read the data sheet correctly, the VNP4904 might be even better than the one originally suggested. IIRC, the one before had an on resistance of 0.05 ohms. This one states 0.025. If you use just one, you will definitely need a heatsink. However, I think if you parallel three of them you are really close to being able to get away without one. Four in parallel and you definitely won't need a heat sink.

Joe

Warske
Mar 11, 2005, 10:47 AM
I live in the UK and the postage on a Digikey order may put the price up too much (I need to check this).
I see that DigiKey has a UK site: http://dkc1.digikey.com/uk/digihome.html

There are probably other companies in the UK that have the parts and are reasonable to deal with. You might do a search on these forums to look for names.

I've got an account with Rapid Electronics ...Would the VNP49N04 be OK?
What Joe said looks right.

You could also use a FET to drive a relay, of course.

BTW what does the -ND suffix mean?
I was giving you DigiKey part numbers. They usually add -ND to the actual number but not always. If in doubt, look it up on the DigiKey site. You can usually link to a datasheet from there.

BTW2 yes I am just going to use the transistor to switch a resistive load, that will be disipating all the heat - and probably in a bucket of water! However if I could implement a constant load circuit, in the 10A to 40A range, for less than $100 and 10 hours work I would be very interested.
Might be possible. Maybe if you gave us some more details about your application.

What type of battery are you trying to discharge? What voltage?

Just one battery, or several at a time?

By constant load, do you mean constant current, constant power, or ...?

Are you driving this with a PC data acquisition system? If so, which one? Can you write programs to read voltage, compute on it, and output a voltage based on the result?

Warske

Neil Stainton
Mar 11, 2005, 02:23 PM
> I see that DigiKey has a UK site: http://dkc1.digikey.com/uk/digihome.html

Thank you very much. Unfortunately for small orders the handling & postage cost works out to be very expensive, but for orders over $140 they could be excellent.

< Might be possible. Maybe if you gave us some more details about your application. What type of battery are you trying to discharge? What voltage?>

Testing of batteres for sport and competition (motor glider) use. My initial need is to compare two 7 cell NiMH batteries at around 30A. The complication is that the motor is only run for about 10 seconds every 2 minutes, so I want to get the PC to switch the load and log current and voltage. I will then be able to compare total watt-hours available from each battery.

> Just one battery, or several at a time?

Just one.

> By constant load, do you mean constant current, constant power, or ...?

Constant current.

> Are you driving this with a PC data acquisition system? If so, which one?

Yes, I've got an ADC11/12 (11 inputs, 12bit) from http://www.picotech.com/data-acquisition.html

> Can you write programs to read voltage, compute on it, and output a voltage based on the result?

Yes!

I think my initial 10 hour restriction was unrealistic, I woudl be willing to spend a lot more time to create a good test facility.

TIA,

Neil.

jperch
Mar 11, 2005, 02:25 PM
Neil,
Forgive me if this is a stupid question, but wouldn't something like the CBA do what you want?

Joe

Neil Stainton
Mar 11, 2005, 03:57 PM
I don't think the CBA will allow the load to be switched in and out. The two batteries I am considering are the 44g GP2200 and the 27g GP2300mah "mignon" (AA sized I think) cell which I imagine would struggle to deliver 30A continuously. However it may work OK for 10s every 2 minutes.

Also West Coast weren't very good at documenting the min/max voltage limitations for the CBA initially, which really put be off. Finally the CBAII couldn't discharge a 7V battery at 30A, I would have to make up a special 2 cell battery.

Neil

Neil Stainton
Mar 11, 2005, 07:19 PM
I've just found a PHP 45N03LT in my odds and ends box (purchased some years ago for a never completed project). I haven't been able to find the spec sheet for it but did read the PHB version described as a "logic level N channel 45A power mosfet". Do any of you guys know if it would be possible to use one PHP 45N03LT with a CPU heatsink?

TIA,

Neil.

Warske
Mar 11, 2005, 10:25 PM
Do any of you guys know if it would be possible to use one PHP 45N03LT with a CPU heatsink?
Spec sheet
http://www.alldatasheet.com/datasheet-pdf/view/PHILIPS/PHP45N03LT.html
suggests it is a 30 v part and the ON resistance is 0.024 mOhm with the gate at 5 v.

At 30 amps, the power is 21.6 Watts.
But your average power, 10 seconds on every 120 seconds, is 1.8 watts.

The thermal mass of the sink should be ok for the 216 joules you get in 10 sec.

Overall, it sounds OK, especially if you blow air over the heat sink. Its possible to run calculations on it, but for a one-off home project, my inclination would be to try it and see how warm it gets. If it "feels too hot" use a bigger heat sink.

I haven't had a chance to look at the specs for your data acquisition system yet. Are you getting exactly 5 v on the digital out?

Warske

Neil Stainton
Mar 12, 2005, 11:17 AM
Thanks for finding the spec sheet, and calculating the power dissipation.

I've just read the specs on the ADC11/12 output and Pico state:

Digital output voltage typically 3-5 volts, depending on computer and load
Digital output impedance approx 1-3k ohms depending on type of computer

So I will have to write a little program to toggle the digital output and read the voltage I get. What load will the PHP 45N03LT place on this output?

If the voltage isn't enough I could fit a second printer port and use one of its IO lines.

Thank you again for all your help.

Neil.

Warske
Mar 12, 2005, 02:39 PM
...What load will the PHP 45N03LT place on this output?
The nice thing about FETs is that it doesn't take much current to drive them. There is a little bit of capacitance, so if you want them to switch really fast like in a switching power supply, they do need some drive current to charge and discharge that capacitance. For your application, you don't need to worry about it.

The specs say "Gate source leakage current" is 10 nA typical, 100 nA max. This means that it typically uses 50 times LESS current than when you measure 5 volts using your 10 meg input DVM. That is, it places essentially no load on your ADC11/12 output.

The "Input capacitance" is listed as 2500 pF, and there is some feedback capacitance. This slows down the switching a bit, but for your application it will still be plenty fast. The problem with slow switching is that the FET absorbs lots of power while it is between OFF and ON, so you don't want it to stay in that intermediate state for very long (unless you intend to use it that way, which involves different design considerations).

If your ADC11/12 outputs don't get up to 5 v, or at least 4.5 v, you might try using a 10k pull up resistor to 5 v and see if that helps.

I'm still playing around with ideas for a constant current load. You are wanting 30 or 40 amps at around 7 volts. At 30 amps, that's 210 watts. So, for example, I looked up the CBA II (http://www.westmountainradio.com/CBA.htm) that Joe mentioned. Its rated for only 150 watts, but at your low duty cycle it would probably work if you could control the duty cycle with your software.

So one possibility is to contact West Mountain Radio and see if they would provide an interface to their software that you could write programs around. Its possible they already do this.

Just a thought. I'll list some more ideas later.

Warske

Warske
Mar 12, 2005, 03:07 PM
The nice thing about FETs is that it doesn't take much current to drive them.
I forgot to mention that this is also the reason why it only takes a little bit of static electricity to zap them.

Probably the first thing to do before you start playing with your FET is to solder a 7 to 13 volt zener diode between the Gate and Source leads, and a 10 to 25 volt zener between the Source and Drain leads.

That will protect your investment. :)

Warske

Warske
Mar 13, 2005, 12:51 PM
Back to the question how to build a constant current load for your application.

Another idea is to use an ESC designed for a brushed motor. Your load resistor would be used instead of the motor. You would need a PC interface to control the ESC, and you would need to write a program that reads the current and adjusts the ESC in the appropriate direction to keep the current constant.

For example, one of these http://www.castlecreations.com/ ESCs might work:

PEGASUS-35P
$49.95
Cells w/o BEC 5-18
Continuous 35 amps
Surge 60 amps
Switching Rate 2800 Hz
Resistance 0.0015 Ohms

Griffin-40
$64.95
Cells w/o BEC 5-16
Continuous 40 amps
Surge 60 amps
Switching Rate 2800 Hz
Resistance 0.0012 Ohms

Griffin-55
$74.95
Cells w/o BEC 5-16
Continuous 55 amps
Surge 80 amps
Switching Rate 2800 Hz
Resistance 0.001 Ohms

I am not 100% sure these ESCs work with a resistive load, but I don't know of any reason they wouldn't. To make sure, you could post the question in the Vendors - Castle Creations (http://www.rcgroups.com/forums/forumdisplay.php?f=168) forum.

Also, this method limits you to the number of cells the ESC is designed for.

I haven't researched the PC interface part. Basically you would need a PC controlled servo tester, which shouldn't be too hard to find.

Warske

Neil Stainton
Mar 13, 2005, 02:12 PM
> I forgot to mention that this is also the reason why it only takes a little bit of static electricity to zap them.

I had to take the device out of the anti static bag to read the part number, but have been quite carful so far - though I haven't worn a grounded wrist strap. Should I do so? Usually I take my shoes off when handling sensitive PC parts.

> Probably the first thing to do before you start playing with your FET is to solder a 7 to 13 volt zener diode between the Gate and Source leads, and a 10 to 25 volt zener between the Source and Drain leads.

Excellent idea. I think I have got some suitable zenners. Do I put the zenner positive (anode) leads to the drain and gate pins?

Thank you again for your help.

Neil.

Neil Stainton
Mar 13, 2005, 02:35 PM
> Another idea is to use an ESC designed for a brushed motor. Your load resistor would be used instead of the motor. You would need a PC interface to control the ESC, and you would need to write a program that reads the current and adjusts the ESC in the appropriate direction to keep the current constant.

That is an excellent idea, especially as I have some suitable brushed controllers lying around. Howerver I have two reservations:

1. Will it matter that the load is purely resistive and being switched? Won't pullying say 60A at a 50% duty cycle be much harder on the batteries than a constant 30A load? Wouldn't resistive losses would be twice as high? I also have this concern with the CBA.

2. The other problem I have is calculating the average current accurately. I suppose I can look up a suitable algorithm but trying to hold an equivalent to 30A from a chopped say 45A current sound like a non trivial programming excercise.

One way of alleviating the first concern would be to use a resistive load to pull the required 30A current when the battery is fresh (say 1.3V per cell) and have the ESC in parallell with a smaller (say 10A) load. Then as the battery voltage drops the ESC could be progressivley "throttled up" to keep the load constant. At least the instantaenous current would be only varying between 25A and 35A.

> I haven't researched the PC interface part. Basically you would need a PC controlled servo tester, which shouldn't be too hard to find.

I wonder if you could programaticaly create the pulse train directly on the IO port...

Regards,

Neil.

Warske
Mar 13, 2005, 05:16 PM
I haven't worn a grounded wrist strap. Should I do so?
I don't, but I have also zapped FETs.:) At least make sure you touch a finger to ground before handling the FET, and don't shuffle your feet on the rug.:) It partly depends on the humidity there. Low humidity = much more dangerous. I'm in Oregon USA, where it used to rain all the time. Also depends on how much you paid for the FET and if you can replace it.:) If I'm feeling especially nervous, first thing I do is short the 3 leads together by wrapping with fine copper wire like from a stranded wire lamp cord.

Do I put the zenner positive (anode) leads to the drain and gate pins?
There seems to be potential for confusion with zeners as to which end is called the anode. The line marked on the body of the diode should correspond to the jagged line on the zener symbol. In normal zener mode of operation, this end is the positive terminal, and on the N channel FET the positive terminals would go to drain and gate as you said. When the FET is in operation, you want the Drain and Gate to be positive compared to the Source terminal.

1. Will it matter that the load is purely resistive and being switched?
My thinking is that the current waveform the battery sees will be essentially the same whether the ESC is driving a motor or a resistor, assuming the resistor is sized to match the motor. That is, if your motor takes 30 amps at 7 volts you would use a 7/30 = 0.23 ohm resistor. You could double check this with a 'scope.

Won't pullying say 60A at a 50% duty cycle be much harder on the batteries than a constant 30A load? Wouldn't resistive losses would be twice as high?
Yes to both.

If you use a resistor as described above, you might start out at 80% full throttle and as the battery voltage drops, get up to 100%. This could be a more accurate simulation for the battery than using a steady current, because it simulates what the battery would see when driving a motor throgh an ESC.

On the other hand, if your resistor value is lower so your duty cycle is closer to 50%, then what you pointed out would be a concern. You can get around that by putting an electrolytic capacitor across the input to the ESC. With a large enough capacitor that has low ESR, the current from the battery becomes essentially constant. The battery resistance and the capacitor form a low pass filter. It would be a good idea to put this type of capacitor on airplanes, except that the weight of the capacitor is prohibitive.

2. The other problem I have is calculating the average current accurately.
The ESC switching rate is 2800 Hz. Your A/D may already filter this out. If not, a little capacitor across the A/D input and some series resistance up to the capacitor will average the current (another low pass filter).

I wonder if you could programmatically create the pulse train directly on the IO port...
For sure. You may get some jitter when your PC operating system services high priority interrupts. That might not be a problem, but I haven't tried it.

Good questions! Hope I was able to help.

Warske

Neil Stainton
Mar 18, 2005, 04:29 AM
Thanks for your very helpful answers and advice, and apologies for my slow reply. I've been working like mad recently. Hope to have a bit more time next week.

> If not, a little capacitor across the A/D input and some series resistance up to the capacitor will average the current (another low pass filter).

Excellent idea. I was trying to think of a software solution to integrate & average the voltage, and instead we can use a 5c capacitor! What sort of resistor and capacitor values should I start with? The A2D is capable of 15K samples per second, but logging much slower (say a few times per second) would be easier.

Regards,

Neil.

vintage1
Mar 18, 2005, 05:30 AM
You shouldn't use digital filtering until the bandwith of what is coming into the A to D is about an order of two below the sampling freuqency.

A ingle RC filter with cutoff about ten times less than sampling should be adequate.

If there is somne overall feedback roiund everythuibg what out foir phase delay and instability.

Warske
Mar 18, 2005, 02:10 PM
What sort of resistor and capacitor values should I start with?
Lets look at the resistor value first.

The RC low-pass filter cutoff frequency is proportional to R times C, which means that you can use a smaller capacitor if you use a larger resistor value.
http://hyperphysics.phy-astr.gsu.edu/hbase/electric/filcap2.html

What limits how high your resistor value can be? Its the resistance (and current) of your A/D input. Pico says the input impedance is greater than 1 meg. If you used a 100 k ohm series resistor for the filter, then as much as 10% of the input voltage would get dropped across it, and your A/D input would read only 90% of the true voltage. If the input resistance is constant, you can compensate for it, but from the specs we don't know that its constant.

So lets use a 10k ohm series resistor, which would affect the input voltage by less than 1%.

Now what size capacitor do you need? That depends on the switching rate of your ESC. I don't know what it is for your ESC. For the CC ESC, it is 2800 Hz. You want your low pass filter to greately attenuate that switching frequency so that what you get is a steady voltage.

There are a couple ways to approach this. The seat-of-the-pants method is just to make the RC time constant long compared to the period of the switching waveform.

Digression 1: The numbers will come out if we use a consistent set of units. In the MKS (Meters Kilograms Seconds) system, the units would be: Ohms, Farads, and Seconds.

Digression 2: If you suddenly apply a voltage to a resistor and capacitor in series, the capacitor will charge up to about 2/3 of its final value in one time constant. The time constant is found by multiplying the values of R and C together.

The switching waveform is 2800 cycles per second. Its period is 1/2800 = 0.000357 seconds per cycle.

To make a good filter, the RC time constant should be at least 10 times the period. That is:

R * C = 10 * 0.000357
or C = 10 * 0.000357 / R
where R is 10k or 10e3 ohms.
so, C = 10 * 0.000357 / 10e3 = 0.0000003570 Farads, or 0.357 uF

The larger the capacitor the better, so use a common value like 0.47 uF.

Lets double check this result using the formula for the cutoff frequency of a low pass filter.
The corner frequency of the filter in Hz is

f = 1 / (2 * pi * R * C)
f = 1 / (2 * 3.14159 * 10e3 * 0.357e-6)
f = 44.6 Hz

This will give excellent attenuation to the 2800 Hz switching frequency, and will still let you measure rapid changes in the battery voltage.

Warske

Neil Stainton
Mar 21, 2005, 05:17 AM
Wow, what a tour de force! Thank you for such a magnicifent post, that doesn't just give me the the answers, but explains how to calculate them. I wish my university lecturers had been half as lucid.

Also thank you for posting the Hyperphysics link. I had seen the site before but hadn't taken it fully in. I lost an evening's modelling (and my first answer to your post) browsing this amazing resource.

Thanks again,

Neil.