So for various reasons I'm designing a DC microgrid that: (TLDR at the bottom in bold)
1. Has PV in of MPPT optimized power (from optimizers on every panel with emergency shut off per US NEC). Every string is series together and then I'm using a GanFET-based freewheeling half-bridge DC/DC boost/buck in buck mode (since the Bus will always be less than the Solar if the solar is on at all but it could go boost if needed). This generates stable 48VDC power (exactly 48VDC power which is monitored by the PWM controller to ensure that it stays stable and adjusts the duty cycle accordingly)
2. AC Grid 240V in that may or may not be there depending on usage (Think RV) and uses a patented algorithm that I've designed to figure out when it should engage that and when it doesn't need to and there will be sufficient power using predictive analytics, a little AI and a lot of sensors and weather data. It uses a mosfet rectified bridge design with positive biased caps and then uses the same topology as #1 to step down the ~240VDC that is produced with low loss to 48VDC exact power.
3. There is a 48VDC Nominal LiFePO4 battery as well that can either be charged or discharged based on demand on the microgrid. (This is the subject of this post, I'll get to how it works below)
4. There are are a few legacy 12VDC items that are on a buck similar to #1's above that steps down for those 12VDC.
5. There is a small inverter that literally is only used for a blow dryer because I haven't had time to gut one and make it run off DC Power. (and if there is AC power available, it runs direct to eliminate the losses)
6. All other loads are 48VDC (eg custom 48VDC heat pump that does AC/Heat + hot water (with super deheater), USB C 4 240V)
So, all of the other power sources are straight forward. The logic is a little difficult but basically it works like this:
1. If solar > total current draw, then charge battery
2. If solar = total current draw, then nothing else.
3. If solar < total current draw, then battery picks up the rest of the current draw unless it's below a certain threshold or there are other reasons to do with the algorithm that it should be getting it from AC.
4. Use AC if all else fails per the algorithm.
The Microgrid significantly expands the life span of the LiFePO4 batteries because instead of charging/discharging on loads constantly because the MPPT charge controller is dumping into the battery and then an inverter is extracting from the battery, the inverter very often is skipping the battery entirely which significantly reduces the total number of cycles on the battery.
It also averages out with this design at about 97% efficiency across the system as long as you ignore the inverter for the hair dryer. (Yes I tore apart the microwave and created a boost converter to jack the voltage from 48VDC to the required, and gutted the rectifier in the stove and power it directly over 48VDC. The hair dryer is more wife not wanting me to screw with her hair dryer.)
And after some analysis and looking at how passive and active balancers work on LifePO4 batteries I have realized that the current brute force method is resulting in a significantly shorter life span that I think I can make work because of how the DC Microgrid works with net amps. Basically, with a standard BMS, it passively drains overvoltage to cells that are under voltage. With Active balancers this micro cycling is MUCH worse. I've verified this with a battery chemist.
So, the battery is always in one of 2 discrete modes: Charging OR discharging. There is no passive loading or floating on the battery at all in the DC Microgrid. It's either contributing current or it isn't and it's semi-isolated (it isn't a full bridge, so it isn't isolated in the traditional sense because it isn't broken apart by a transformer only an inductor) because of the DC/DC converter that ensures that 48VDC is going out to the bus to contribute in parallel to the amperage.
What I'd like to do is create a solid state circuit using high amperage FETs and connecting the batteries separately. And yes, I know that if you were to have them in series and try and charge from the same source in parallel, they'd short and there is no way around that which is what got us these balancing BMSes in the first place. But because the battery is either charging or discharging, this isn't really an issue for me because I've designed a circuit that when charging, the batteries are separated and effectively in parallel. The charging is always by definition balanced and using FETs any given battery can be turned off so that the amperage is shared with the remaining batteries that are still in parallel. A discrete CC/CV 2.5 - 3.5 Volt charger that has a DC/DC buck from the microgrid that I've built with high amperage does the work.
When the battery needs to go into discharge, different FETs close and the charging ones disconnect, and it creates the series of the batteries (because the duty cycle is too high for long term life to go DC/DC on 3.2V to 48VDC and this is just a POC, ultimately this will be a 380VDC microgrid with a 48VDC low voltage rail like the 12VDC in this POC). This series is then DC/DC Buck/Boosted as needed.
While this results in more small wires to each battery (2x) because there is a positive and negative it doesn't have significantly more componentry other than the extra buck/boost which is negligible cost in the design because an Active Balancer like the JK BMS has 2 FETs per cell which mine has 4 per cell (2 N-Channels per, controlled by a 2-way driver ic).
TLDR:
I'm trying to figure out without resorting to complex monitoring of each input source and output whether the battery needs to be in charging or discharging mode. I.e. it's in charging when the net current > 0 and discharging if net current < 0. (well, more like a few amps above 0 so that I don't have cycling of the circuit, but you get the idea).
So how can I, at the battery connection to the microgrid, determine what the amperage is? Or is there no way to do this, and I have to put an current sense on the microgrid out (PITA because it's in a star configuration with the sources) and then keep track of the current from the sources and total them up to do this?
I'm trying to keep this discrete. I.e. The battery has its own PCB with micro controller, the solar its own, the AC its own. They talk to each other with I2C orchestrated using the equivalent of a Raspberry Pi, but that's because the micro controller for the AC power isn't smart enough to process the algorithm for if the AC power should be involved or not and the PI also does other things like providing the UI etc. I'm trying to avoid having Yet Another PCB and Micro controller and keep the Star pattern for sources and drains.
Thanks!