Switch from flat to charged battery while under load - Page 1
Forum section: electronics / projects

author: gnif
author_rank: Unknown
timestamp: August 10, 2019, 02:23:53 pm
content: Hi All,I am looking at building a solar charge solution to try to save a bit on my power bill for my soho server. I obtained a 1KW solar array for extremely cheap but due to austalian law with regards to PV and grid tie in, as well as the abysmal byback rates, I have decided to try and go another route. I already have a enterprise grade UPS I use to protect my equipment with which works great, I also know that I consume more then this solar array can generate, so my goal here is to make usage of this system without exceeding ELV (110V DC IIRC) at which point I would require an PV license.My idea is to switch the UPS between two battery banks, one is maintained full for redundency reasons, the other is charged and discharged by the solar array. When the solar batteries are full I intend to switch the UPS over to them and disconnect the mains feed to the UPS, this should be simple, however the switch back is what I am worried about.Switching back would require connecting the still charged UPS battery back to the UPS, however doing so will mean that the now flat solar battery bank will try to charge the UPS battery bank at an insane rate. I am looking for a way to avoid this.The reason to use this method is simple, the cost of a large battery bank is at this time out of the question, and since I only intend to power one device, it doesn't need to be huge. Just large enough to cycle on and off solar power as the cells discharge and recharge.I hope this makes sense. If anyone has any ideas it would be greatly appreciated.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 10, 2019, 02:57:56 pm
content: Just add additional battery capacity and a charge controller will take care of maintaining the charge level.

author: gnif
author_rank: Unknown
timestamp: August 10, 2019, 03:04:34 pm
content: Quote from: NiHaoMike on August 10, 2019, 02:57:56 pmQuote from: gnif on August 10, 2019, 02:23:53 pm

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 10, 2019, 04:21:39 pm
content: Then use what you have for now. The charge controller will take care of it.

author: gnif
author_rank: Unknown
timestamp: August 11, 2019, 01:15:09 am
content: I think you don't understand what I have tried to explain, or I didn't explain it very well..I have a UPS feeding a server already with a battery bank, I do not want to use this battery bank for solar, i'd like it to continue to remain charged incase of a power outage while a secondary (solar chaged) bank is also flat. This way I wont loose redundency which is the entire purpose of a UPS.I would like to hot swap between battery banks that are connected to the UPS, the change over will be from the flat solar batteries to the fully charged still unused UPS batteries. The UPS will not be using these batteries at this point as it's AC service will have been restored. I believe the UPS will complain and likely shutdown if I just cold disconnect the battery pack from it, as such I need a way to transition over that wont cause a massive charging current to flow from the still charged UPS batteries back into the now flat solar chaged batteries.Edit: it might be possible to just switch them fast enough using some relays, I am yet to test any of this as I am waiting on parts, etc.

author: digsys
author_rank: Unknown
timestamp: August 11, 2019, 01:30:47 am
content: Don't usually get confused with a problem, but seems I've managed this time :-) Can you do a rough wiring layout of the components in play / final wiring layouts.As a quick "guess", can you use 50A+ diodes in a parallel setup to handle switch-over dropouts? And maybe even a small cap, 10,000uF as a filter.

author: langwadt
author_rank: Super Contributor
timestamp: August 11, 2019, 01:39:47 am
content: Quote from: gnif on August 11, 2019, 01:15:09 amadd diodes after that charger on both batteries?

author: gnif
author_rank: Unknown
timestamp: August 11, 2019, 01:44:53 am
content: Diodes alone wouldn't work as the UPS needs to be able to charge the pack, however it would allow the switch over and then a bypass on the diode to allow the reverse flow after the switch occurs.Edit: I even have some 35A rectifiers around here I could use simpy as a diode pack

author: Psi
author_rank: Super Contributor
timestamp: August 11, 2019, 01:53:53 am
content: Could you put a supercap stage in there somewhere to buffer the potential difference during changeover.Supercaps can handle really high charge discharge rates and also store enough energy to run the system for the few seconds it would take to do the transition.I have not thought through the implications or details of this, but it seems to me that using a supercap with multistage switch-over might solve the problem

