Skip to content

Commit

Permalink
updated config.default.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed May 1, 2023
1 parent f95dc05 commit 52fdc4a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
37 changes: 18 additions & 19 deletions etc/dbus-serialbattery/config.default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAX_BATTERY_DISCHARGE_CURRENT = 60.0
; Choose the mode for voltage / current limitations (True / False)
; False is a step mode. This is the default with limitations on hard boundary steps
; True is a linear mode. For CCL and DCL the values between the steps are calculated for smoother values (by WaldemarFech)
; For CVL the penalties are only applied, if the cell voltage reaches the penalty voltage
; For CVL max battery voltage is calculated dynamically in order that the max cell voltage is not exceeded
LINEAR_LIMITATION_ENABLE = False

; Specify in seconds how often the linear values should be recalculated
Expand All @@ -16,14 +16,21 @@ LINEAR_RECALCULATION_EVERY = 60
; 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) and switch from max voltage to float voltage (FLOAT_CELL_VOLTAGE * cell count)
; after max voltage is reached for MAX_VOLTAGE_TIME_SEC. It switches back to max voltage after SoC is below SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT
; If LINEAR_LIMITATION_ENABLE is set to True then penalty voltages are applied
; Description: Limit max charging voltage (MAX_CELL_VOLTAGE * cell count), switch from max voltage to float voltage (FLOAT_CELL_VOLTAGE * cell count) and back
; 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
; 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.050V
; Charge voltage control management enable (True/False).
CVCM_ENABLE = False
CVCM_ENABLE = True

; -- Cell Voltages
; Description: Cell min/max voltages which are used to calculate the min/max battery voltage
Expand All @@ -33,22 +40,14 @@ MIN_CELL_VOLTAGE = 2.90
MAX_CELL_VOLTAGE = 3.45
FLOAT_CELL_VOLTAGE = 3.35

; ----- DEPRECATED | start
; -- Penalty Voltages
; NOTE: works only when LINEAR_LIMITATION_ENABLE = True
; More details can be found here: https://github.com/Louisvdw/dbus-serialbattery/issues/297#issuecomment-1327142635
; If the cell voltage reaches 3.48V, then reduce actual battery-voltage by 0.01V
; If the cell voltage goes over 3.6V, then the maximum penalty will not be exceeded
; There will be a sum of all penalties for each cell, which exceeds the limits
; NOTE: The first value of PENALTY_AT_CELL_VOLTAGE has to be at least MAX_CELL_VOLTAGE + the first value of PENALTY_BATTERY_VOLTAGE,
; else the FLOAT_CELL_VOLTAGE is never set. Additionally the battery voltage has to reach max voltage and all cells has to be below penalty voltage to switch to float voltage.
; PENALTY_AT_CELL_VOLTAGE = 3.48, 3.55, 3.6
; this voltage will be subtracted
; PENALTY_BATTERY_VOLTAGE = 0.01, 1.0, 2.0
; ----- DEPRECATED | end
; -- 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 CVL limit is reset to max voltage, if value get above
CELL_VOLTAGE_DIFF_TO_RESET_VOLTAGE_LIMIT = 0.050

; -- CVL reset based on SoC option (step mode)
; Specify how long the max voltage should be kept if reached, then switch to float voltage
; Specify how long the max voltage should be kept, if reached then switch to float voltage
MAX_VOLTAGE_TIME_SEC = 900
; Specify SoC where CVL limit is reset to max voltage, if value gets below
SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT = 90
Expand Down
6 changes: 3 additions & 3 deletions etc/dbus-serialbattery/dbushelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ def publish_battery(self, loop):
if self.error_count >= 60:
loop.quit()

# This is to mannage CCL\DCL
self.battery.manage_charge_current()

# This is to mannage CVCL
self.battery.manage_charge_voltage()

# This is to mannage CCL\DCL
self.battery.manage_charge_current()

# publish all the data from the battery object to dbus
self.publish_dbus()

Expand Down

0 comments on commit 52fdc4a

Please sign in to comment.