Louisvdw / dbus-serialbattery

Battery Monitor driver for serial battery in VenusOS GX systems
MIT License
540 stars 165 forks source link

Daly BMS - Incorrect display which cell is balanced #752

Closed centro-max closed 8 months ago

centro-max commented 1 year ago

Describe the bug

For me, only the 1st cell is shown in color, not the critical cell. I've noticed this for many driver versions. Min-Max-Cell

How to reproduce

Steps to reproduce the behavior:

  1. Go to "Cell-Voltages"
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

It would be nice if the minimum and maximum cell voltages were displayed

Driver version

1.0.20230711beta

Venus OS device type

Raspberry Pi

Venus OS version

3.01

BMS type

Daly Smart BMS

Cell count

16

Connection type

Serial USB adapter to TTL

Config file

[DEFAULT]

; --------- Battery Current limits ---------
MAX_BATTERY_CHARGE_CURRENT    = 175.0
MAX_BATTERY_DISCHARGE_CURRENT = 350.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)
MAX_CELL_VOLTAGE   = 3.450
; Float voltage (can be seen as resting voltage)
FLOAT_CELL_VOLTAGE = 3.375

; Bulk voltage (may be needed to reset the SoC to 100% once in a while for some BMS)
; Has to be higher as the MAX_CELL_VOLTAGE
BULK_CELL_VOLTAGE  = 3.650
; Specify after how many days the bulk voltage should be reached again
; The timer is reset when the bulk voltage is reached
; Leave empty if you don't want to use this
; Example: Value is set to 15
; day 1: bulk reached once
; day 16: bulk reached twice
; day 31: bulk not reached since it's very cloudy
; day 34: bulk reached since the sun came out
; day 49: bulk reached again, since last time it took 3 days to reach bulk voltage
BULK_AFTER_DAYS =

; --------- Bluetooth BMS ---------
; Description: List the Bluetooth BMS here that you want to install
; -- Available Bluetooth BMS:
; Jkbms_Ble, LltJbd_Ble
; Example:
;     1 BMS: Jkbms_Ble C8:47:8C:00:00:00
;     3 BMS: Jkbms_Ble C8:47:8C:00:00:00, Jkbms_Ble C8:47:8C:00:00:11, Jkbms_Ble C8:47:8C:00:00:22
BLUETOOTH_BMS =

; --------- BMS disconnect behaviour ---------
; Description: Block charge and discharge when the communication to the BMS is lost. If you are removing the
;              BMS on purpose, then you have to restart the driver/system to reset the block.
; False: Charge and discharge is not blocked on BMS communication loss
; True: Charge and discharge is blocked on BMS communication loss, it's unblocked when connection is established
;       again or the driver/system is restarted
BLOCK_ON_DISCONNECT = False

; --------- Charge mode ---------
; 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 max battery voltage is calculated dynamically in order that the max cell voltage is not exceeded
LINEAR_LIMITATION_ENABLE = True

; 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 = False

; -- 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
; 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: If cells are balanced keep max voltage for further MAX_VOLTAGE_TIME_SEC seconds
MAX_VOLTAGE_TIME_SEC = 900
; Specify SoC where CVL limit is reset to max voltage
;     Step mode: If SoC gets below
;     Linear mode: If cells are unbalanced or if SoC gets below
SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT = 80

; --------- Cell Voltage Current limitation (affecting CCL/DCL) ---------
; Description: Maximal charge / discharge current will be in-/decreased depending on min and max cell voltages
; Example: 18 cells * 3.55V/cell = 63.9V max charge voltage
;          18 cells * 2.70V/cell = 48.6V min discharge voltage
;          But in reality not all cells reach the same voltage at the same time. The (dis)charge current
;          will be (in-/)decreased, if even ONE SINGLE BATTERY CELL reaches the limits

; Charge current control management referring to cell-voltage enable (True/False).
CCCM_CV_ENABLE = False
; Discharge current control management referring to cell-voltage enable (True/False).
DCCM_CV_ENABLE = False

