Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement of CVL-controller #882

Merged
merged 3 commits into from
Dec 17, 2023

Conversation

cflenker
Copy link
Contributor

@cflenker cflenker commented Nov 29, 2023

A big advantage of serialbattery-driver compared to a victron-system with a smartshun-system is, that the serialbus-driver sees every cell voltage and can react on bad balanced batteries.

Especially at the end of charging (close to 100%) the charging-current is usually controlled indirect by CVL (Charge Voltage Limitation).
Furthermore in Victron Systems with MPPTs and DC-Feed-In activated CVL is the only way to reduce charging current, because CCL (charge current limitation does only apply to Multis, but not to MPPTs.

So it is a very good feature of the driver, that CVL can be reduced if a single cell runs over MAX_CELL_VOLTAGE.
This is implemented today with a "penaltySum"-Method that is in fact a P-Controller.

I think an I-Controller fits better to the requirements of CVL-Controlling.
This is implemented with this PR.
With the switch CVL_ICONTROLLER_MODE the PenaltySum (CVL_ICONTROLLER_MODE=false) or a I-Controller (CVL_ICONTROLLER_MODE=True) can be choosen.

I made a test with each controller. With a power-supply I charged a single cell (cell no3) for 1.5h with 2Amps. So I got the cell3 about 3Ah higher than the rest of the 16s-Pack.
image

Then I charged the battery-pack to 100%. And the balancer got it right again.

Here is the result:

image

An I-Controller provides a calmer CVL and so gives the victron system time to adjust the charging-current to meet the CVL.

@mr-manuel
Copy link
Collaborator

Unfortunately I have no possibility to test this now in winter, but based on the graph it looks very good! If many can test this, I would remove the current method with the penalty voltages.

@codeworkx
Copy link
Contributor

I have been using it for about a week and have not noticed anything negative so far. Thanks for your work!

@cflenker
Copy link
Contributor Author

Hello @codeworkx, thank you a lot for your positiv reply. I am also using it for some time now on 2 Systems. Of cause i got only to 100% by planned charging in December. But for this I always see a much smoother behaviour.

@mr-manuel
Copy link
Collaborator

This PR is now merged and will replace the penalty sum voltage after a few months of testing. In the meanwhile it will be available as option.

@mr-manuel mr-manuel merged commit 4dd0e03 into Louisvdw:dev Dec 17, 2023
@cflenker
Copy link
Contributor Author

Hello @mr-manuel , thanks a lot. Happy to read this!

@mr-manuel
Copy link
Collaborator

Thank you for your contribution!

@mr-manuel mr-manuel mentioned this pull request Dec 17, 2023
@mr-manuel
Copy link
Collaborator

mr-manuel commented Dec 18, 2023

@cflenker now I tested it with loading the battery from the grid. The battery never reached the SOC_RESET_VOLTAGE, but only MAX_CELL_VOLTAGE. This is done in this lines:

self.soc_reset_battery_voltage = round(
utils.SOC_RESET_VOLTAGE * self.cell_count, 2
)
if self.soc_reset_requested:
self.max_battery_voltage = self.soc_reset_battery_voltage
else:
self.max_battery_voltage = round(
utils.MAX_CELL_VOLTAGE * self.cell_count, 2
)

Checking your changes you did not consider that. I made this changes to implement that: mr-manuel/venus-os_dbus-serialbattery@f52f21f

Will merge it after a few days of testing.

The curve looks very clean! Great work!

grafik

@cflenker
Copy link
Contributor Author

Hello @mr-manuel, sorry. You are right. I did not consider that. I will make a proposal to fix it tonight or tomorrow night. Thank you.

@mr-manuel
Copy link
Collaborator

mr-manuel commented Dec 18, 2023

I already fixed it ;-) the change is linked above

@cflenker
Copy link
Contributor Author

Thank you very much!!!

@Becker884
Copy link

with CVL_ICONTROLLER_MODE = True, will never be switched to float ?
I tried today, after successfull absorption to <10mV CVL stays at 3,43V (61,8V):
grafik

@mdkeil
Copy link

mdkeil commented Jan 29, 2024

Same to me.. 4h absorb with <10mv celldiff. I will switch back to CVL_ICONTROLLER_MODE = False for further testing.

@cflenker
Copy link
Contributor Author

Hello @mdkeil, hello @Becker884,
I do not think it has to do with the type of cvl-controller.
Maybe it has to do with: #895
Please try to set CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART to a higher value. Maybe 0.030V.

@mdkeil
Copy link

mdkeil commented Jan 30, 2024

I will try it out.

@mdkeil
Copy link

mdkeil commented Feb 7, 2024

Problem solved.. I had to setup a little voltagedrop, because with linear limitation enabled I never reached the maximum charge voltage.

@Becker884
Copy link

Becker884 commented Feb 7, 2024

can you show me please what you did set up?

@mdkeil
Copy link

mdkeil commented Feb 7, 2024

my config:

LOGGING = INFO

MAX_BATTERY_CHARGE_CURRENT = 100
MAX_BATTERY_DISCHARGE_CURRENT = 100

MIN_CELL_VOLTAGE   = 2.900
MAX_CELL_VOLTAGE   = 3.450
FLOAT_CELL_VOLTAGE = 3.375

VOLTAGE_DROP = 0.025

SOC_RESET_VOLTAGE = 3.500
SOC_RESET_AFTER_DAYS = 15