author: gnif
author_rank: Unknown
timestamp: August 11, 2019, 01:56:51 am
content: Yeah I thought of a supercap also, but I don't think it would be needed with the diode solution, all I need to do is prevent the UPS from seeing 0v. When the change over occurs it will already be back on mains so the output wont be interrupted.

author: Psi
author_rank: Super Contributor
timestamp: August 11, 2019, 02:05:33 am
content: Reading though your post a bit more i have a few more thoughts.- Be careful trying to utilize a UPS for on time longer than it's original batteries. They are usually not engineered for always on operation and overheat easily. When i modified a UPS intended for small SLA to have a big SLA external battery i had to add some case fans to prevent it shutting down from overheating after a few hours. This point is more of an issue with home UPS, business grade 'always on' UPS's are fine.- Maybe have a system like this..* Supercap bank attached to the UPS through a resistor that limits current flow to whatever the max charge/discharge current is for the supercaps.* A relay that connects battery 1 across the supercap* A relay that connects battery 2 across the supercap. (these 2 relays could be interlocked to prevent both connecting)* A timer system to disconnect one, wait a few seconds and connect the other.The current limit resistor is there so that the battery banks can only charge/discharge the supercap within its spec. Since the supercap is quite small this will happen pretty fast. The bank will charge/discharge the supercap to match its voltage within seconds.- A diode-OR solution has some losses. Unless you do it using fets. There are ICs that will drive two fets in a diode OR type config that may work

author: gnif
author_rank: Unknown
timestamp: August 11, 2019, 02:15:40 am
content: Yes, this is a HP Enterprise UPS designed for data center usage and is provided with the means to connect a large external SLA pack to it to allow for extended run time, so I doub't I will see issues. It's also rated for 2200W but I intend to only draw about 500W max from it.

author: langwadt
author_rank: Super Contributor
timestamp: August 11, 2019, 02:34:07 am
content: Quote from: gnif on August 11, 2019, 01:44:53 amdoes the ups have to charge both batteries? if not maybe could split the connection to the a UPS battery so the charger is directly connected but the inverter after the diode

author: gnif
author_rank: Unknown
timestamp: August 11, 2019, 02:37:12 am
content: No, the UPS is intended to only keep its own set float charged. The other pack will be charged from solar. The intent is to completely disconnect the UPS batteries while there is sufficiant power in the pack charged from solar. This way they are not used unless there is an actual power outage and still available as a backup.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 11, 2019, 02:44:43 am
content: Quote from: gnif on August 11, 2019, 01:15:09 amJust connect the batteries in parallel and don't use the full range for solar. For example, switch to solar when the charge level goes to 95% and rising, back to mains at 80% or when the sun goes down. You can even tap into the CPU frequency controls through software and vary it according to system power state, maybe even run a cryptocurrency miner if there's plenty of solar and nothing better to use it on.

author: gnif
author_rank: Unknown
timestamp: August 11, 2019, 03:32:56 am
content: I have the opposite problem, I am drawing far more then the solar can produce, I intend to run the batteries until flat. I am avoiding using a grid tie in because the rates in AU suck, better to use the power myself.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 11, 2019, 04:32:11 am
content: It's a 1kW solar array so I would expect it to produce more than most servers use, at least during a few hours per day. It probably won't cover all of the energy use but I would expect some times when you'll have to up the load on the server to actually use the solar, then back it down at other times. I would say that getting enough batteries to store all surplus production probably wouldn't be economical, but dynamically adapting to solar production would be.There might be a way to tell the UPS to switch to batteries even with the mains present, eliminating the need to actually switch the mains with an external circuit.If the server has a redundant PSU setup, check if it prefers to draw most/all power from one input in normal operation or load balance between the two. (That could even be adjusted through BIOS in some cases.) In the latter case, there might be some merit to adding a transfer switch to allow one of the inputs to bypass the UPS, allowing some control over how much to pull from the UPS. Ideally, there would be some way to program the power balance dynamically for fine tuning.

author: Psi
author_rank: Super Contributor
timestamp: August 11, 2019, 04:45:22 am
content: Quote from: NiHaoMike on August 11, 2019, 04:32:11 amYes, some UPS have a serial/USB test command.You can say, run on battery for X hours or Run on battery until flat.

