diy solar

diy solar

SunGoldPower 10kw with EG4 LifePower4 batteries - Closed Loop

marionw

Solar Enthusiast
Joined
Nov 8, 2023
Messages
574
Location
South Carolina
I wanted to build a software "Master BMS" which will operate between my six EG4 LifePower4 batteries and my SunGoldPower 10kw inverter. I have discovered that the "Master BMS" in closed loop does not completely control the charge profile used by the inverter. I have spent the last two weeks conversing back and forth with SunGoldPower and they have finally provided a response that somewhat agrees with what I am seeing. To SunGoldPowers benefit, they did respond to each email I sent them.

I hope this info will at least somewhat help others understand the "closed loop" charging process which still is sort of a mystery.

Many on this forum have build software/devices using Raspberry PI, Aurduino or even esp32 to accomplish this but they operate with the BMS function in the inverter turned off and use modbus commands to directly set values in the inverter.

The software I am building has an RS485 to USB connection to the Inverter's BMS port, and RS485 to USB converter connection to the EG4 LifePower4 RS485 bus and another RS485 to USB converter connection to the inverters WIFI/Monitoring port so I can monitor what changes using modbus commands. My test software allows me to change/set SOC, Max Charge Voltage and Max Charge Current to see what changes in the inverter.

SunGoldPower 10kw continuously sends three commands to the "Master BMS":
61h Get System analog data
62h Get system alarm info
63h Get system charge discharge management info

I assumed (incorrectly) that the data sent back to the inverter in response to the "63h Get system charge discharge management info" would directly set the "Max Charging Voltage" and "Max Charging Current" in the inverter. The "Max Charging Current" (in the inverter) is set by some formula/algorithm in the inverter which is using SOC as reported in response to 61h and Max Charging Current as reported in response to 63h.

The inverters "Max Charging Voltage" and "Max Charging Current" can be set by using modbus commands but BMS communications must be disabled (in open loop)

The "Master BMS" software continuously polls the batteries and uses the data/responses to build/create the response/reply sent back to the inverter for the command sent by the inverter.

I also have an interface to a Victron SmartShunt and I could also use this data as well to manage the charging profile.

Master BMS System Analog Data in Response to Inverters 61h Command
Battery Pack Average Voltage: 51.5 V
Battery Pack Total Current: 0.0 A
Battery Pack SOC: 57.0 % This does update the SOC as displayed on the IPower.exe software or Solar Assistant as well as on the Inverters display
Average Cycles: 0.0
Max Cycles: 0.0
Average SOH: 100.0 %
Minimum SOH: 100.0 %
Single Core Max Voltage: 51.5 V
Module With Single Core Max Voltage: 0105
Single Core Min Voltage: 51.5 V
Module With Single Core Min Voltage: 0103
Single Core Average Temp: 22.5 °C
Single Core Max Temp: 24.0 °C
Module With Single Core Max Temp: 0202
Single Core Min Temp: 21.0 °C
Module With Single Core Min Temp: 0606
MOSFET Average Temp: 23.0 °C
MOSFET Max Temp: 24.0 °C
Module With MOSFET Max Temp: 0102
MOSFET Min Temp: 22.0 °C
Module With MOSFET Min Temp: 0106
BMS Average Temp: 22.5 °C
BMS Max Temp: 23.0 °C
Module With BMS Max Temp: 0101
BMS Min Temp: 21.0 °C
Module With BMS Min Temp: 0106
Bytes To Inverter: 7E-32-30-31-32-34-36-30-30-38-30-36-32-43-39-32-38-30-30-30-30-33-39-30-30-30-30-30-30-30-30-36-34-36-34-43-39-35-33-30-31-30-35-43-39-35-33-30-31-30-33-30-42-38-43-30-42-39-42-30-32-30-32-30-42-37-44-30-36-30-36-30-42-39-31-30-42-39-42-30-31-30-32-30-42-38-37-30-31-30-36-30-42-38-43-30-42-39-31-30-31-30-31-30-42-37-44-30-31-30-36-45-39-31-46-0D
Text To Inverter: ~201246008062C928000039000000006464C9530105C95301030B8C0B9B02020B7D06060B910B9B01020B8701060B8C0B9101010B7D0106E91F\r

Master BMS System Alarm Status Info Response to Inverters 62h Command (normally all zero's if no BMS/Battery alarms)
AlarmStatus1 0
AlarmStatus1: 0
ProtectionStatus1: 0
ProtectionStatus2: 0
Bytes To Inverter: 7E-32-30-31-32-34-36-30-30-38-30-30-38-30-30-30-30-30-30-30-30-46-43-32-31-0D
Text To Inverter: ~20124600800800000000FC21\r

Master BMS System Charge-Discharge Management Info Response to Inverters 63h Command
Max Charging Voltage: 56.4 sets Menu Items 9 (Battery Bulk Charging Voltage), 11 (Battery Float Charging Voltage) and 17 (Battery Equalization Charging Voltage)
Min Discharging Voltage: 43.2 sets Menu Item 12 (Battery Overdischarge Voltage)
Max Charging Current: 10.0 along with SOC as reported above sets Menu Item 7 (Max Charging Current)
Max Discharge Current: 20.0
Charge-Discharge Status: 192
Charge Enabled: True
Discharge Enabled: True
Charge Immediately: False
Full Charge Requested: False
Bytes To Inverter: 7E-32-30-31-32-34-36-30-30-44-30-31-32-44-43-35-30-41-38-43-30-30-33-45-38-30-37-44-30-43-30-46-39-39-34-0D
Text To Inverter: ~20124600D012DC50A8C003E807D0C0F994\r


SunGoldPower Gold response to my last email:
1. When the inverter and the battery successfully communicate with the BMS, the charging current value of item 07 of the inverter is completely controlled by the BMS.
2. The charging current value of item 07 of the inverter is not modified by sending a command but needs to change the program of the BMS protection board. It cannot be modified by sending a command.
3. The charging current value of item 07 of the inverter will be adjusted according to the SOC value of the battery. The higher the SOC value of the battery, the smaller the charging current will be.
4. Your feedback also shows that the battery correctly displays the battery SOC value and battery voltage, indicating that the battery has uploaded this information to the inverter, and the inverter has the correct display, indicating that the inverter is normal, and the battery is also normal.
 
What I forgot to mention: Max Charging Current in the Inverter (menu item 07) was set to 100 amps and not the 10.0 amps as the below BMS response requested (no this is not a decimal or multiplication issue). If I set the SOC in the 61h response to 100% and with "Max Charging Current" still at 10 amps the Inverter shows 6 amps. In other words the inverter, not the BMS is setting the Max Charging Current (menu item 07) based I guess, on the BMS reported SOC and requested Max Charging Current

Master BMS System Charge-Discharge Management Info Response to Inverters 63h Command
Max Charging Voltage: 56.4 sets Menu Items 9 (Battery Bulk Charging Voltage), 11 (Battery Float Charging Voltage) and 17 (Battery Equalization Charging Voltage)
Min Discharging Voltage: 43.2 sets Menu Item 12 (Battery Overdischarge Voltage)
Max Charging Current: 10.0 along with SOC as reported above sets Menu Item 7 (Max Charging Current)
Max Discharge Current: 20.0
Charge-Discharge Status: 192
Charge Enabled: True
Discharge Enabled: True
Charge Immediately: False
Full Charge Requested: False
Bytes To Inverter: 7E-32-30-31-32-34-36-30-30-44-30-31-32-44-43-35-30-41-38-43-30-30-33-45-38-30-37-44-30-43-30-46-39-39-34-0D
Text To Inverter: ~20124600D012DC50A8C003E807D0C0F994\r
 
Fine tuning Max Charging Voltage in the Charge-Discharge Management Info Response to Inverters 63h Command does in fact result in complete control of the charge current into the batteries

Max Charge Voltage set to 52.3 (Overridden) with battery voltage at 52.11. Notice "Total Battery Charge Power" and "Battery Current"

Screenshot 2024-05-16 102416.png

Max Charge Voltage set to 56.4 (not overridden) with battery voltage at 52.32. Notice "Total Battery Charge Power" and "Battery Current" increase significantly from the above screenshot
Screenshot 2024-05-16 102503.png
 
Still charging from 58% SOC from the grid. The "Master BMS" is reporting 100% SOC and the BMS_Test tool is reporting 100% SOC for each of the 6 LifePower4 batteries.

The "Max Grid Charge Current" for the SunGoldPower 10kw defaults to 60 amps. I have not changed this as I expect the limit is due to the actual charger in the inverter, it is not after all an EG4 Charge-Inverter.

My observations so far suggest that the "Master BMS" in closed loop has little control over the charge profile. The inverter has no knowledge of the number of batteries in the bank nor the total amp hour capacity of the bank and the inverter does seem to ignore the "Master BMS" charging data except for "Master BMS" reported SOC which over time becomes wildly inaccurate.

Once the "Master BMS" reported the battery bank was at 100% SOC the inverter stopped charging the battery bank. I wanted the charge to continue until at least some cells in one or more batteries reached a cell voltage of 3.45 volts (Balance Voltage) at which time the BMS would start to balance cells and reset the SOC to 100% (this is true 100% SOC).

Charge and discharge cycles over a week or more where the "Master BMS" incorrectly reports 100% SOC may be OK but once in awhile the system needs to perform the equivalent of a "lead acid battery equalization" charge. In other words disregard 100% SOC and charge until cells reach 3.45 volts and start to balance. If this does not occur then it is a sum losing game and the inverters knowledge of battery SOC gets out of whack.

In order to make this happen I have my "Software Master BMS" lie to the inverter and report an SOC of 95% in order for the inverter to continue to charge the batteries. I can still control charge current while setting a Max Charge Voltage of 16 cells x 3.45 volts = 55.2 (bump up to 55.5)

I am waiting on a "Bal" indication from one or more of the batteries.

Please note: I also have two SunGoldPower/SOK 48V100AH batteries connected to the bus bar in the 6 battery EG4 rack for a total of 8 batteries. The charge current is therefore divided amongst 8 batteries and not the 6 I am polling, minor stuff but worth noting for you folks than might be crunching the numbers. I could also collect the data from the two SunGoldPower/SOK and include it in the data being sent back to the inverter but it appears it really does not make a difference as the inverter has a mind of it's own. In addition I originally set the Victron SmartShunt battery capacity to 600ah but because of the two SunGoldPower/SOK batteries I should have set it to 800ah. Regardless the "actual" current being measured by the shunt is correct, the shunt SOC is incorrect.

Screenshot 2024-05-16 183916.png
 
Very interesting reading and deep dive information (I'm really interested in these protocol things)!

After long time thinking about closed loop communication and the pros and cons, I came (just for myself) to the conclusion that's not worth the effort and because of the possible problems. Here are some of the reasons (a copy of this post), why I prefer NOT using closed loop communication and since I'm doing it this way, I have not regret it.

I have control over and would like to know the max. charging current via settings for the bulk charging phase
  • In case the BMS would select this value (which happens in closed loop communication), you don't really know the current selected values and when it changes and why - the value of program 02 (max. charging current) will not show the current selected value if BMS takes control!
  • The supposed disadvantage to rely on voltage instead on SOC for settings 12 "point back to utility" and 13 "point back to grid" is in my opinion not a real disadvantage. The usually very flat LiFePO4 voltage curve gets steeper at very low and very high SOC's and these are the ranges where these two settings usually be used and here the voltage is good enough as an indicator when to switch.
  • Additionally I control the settings for 12 and 13 via smart home rules to force a mode change. In case the combination of the SOC and the corresponding battery voltage would drop below about 8% (I still get the exact SOC values into my smart home system from the batteries, even without closed loop communication) the AC-in contactors will be closed and a minute later the value of program 12 will be adjusted to the highest value to initiate the AIO's grid/bypass mode. After enough solar production begins and charge rise to 12% the value of program 13 will be set to the lowest possible value to initiate the AIO's to switch back to solar/battery mode. After the smart home detects the mode switch, the AC-in contactors will be disconnected again. This reduces the time the AC-in's are connected to the grid to a minimum.
  • In case the batteries would not often gets fully charged, the SOC reading inside the batteries get's fast very inaccurate and I will not rely on it exclusively - that's the reason why the smart home rules use both SOC and voltage to control the mode switching!
  • I very often read about closed loop communication problems and it heavily relies on firmware of AIO and batteries, additional wiring with possible problems, etc. that's one reason more for me to not use it. In my opinion, the closed loop communication is overrated - but I may be wrong.
I'm just using the well known LFP charging voltage settings with the best compromise between maximize the used capacity while not stressing the batteries to much (3.45V/cell for absorption/bulk and 3.35V/cell for float).

So I don't really see which real pros a closed loop communication will provide - maybe I'm wrong here, but that's my personal conclusion.
 
I certainly appreciate the feedback. In the end we will all develop a better understanding of the "stuff" we invest money in and also have more realistic expectations for the equipment we install.

In addition hopefully we can drive the industry to make a better product; for example, why can't invert manufacturers include a "Victron SmartShunt" capable shunt in the inverter, after all the inverter does have a shunt, upgrade the firmware to provide better more accurate data and/or the shunt to be 1% rather that 10% accurate.

Why can't a BMS accurately measure current (in or out) like a smartshunt?

I am still trying to decipher the data. One advantage of a "managed close loop" over other solutions where software in an "open loop" system controls the charge profile is that when the "software" fails or crashes the inverter will (in close loop) revert back to the preset values which hopefully were set to be conservative. In an "open loop" system where software sets the various values, if the "software" fails or crashes the last settings will be honored which may not be conservative.

It appears to at least what I am seeing (with respect to SRNE (clones)) is that the Inverter is basing it's charging profile less on what the "Master BMS" is reporting for charging current and voltage but rather on the "Master BMS" reported SOC which can and will over time become wildly inaccurate.

At this moment the inverter is pumping on average 8 amps into each of 8 batteries where max cell voltage is 3.38 volts (and SOC is reported at 100%). Is the bank as a whole at 100% SOC or should I keep charging until at least on or more cells reaches 3.45 volts at which time that battery will start to report cell balancing and truly be at 100% SOC?

I should also note the the inverter "Current Invert State" has always been "Constant Current" even though the "Battery Boost Charge Time" is set to 120 minutes. Is it possible that in closed loop communications the inverter is always in "Constant Current"?

Currently at 59.11 amps total charge current (eight batteries), max battery charge current is 8.49 amps, min battery charge is at 7.50 amps with max cell voltage at 3.381. This means that one battery is charging at 8.49 amps, and one is charging at 7.50 amps and all others in between.

At least one battery (and possibly more) have a cell voltage of 3.382. The target is 3.45. At least one battery (and possibly more) have a minimum cell voltage of 3.370

What is the point: Understanding how the inverter manages the charge profile in "closed loop" and in the end ensure that the batteries are always when possible charged to 100% SOC. I just want (have) to know.

I will either fry the batteries or figure something out......

I am lying to the inverter in order to get a charge current to 8 batteries. I have set the SOC to 95% where the batteries are individually reporting 100% SOC. The Max Cell Voltage amongst all the batteries is 3.381, I want to get to 3.45. Remember the max charge current of 60 amps (Grid charge current max) is split between eight batteries


Screenshot 2024-05-16 211726.png
 
As you can see Max Cell Voltage is barely creeping up, but the shunt SOC is progressing. I can't increase charge current as the max is limited by the "Max AC Charger Current (Menu Item 28)" (although I could increase it). I will let things go for now and as the batteries accept the charge the cell voltages will eventually "jump up" and the charge current will significantly drop off. I have a "break point" installed should cell balancing start.

Battery temperatures are well within spec (below 80 F) and cell voltage diff (across all batteries) is slowly decreasing.

Blow it all up or die trying...


Screenshot 2024-05-16 220057.png
 
Opened the breakers on the two SunGoldPower batteries so the charge current is only split amount the 6 EG4 LifePower4 batteries. Notice the increase in "Max Single Battery Current". Hopefully the "Max Cell Voltage of Battery Bank" will start to increase more rapidly (so I can watch some TV or go to bed). I do want at least some cells ("Max Cell Voltage of Battery Bank") to hit 3.45. Bottom line here is, the more batteries you have in your battery bank, the more charging current per battery you need to get to cell balancing. Still limited by the "Max AC Charger Current" of 60 amps. If I were charging from PV with PV strings into both MPPT charge controllers I would have potentially up to 200 amps charging current (total available PV power minus what the AIO output load is)

Screenshot 2024-05-16 222319.png
 
The BMS_Test software reflects what I am seeing with the "software Master BMS". Just want to get to cell balancing. All in all, the batteries are fully charged except that the "SOC" is not actually "Reset" so after several discharge/charge cycles the SOC will be off.
The question is; How often do I need to run this process to maximize battery bank capacity?

Screenshot 2024-05-16 222319.png
 
Reached the magic cell voltage of 3.45 (the 105 after Max Cell Voltage Battery Bank) is battery 5 which has always been the oddball battery.

At this point I cleared the SOC override and reported 100% SOC to the Inverter which in turn stopped charging the batteries.

All is well and continue to learn what all these various solar components actually do (or don't).

Time for a scotch and a John Wayne Movie.

Balancing.png


Balancing1.png

Unchecked the SOC "Enabled" override and allowed a 100% SOC to be reported to the Inverter which resulted in 0 current charging.
Once charging stopped the cells settled to 3.383 as expected. SOC of 100% is now accurate. For how many charge/discharge cycles, who knows. I can also reset the Victron SmartShunt to 100% SOC

NoCharge.png

Did not need to reset the Victron SmartShunt. Apparently it is smart enough it reset itself.
Victron.png
 
Continuing to document "closed-loop" communications.

No charge going into the batteries since last post (Thursday 05/16). Inverter has no load so the only drain on the batteries is the Inverter Idle power consumption.

The "Master BMS" is reporting the battery bank is at 99% SOC (reporting to the inverter) whereas the Victron Shunt is reporting what I believe to be a more accurate SOC of 96.6 %. Just demonstrates with real-time data that the BMS in a battery does not properly account for minor (less than 1 amp???) current discharge.

The "Override Inverter/Charge-Discharge Management Info" "To Inverter" data is displaying what the EG4 Communications Hub (acting as a Master BMS) is actually sending to the Inverter

The "Inverter Monitoring Read From Inverter" is what is being read from the Inverter in real time via modbus

Screenshot 2024-05-18 161222.png
 
Last edited:
I'm just using the well known LFP charging voltage settings with the best compromise between maximize the used capacity while not stressing the batteries to much (3.45V/cell for absorption/bulk and 3.35V/cell for float).
Running the math:
3.45V x 16 = 55.2V absorption/bulk
3.35V x 16 = 53.6V Float

LifePower4 manual suggest 56.2 & 54.0

Other Posts match your numbers for being conservative.
BULK/ADSORB 3.45-3.52 (3.485 ave) = 55.8 (16 Cell) 55.2V to 56.32Vmax
FLOAT 3.35 = 53.6 (16 Cell)

I have LifePower4 that doesn't want to charge over 54.5V, works great otherwise.

Only concern is a large storage system on solar with limited useful sunlight. May take some extra voltage closer to the 56.2V to get-er-done.

I just did a mental experiment of what you already have done. I'll join the ranks of hundreds before me
 
Last edited:
Running the math:
3.45V x 16 = 55.2V absorption/bulk
3.35V x 16 = 53.6V Float

LifePower4 manual suggest 56.2 & 54.0
I know, but for my feeling, it's unnecessary high.

Other Posts match your numbers for being conservative.
BULK/ADSORB 3.45-3.52 (3.485 ave) = 55.8 (16 Cell) 55.2V to 56.32Vmax
FLOAT 3.35 = 53.6 (16 Cell)

I have LifePower4 that doesn't want to charge over 54.5V, works great otherwise.

Only concern is a large storage system on solar with limited useful sunlight. May take some extra voltage closer to the 56.2V to get-er-done.

I just did a mental experiment of what you already have done. I'll join the ranks of hundreds before me
After a bit of research, I've found that the EG4-LL (V2) and EG4-LL-S will start balancing if cell voltage >3.4V and cell Δ >40mV. In my situation where I got nearly every day full sun and recharge to full capacity (which resets my BMS SOC counter always to 100%), I have between 60 and 90 minutes every day with cell voltage >3.4V which is hopefully enough to do the balancing. I will find out over time...
 
The number of batteries in the bank is also a factor. The charge current from the inverter is for all the batteries, so it get divided by battery count for the charge current into each battery (assuming they are closely balanced). My inverters max charging current from the grid is limited to 60 amps and from the PV array it is 200 amps

One thing I have not yet figured out is when the inverter shifts between Bulk/Absorb and Float. In closed loop these get set by the BMS and are always 57.2, rather high
 
I know, but for my feeling, it's unnecessary high.


After a bit of research, I've found that the EG4-LL (V2) and EG4-LL-S will start balancing if cell voltage >3.4V and cell Δ >40mV. In my situation where I got nearly every day full sun and recharge to full capacity (which resets my BMS SOC counter always to 100%), I have between 60 and 90 minutes every day with cell voltage >3.4V which is hopefully enough to do the balancing. I will find out over time...
I reduced them down to your numbers yesterday. I wanted to give it a try because I've been peeking out at 100% every now and then. One battery was going into protection.

Looks good so far. The main load today was mini split.
 

Attachments

  • Screenshot_20240520-202315.png
    Screenshot_20240520-202315.png
    76.7 KB · Views: 2
The number of batteries in the bank is also a factor. The charge current from the inverter is for all the batteries, so it get divided by battery count for the charge current into each battery (assuming they are closely balanced). My inverters max charging current from the grid is limited to 60 amps and from the PV array it is 200 amps
Yes, this is an important factor. In my case I feed 12 EG4-LL batteries and the PV charge current of all AIO's in parallel charge at a max. of 0.2C (after conversion losses). I don't want to charge from grid, so I've reduced the grid charging current to the minimum possible value of 2A per AIO (12A for 6 AIO's in parallel will be <0.01C) - my AIO's does not allow to completely disable grid charging, just minimize the current to 2A.
One thing I have not yet figured out is when the inverter shifts between Bulk/Absorb and Float. In closed loop these get set by the BMS and are always 57.2, rather high
This is one of the reasons, why I'm not a big fan of closed loop communication and don't use it in my setup. You'll loose control over the charging settings and usually you even can't see the current values which the BMS selected and when and why. I have a much better feeling, if I can control the absorption and float voltages like I wish and can be sure that they will not change. But this is just my personal preference...
 
Yes, this is an important factor. In my case I feed 12 EG4-LL batteries and the PV charge current of all AIO's in parallel charge at a max. of 0.2C (after conversion losses). I don't want to charge from grid, so I've reduced the grid charging current to the minimum possible value of 2A per AIO (12A for 6 AIO's in parallel will be <0.01C) - my AIO's does not allow to completely disable grid charging, just minimize the current to 2A.

This is one of the reasons, why I'm not a big fan of closed loop communication and don't use it in my setup. You'll loose control over the charging settings and usually you even can't see the current values which the BMS selected and when and why. I have a much better feeling, if I can control the absorption and float voltages like I wish and can be sure that they will not change. But this is just my personal preference...
I do see the point with all the folks who use open loop. Yes you have control over bulk/absorption and float voltages but how do you control when and for how long the inverter uses one or the other. The inverter only knows "battery bank" voltage and determines an inaccurate SOC from that. Bulk/absorption normally uses a constant current charge and float uses a constant voltage charge. Controlling voltages alone does not entirely solve the charge issue, particularly in ensuring BMS SOC periodically gets reset as the batteries to get time to balance. You would also have to control when the inverter uses bulk/absorption or float and ultimately adjust based on cell and not battery voltages.
 
Back
Top