; Set steps to reduce battery current
; The current will be changed linear between those steps if LINEAR_LIMITATION_ENABLE is set to True
CELL_VOLTAGES_WHILE_CHARGING   = 3.55, 3.50, 3.45, 3.30
MAX_CHARGE_CURRENT_CV_FRACTION =    0, 0.05,  0.5,    1

CELL_VOLTAGES_WHILE_DISCHARGING   = 2.70, 2.80, 2.90, 3.10
MAX_DISCHARGE_CURRENT_CV_FRACTION =    0,  0.1,  0.5,    1

; --------- Temperature limitation (affecting CCL/DCL) ---------
; Description: Maximal charge / discharge current will be in-/decreased depending on temperature
; Example: The temperature limit will be monitored to control the currents. If there are two temperature senors,
;          then the worst case will be calculated and the more secure lower current will be set.
; Charge current control management referring to temperature enable (True/False).
CCCM_T_ENABLE = False
; Charge current control management referring to temperature enable (True/False).
DCCM_T_ENABLE = False

; Set steps to reduce battery current
; The current will be changed linear between those steps if LINEAR_LIMITATION_ENABLE is set to True
TEMPERATURE_LIMITS_WHILE_CHARGING = 0,   2,   5,  10,  15, 20, 35,  40, 55
MAX_CHARGE_CURRENT_T_FRACTION     = 0, 0.1, 0.2, 0.4, 0.8,  1,  1, 0.4,  0

TEMPERATURE_LIMITS_WHILE_DISCHARGING = -20,   0,   5,  10, 15, 45, 55
MAX_DISCHARGE_CURRENT_T_FRACTION     =   0, 0.2, 0.3, 0.4,  1,  1,  0

; --------- 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

; Charge current SoC limits
CC_SOC_LIMIT1 = 98
CC_SOC_LIMIT2 = 95
CC_SOC_LIMIT3 = 91

; Charge current limits
CC_CURRENT_LIMIT1_FRACTION = 0.1
CC_CURRENT_LIMIT2_FRACTION = 0.3
CC_CURRENT_LIMIT3_FRACTION = 0.5

; Discharge current SoC limits
DC_SOC_LIMIT1 = 10
DC_SOC_LIMIT2 = 20
DC_SOC_LIMIT3 = 30

; Discharge current limits
DC_CURRENT_LIMIT1_FRACTION = 0.1
DC_CURRENT_LIMIT2_FRACTION = 0.3
DC_CURRENT_LIMIT3_FRACTION = 0.5

; --------- Time-To-Go ---------
; Description: Calculates the time to go shown in the GUI
;              Recalculation is done based on TIME_TO_SOC_RECALCULATE_EVERY
TIME_TO_GO_ENABLE = False

; --------- Time-To-Soc ---------
; Description: Calculates the time to a specific SoC
; Example: TIME_TO_SOC_POINTS = 50, 25, 15, 0
;          6h 24m remaining until 50% SoC
;          17h 36m remaining until 25% SoC
;          22h 5m remaining until 15% SoC
;          28h 48m remaining until 0% SoC
; Set of SoC percentages to report on dbus and MQTT. The more you specify the more it will impact system performance.
; [Valid values 0-100, comma separated list. More that 20 intervals are not recommended]
; Example: TIME_TO_SOC_POINTS = 100, 95, 90, 85, 75, 50, 25, 20, 10, 0
; Leave empty to disable
TIME_TO_SOC_POINTS =
; Specify TimeToSoc value type [Valid values 1, 2, 3]
; 1 Seconds
; 2 Time string <days>d <hours>h <minutes>m <seconds>s
; 3 Both seconds and time string "<seconds> [<days>d <hours>h <minutes>m <seconds>s]"
TIME_TO_SOC_VALUE_TYPE = 1
; Specify in seconds how often the TimeToSoc should be recalculated
; Minimum are 5 seconds to prevent CPU overload
TIME_TO_SOC_RECALCULATE_EVERY = 60
; Include TimeToSoC points when moving away from the SoC point [Valid values True, False]
; These will be as negative time. Disabling this improves performance slightly
TIME_TO_SOC_INC_FROM = False

