Sleeper85 / esphome-yambms

Yet another multi-BMS Merging Solution
GNU General Public License v3.0
35 stars 2 forks source link

Auto CCL / DCL functions with JK-PB and new JK-B #11

Open Sleeper85 opened 4 hours ago

Sleeper85 commented 4 hours ago

@MrPabloUK

The JK-PB and new JK-B (JK-B2A8S20P) found on software V11.54 must have OVPR and UVPR values ​​between the SOC 100% and SOC 0% values ​​which poses a problem with the Auto CCL and DCL functions which rely on these parameters.

OVPR_UVPR

MrPabloUK commented 3 hours ago

https://github.com/Sleeper85/esphome-yambms/issues/5#issuecomment-2465844332

I was originally planning to adjust the Auto CCL to work as per the comment above, although now I am thinking the below would be more consistent: Auto CCL - use midpoint of OVPR and OVP (in this case, 3.55v with rounding). Auto DCL - use midpoint of 0% SOC and UVP (in this case, 2.90v with rounding).

We can't use the 0% SOC or 100% SOC values, as not all BMSs will have that.

I can make that change pretty easily if you agree with the approach, @Sleeper85.

Sleeper85 commented 3 hours ago

I think we can continue to use UVPR with Auto DCL, it's not really a problem to decrease the Amps just before 0% ? Furthermore UVPR is also used to calculate the max discharge voltage.

For Auto CCL, some BMS don't provide these values (OVP, OVPR, UVPR) ​​like Seplos V1 V2 and JDB (I need to add template sensors for missing values). I recently removed the OVP sensors because it was no longer used in the code.

So I wonder if you could do like with Auto CVL ?

            double balance_delta = id(${yambms_id}_balance_trigger_voltage).state;
            double max_allowed_voltage = cell_bulk_v + balance_delta;

For Auto CVL and CCL, we could even just replace balance_trigger_v with a fixed value like 0.005 ? (this will be one less sensor template to configure).

A few weeks ago, after a discussion with @shvmm we removed everything related to Absorption because it wasn't really used and it was a source of confusion about what the absorption_offset_v was for.

The only thing absorption_offset_v was used for was to display the Absorption status at a given time but also in the formula to calculate the Cut-Off Voltage. After doing several simulations for all chemistries I replaced it with a fixed value of 0.005, see the Charging Logic.

What do you think?

MrPabloUK commented 3 hours ago

The downside of setting DCL to 0 amps at UVPR is that it's possible for the BMS to still return a SOC >0% due to SOC drift. Ideally, I'd like to ensure SOC is reset in that situation so that the user can't be confused about why the battery is no longer discharging. Same with 100% reset.

I see your point about wanting to remove sensors where possible. I do want to retain the use of balance_trigger_v where possible, as a user may prefer a 10mV range, or perhaps even more. Setting it to a fixed 5mV would result in a very tight range for the PI controller to maintain.

If OVP has to be removed, I would prefer something like this for AutoCCL:

            double balance_delta_multiplier = id(${yambms_id}_balance_trigger_voltage).state * 10;
            double max_allowed_voltage = cell_bulk_v + balance_delta_multiplier;

Using a 10x multiplier would result in 3.549v as the max allowable voltage, giving a good range for the current to be tapered down smoothly. The potential issue is that if someone sets OVP to 3.55v then there's a good chance BMS protection will kick in.

Sleeper85 commented 1 hour ago

Otherwise replace OVPR and UVPR with (OVP - offset_v) and (UVP + offset_v ) ?

I could also use (UVP + offset_v ) for the max discharge voltage and not use UVPR anymore.

I connected to a French user via TeamViewer this afternoon because his max charging current was yo-yoing with Auto CCL enabled, here is his JK-PB config.

What kind of offset_v could we use ? It could be a fixed variable in the YAML.

image

MrPabloUK commented 1 hour ago

It's not a surprise that the requested CCL was bouncing around. With the current logic, having bulk above OVPR is like driving with your feet on the brake and accelerator at the same time.

What about replacing OVPR with ((bulk + OVP) /2)? We still remove one sensor, plus it will prevent the oscillation of CCL as bulk is approached. No need for a fixed offset that might clash with other settings.

UVPR could be replaced with (UVP + 0.1).

Alternatively, we might be able to use UVP and OVP directly. I would just need to adjust the curve parameters to adjust the rate of current reduction, ensuring a flat section of 0 amps before hitting protection limits. I can test that out, but not until Saturday.