Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: z.s.tar.gz on December 30, 2009, 09:37:31 AM

Title: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on December 30, 2009, 09:37:31 AM
I am trying to make my own charging circuit for my robot. It will be powered by 4 solar cells which output ~17V @ 24ma. I have two LiFePO4 cells rated 3.2V @ 1100mah. I'm suspecting I'll have to make my MCU do all the monitoring, as I can't find a suitible charging circuit anywhere.

Could this (http://www.seattlerobotics.org/encoder/200210/lithiumion.htm) be adapted to fit my needs?
Title: Re: custom LiFePO4 charging circuit help
Post by: Soeren on December 30, 2009, 09:43:36 AM
Hi,

Was that just a statement, or do you have any questions to go with it?
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on December 30, 2009, 09:50:34 AM
Yeah that is a bit vague on my part... Let me try again

Also it looks like I'm going to need some kind of PWM  to get the setup described here (http://www.societyofrobots.com/robotforum/index.php?topic=9793.msg75015#msg75015).

I guess what I'm really wondering is what I need to charge these batteries. I guess I'll need some kind of regulator, a pwm ic, and some monitoring ic's. Is that all I need to get going?
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on December 30, 2009, 02:48:21 PM
Ok, so I've been doing more research and there's something I just don't understand.
All the lithium charging pages I've seen talk about the "charge current dropping to 3%". What exactly does this mean?
Is it something to look for when monitoring the battery, or is it something that is applied to the battery?
Title: Re: custom LiFePO4 charging circuit help
Post by: waltr on December 30, 2009, 07:18:19 PM
Go back and look at the charging graph in the post you linked to. The solid line is the voltage and the dashed line is the current.
Charging is done in stages.
Stage1: The current supplied to the battery is constant. The voltage is monitored until it the cell voltage limit is reached. Go to stage 2.
Stage 2: The voltage to the battery is held constant and the current is monitored. When the current is less than 3% of the starting current the battery is charged.

Stage 3: is when the battery is left on the charger for an extended time. The charger applies a voltage near the limit for until either the current drops or the voltage gets to the limit. This keeps the battery at peak charge without over charging or over heating.
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on December 30, 2009, 09:03:35 PM
But what I'm wondering is what voltage to apply in stage one and what current to supply in stage two. Something has to be supplied right?
Title: Re: custom LiFePO4 charging circuit help
Post by: billhowl on December 31, 2009, 06:08:05 AM
What voltage and current to apply will base on the battery type & capacity, you have two LiFePO4 cells rated 3.2V @ 1100mah, is this connected in series or parallel?

If connected in series, then the voltage limits will be 3.9V x 2 = 7.8V and the initial current will be 1100mA or 1.1 Amps. then 3% will be 33mA.

If connected in parallel, then the voltage limits will be 3.9V and the initial current will be 1100mA x 2 = 2200mA or 2.2Amps. then 3% will be 66mA.
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on December 31, 2009, 09:11:11 AM
The batteries will be in series, so if I just apply 7.8V @ 1.1A all the time, I would just have to monitor it to tell when it's done aka at 3%?
Sorry, it still doesn't make much sense to me.

I think I'm having trouble with the concept of charging current vs regular current and the likes.

Edit: What exactly is the charge current anyways?
Title: Re: custom LiFePO4 charging circuit help
Post by: waltr on December 31, 2009, 10:38:40 AM
Quote
What exactly is the charge current anyways?

In the case of the graph you linked to and billhowl's post the charge current is 1C. This rate comes from the batteries data sheet.

You need to read the data sheets and app notes of the battery manufacturers. Panasonic has some good ones that would apply the other manufacture's batteries.

Quote
The batteries will be in series, so if I just apply 7.8V @ 1.1A all the time, I would just have to monitor it to tell when it's done aka at 3%?
Sorry, it still doesn't make much sense to me.

No, you want to follow the two charge stages as shown in the graph as I explained above.
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on December 31, 2009, 11:29:10 AM
So the voltage in the graph is the monitored voltage and the current is the applied current?
Title: Re: custom LiFePO4 charging circuit help
Post by: madsci1016 on December 31, 2009, 02:48:00 PM
I think you are getting a little mixed up with 'monitored' and 'applied' voltage.

(this is a bit crude but should illustrate my point)
Let's say you have a dead 6V battery in one hand and a charger in the other. If you measure the voltage at the battery, it will be around 3-4 V (because it's dead) and the voltage of the charger will be 6V.

Once you connect the charge, both the battery and the charger are now around 6V. In order for the charger to maintain that voltage (because the battery is going to try to "pull it down" ) it produces a current that flows into the battery.

The moral of this story is when you are charging a battery, there is only one voltage and one current (between the charger and the battery). So the graph shows this, one voltage line and one current line.
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on December 31, 2009, 02:56:13 PM
Ok, so the voltage applied is always going to be the same, but in the beginning it gets "pulled down". After the voltage reaches maximum, the current required to finish the charging decreases until it get to around 3 percent, at which the battery is fully charged.

Is that correct? If it is, what's the best way to monitor the current?
Title: Re: custom LiFePO4 charging circuit help
Post by: madsci1016 on December 31, 2009, 03:14:11 PM
Mostly right. There are going to be two limits to the system.

How much current the charger can source, and what voltage the battery needs to be charged too.

The first stage, the charger trying to bring up the battery to 6V, but will stop at some voltage when it hits it's current limit (this is known as constant-current mode). As the battery charges, it will be not 'pulling down' as hard, until the voltage between the two comes up to the what should be the battery voltage, and then the charger will hold at that voltage.

As a result, the battery continues to charge and not 'pull' as hard, the current will decrease. This is constant voltage mode.

You would need a circuit that monitors current and voltage. If you wanna use a MCU to handle this, something lie this would work.
http://www.sparkfun.com/commerce/product_info.php?products_id=9028 (http://www.sparkfun.com/commerce/product_info.php?products_id=9028)

This is what i used in my SAGAR robot. My smart motor controller reports voltage and current to my main MCU and it will override speed commands if the current is over a critical limit.
Title: Re: custom LiFePO4 charging circuit help
Post by: madsci1016 on December 31, 2009, 03:24:06 PM
The biggest obstacle i see to to what you want to do is the high voltage (17V) coming from your solar cells, and the fact that the sun does not remain constant. While i have never done something like this before, i imagine this is one way to do it:

Solar Cell ======controllable switching regulator=======Voltage and current sensor=======battery
                                              ||                                                  ||
                                               =======MCU==============

you might also need voltage monitoring between the solar cell and the voltage regulator. The MCU would have to adjust the voltage regulator to a lower voltage if the charging current got too high.

I also don't know if you can damage solar cells by trying to pull too much current, or if it's voltage would just drop. That is another thing to worry about.
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on December 31, 2009, 03:53:11 PM
I was actually run the solar panels through a capacitive dc-dc converter to bring up the available amperage, as I really don't need 17V, and I don't think 24ma is enough to charge the batteries.

And as for the consistancy of the power coming from them, it's pretty stable, as they still put out 14V with cloud cover. I think I'll run them through a switching regulator regarless.

Title: Re: custom LiFePO4 charging circuit help
Post by: Soeren on December 31, 2009, 06:53:52 PM
Hi,

Take a look at this circuit (http://That.Homepage.dk/PDF/10_Cell_NiMH_Tapered_Charger.pdf)
It will do the CC/CV (a better name for that would be max. current and max. voltage) you need.

You could modify it for a switch mode regulator - the resistor values need changing anyway.
Title: Re: custom LiFePO4 charging circuit help
Post by: madsci1016 on December 31, 2009, 07:42:43 PM
Hi,

Take a look at this circuit (http://That.Homepage.dk/PDF/10_Cell_NiMH_Tapered_Charger.pdf)
It will do the CC/CV (a better name for that would be max. current and max. voltage) you need.

You could modify it for a switch mode regulator - the resistor values need changing anyway.


You won't need the 4 diodes on the left side of the circuit, that is only for AC input. And using a R]resistive regulator is a waste of energy.

Soeren, I'm assuming you know of switch mode regulators the accept an input reference for voltage output. Care to link? I have only ever found Pot adjusted ones, like then ones from dimension engineering.
Title: Re: custom LiFePO4 charging circuit help
Post by: Soeren on January 01, 2010, 12:37:26 AM
Hi,

You won't need the 4 diodes on the left side of the circuit, that is only for AC input. And using a R]resistive regulator is a waste of energy.
Resistive regulator??

Well, it was meant for inspiration, it's an old design for a simple mains driven NiMH charger, in case anyone didn't get that.


Soeren, I'm assuming you know of switch mode regulators the accept an input reference for voltage output.
Not quite sure what you mean?
Title: Re: custom LiFePO4 charging circuit help
Post by: madsci1016 on January 01, 2010, 01:49:22 AM

Resistive regulator??


The LM317 is that circuit is a resistive regulator. It drops voltage down by burning it off in a resistor, just like the 7805 (etc) voltage regulator.


Not quite sure what you mean?


The LM317 is an adjustable regulator. The circuit you provided work as a CC source because the the LM317 is electronically adjusted to maintain the correct voltage based on current. If he were to adapt this circuit to a switching regulator, he would need one that had a input pin that controlled it's output voltage like the LM317 does. I guess the solution to this is two build a switching regulator circuit, as opposed to a pre built regulator.
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on January 01, 2010, 08:49:12 AM
So here's what I've got so far:
Solar Panels <> DC/DC converter and regulator (http://www.sparkfun.com/commerce/product_info.php?products_id=317) <> Voltage and Current Monitor (http://www.sparkfun.com/commerce/product_info.php?products_id=9028) <> Batteries
Title: Re: custom LiFePO4 charging circuit help
Post by: billhowl on January 01, 2010, 11:02:32 AM
Here is the switching regulator, constant-current, constant-voltage two-cell Li-Ion battery charging circuit.
The regulation voltage (VREG) of the LM3420 can be externally trimmed by adding a single resistor from the COMP pin
to the +IN pin or from the COMP pin to the GND pin, depending on the desired trim direction. Trim adjustments up
to ±10% of VREG can be realized, with only a small increase in the temperature coefficient.
http://www.national.com/mpf/LM/LM3420.html (http://www.national.com/mpf/LM/LM3420.html)
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on January 01, 2010, 11:11:18 AM
Two questions:

In that schematic, what are the op-amps for? Do I really need them?

If I set it up like in my last post, will I be able to simultaneously charge the batteries and run a load? Ideally I would like the batteries to be a sort of reservoir between the solar panels and the electronics.

Edit: From looking at the datasheets for the parts I posted, it seems that the schematic you provided is just a completed circuit.
Title: Re: custom LiFePO4 charging circuit help
Post by: billhowl on January 01, 2010, 11:29:02 AM
The op-amp on the top of the schematic is configure as voltage follower for voltage sensing.
The op-amp on the bottom of the schematic is for current sensing, all this are part of the circuit.
Please read the PDF file for more detail. 
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on January 01, 2010, 11:44:08 AM
I see...
For the sake of free day from sparkfun I'm going to go with the parts I linked to earlier, but if that doesn't work out I'm going to use that one you posted.
Title: Re: custom LiFePO4 charging circuit help
Post by: madsci1016 on January 01, 2010, 12:28:50 PM
I see...
For the sake of free day from sparkfun I'm going to go with the parts I linked to earlier, but if that doesn't work out I'm going to use that one you posted.

idk, I kinda like BillHowl's circuit better.
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on January 01, 2010, 02:56:59 PM
I do too, but how can I get that for free?

Edit: The answer is that I can't, because I can't find the LM3420 anywhere.
Title: Re: custom LiFePO4 charging circuit help
Post by: waltr on January 01, 2010, 10:12:47 PM
http://search.digikey.com/scripts/DkSearch/dksus.dll (http://search.digikey.com/scripts/DkSearch/dksus.dll)
Title: Re: custom LiFePO4 charging circuit help
Post by: Soeren on January 01, 2010, 10:55:39 PM
Hi,

The LM317 is that circuit is a resistive regulator. It drops voltage down by burning it off in a resistor, just like the 7805 (etc) voltage regulator.
No, it's called a linear regulator and it dissipates the dropped power in a semiconductor (just like the 78xx and any other linear regulators).


The LM317 is an adjustable regulator. The circuit you provided work as a CC source because the the LM317 is electronically adjusted to maintain the correct voltage based on current. If he were to adapt this circuit to a switching regulator, he would need one that had a input pin that controlled it's output voltage like the LM317 does. I guess the solution to this is two build a switching regulator circuit, as opposed to a pre built regulator.
To answer the last thing first, I never said anything about pre-built or not.
That said (or not ;D), it doesn't have to be adjustable, as long as there is some means to sink the output voltage - whether it's an enable pin on a pre-built chip, a transistor quenching the oscillator on a pre-built (or not), or any other way of cutting the output for any number of cycles needed.
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on January 02, 2010, 10:07:08 AM
Well, digikey does have the lm3420, but what I didn't know is that it's surface mount. At the moment I have neither the means to work with surface mount nor the money to buy the tools to do so.
Title: Re: custom LiFePO4 charging circuit help
Post by: madsci1016 on January 02, 2010, 08:08:13 PM
No, it's called a linear regulator and it dissipates the dropped power in a semiconductor (just like the 78xx and any other linear regulators).

While 'linear' regulator is a more commonly used name for it, it can still be called a resistive regulator. The university from which I graduated houses the North American Center for Advanced Power Systems, and thus most of the classes are taught from a power perspective. When modeling the steady state analysis of a circuit with a 78xx device, it can be replaced with a resistor of a variable value, because (quote from Wikipedia) "the transistor is acting like a resistor, it will waste electrical energy by converting it to heat." Which is why it is acceptable to refer to it as a 'resistive regulator' (much like my professors did) as well as a linear regulator. One way describes it's electrical characteristics while one way describes the state the semi-conductor is in.

And i meant to say like a resistor, not in a resistor.
Title: Re: custom LiFePO4 charging circuit help
Post by: billhowl on January 02, 2010, 09:11:42 PM
Well, digikey does have the lm3420, but what I didn't know is that it's surface mount. At the moment I have neither the means to work with surface mount nor the money to buy the tools to do so.
Hi z.s.tar.gz, I think you can replace the LM2575 with your MC34063 and the LM3420 with TL431 plus some add on circuit. please check out.
(http://electronics-diy.com/schematics/729/a1013025-129-simplest-licharge.png)
http://electronics-diy.com/electronic_schematic.php?id=729 (http://electronics-diy.com/electronic_schematic.php?id=729)
In Figure 1, an MC34063A switching regulator and an MC33342 NiMH battery-charger IC combine to generate from an unregulated power supply a 600-mA battery charger for one to four NiMH cells.
http://www.edn.com/article/CA56207.html (http://www.edn.com/article/CA56207.html)
http://www.edn.com/articles/pdfs/EDN/20001221/26di11.pdf (http://www.edn.com/articles/pdfs/EDN/20001221/26di11.pdf)
http://www.edn.com/contents/images/122100di.pdf (http://www.edn.com/contents/images/122100di.pdf)
Title: Re: custom LiFePO4 charging circuit help
Post by: z.s.tar.gz on January 02, 2010, 09:20:57 PM
I've actually run into several new problems.
For the sake of copy and pasting everything again, here's my other post: http://www.societyofrobots.com/robotforum/index.php?topic=9965.0 (http://www.societyofrobots.com/robotforum/index.php?topic=9965.0)