SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Jul 21, 2004, 12:55 PM
Registered User
tblount70's Avatar
United States, TN, Thompson's Station
Joined May 2004
195 Posts
DIY Charger Analog Techniques

I would like to build a PIC-based charger with integral RS232 so that I can log the charge profile to PC. My digital design and programming experience is pretty good, so the PIC, RS232, and PC parts of the project look fairly straightforward. The problem is, I don't know much about analog design. The actual charging profiles (constant V, constant A, etc.) are already published, so that isn't what I need.

Assuming I have the microcontroller section under control, what parts do I need to do the analog section of the charger? I think the following specs should do for most of my packs:

1) I want to be able to able to charge LiPo or NiMH packs

2) should be capable of constant current or constant voltage operation (LiPo)

3) should produce charging voltage sufficient for 3C LiPo packs with charge current in the range of 10mA trickle up to 3A (this should be sufficient for most parkflyer/shockflyer setups)

4) I want to be able to log voltage and current real-time during the charge cycle

So what I really want is a flexible analog section that can be regulated by the micro/software to achieve variable charge profiles.

Here's what I've read so far on rcgroups. I've seen the Tinker's charger (http://www.rcgroups.com/forums/showt...7&page=1&pp=15). This one is made of two voltage regulators with a couple of resistors to vary the voltage and current limits. How flexible is this within the voltage/current ranges set forth above? I've also seen a reference to a specialty chip that actually has charging algorithms on board. I don't want to use that method because I want the micro to control the algorithm. I've also seen a reference to a PIC-controlled NiCd charger, but that one uses the PIC solely as a timing mechanism to switch from fast charge to trickle.

Anyone got any wisdom to share?

Tim
tblount70 is offline Find More Posts by tblount70
Reply With Quote
Sign up now
to remove ads between posts
Old Jul 21, 2004, 01:39 PM
Dimension Engineering
Akron, Ohio
Joined Jan 2002
1,705 Posts
Basically, what you need to make is called a "buck converter." If you're not looking to do high cell counts, then this can be done with just the PIC (the 10 bit A/D limits precision at high counts.) You'd need a high power resistor for current measurement, an inductor, a large electrolytic capacitor, a P channel FET, a shottkey diode and then the usual assortment of goodies. The you have the PIC running either a current control or a voltage control algorithm.

A buck converter is essentially just a high side PWM switch and then an LC low-pass filter. It steps voltages down only.

For the real gory details I suggest you try www.national.com as they have a good amount of switching power supply info.

If you need to step up then step down, the topology you want is either boostbuck or SEPIC, but you'll need to understand the basic buck first.
Comatose is offline Find More Posts by Comatose
Reply With Quote
Old Jul 22, 2004, 06:39 AM
Registered User
MartinFVS's Avatar
Scotland
Joined Oct 2003
31 Posts
Iíve done two of these now. Hereís what I think.

You need a boost regulator because the battery voltage will be greater than your minimum input voltage (12V). Use an LM2587-ADJ from national that should give 3A at lower voltages. Use the PIC to limit the current as the voltage increases.

To regulate the current use a FET or Bipolar transistor and op-amp as a linear current source driven from the PIC PWM. Use the PIC to protect the transistor at lower battery voltages where the voltage drop across the device is high.

The boost regulator uses the output of the current regulator as its feedback. This should be as low as possible so the power loss is minimum. This is also the battery negative. Battery positive goes to the boost output.

If you want to do NiMH and Li-poly then 10 bits is not enough. Iíve used a LTC1286 from Linear. Itís a serial 12-bit ADC and easy to interface to a PIC.

The PIC can now measure the voltages, control the current and protect the regulators.

To log the data output voltage and current values plus anything else you measured. If you capture the line with Hyper-terminal as a text file you can use Excel to plot a graph. Hereís one I did earlier:
MartinFVS is offline Find More Posts by MartinFVS
Reply With Quote
Old Jul 22, 2004, 10:30 AM
Registered User
tblount70's Avatar
United States, TN, Thompson's Station
Joined May 2004
195 Posts
Comatose,

So the buck regulator would look something like this? If I limit charge current to 3A, the 1/3 ohm resistor would give me 5V that could be directly measured by the PIC?
tblount70 is offline Find More Posts by tblount70
Reply With Quote
Old Jul 22, 2004, 10:31 AM
Registered User
tblount70's Avatar
United States, TN, Thompson's Station
Joined May 2004
195 Posts
Comatose,

Whoops! That 5 ohm resistor in the schematic should read 1/3 ohm. 5W should do it, eh?
tblount70 is offline Find More Posts by tblount70
Reply With Quote
Old Jul 22, 2004, 10:35 AM
Registered User
tblount70's Avatar
United States, TN, Thompson's Station
Joined May 2004
195 Posts
MartinFVS,

Do I still need an inductor to do it that way? The op amp stuff is a little over my head (I slept through that class). But I'm checking it out...
tblount70 is offline Find More Posts by tblount70
Reply With Quote
Old Jul 22, 2004, 12:38 PM
Dimension Engineering
Akron, Ohio
Joined Jan 2002
1,705 Posts
tblount, thats about it. You'll need a difference amp with a gain of 1 to bring your sense voltage down to 0-5v, with now it'd be foating above your battery voltage, and you'll need a voltage divider to scale Vsense. You probbaly don't need Vref.

Also, you need an input electrolytic capacitor between 24v and ground, and a ceramic bypass capacitor between input and ground.



The main difference between Martin's route and mine depends on your cell count and power supply situation. If you've got a 24V supply handy, or aren't using high cell count batteries, mine is easier. If you're using high cell count packs and only have 12v, martin's is easier.
Comatose is offline Find More Posts by Comatose
Reply With Quote
Old Jul 22, 2004, 01:59 PM
Registered User
MartinFVS's Avatar
Scotland
Joined Oct 2003
31 Posts
Yes you need an inductor for both designs. It should be readily available. The LM2587 datasheet has type numbers listed.

You may like to move the current sense resistor in your drawing to the negative end of the battery. It would make it easier to measure. The battery voltage then becomes Vsense-Isense.

If you can start with 24V then an alternative may be to just use a linear current regulator. All that is required is a big heat sink to dump 50W. Drive a logic level FET from the PWM filtered and put the sense resistor in the source to 0V. Measure the volts drop to regulate the current. Battery goes from drain to +24V, measure both to get the battery voltage. The issue would be getting enough PWM resolution to get down to 10mA. You wont get any simpler than that and no inductors!
MartinFVS is offline Find More Posts by MartinFVS
Reply With Quote
Old Jul 22, 2004, 02:55 PM
Registered User
tblount70's Avatar
United States, TN, Thompson's Station
Joined May 2004
195 Posts
Comatose,

How's this look? Did I do the op amp right? Don't know about the p/n on the op amp yet... That's just what was handy in my schematic tool.

I'm assuming R2=R3=R4=R5=something big like 5K to prevent the charge current from dumping to ground.

If I seem lost on some of this, it's because I am. My formal training is mech engineering, not electronics.

Thanks
tblount
tblount70 is offline Find More Posts by tblount70
Reply With Quote
Old Jul 22, 2004, 03:02 PM
Registered User
tblount70's Avatar
United States, TN, Thompson's Station
Joined May 2004
195 Posts
Comatose,

Per Martin's comment, why not move the sense resistor between the negative pole of the target pack? Would this allow me to get rid of the op amp? Or would the extra voltage drop mess up my VSense point?
tblount70 is offline Find More Posts by tblount70
Reply With Quote
Old Jul 22, 2004, 04:01 PM
Registered User
MartinFVS's Avatar
Scotland
Joined Oct 2003
31 Posts
It would be better if the op-amp had a gain of x5 to fully use the A/D. R3 = R5 = 25k.

You will also need to convert the logic level PWM to 24V to drive the FET.
MartinFVS is offline Find More Posts by MartinFVS
Reply With Quote
Old Jul 22, 2004, 06:22 PM
Dimension Engineering
Akron, Ohio
Joined Jan 2002
1,705 Posts
Hey, technically I'm a MechE too, so I understand. If I had to do some, say, fluid flow problems I'd be uncomfortable too.

There's technically nothing _wrong_ with the "dump 50 watts of heat solution", its just not neat and tidy. Easy, but not elegant.

As per moving the sense resistor. Yes, you can do that. I'd assumed there was a reason you put it on the high side. The only thing is you'll have to subtract the current sense voltage from Vsense. Either way its a subtract, low side you do the subtract in software instead of hardware.

Martin is right about the transistor switch, you'll have to do some level shifting. Is this going to be running from a "24v" battery or a regulated 24v supply? If its a supply, one can find P channel FETs that have a max gate voltage of +- 24v, so driving can be simply an NPN transistor in common emitter configuration and a resistor. If you mean a 24V battery, that has a maximum voltage of 30V, so a driver chip is probably required. An IR2117 from international rectifier would be the easy solution. They're about $2, and use an N channel FET.
Comatose is offline Find More Posts by Comatose
Reply With Quote
Old Jul 23, 2004, 09:23 AM
Registered User
tblount70's Avatar
United States, TN, Thompson's Station
Joined May 2004
195 Posts
Comatose,

My supply will be a 24V regulated supply, but I'll probably go ahead with the FET driver route just in case.

Question: when I search MOSFET switches on digikey.com and then filter on P-channel, why is the current rating on 99% of the P-channel parts listed as -n A. What does a negative current rating mean? Current just flows backward through the switch?
tblount70 is offline Find More Posts by tblount70
Reply With Quote
Old Jul 23, 2004, 09:26 AM
Registered User
tblount70's Avatar
United States, TN, Thompson's Station
Joined May 2004
195 Posts
Martin,

The voltage reg idea is a good one, but I eventually want maybe six of these analog sections connected to one micro talking to my PC. I'd rather not deal with the heat issues associated with that arrangement.
tblount70 is offline Find More Posts by tblount70
Reply With Quote
Old Jul 23, 2004, 09:40 AM
Registered User
tblount70's Avatar
United States, TN, Thompson's Station
Joined May 2004
195 Posts
Here's the circuit with the sense resistor moved, but without the FET driver.
tblount70 is offline Find More Posts by tblount70
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
PQ 1800mah Would DIY Charger do ? rikhye Batteries and Chargers 23 Sep 29, 2004 12:47 PM
DIY charger? Help! arx_n_sparx Batteries and Chargers 4 Jan 14, 2004 06:46 PM
testing Scott Henion's diy charger rcnutt Batteries and Chargers 4 Dec 14, 2003 10:13 PM
Maxim 1501 DIY charger gtstubbs Batteries and Chargers 1 Nov 13, 2003 09:00 AM
NiCd/NiMh DIY Charger mt_100 Batteries and Chargers 9 May 31, 2003 12:09 PM