; --------- Additional settings ---------
; Specify one or more BMS types to load else leave empty to try to load all available
; -- Available BMS:
; Daly, Ecs, HeltecModbus, HLPdataBMS4S, Jkbms, Lifepower, LltJbd, Renogy, Seplos
; -- Available BMS, but disabled by default (just enter one or more below and it will be enabled):
; ANT, MNB, Sinowealth
BMS_TYPE = Daly

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

; Enter custom battery names here or change it over the GUI
; Example:
;     /dev/ttyUSB0:My first battery
;     /dev/ttyUSB0:My first battery,/dev/ttyUSB1:My second battery
CUSTOM_BATTERY_NAMES =

; Auto reset SoC
; If on, then SoC is reset to 100%, if the value switches from absorption to float voltage
; Currently only working for Daly BMS
AUTO_RESET_SOC = True

; Publish the config settings to the dbus path "/Info/Config/"
PUBLISH_CONFIG_VALUES = 1

; Select the format of cell data presented on dbus [Valid values 0,1,2,3]
; 0 Do not publish all the cells (only the min/max cell data as used by the default GX)
; 1 Format: /Voltages/Cell (also available for display on Remote Console)
; 2 Format: /Cell/#/Volts
; 3 Both formats 1 and 2
BATTERY_CELL_DATA_FORMAT = 1

; Simulate Midpoint graph (True/False).
MIDPOINT_ENABLE = False

; Battery temperature
; Specify how the battery temperature is assembled
; 0 Get mean of temperature sensor 1 to sensor 4
; 1 Get only temperature from temperature sensor 1
; 2 Get only temperature from temperature sensor 2
; 3 Get only temperature from temperature sensor 3
; 4 Get only temperature from temperature sensor 4
TEMP_BATTERY = 1

; Temperature sensor 1 name
TEMP_1_NAME = BMS

; Temperature sensor 2 name
TEMP_2_NAME = Temp 2

; Temperature sensor 2 name
TEMP_3_NAME = Temp 3

; Temperature sensor 2 name
TEMP_4_NAME = Temp 4

; --------- BMS specific settings ---------

; -- LltJbd settings
; SoC low levels
; NOTE: SOC_LOW_WARNING is also used to calculate the Time-To-Go even if you are not using a LltJbd BMS
SOC_LOW_WARNING = 20
SOC_LOW_ALARM   = 10

; -- Daly settings
; Battery capacity (amps), if the BMS does not support reading it
BATTERY_CAPACITY = 50
; Invert Battery Current. Default non-inverted. Set to -1 to invert
INVERT_CURRENT_MEASUREMENT = -1

; -- ESC GreenMeter and Lipro device settings
GREENMETER_ADDRESS  = 1
LIPRO_START_ADDRESS = 2
LIPRO_END_ADDRESS   = 4
LIPRO_CELL_COUNT = 15

; -- HeltecModbus (Heltec SmartBMS/YYBMS) settings
; Set the Modbus addresses from the adapters
; Separate each address to check by a comma like: 1, 2, 3, ...
; factory default address will be 1
HELTEC_MODBUS_ADDR = 1

; --------- 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.00

Relevant log output