author: sleemanj
author_rank: Super Contributor
timestamp: August 11, 2019, 04:47:57 am
content: You want to limit the current drawn from the fresh battery put in parallel until the flat one is disconnected (some milliseconds later).No different that limiting the current until big capacitors are charged, ie, this is a soft-start situation with the added factor of disconnecting the flat battery during the soft-start. You can probably find a soft-start controller (inrush limiting PMIC) that can do that.Or, use a micro, switch in the new battery in parallel through a suitable resistor, disconnect old battery, short out the limiting resistor so full current is now available.

author: gnif
author_rank: Unknown
timestamp: August 11, 2019, 04:54:06 am
content: Quote from: NiHaoMike on August 11, 2019, 04:32:11 amThis is not most servers, is a 16 core threadripper with two GPUs and 4 monitors running an array of 15 spinning disks and multiple virtual machines, it will certainly consume more then the array can produce.

author: magic
author_rank: Super Contributor
timestamp: August 11, 2019, 08:17:53 am
content: Quote from: gnif on August 11, 2019, 01:15:09 amThat sounds like a fine moment for mains outageI think the diode solution may be OK. But do check what happens if the UPS tries to charge in the short window when one battery is connected only with diode and the other not connected yet.

author: capt bullshot
author_rank: Super Contributor
timestamp: August 11, 2019, 08:33:28 am
content: Back-to-back connected MOSFETS of appropriate rating and control circuitry would be able to switch over from one battery to another within some 10 to 100us. The UPS buffer cap should cover for that. Back-to-back MOSFETS operate like a "real" switch, conducting and isolating in both directions (within their capabilities).Currently I'm thinking about extending the capacity of my homegrown solar battery system using such a configuration, adding a second battery that would be charged by another source (more solar power):http://wunderkis.de/pvbat/

author: ogden
author_rank: Super Contributor
timestamp: August 11, 2019, 08:45:26 am
content: It is not good idea to modify your "last line of defense" UPS. I would leave it alone. As you consume more than PV can produce - why don't you just install grid-tied inverter w/o batteries. Does "PV license"+ grid tie inverter is more expensive than battery pack for 1KW solar?

author: gnif
author_rank: Unknown
timestamp: August 11, 2019, 10:58:30 am
content: Quote from: ogden on August 11, 2019, 08:45:26 amIt's not my last line of defence, it's one of two. Grid tied inverters in australia are a joke, we have to have a seperate meter that measures what we generate, and we are reimbursed that amount on our electricity bill, but at the abysmal rate of 6c/kwh. Dave did a video on his grid tie in a little while back that explains all this and how much we get ripped off over here. If I stay within ELV and don't mess with the mains directly there is no issue and instead of getting 6c/kwh saving on my power, I will get 58c/kwh.

author: ogden
author_rank: Super Contributor
timestamp: August 11, 2019, 12:21:33 pm
content: Quote from: gnif on August 11, 2019, 10:58:30 amSorry, didn't see video about PV in Australia because honestly don't care. Your grid buys electricity from individuals at 6c/kwh rate, right? This is important for those who during day are able to generate more than they consume, who use grid as a "storage" - sell excess power. This is not your case because your PV generates less than you consume at any time of the day. You may just plug grid-tied inverter into socket and do not tell anyone

author: Marco
author_rank: Super Contributor
timestamp: August 11, 2019, 05:07:22 pm
content: Quote from: gnif on August 11, 2019, 10:58:30 amSeems to depend on the state/company.Are you really not allowed to install a system which simply never feeds in but only saves on your consumed electricity?

author: Psi
author_rank: Super Contributor
timestamp: August 12, 2019, 02:03:07 am
content: Quote from: Marco on August 11, 2019, 05:07:22 pmIt's the grid tie that makes it complex (backfeeding into the grid)If you just want to run your house without back-feeding it's pretty simple.You just have to get an electrician to do the in-wall wiring and wiring to the fuse/breaker panel with contractor/disconnects or selector switch (mains vs UPS).That's all a one-off cost.