A device for "floating" a charge on lithium iron phosphate batteries  - Page 1
Forum section: electronics / projects

author: profdc9
author_rank: Frequent Contributor
timestamp: March 05, 2021, 02:05:21 am
content: I have LiFePO4 batteries that I would like to maintain as mostly charged and ready for amateur radio use. They are quite expensive and so I would like to keep them working as long as possible. Unfortunately, as I found out, if the battery is left on the charger for a long time, its capacity is diminished over time. Furthermore, if it is allowed to discharge by being connected to a device that slowly drains it, that will also greatly hurt the capacity as well.This is unlike a SLA battery which can be left float charged at maximum capacity and will remain more-or-less stable as long as it is float charged. However, SLA batteries are heavy.I have read that perhaps a good strategy would be to allow the LiFePO4 battery to drain slowly to a certain voltage (perhaps 12.0 volts) and then "top it off" over time, charging it to a certain voltage under its maximum capacity, for example, around 13.6 to 13.8 volts for a 4-cell LiFePO4 battery. With this in mind, I was think of designing a "smart charger" to do exactly this.The idea would be to have a simple, reproducible circuit based on a ATMEGA328P or other common microcontroller that would sample the voltage and current through the battery, and generate a PWM signal to drive the MOSFET of a buck converter to step the voltage down from something higher (like 18 to 24 VDC) to 12 to 14 VDC to charge the battery. The battery could be left connected to a transceiver if desired, and if the transceiver drained the lithium iron phosphate battery too much, the battery could be charged using the buck converter. I was thinking of simple protection circuit, for example, if the voltage across the battery gets to high, or the current through the measurement shunt is too high, a circuit would shut off the MOSFET drive to the buck converter.Such a device might be adaptable to other kinds of complicated schemes of maintaining charge on batteries.Does this sound like a reasonable idea? I haven't found such a device available either, but perhaps I haven't looked hard enough.

author: amyk
author_rank: Super Contributor
timestamp: March 05, 2021, 02:59:06 am
content: Just connect a constant voltage, current limited supply that keeps them at the ~50% full voltage. Any current it supplies will serve only to balance self-discharge and keep the cells at their desired charge level.

author: ledtester
author_rank: Super Contributor
timestamp: March 05, 2021, 09:53:23 am
content: QuoteSeems like you want to be able to charge the battery while it is in use -- is that correct?Also, this video "ExpertPower Lithium Iron Phosphate Smart Charger - Ham Radio Q&A" raises a couple of points...- something about LiFePO4 chargers having to trick the BMS to get a complete charge (around 1:50 in the video)- some chargers emit a lot of HF noise making your transceiver unusable during charging (around 5:00 in the video)https://youtu.be/dzW0D8AnaLA

author: Siwastaja
author_rank: Super Contributor
timestamp: March 05, 2021, 02:55:39 pm
content: LFP isn't optimum for constant-voltage operation because it has steeper curve than most LCO, NCA, NMC cells for example. Small change in voltage results in relatively large change in SoC.But despite this, it can be done; choose an Open-Circuit Voltage that corresponds to the State-of-Charge you want to "float" at. From memory, I'd say 3.45V is 100% and 3.10V is 0%; 3.20V is approx. 50%.Look up the exact curve, or try it yourself; for example, if you want to float at 60%, fully charge a cell first (with the specified stopping conditions, like C/20 at 3.65V), then discharge 40% of capacity with a dummy load measuring the I*t integral. Now you know it's at 60%. Finally let it sit for a few hours, measure the open-circuit voltage. This is where you want to set your CV supply at.Of course, the CV supply needs to be able to work in CC mode as well, limiting the current below the cell ratings (and not blow up in the process).