@4000000064b8f5ef03190d7c INFO: Start service vedirect-interface.ttyUSB4 once
@4000000064b8f5f21543523c INFO: Start service dbus-serialbattery.ttyUSB4 once
@4000000064b8f5f72967d0bc INFO: Start service dbus-cgwacs.ttyUSB4 once
@4000000064b8f5fd03b2a1e4 INFO: Start service gps-dbus.ttyUSB4 once
@4000000064b8f60620bf3784 INFO: Start service vedirect-interface.ttyUSB4 once
@4000000064b8f60932d753d4 INFO: Start service dbus-serialbattery.ttyUSB4 once
@4000000064b8f60f1c931234 INFO: Start service dbus-cgwacs.ttyUSB4 once
@4000000064b8f6143130ac9c INFO: Start service gps-dbus.ttyUSB4 once
@4000000064b8f61e157eb55c INFO: Start service vedirect-interface.ttyUSB4 once
@4000000064b8f621266e10ec INFO: Start service dbus-serialbattery.ttyUSB4 once
@4000000064b8f62700f571fc INFO: Start service dbus-cgwacs.ttyUSB4 once
@4000000064b8f62c165f786c INFO: Start service gps-dbus.ttyUSB4 once
@4000000064b8f6353397254c INFO: Start service vedirect-interface.ttyUSB4 once
@4000000064b8f6390a8ef6fc INFO: Start service dbus-serialbattery.ttyUSB4 once
@4000000064b8f63e200359c4 INFO: Start service dbus-cgwacs.ttyUSB4 once
@4000000064b8f643348c722c INFO: Start service gps-dbus.ttyUSB4 once
@4000000064b8f64d166c2a6c INFO: Start service vedirect-interface.ttyUSB4 once
@4000000064b8f650277a8b64 INFO: Start service dbus-serialbattery.ttyUSB4 once
@4000000064b8f65601ac4a94 INFO: Start service dbus-cgwacs.ttyUSB4 once
@4000000064b8f65b16574e94 INFO: Start service gps-dbus.ttyUSB4 once
@4000000064b8f66432d13184 INFO: Start service vedirect-interface.ttyUSB4 once
@4000000064b8f668094fdf7c INFO: Start service dbus-serialbattery.ttyUSB4 once
@4000000064b8f66d1f037dc4 INFO: Start service dbus-cgwacs.ttyUSB4 once
@4000000064b8f67233347f64 INFO: Start service gps-dbus.ttyUSB4 once
@4000000064b8f67c15808a1c INFO: Start service vedirect-interface.ttyUSB4 once
@4000000064b8f6812a24c7bc INFO: Start service dbus-serialbattery.ttyUSB4 once

Any other information that may be helpful

No response

centro-max commented 1 year ago

Min-Max-Cell-2

I have 4 Baly-BMS connected and always the same behaviour.

mr-manuel commented 1 year ago

Please post the log of the driver itself: https://louisvdw.github.io/dbus-serialbattery/troubleshoot/#datalogdbus-serialbatteryttyusbcurrent-or-datalogdbus-serialbatteryttyama0current

centro-max commented 1 year ago

There seems to be a problem here that I don't understand. All 4 BMS report the same error in the LOG file, but the display of the BMS in the Victron is fine except for the red display of the min/max values. The data (voltage, current, SOC etc.) are displayed correctly by all 4 BMS.

/data/log/dbus-serialbattery.ttyUSB*/current

@4000000064bb8a7f22ed9104 INFO:SerialBattery:refresh_data: result: False
@4000000064bb8a802544bbbc INFO:SerialBattery:refresh_data: result: False
@4000000064bb8ab125f36694 INFO:SerialBattery:refresh_data: result: False
@4000000064bb8b2930f0406c INFO:SerialBattery:refresh_data: result: False
@4000000064bb8c23023d8e14 INFO:SerialBattery:refresh_data: result: False
@4000000064bb8c8b08665e24 INFO:SerialBattery:refresh_data: result: False
@4000000064bb8c8c099577e4 INFO:SerialBattery:refresh_data: result: False
@4000000064bb8d2a11fe3574 INFO:SerialBattery:refresh_data: result: False
@4000000064bb8d2b14c72144 INFO:SerialBattery:refresh_data: result: False
@4000000064bb8e7a27b8c8fc INFO:SerialBattery:refresh_data: result: False
@4000000064bb8ec82dce72b4 INFO:SerialBattery:refresh_data: result: False
@4000000064bb8f1030ef0404 INFO:SerialBattery:refresh_data: result: False
@4000000064bb8f273228a8fc INFO:SerialBattery:refresh_data: result: False
@4000000064bb8f8d384e63fc INFO:SerialBattery:refresh_data: result: False
@4000000064bb8f8e3a18d35c INFO:SerialBattery:refresh_data: result: False
@4000000064bb8fc0035b0c04 INFO:SerialBattery:refresh_data: result: False
@4000000064bb90c01992516c INFO:SerialBattery:refresh_data: result: False
@4000000064bb90f412cbf554 INFO:SerialBattery:refresh_data: result: False
@4000000064bb91441a313d04 INFO:SerialBattery:refresh_data: result: False
mr-manuel commented 1 year ago

Why did you not execute the whole command?

centro-max commented 1 year ago

I do not understand, here a screenshot what i did:

