diy solar

diy solar

YamBMS JK-BMS-CAN with new Cut-Off Charging Logic (open-source)

No, there is a new yambms_cutoff_timer var since 1.4.1.
Yes, but the inverter offset substitution exists in both 1.3.2 and 1.4.1, doesn't it?

@ChrisG, I would recommend the latest version on Dev in this case. Being on the latest version of @Sleeper85's refinements mean it'll be easier for him to support.
I'll admit, I am not on the YAMBMS version yet.
 
Yes, but the inverter offset substitution exists in both 1.3.2 and 1.4.1, doesn't it?

@ChrisG, I would recommend the latest version on Dev in this case. Being on the latest version of @Sleeper85's refinements mean it'll be easier for him to support.
I'll admit, I am not on the YAMBMS version yet.
Thanks. Will clone his current dev repo down later and see if the inverter offset is in 1.4.1. Appreciate all the support. I split one of my 2p16s packs just to test this out. It’s awesome.
 
Thanks. Will clone his current dev repo down later and see if the inverter offset is in 1.4.1. Appreciate all the support. I split one of my 2p16s packs just to test this out. It’s awesome.

Here is what I use at home.

YAML:
      # Inverter Offset V. allows you to correct the inverter charging voltage.
      # Requested Charging Voltage = Bulk. V + Inverter Offset V.
      yambms_inverter_offset_v: "0.1"
      yambms_inverter_offset_v_slider: 'false' # true: the slider is hidden, false: the slider is available
 
Here is what I use at home.

YAML:
      # Inverter Offset V. allows you to correct the inverter charging voltage.
      # Requested Charging Voltage = Bulk. V + Inverter Offset V.
      yambms_inverter_offset_v: "0.1"
      yambms_inverter_offset_v_slider: 'false' # true: the slider is hidden, false: the slider is available
Thanks. Don’t have web enabled in YAML so can’t OTA update it. Won’t be back onsite till later next week.

Just looked at the single BMS code I was running successfully till multi version. The inverter offset was 0.0 in the single BMS code which worked perfectly fine. Not sure of why it's impacting me in multi version.
 
Last edited:
I see the problem between the Bulk Voltage Slider setting and everything else. Here are my metrics:

YamBMS 1 Bulk Voltage: 55.6v (SLIDER)

Inverter Reading: 55.4v
JK BMS 1: 55.44v
JK BMS 1 SOC: 100%
JK BMS 1 Cell Delta: .004
JK BMS 2: 55.43v
JK BMS 2 SOC: 100%
JK BMS 2 Cell Delta: .004
YAMBMS YamBMS 1 Total Voltage: 55.43v
YAMBMS YamBMS1 Battery SOC: 98%

Separate Victron Shunt between Inverter and BMS: 55.43v

Not sure what to change here to get this in sync.

If we analyze your data it seems that all your devices are well calibrated but you ask for a charge at 55.6V but you get 55.4V so it is possible that the charging conditions will never be met because you will never reach the cutoff voltage, in this situation you can wait a very long time.

The new version 1.4.1 adds a new `Cut-Off` status which will show you that you have reached the end of charging phase without satisfying all the conditions for it to end but in any case you have well reached the V. and A cutoff.

If that's the problem then the voltage offset will be able to solve it but I don't know why it worked well before in 16S2P without using a V offset.

As soon as you see the status `Cut-Off` you are in this part of the code.

So even to trigger the `EOC timer` of 30min you must satisfy the cutoff conditions during the entire end of charge period, if the status changes from `Cut-Off` to `Bulk` or other then the timers will be killed. This version of the charging logic is slightly different of the old single BMS version. I removed the old counter based system and introduced this two new timers.

cutoff.png

Regarding OTA updates, you can do them from the command line.
 
Last edited:
From memory there were no timers in the old version 1.17.4. The first counter was introduced by @MrPablo in version 1.17.5.

The 60s timer can also be decreased to 1s or whatever value you wish. It is used to verify that the balancing is actually complete.
 
I VPN'd into a local Mac mini and setup a quick dev environment to install 1.4.1 through OTA esphome command line, worked fine. Worse case it would have just been in permanent grid bypass if it could not recognize the battery, even then I can set to voltage mode. @Sleeper85 one thing to add to the readme on dev env setup (for MacOS anyway) is: Install Setup Tools: pip3 install setuptools, just a suggestion to have 'pkg_manager'. After the flash, looked liked the stars aligned and inverter started discharging. Inverter is now set to discharge to 90% and start charging again, will let you all know how it goes. I did have the inverter offset to 0.1 and have the slider available to tweak if needed.

Again, thank all of you for the support.
 
Can now confirm the latest code (multi-ble with MCP2515 CAN) works EG4 6000xp (LuxPower) and two battery packs. It's able to hit target voltage (55.4), SOC, and cells are balanced. Just going to let this cycle for a few days and will report back if any issues. Hard to catch the exact moment of cutover from charge to discharge. If this works I'll add the third JK to the mix next week.
1721358414135.png
1721358481645.png
1721358574177.png
 
@MrPablo @silverstone and all

There was a small bug (fixed) in the YAML AutoCVL, the value of CVL was not saved in the global variable and therefore this function had no effect.
I realized this while implementing the function proposed in issue #44.

So I decided to implement the AutoCVL Boost Charge V. function and it's really great. This allows you to charge your battery more quickly by increasing the charging voltage which will then be reduced automatically by the AutoCVL function developed by @MrPablo in order to reach the target (Bulk voltage + Inverter Offset V.)

