UPS - Charging a Li-ion battery whilst also powering a load? - Page 1
Forum section: electronics / projects

author: Ionforbes
author_rank: Contributor
timestamp: March 21, 2020, 10:49:47 pm
content: I'm trying to build simple 12v UPS poweredd by 2 18650 cells in series. I was thinking of a sort of topology where the normal 12v source would go to straight into the charger IC. The output of the charger IC would connect to both the li-ion cells and the input of a boost converter in parallel like the 1st image '2S charger block diagram 1' (sorry I can't work out how to embed images). Under normal conditions, the battery would feed the converter to power the load whilst the charger ic from the normal 12v input would keep the battery from discharging. When the 12v onput is disconnected, the battery would feed the converter and discharge (I'll also have some undervoltage protection). When reconnected, the charger would recharge the battery whilst also feeding the converter as I would charge the battery with more current than is being drained from it.However it seems thaty designs for similar goals instead prefer to go for a different approach where they switch between the regular input source and battery+converter as in the image '2S charger block diagram 2.' Why is this 2nd desitgn the one thaat's commonly used (or is not)? Would the first idea work? Which would be the better route to go down and why? Any help much appreciated.-Thanks, Ion

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 21, 2020, 11:04:38 pm
content: Not 100% sure of what exactly you envisioned, but basically constantly trickle-charging a Li-ion battery (unlike with other chemistries) is a big no-no.

author: jbb
author_rank: Super Contributor
timestamp: March 22, 2020, 12:24:51 am
content: HmmYou could look at the Texas Instruments battery charger chips with Narrow Voltage DC (NVDC) feature. But some messing around will be required.If currents aren’t too high, it might be better to use the LiIon cells in parallel, as this simplifies battery protection and removes the need for battery balancing. (At cost of reduced efficiency.)

author: NiHaoMike
author_rank: Super Contributor
timestamp: March 22, 2020, 01:30:03 am
content: Quote from: SiliconWizard on March 21, 2020, 11:04:38 pmIt works perfectly fine if the voltage is limited to 4.1V/cell or less.

author: Ionforbes
author_rank: Contributor
timestamp: March 22, 2020, 01:53:09 am
content: The battery would be hooked up to a dedicated charging IC so if the coltage rose too much the charger would just allow it to discharge and effectively hold it at 4.2V

author: digsys
author_rank: Unknown
timestamp: March 22, 2020, 02:28:05 am
content: Quote from: IonforbesIt really depends on the load / charge profile and how long you want it to last, EVEN for lead-acid systems. You can get away with minimal degradation with lead-acid, with low to medium power profile, but it is a lot greater with Lithium, again depends on usage. Figures I've personally seen are 10yrs > 5yrs or 3yrs (even 1-2yrs in more extreme environments), with poor management, and I've been making DC UPS's for many years.The "common" practice is to have 2 separate circuits - one running your dedicated charging IC, and the other running the main supply. You then either use OR diodes / switching relays / power FETs etc, depending on requirements for the change-over when main supply fails. This way, you are pretty much guaranteed the full life expectancy of the battery pack. Again, depends on what "degradation" you are happy with.

author: NiHaoMike
author_rank: Super Contributor
timestamp: March 22, 2020, 02:58:22 am
content: Quote from: Ionforbes on March 22, 2020, 01:53:09 amYou don't want to float it at 4.2V - it won't last long if you do. 4.1V sacrifices little capacity but dramatically boosts service life. 4V boosts it even more and is preferred for a large, expensive pack. Going even lower gets into diminishing returns and the cost of extra cells to make up for the unused capacity will outweigh the improvements in service life at some point.

author: Ionforbes
author_rank: Contributor
timestamp: March 22, 2020, 11:18:07 am
content: I guess I'll just go for the second circuit that switches the output, seems like a safer bet

author: NiHaoMike
author_rank: Super Contributor
timestamp: March 22, 2020, 01:25:29 pm
content: Quote from: Ionforbes on March 22, 2020, 11:18:07 amHint: a non synchronous boost converter already has a diode. All you need is another schottky diode and set the converter so that it does not operate under normal conditions. It helps to add a resistor to the feedback divider (keep it close to the converter to minimize capacitance) so that the setpoint is lowered with the input high.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 22, 2020, 02:48:04 pm
content: Quote from: NiHaoMike on March 22, 2020, 01:30:03 amNope. This would be called float charging rather than trickle charging then, and should anyway be done with a lot of extra care with Li-ion batteries. You should definitely limit the voltage to less than the max voltage (typically 4.1V for std li-ion and 4.2V for typical LiPo). Significantly less. Otherwise even if the remaining charge current is very low, it will just build up over time and the battery will keep inflating. Guaranteed. Tried and tested. Can be a matter of just a few tens of mV.Even if you limit the float voltage to less (like 4.0V or less), it will reduce the life of the battery significantly. An UPS use case is typically very close to a battery just being stored unused (most of the time). You don't store a Li-ion battery at more than ~3.8V usually if you want it to last.Li-ion batteries are still a relatively poor choice for UPSs these days, and there's a reason Lead-acid batteries still predominate for that application. And I would certainly strongly advise AGAINST it for a beginner or even someone that doesn't fully grasp all the subtleties of Li-ion. Just my 2 cents.

author: magic
author_rank: Super Contributor
timestamp: March 22, 2020, 03:49:38 pm
content: I wonder how laptops maintain their batteries?I have an over 10 y.o. laptop which must have accumulated a few years of total uptime by now being almost constantly plugged in. It still manages more than half of its original battery life on the odd occasion that power goes out.editPartly answering my own question: current battery voltage reported by ACPI is 15.415V. I suppose that means four cells in series and 3.85V per cell.

author: Buriedcode
author_rank: Super Contributor
timestamp: March 22, 2020, 04:25:27 pm
content: Quote from: magic on March 22, 2020, 03:49:38 pmBecause the battery isn't always charging. And when plugged in the laptop is powered by the DC input, so the battery is effectively only powering its support circuitry. Laptop batteries' life is based on charge/discharge cycles, as well as whatever limit the BMS has set. Often the limits are set so that the battery pack stops allowing charge, so the user replaces the pack before performance degrades badly, or just so the user replaces the pack every few years for safety purposes. If your laptop spends the majority of its time plugged in, then that isn't very many charge/discharge cycles used.

author: Buriedcode
author_rank: Super Contributor
timestamp: March 22, 2020, 04:31:33 pm
content: To the OP, I may be missing something here but aren't you just talking about load sharing?https://ww1.microchip.com/downloads/en/appnotes/01149c.pdfMost, if not all lithium chemistry chargers use current draw at constant voltage for charge termination. SO it charges at constant current, then when maximum cell voltage is reached, it holds that voltage, allowing the cell(s) to determine the current. As the cell charges, this current decreases, and "end of charge" is usually when this current is C/10 or C/20 where C is the charging current.The upshot of that is, any load on the system also draws current, and if this is larger than C/10 - say you charge at 500mA. C/10 = 50mA, so any load greater than 50mA will mean the charger never stops, and could mean, that you're constantly putting energy into the battery even when it is at max capacity. Whilst this current may be small, and would probably just cause slight heating, it is still generally a bad idea.So it is best to keep the charger circuit directly connected to the battery, but isolate the load with a MOSFET, so when charging, the only thing the charging circuit "sees" is the battery.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 22, 2020, 04:51:55 pm
content: Quote from: Buriedcode on March 22, 2020, 04:25:27 pmYup. Laptops just charge the batteries when they are under a certain level too. For instance, if you're on DC supply, it will provide power to the laptop AND will charge the battery ONLY when it is under a certain level (depends on the laptop and configuration - can be anything from 80% to 95% or even 100%) There's always some kind of "hysteresis" implemented with usually two thresholds (the battery's state under which the charging kicks in, and the state over which it stops charging.) If you constantly leave your laptop on DC adapter, the battery will recharge only when it has self-depleted to a given state as I just said, and since a Li-ion battery in good shape has a relatively low self-discharge, it doesn't happen very often.So it requires some kind of "intelligence" - granted it's pretty simple overall, but it will still require some logic to do this. If you're trying to build a PSU, you should definitely control the charging in a similar way probably with some MCU controlling the charging circuit.

author: magic
author_rank: Super Contributor
timestamp: March 22, 2020, 06:36:57 pm
content: Quote from: SiliconWizard on March 22, 2020, 04:51:55 pmI have noticed it too. Normally the "charged" LED is lit, but sometimes the "charging" one lights up for a short time. I just set up a script which logs battery voltage on that laptop so I will see what the thresholds are.At any rate, laptops are proof that with proper techinque a perfectly viable UPS can be built around Li-ion.updateCharging kicked it an 3.81V per cell and got it up to 4.17V per cell, although I don't know the exact algorithm and termination condition used.

author: magic
author_rank: Super Contributor
timestamp: August 26, 2020, 08:57:00 pm
content: Quote from: magic on March 22, 2020, 06:36:57 pmTime to dig this thread from its graveThe script ended up running for over three months before I killed it. And today I plotted the result, prompted by another Li-ion thread.So this is how my laptop manages its battery. I testify that it spent probably tens of hours permanently on mains power over many years. The battery has been discharged no more than 10 to 20 times. It still holds enough juice for maybe 75% or more of the run time I remember this laptop having when new. This doesn't take into account hardware and software upgrades.Drumroll...

author: aheid
author_rank: Regular Contributor
timestamp: August 28, 2020, 07:08:43 pm
content: Thanks for providing real data, not unexpected but still very interesting!

author: magic
author_rank: Super Contributor
timestamp: August 28, 2020, 07:34:32 pm
content: BTW, I forgot to add: time scale is in days and I only posted two weeks.The rest wasn't any different, so