Power tool battery + charger as a UPS (problems) - Page 1
Forum section: electronics / beginners

author: npelov
author_rank: Frequent Contributor
timestamp: February 11, 2023, 07:46:16 pm
content: Hi,I'm trying to use a power tool charger and battery as a ups. The battery (18V 5S2P) has V-, ID, DC+ and V+ terminals. Charger only has DC+ and V-. My guess is that the power tool (don't have one) uses V+, DC+ is normally disconnected, until charger voltage is applied. The voltage is always present at V+. The charger also always supplies voltage to DC+ (in normal operation). The charger has 0.1R resistor and LM358 connected to opto-coupler which goes to the high voltage side. The charger controls the maximum charging current. I increased the 0.1R resistor to 0.2R because with the first charge he charger started stinking like burnt.The batter has a shunt resistor (don't remember - something between 0.01 - 0.05R) and a mosfet near DC+. It also has protection with much smaller shunt on the negative side - about 0.001 to 0.005. The battery cuts DC+ when the current drops to 1A.So I connected the anodes two diodes to DC+ and V+ of the battery. The cathodes are connected together to supply the "always-on" voltage. It works for a while. I took the battery down to 18 Volts and then charged it while having a dummy load connected to the diodes. Everything works fine. Load is a lot smaller than charging current - 100-200mA. Then I started discharging the battery again while turning on the AC power to check if it works. When the battery is about 20.1V I turned on AC power and both the charger and the battery dropped to 0 volts. I tested a lot and it almost always when the voltage is about 20.1V and I turn the charger on. If I continue discharging past 20.1V - works fine. I also managed to do it the other way around - unplug re-plug the battery - but not as repeatable.If the battery voltage goes lower than 20V powering on the charger is not a problem.I tried to overload the charger with 2x12V 35W bulbs to see if it'll turn off. It won't. It just restarts over and over again. The voltage drops, then goes up in a loop with period about 0.5 seconds.How do I figure out what's causing the turn-off for both battery and charger. I can't reverse engineer the battery - too complex, the terminals hide a lot of traces and de-soldering will be hard. The charger is a mess - I can't figure out what they are doing. I think the opamp mostly drives the indicator LEDs, but it's also connected to the opto-coupler for current limiting. It doesn't seam like it's something special.Please help.P.S. I could use 24V power supply and DC-DC buck converter with current limiting to charge the battery, but I already planned the box and the power supply is relatively big and won't fit. But then what's preventing the battery to cut off the lower side. I don't want to skip the protections circuit. I'll have to add a charge cut off and only use V+ (and not DC+). The battery only seams unhappy when there is supplying power while being charged via DC+. I could charge via V+ and cut the charging myself. but I'll have to redo the PCB (no space left) and it's an experimental PCB for proof of concept - it took me a week.

author: mvs
author_rank: Frequent Contributor
timestamp: February 12, 2023, 08:42:39 pm
content: It looks like battery protection circuit kicks in early. Your battery might be unballanced and/or partly damaged.Check cell voltages to be shure.

author: npelov
author_rank: Frequent Contributor
timestamp: February 12, 2023, 09:04:33 pm
content: Battery brand new, cells are within <10 mV.It could be that the protection circuit doesn't allow charging and discharging at the same time. But it looks more like a glitch - why it does it only at specific battery voltage. Higher and lower doesn't seam to be a problem. Although I'm not 100% sure about the lower voltage.The protection PCB looks smart enough and has enough info (currents) to cut off the battery voltage. However I can't figure out how the charger turns off. Maybe if I can keep the charger on the battery will get over the cut off conditions.Maybe the easiest thing to try is to use the charger for charging only and use 24V power supply as DC power source to test if that'll fix the problem. There is 0.5mA leakage on the diode (didn't measure it) - it could be causing the glitch.Or it could be a problem of the charger not limiting the current correctly. I remember that when I turn on AC power I see the voltage spike to 21V before it goes down to the battery voltage - about 20V. It could be a surge on power on. I could measure the shunt resistor with the scope.

author: mvs
author_rank: Frequent Contributor
timestamp: February 12, 2023, 10:34:03 pm
content: This charger is based on some ob2263 clone. Its a green mode controller, that can switch off at no load. You can find a datasheet below.https://datasheet.lcsc.com/lcsc/1811051522_OB-On-Bright-Elec-OB2263MP-_C52977.pdfIf you change 0.1R to reduce battery charging current, you may also want to reduce max. MOSFET current on the primary side (current shunt is made of R13-R16). It will lower also in-rush currents and perhaps even solves this glitch.

author: npelov
author_rank: Frequent Contributor
timestamp: February 13, 2023, 10:00:36 am
content: Thanks for the datasheet. I'll read it - hopefully it says when the charger powers off.I just got it to turn off without turning on AC power.Actually I turned it off, the battery was about 20.1V and the charger voltage was going down slowly - it's output capacitor usually discharges within 10-20 seconds (the green led slowly fades out). So some time during the capacitor discharge the battery cut off the V+ pin.So maybe the inrush current is not a problem, but instead the turn off happens when the charger output reaches certain voltage (around 2.5 maybe?), regardless of the direction of voltage change - up or down.So the battery cuts power (on the low side probably, because V+ is also not present), not the charger. Maybe I should look at a typical protection circuits. But then why the charger also powers down?Maybe I should just move the charging pin to V+ instead and don't use the Vdc+.The biggest problem is how to figure out when it powers down, so I can test if I fix it. What if I move charging to V+ and it doesn't power down - that could mean that I fixed it or I just couldn't replicate the problem.

author: npelov
author_rank: Frequent Contributor
timestamp: February 13, 2023, 01:54:02 pm
content: No inrush current spike. The voltage goes up because the battery takes a second to enable charging after voltage is applied.I recorded the power off - first with a load, and then with only the Buck onverter on (draws about 18mA). It didn't turn off with light load, but it tried.

author: npelov
author_rank: Frequent Contributor
timestamp: February 13, 2023, 04:31:04 pm
content: I give up. I moved the charging pin from Vdc+ to V+. I'll have to stop the charging using the MCU though. I saw in another charger it's done via two pmos transistors with sources connected back to back.Now this part is a bit tricky. Currently charger is directly connected to the battery and when the charger is off, the green light is on and it draws 35mA in total (I think that includes the 18mA of my buck converter). It's tricky because while charging I have to monitor current to detect power loss, and if the charging is done (switch disconnected) I have to monitor charger output voltage.Now if I put a diode between charger and battery I can use a single PMOS to cut the battery power(the diode will prevent battery feeding the charger). That means I'll charge the battery to 21-0.7V = 20.3 / 5 = 4.06V. I'll loose some capacity, but I'll prolong the battery live.The battery still has it's overcurrent protection on the low side.Any traps for young players with this setup (well young according to experience at least)?