So this is a very good reason to use this function.

Only the YAML AutoCVL has been changed, I'm publishing it as soon as my test is finished and I've reached the end of load.

@MrPablo for info this multi-bms version also works with a single BMS (if you want to test).

Thanks again to @MrPablo for the work done.

Capture d’écran du 2024-07-19 13-04-50.png
 
Last edited:
I'll be very interested to see requested charge voltage over time, alongside max cell voltage if you get a chance.
Sadly, this is a case where I'm not sure if I can test effectively with my inverter, it's a bit crap at respecting CVL.
 
I'll be very interested to see requested charge voltage over time, alongside max cell voltage if you get a chance.
Sadly, this is a case where I'm not sure if I can test effectively with my inverter, it's a bit crap at respecting CVL.

Ok that's a few things I could show after a full charge.
 
Still working with multiple discharge and charge (90-100%) sessions. @Sleeper85 as you can see I am getting Cut-Off in the charging status. So it seems all conditions are not met for complete charging but the timer kicks in anyway. My Delta is under my trigger amount and voltage is spot on.

1721389711021.png
 
Last edited:
Still working with multiple discharge and charge (90-100%) sessions. @Sleeper85 as you can see I am getting Cut-Off in the charging status. So it seems all conditions are not met for complete charging but the timer kicks in anyway. My Delta is under my trigger amount and voltage is spot on.

View attachment 229700

No, it's the opposite.

Status Cut-Off all conditions are met to enter the last charging phase before EOC.
 
No, it's the opposite.

Status Cut-Off all conditions are met to enter the last charging phase before EOC.
Ahh ok. So everything is working as expected now. Thanks. I’ve gone through three discharge/charge cycles at this point since my charge SOC is set to 90%. Going to let it continue to run but so far so good.
 
Charge/Discharge has worked great from 90%-100% throughout last night and today. I set inverter to go down to 30% before a charge cycle and now something else is going on. The current swings wildly between JK1 and JK2 for charging as you can see in the graph related to voltage. Then at 21:11, Got a YAMBMS alarm and Bitmask changed to 16384 then it just discharges. You can also see YAMBMS SOC drops quickly from 48% to 2%.

1721438980156.png

For reference, here is the 90 to 100% SOC Charge view:
1721439092913.png
 
It started charging again but same behavior. Interesting is the voltage and SOC difference between JK1 and JK2.
1721439718922.png



Code:
yambms YamBMS 1 Warning  changed to Alarm
9:42:26 PM - 2 minutes ago
yambms YamBMS 1 Alarm  changed to Warning
9:42:26 PM - 2 minutes ago
yambms YamBMS 1 BMS combined changed to 1
9:42:26 PM - 2 minutes ago
yambms YamBMS 1 Cell Count (Σ)  changed to 16
9:42:26 PM - 2 minutes ago
yambms YamBMS 1 BMS in alarm  changed to 1
9:42:25 PM - 2 minutes ago
yambms YamBMS 1 Errors Bitmask Warning changed to 16384
9:42:25 PM - 2 minutes ago
yambms YamBMS 1 Min Voltage Cell changed to 111
9:42:25 PM - 2 minutes ago
yambms YamBMS 1 Charging Cycles (Ø) changed to 1
9:42:25 PM - 2 minutes ago
yambms Uptime Human Readable  changed to 01d 02h 40m 10s
9:42:25 PM - 2 minutes ago
yambms JK-BMS 2 Can be combined  turned off
9:42:25 PM - 2 minutes ago
yambms JK-BMS 2 Combine Availability turned off
9:42:25 PM - 2 minutes ago
yambms JK-BMS 2 charging  turned off
9:42:24 PM - 2 minutes ago
yambms Uptime Human Readable  changed to 01d 02h 40m 05s
9:42:20 PM - 2 minutes ago
 

Attachments

  • IMG_5710.jpeg
    IMG_5710.jpeg
    80.2 KB · Views: 2
Last edited:
@ChrisG

Concerning the soc change from 48% to 2% here is the responsible code:

C:
float soc = id(${yambms_id}_state_of_charge).state;
float min_cell_v = id(${yambms_id}_min_cell_voltage).state;
float cell_uvpr = id(${yambms_id}_cell_uvpr).state;
if (min_cell_v <= cell_uvpr) return 0;                          // Real 0% Sending 0%
else if (soc < 1) return 2;                                     // False 0% sending 2%
else if (soc < 99) return soc;                                  // SOC < 99% => Sending BMS SOC
// Useful for some inverters, will not send 100% until charging is complete
else if (id(${yambms_id}_eoc) == true) return soc;              // End Of Charge => Sending BMS SOC
else return 98;

Then your JK-BMS 2 was decombined because it seems to have been in alarm. Can you show the error_bitmask of JK BMS 2?
We can see that the YamBMS soc is that of JK-BMS 1 because JK-BMS 2 is decombined.

I cannot analyze your data further at the moment, sorry.
 
Error bitmask of JK2 is 16,384. Both JKs have Max charge current set to 20a. What I see happening is more than 20a is being sent to JK2 which is causing the alarm and disconnect.
 

Attachments

  • IMG_5712.jpeg
    IMG_5712.jpeg
    72.1 KB · Views: 3
  • IMG_5711.jpeg
    IMG_5711.jpeg
    74.3 KB · Views: 3
  • IMG_5713.jpeg
    IMG_5713.jpeg
    101 KB · Views: 2

diy solar

diy solar
Back
Top