LOG

mr-manuel commented 1 year ago

The logs in the screenshot and the logs you posted are different. In the screenshot (correct) you see the timestamp and in the logs you posted (wrong) an encoded string.

centro-max commented 1 year ago

Is that what you need? The logs just tell me that something is wrong...

mr-manuel commented 1 year ago

We always need the timestamp, but we have it in the screenshot. With the timestamp you can see, that it does not fail every second, that's why the data gets updated.

mr-manuel commented 1 year ago

Please also post the exact model of the BMS you are using as also the soft and hardware version of the BMS.

centro-max commented 1 year ago

Here the screenshot (BMS Nr. 2, USB4) from the Daly-App and a photo from my reserve BMS which is the same type.

LiFePO4, 16S, 100A, Smart-BMS, identical to Daly, works perfectly with the Daly app without error messages, from the company hibms

IMG_20230722_111754

Screenshot_2023-07-22-11-16-43-264_com inuker bluetooth daliy

mr-manuel commented 1 year ago

@transistorgit if you have some spare time could you check this?

transistorgit commented 1 year ago

Im on vacation right now, but I will check it I find some time.

1st impression: On my 2 Dalys, it works as expected: random cells get highlighted. The cells are indicated by bits from the daly directly, thats nothing that I calculate. And this Bit is a Fault flag, so the highlight doesnt mean that they are the min/max cells.

I suggest a bms firmware update

Brgds Bernd

PS: adding the cell index to the min/max voltage fields may be a meaningful feature request

mr-manuel commented 1 year ago

PS: adding the cell index to the min/max voltage fields may be a meaningful feature request

They are on the "Details" page. Are they also needed on the cells page?

centro-max commented 1 year ago

@transistorgit I have updated the firmware of my Daly BMS to the latest version from 25.03.2023 (31_230325_001T, obtained directly from the manufacturer/supplier). Unfortunately without success, the error persists.

I was also confirmed that "hibms and daly bms are the same company".

While researching I found out that there are different hardware versions of Daly, the MCU (ST103 or ST030 or GD230 - first Number of Firmware) and the AFE (309E or 303E or DVCE or 9818 - second Number of Firmware) are different. Maybe this helps.

I have GD230 and 309E.

IMG_20230728_095812~2

Screenshot_2023-07-30-15-41-45-664_tk klurige fullscreenbrowser

mr-manuel commented 1 year ago

After reviewing this issue I'm the opinion that this is not a problem of incorrect min/max cell voltage dislay, but only a problem of incorrect cell balancing display. Since the values in Cells (Min/Max/Diff) are always correct in the screenshots.

The red background is displaying which cell is currently being balanced.

Screenshot_2023-07-22-11-16-43-264_com inuker bluetooth daliy

In this screenshot I see that you have disabled the active cell balancing. What happens if you turn it on?

centro-max commented 1 year ago

The "active cells balacing" switch is automatically activated by the system and indicates whether balancing is active or not.

the cell voltages are displayed correctly, the red background should always be on the cell with the highest or lowest voltage, the first cell is always displayed, regardless of the voltage of the first cell. this is definitely not correct!

mr-manuel commented 1 year ago

Do you see in the app which cells are being balanced or do you see only that balancing is active?

centro-max commented 1 year ago

the App shows always the highest cell in red and the lowest cell in blue

Screenshot_2023-07-26-09-22-41-097_com inuker bluetooth daliy~2

mr-manuel commented 1 year ago

@transistorgit if you find some time can you help me with that?

transistorgit commented 1 year ago

Yes will do.

I first have to think my way back into the topic 🙄

transistorgit commented 1 year ago

Hi,

today I looked into this issue. Unfortunately, I have the hardware ST103 which seems different to @centro-max hw. It would be interesting, if any other G230 user could acknowledge the problem.

In the meantime, my only suggestion would be to make a config entry to disable the balance status for these users.

best regards

mr-manuel commented 8 months ago

I don't think that the red and blue colors indicate that these cells are balancing. It's showing only the highes and lowest cell voltage, since the cell balancing is not active in your screenshot.

@centro-max can you confirm that the one cell has only a red background, if the balancing is active?