Calculation of CVL_ICONTROLLER has got corrupted.
cflenker opened this issue · comments
Describe the bug
Hello @mr-manuel,
Yesterday I installed the latest release of the driver on my friends system and the CVL_ICONTROLLER did not work correctly.
I am afraid the commit 9635344 corrupted the CVL_ICONTROLLER.
You renamed controlvoltage
to control_voltage
.
But controlvoltage
kept the result of the ICONTROLLER whereas control_voltage
kept the result of the penalty-sum-algorithm. (Sorry for me using so faulty names.)
Using the same variable for both leads to overwriting the ICONTROLLER-result with the penaltysum-Result.
It would be nice if you could fix that.
Thank's a lot! Christian
How to reproduce
Reach the MAX_CELL_VOLTAGE to activate the CVL_CONTROLLER
Expected behavior
CVL_ICONTROLLER working in a smooth way
Driver version
1.2.20240408
Venus OS device type
Cerbo GX
Venus OS version
3.30
BMS type
JKBMS / Heltec BMS
Cell count
16
Battery count
1
Connection type
Serial USB adapter to RS485
Config file
[DEFAULT]
; If you want to add custom values/settings, then check the values/settings you want to change in "config.default.ini"
; and insert them below to persist future driver updates.
; Example (remove the semicolon ";" to uncomment and activate the value/setting):
; MAX_BATTERY_CHARGE_CURRENT = 50.0
; MAX_BATTERY_DISCHARGE_CURRENT = 60.0
; --------- Battery Current limits ---------
MAX_BATTERY_CHARGE_CURRENT = 80.0
MAX_BATTERY_DISCHARGE_CURRENT = 80.0
; --------- Cell Voltages ---------
; Description: Cell min/max voltages which are used to calculate the min/max battery voltage
; Example: 16 cells * 3.45V/cell = 55.2V max charge voltage. 16 cells * 2.90V = 46.4V min discharge voltage
MIN_CELL_VOLTAGE = 2.900
; Max voltage can seen as absorption voltage
; CF: MAX_CELL_VOLTAGE auf 3.55 gesetzt, damit penalty nicht zu frueh greift
; und die CVL runterholt was zu einem starken toggeln führt
; Die wirkliche Absobtion-Spannung wird über DVCC auf 55.2V begrenzt.
MAX_CELL_VOLTAGE = 3.450
FLOAT_CELL_VOLTAGE = 3.375
;
;
;
;
; Specify in seconds how often the linear values should be recalculated
LINEAR_RECALCULATION_EVERY = 60
; Specify in percent when the linear values should be recalculated immediately
; Example: 5 for a immediate change, when the value changes by more than 5%
LINEAR_RECALCULATION_ON_PERC_CHANGE = 5
; --------- Charge Voltage limitation (affecting CVL) ---------
; Description: Limit max charging voltage (MAX_CELL_VOLTAGE * cell count), switch from max voltage to float
; voltage (FLOAT_CELL_VOLTAGE * cell count) and back
; False: Max charging voltage is always kept
; True: Max charging voltage is reduced based on charge mode
; Step mode: After max voltage is reached for MAX_VOLTAGE_TIME_SEC it switches to float voltage. After
; SoC is below SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT it switches back to max voltage.
; Linear mode: After max voltage is reachend and cell voltage difference is smaller or equal to
; CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL it switches to float voltage after 300 (fixed)
; additional seconds.
; After cell voltage difference is greater or equal to CELL_VOLTAGE_DIFF_TO_RESET_VOLTAGE_LIMIT
; OR
; SoC is below SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT
; it switches back to max voltage.
; Example: The battery reached max voltage of 55.2V and hold it for 900 seconds, the the CVL is switched to
; float voltage of 53.6V to don't stress the batteries. Allow max voltage of 55.2V again, if SoC is
; once below 90%
; OR
; The battery reached max voltage of 55.2V and the max cell difference is 0.010V, then switch to float
; voltage of 53.6V after 300 additional seconds to don't stress the batteries. Allow max voltage of
; 55.2V again if max cell difference is above 0.080V or SoC below 90%.
; Charge voltage control management enable (True/False).
CVCM_ENABLE = True
; -- CVL reset based on cell voltage diff (linear mode)
; Specify cell voltage diff where CVL limit is kept until diff is equal or lower
CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL = 0.010
; Specify cell voltage diff where MAX_VOLTAGE_TIME_SEC restarts if diff is bigger
CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART = 0.013
; Specify cell voltage diff where CVL limit is reset to max voltage, if value get above
; the cells are considered as imbalanced, if the cell diff exceeds 5% of the nominal cell voltage
; e.g. 3.2 V * 5 / 100 = 0.160 V
CELL_VOLTAGE_DIFF_TO_RESET_VOLTAGE_LIMIT = 0.080
; -- CVL reset based on SoC option (step mode & linear mode)
; Specify how long the max voltage should be kept
; Step mode: If reached then switch to float voltage
; Linear mode:
; * Cells are judged to be balanced when max voltage is reached and cell difference is below CELL_VOLTAGE_DIFF_TO_RESET_VOLTAGE_LIMIT
; for FLOAT_TRANSITION_DEBOUNCE_SEC seconds
; * If cells are judged to be balanced keep max voltage for further MAX_VOLTAGE_TIME_SEC seconds
;FLOAT_TRANSITION_DEBOUNCE_SEC = 900
MAX_VOLTAGE_TIME_SEC = 1800
; Specify SoC where CVL limit is reset to max voltage, if value gets below
SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT = 90
; --------- SOC limitation (affecting CCL/DCL) ---------
; Description: Maximal charge / discharge current will be increased / decreased depending on State of Charge,
; see CC_SOC_LIMIT1 etc.
; Example: The SoC limit will be monitored to control the currents.
; Charge current control management enable (True/False).
CCCM_SOC_ENABLE = False
; Discharge current control management enable (True/False).
DCCM_SOC_ENABLE = False
; --------- Cell Voltage limitation (affecting CVL) ---------
; This function prevents a bad balanced battery to overcharge the cell with the highest voltage and the bms to
; switch off because of overvoltage of this cell.
;
; Example:
; 15 cells are at 3.4v, 1 cell is at 3.6v. Total voltage of battery is 54.6v and the Victron System sees no reason to
; lower the charging current as the control_voltage (Absorbtion Voltage) ist 55.2v
; In this case the Cell Voltage limitation kicks in and lowers the control_voltage to keep it close to the MAX_CELL_VOLTAGE.
;
; In theory this can also be done with CCL, but doing it with CVL has 2 advantages:
; - In a well balanced system the current can be kept quite high till the end of charge by using MAX_CELL_VOLTAGE for charging.
; - In systems with MPPTs and DC-feed-in activated the victron systems do not respect CCL, so CVL is the only way to prevent the
; highest cell in a bad balanced system from overcharging.
;
; There are 2 methods implemented to calculate CVL:
; 1. PenaltySum-Method (CVL_ICONTROLLER_MODE = False)
; The voltage-overshoot of all cells that exceed MAX_CELL_VOLTAGE is summed up and the control voltage is lowered by this "penaltysum".
; This is calculated every LINEAR_RECALCULATION_EVERY seconds.
; 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 PenaltySum-Method but usually smoother and more stable against toggeling and has no stationary deviation.
CVL_ICONTROLLER_MODE = True
CVL_ICONTROLLER_FACTOR = 0.2
; --------- SOC calculation ---------
; Description: Calculate the SOC in the driver. Do not use the SOC reported by the BMS
; SOC_CALCULATION:
; True: Calc SOC in the driver, do not use SOC reported from BMS
; - The SOC is calculated by integration of the current reported by the BMS
; - The current reported from the BMS can be corrected by
; the map (SOC_CALC_CURRENT_REPORTED_BY_BMS, SOC_CALC_CURRENT_MEASURED_BY_USER)
; - The SOC is set to 100% if the following conditions apply for at least SOC_RESET_TIME seconds:
; * Current is lower than SOC_RESET_CURRENT amps
; * Sum of cell voltages >= self.max_battery_voltage - VOLTAGE_DROP
; - The calculated SOC is stored in dbus to persist a driver restart
; False: Use SOC reported from BMS (none of the other parameters apply)
; More info: https://github.com/Louisvdw/dbus-serialbattery/pull/868
SOC_CALCULATION = True
SOC_RESET_CURRENT = 7
SOC_RESET_TIME = 60
SOC_CALC_CURRENT_REPORTED_BY_BMS = -300, 300
SOC_CALC_CURRENT_MEASURED_BY_USER = -300, 300
; CUSTOM_BATTERY_NAMES = /dev/ttyUSB0:JKBMS1_Flenker,/dev/ttyUSB1:JKBMS2_Flenker
; --------- Battery monitor specific settings ---------
; If you are using a SmartShunt or something else as a battery monitor, the battery voltage reported
; from the BMS and SmartShunt could differ. This causes, that the driver never goapplies the float voltage,
; since max voltage is never reached.
; Example:
; cell count: 16
; MAX_CELL_VOLTAGE = 3.45
; max voltage calculated = 16 * 3.45 = 55.20
; CVL is set to 55.20 and the battery is now charged until the SmartShunt measures 55.20 V. The BMS
; now measures 55.05 V since there is a voltage drop of 0.15 V. Since the dbus-serialbattery measures
; 55.05 V the max voltage is never reached for the driver and max voltage is kept forever.
; Set VOLTAGE_DROP to 0.15
VOLTAGE_DROP = 0.05
Relevant log output
not relevant
Any other information that may be helpful
No response
Ohhh, it seems to be fixed on master of https://github.com/mr-manuel/venus-os_dbus-serialbattery.
I just updated the system to 1.3.20240417dev
. Let's see if this works properly.
Just let me know, there was a bit a mess which I cleaned up.
Fixed with v1.3.20240417dev
.