author: amyk
author_rank: Super Contributor
timestamp: March 06, 2021, 05:00:09 am
content: Phosphate is 3.6V fully charged and 3.2 nominal, 2.5 empty.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 06, 2021, 09:34:09 am
content: Quote from: amyk on March 06, 2021, 05:00:09 amIncorrect.3.6V and 2.5V are charge-end and discharge-end cutoff values, specified under some current value. For example, charge to 3.6V until current drops to C/20. Discharge to 2.5V until current drops to C/5, would be fairly typical specs.For floating applications, open-circuit voltage values are needed instead. I.e., you should not force the cell to sit at 3.6V or 2.5V indefinitely if you want 100% and 0%, respectively.You can get the respective open-circuit voltages by doing the charge / discharge with the specified cutoffs, then let the cell sit for a few hours, or even better, a few days. Then measure the Open-Circuit Voltage. This gives you the correct OCV curve which is useful for "float" charging. From memory, the values are roughly 3.45V and 3.10V. Especially in the discharge side there is significant voltage drop under load which gives wrong impression about the OCV. Even if you stop at 2.0V (as allowed on many cell specsheets), the voltage bounces backs to around 3.1V when the load is removed.

author: profdc9
author_rank: Frequent Contributor
timestamp: March 06, 2021, 04:38:22 pm
content: So I have working on a proposed circuit for a smart charger based on an ATMEGA328P. Schematic is attached.The PWM drives a MOSFET gate through a low-high driver to switch a buck converter. The voltage at the output is sensed on the battery and the current through a shunt so that the duty cycle of PWM can be adjusted on the basis of maintaining a constant voltage, current, or some programmable schedule. There is also a small load (5W resistor) that can be applied to discharge the battery to test cycling the charge/discharge.There is a common-mode choke and filtering on the output to prevent noise from getting into a transceiver.In case the microcontroller fails and turns on the MOSFET, the battery would be connected directly to the positive supply. For this reason, I have a circuit that if a fixed voltage (> 15 V) or excessive current (>3 A) is detected through the battery, it shuts off the MOSFET gate to zero volts. This will operate independently of the microcontroller as a fail safe.There are also three buttons and a LCD display to interface with it, show the state of charge, etc.I hope to use this to experiment with different ways of charging batteries to see what the lifetime that can be achieved is.Thanks for all your feedback so far. Any comments are appreciated!

author: Siwastaja
author_rank: Super Contributor
timestamp: March 06, 2021, 05:22:28 pm
content: Looks like it will have too many issues.What is the purpose of D14?IRF540 is old and has massive gate capacitance, slow with 100R on gate.Gate driver obviously won't work, can't see higher-voltage supply or bootstrap circuit. Either use a P-channel MOSFET or a bootstrap gate driver. I really recommend using off-the-shelf gate driver IC.Buck switching loop layout is unacceptable.Where is inductor or MOSFET drain current sensing (i.e., unfiltered, fast, pulse-by-pulse)? Like this, you'd blow up the MOSFET in no time.MOSFET blows short circuit and overcharges the cell. Absolute bare minimum protection is a fuse that will blow from the resulting unlimited "too high" current. Make sure the 24V input supplies enough current to blow the fuse.I'd say try again with a lot simpler circuit. Reduce all excess parts. Simulate in Spice, then build a prototype. Won't even need a PCB for that. If you want to do that software-controlled buck, I'd start with gate driver IC, inductor current sense resistor, current sense amplifier, a comparator; you can make the comparator force the gate drive low, andadditionallyroute it to the INT/PCINT of the AVR for a peak current detection control loop ISR. Then you can isolate this fast current measurement signal with series resistor and RC filter it and feed to ADC for average current measurement as well.A lot of options, really, but I think what you posted is too far from success. Start smaller.

author: profdc9
author_rank: Frequent Contributor
timestamp: March 07, 2021, 05:51:23 am
content: Ok, I realize after you revealed these problems that this design is not good.So I propose the following revamped design. My motivation to make a buck converter using the Arduino was to avoid requiring lots of specialized buck converter ICs that are manufacturer specific. Instead, I think i will try to use a TL494 and BJTs (TIP41/TIP42) which are widely available from many sources.It is based roughly on the buck converter in the TI TL494 datasheet. The TL494 can implement both voltage and current limiting. Instead of using fixed voltages on the comparators that govern the PWM duty cycle on the TL494, the voltages are adjusted using the AnalogOutput PWM of the Arduino. When the circuit starts up, they start out at zero volts and the TL494 should be nominally shut down until the Arduino AnalogOutput PWM ramps up the current and voltage limiting to start the power supply.I added the fuse as you suggested. However, I am not sure what kind of fuse is appropriate here. An AC fuse does not work for well DC current, and most auto fuses for DC only work up to 12 V.If this is a good idea, I might lay this out, and it probably should be easier given the switching feedback loop will no longer contain the Arduino.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 07, 2021, 08:03:33 am
content: TL494 is ancient. Output stage sucks (requiring external parts), voltage mode control combined with kind-of average current limit fighting against each other sucks.Just use a modern IC with pulse-by-pulse limiting / current mode operation, integrated gate drivers, and MOSFET switches.Easiest way if you don't need accurate current, pick a standard controller IC with current limiting which allows continuous operation against the limit without hickupping or fault latching. I know, it's not easy to find one without those protection features, or a way to disable them, but they do exist.For example, I did build a CC-CV li-ion float charger using LM25117, current limit works indefinitely when RES is connected to Vcc. There is even a suggested circuit for more accurate CC operation although I did not need that, and you usually don't if you just want to charge the battery. This isn't a direct suggestion, you could be able to find something even better, just saying this part worked for me.Also I'm not against the microcontroller-based power conversion, although ATMega328P is underperforming for that but it would be a very educational experience. But make sure you have an actual inductor (or switching mosfet) current measurement which is FAST, with a fast and reliable control loop to turn off the MOSFETbeforethe current gets too high. Remember, dI/dt = V/L. When you apply 24V over 150uH, current will rise at 0.16A per µs. If the inductor, for example, has saturation current at 3A, and you trig overcurrent detection at 2A, you have 6µs to turn that MOSFET off from the onset of detection.Note, you need some logic to prevent charging an overdischarged cell, i.e., read the cell voltage with MCU first, only enable the charger if within acceptable limits. You can read the temperature at the same time preventing charging below 0degC.Almost all fuses are OK up to 24V DC. For robust design you can trust, obviously pick one with DC rating available. Fairly easy to find parts with DC ratings to around 100V, even in small SMD packages. Parametric search is your friend. Automotive blade fuses are designed to be used in 24V DC battery systems.

author: najrao
author_rank: Regular Contributor
timestamp: March 07, 2021, 12:19:27 pm
content: I have a comparable problem: using a 18AH LiFePO4 4S3P to work in a 500VA sine wave UPS. I request the OP's indulgence in letting me ask my questions.This UPS was meant to use an SLA battery. It "floats" at 13.45V; the charging circuit is peculiar, in that, somehow, the main H-bridge feeding the 50Hz toroidal's 'primary' is driven to set up the charging output whenever mains voltage is available (and applied to the 'secondary'). Appears to boost the available 7V rms ac into 13.45V dc, directly on the dc bus. The charger can output a modest 1A or so into a flat battery at 12V. At float, the charging appears to 'pulse' at 1Hz or so, and the average float current is very little. There is a standing load on the dc bus for the Vcc needed and for one or two relay coils, about 70-300mA, and the charger provides it. All this on SLA.I connected my Li battery fully charged and at 13.65V rest. Instead of floating with little current, itdischarges to feed this standing load; the pulsing charge from the UPS does make the net current into the battery positive, i.e., charging, but only on the peaks: the average is a discharge of 100 to 250mA.This may stabilize to real float after many hours, but at 13.4V, which I expect will drop the remaining Ah capacity significantly. More importantly, we will see this sort of charging pulse representing a possibly deleterious ripple current for long periods.Tracing the circuitry of the UPS pcb is strenuous, and it is not easy to trim the float voltage.I am willing to use a more powerful independent charger, but this will need to float too. And I have to somehow defeat the UPS's pulse charge circuit, to cut out the ripple.Is the LiFePO4 battery quite unsuitable? Can it accept this sort of floating? On such a UPS, holding only a 80% or less charge will cut down the back-up time, so must hold full charge for days on end waiting for the next outage.Please help me with expert views.

author: profdc9
author_rank: Frequent Contributor
timestamp: March 07, 2021, 07:19:03 pm
content: Thanks for your feedback.I was trying to avoid using very vendor-specific parts because I would like this to be a durable, reproducible open source project. The problem I have found with many previous projects is that they are difficult to recreate after 10-15 years because many of the parts have been discontinued. TL494 is ancient, but because of this, there are versions from TI, Onsemi, and many other Chinese copies. So it seems like it will be one of these chips like the NE555 or LM358 that will probably be made for decades to come.For that reason, I was also going to use the ATMEGA328P. The other I would consider using is the STM32F103C8T6 because that too is very common with many Chinese variants. I could use a PIC but I am not very familiar with those. You kind of made it sound very hard to get a software feedback loop to be stable for a buck converter, as even simply layout issues could make the feedback loop too large and destabilize the feedback. So using some kind of local feedback like a TL494 would be better than software feedback.I found this interesting thread about the TL494:https://www.eevblog.com/forum/projects/hacking-chinese-tl393-supply-for-battery-charging-(cc-cv)/Reading this thread, I thought that some of the problems could be avoided by placing a current limiter in the pass transistor to avoid saturation of the inductor and so while the transistor will be temporarily dissipating more power by limiting the current, that should prevent saturation so that the capacitor can charge from a short circuit state. This is in the attached schematic.Perhaps this is just papering over the problem. I would like to avoid using a vendor-specific SMPS controller for this kind of project and the TL494 seemed like an acceptable compromise solution.

author: edpalmer42
author_rank: Super Contributor
timestamp: March 07, 2021, 07:35:21 pm
content: There hasn't been any mention here of a BMS. If you're floating 12V worth of LiFePO4, that's 4 cells in series so you need a BMS to keep the cells balanced. You also can't use a standard BMS because it would be set for 3V65 per cell. Is that being handled somehow?I've thought of using LiFePO4 as a drop-in replacement for either NiCd or SLA backup batteries, but I haven't found an economical off-the-shelf solution that's suitable for the small battery packs that I'd be replacing. For large battery banks, there are programmable BMS systems that look like they could be programmed to do this job. How big are your batteries?

author: james_s
author_rank: Super Contributor
timestamp: March 07, 2021, 10:48:00 pm
content: I don't think it's worth spending a great deal of effort to avoid using any specialized part, that's guaranteed to leave you using ancient parts that still doesn't guarantee availability 10-15 years down the road. Things like buck controllers are very common and there are loads of different ones that are fairly similar. You might end up with one going obsolete but as long as you've kept all the source for the project it should be possible to adapt available parts in the future. No matter what you do nothing is guaranteed though, 15 years is an eternity for electronics and nobody knows what the field will be like that far down the road. Use popular components, code it in C, document everything and save all of the design materials.

author: najrao
author_rank: Regular Contributor
timestamp: March 08, 2021, 04:53:26 am
content: There is a BMS, 3.65V but no balancing. I plan to do manual balancing, or use a Imax balancing charger just once, and hope it will hold. This 4S3P uses 32700 cells, said to be 6000mAh each, so the pack should be 12.8V 18Ah give or take.I am sorry if my intervention into this thread is causing confusion. How do I transplant to a separate thread?

author: David Hess
author_rank: Super Contributor
timestamp: March 10, 2021, 02:23:31 am
content: I agree with Siwastaja; use a current limited constant voltage charge to the open circuit voltage of 60% to 80% charge. The accuracy requirements are stringent but not impossible. I would implement a 4-wire connection to the battery connections to remove load current errors. If you use parallel cells, make sure to wire them in a configuration which balances the voltage drop in the wiring.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 10, 2021, 07:05:45 am
content: I wouldn't be so sure ATMega328P is available in 15 years.It starts to be an ancient part and practically sees use only in the hobby scene. Even there, many many have moved on into ARM ecosystem.The problem with hobby scene is, it changes fast and does it suddenly. The use of ATMega328P went up suddenly; it can come down suddenly as well. As soon as someone makes the new de facto Arduino replacement, the already quite small sales of ATMega328P will drop to near-zero.The assumption that old parts are somehow more reliably available is the wrong one. Sure, TL494 and NE555 are so ubiquitous they likely stay available for another 15 years, but you can't design everything with such parts, they are not very good for most uses, even those they are designed for.Use a modern part from a reputable, well-known manufacturer, make sure it isn't NRND (not recommended for new designs), and just design around it. If it is a good one, people use it, so it very likely is still available after 10-15 years, if not, just redesign around a a similar part. It's likely something better has come along.Modern parts are more integrated and easier to design in, so you save time.