CVL_ICONTROLLER_MODE = True
LINEAR_LIMITATION_ENABLE = True
CVCM_ENABLE = True

CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART = 0.015
CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL = 0.010
;MAX_VOLTAGE_TIME_SEC = 1800

BMS_TYPE = Seplos

; Exclute this serial devices from the driver startup
; Example: /dev/ttyUSB2, /dev/ttyUSB4
EXCLUDED_DEVICES = /dev/ttyUSB0

; Charge current control management enable (True/False).
CCCM_SOC_ENABLE = True
; Discharge current control management enable (True/False).
DCCM_SOC_ENABLE = True

CC_SOC_LIMIT1 = 98
CC_SOC_LIMIT2 = 95
CC_SOC_LIMIT3 = 91

CC_CURRENT_LIMIT1_FRACTION = 0.15
CC_CURRENT_LIMIT2_FRACTION = 0.35
CC_CURRENT_LIMIT3_FRACTION = 0.50

@mr-manuel
Copy link
Collaborator

@cflenker for the purpose of completion could you explan what happens, if the value CVL_ICONTROLLER_FACTOR is changed to a bigger/smaller value?

@Albarge
Copy link

Albarge commented Apr 18, 2024

@cflenker for the purpose of completion could you explan what happens, if the value CVL_ICONTROLLER_FACTOR is changed to a bigger/smaller value?

Yeah, I'd like to know this too, as it would be good to understand what is a slower/ faster/ or higher / lower ratio of voltage limitation.

Also, testing 1.3.20240417dev today (I have 2 runner cells) I see the ICONTROLLER lower the CVL from 28v to 27.2v on one battery, but this isn't picked up by batteryaggregator which still shows 28v, so the system still calls for 28v across the three batteries. - Maybe a batteryaggregator problem though?

The CVL keeps decreasing on Battery 1 whilst cell voltage differential also decreases which seems counter intuitive, unless it's still trying to lower the stsem voltage but that's not being aggregated back to Venus:
icontroller

Battery 1:
Screenshot_20240418-175418

BatteryAggregator:
Screenshot_20240418-175448

@cflenker
Copy link
Contributor Author

Hello,
I'll try to explain the behaviour of CVL_ICONTROLLER_FACTOR. Most of it is already explained in config.default.ini:

;   2. I-Controller (CVL_ICONTROLLER_MODE = True)
;      An I-Controller tries to control the voltage of the highest cell to MAX_CELL_VOLTAGE + CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL.
;      (for example 3.45V+0.01V =3.46V). If the voltage of the highest cell is above this level, CVL is reduced. If the voltage is below, CVL is
;      increased until cellcount*MAX_CELL_VOLTAGE.
;      An I-Part of 0.2 V/Vs (CVL_ICONTROLLER_FACTOR) has proved to be a stable and fast controlling-behaviour.
;      This method is not as fast as the penalty_sum-Method but usually smoother and more stable against toggeling and has no stationary deviation.

So the CVL_ICONTROLLER_FACTOR controls how fast the CVL is lowered if one cell goes above MAX_CELL_VOLTAGE + CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL.
For example: If MAX_CELL_VOLTAGE=3.45V and CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL=0.01V and the actual highest cell voltage is 3.56V. Then the deviation is 0.1V. The deviation is multiplied with CVL_ICONTROLLER_FACTOR=0.2 V/Vs. So the CVL is reduced 0.02V per second.

@cflenker
Copy link
Contributor Author

This means:

  • The higher the value of CVL_ICONTROLLER_FACTOR the faster CVL is reduced with a given cell-voltage-overshoot.
  • Do not choose too high values for CVL_ICONTROLLER_FACTOR: this could make the controlling instable.

@Albarge
Copy link

Albarge commented Apr 18, 2024

Thanks, that makes it much clearer, so in your scenario above CVL_ICONTROLLER_FACTOR = 0.4 will reduce the voltage 0.4 V/second.

I'll just have to test another driver release to see why it didn't aggregate with multiple batteries, and maybe test different factors to catch my runner cells early.

@cflenker
Copy link
Contributor Author

With CVL_ICONTROLLER_FACTOR = 0.4 and a cell voltage overshoot of 0.1V the CVL will reduced 0.4*0.1 = 0.04V per Second.
Take care: I think a bug crept in with a cleanup-commit: #1038
I think this bug is fixed in the latest version of @mr-manuel repo. I am just about to test this latest nightly.

@mr-manuel
Copy link
Collaborator

mr-manuel commented Apr 19, 2024

I made the experience that the I-Controller works not so good when you are off grid with a PV inverter (on AC Out). In this case multiple cells can have a bigger voltage then max voltage and the I-Controller does not correct this and the mess starts. In this case the P-Controller (penalty sum) works better. I will add this node in the confile file.

@Albarge
Copy link

Albarge commented Apr 19, 2024

Ok thanks, I am off grid but only have DC MPPT's, I have changed over to P-Controller for now and will maybe test I-Controller when everything is running smoothly. I think it was B aggregator that doesn't currently accept the CVL changes and aggregate them, hopefully Pulquero can make it work :)

*Edit: BatteryAggregator v.3.0.51 > now has the option to allow CVL to aggregate multiple batteries for proper functioning of the Voltage Limiting with CVL-CONTROLLER, just add this to BatteryAggregator config.JSON:

"cvlMode": "min_when_balancing"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants