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

permanently in absorption mode #733

Closed
Micha854 opened this issue Jun 24, 2023 · 30 comments · Fixed by #735
Closed

permanently in absorption mode #733

Micha854 opened this issue Jun 24, 2023 · 30 comments · Fixed by #735
Assignees
Labels
bug Something isn't working

Comments

@Micha854
Copy link

Describe the problem

I have two different installations.
in both I've recently noticed that it no longer comes into float mode. the voltage of the battery is at max_cell_voltage * cells and the maximum cell drift is 0.002V - 0.007V

what can I do?

I first switched to step mode but would like to continue linearly

thanks for the support

Driver version

newest on dev

Venus OS device type

Raspberry Pi

Venus OS version

3.00

BMS type

Daly Smart BMS

Cell count

15

Connection type

Serial USB adapter to RS485

Config file

default config, no changes

Relevant log output

im not have input

Any other information that may be helpful

No response

@Micha854 Micha854 added the support Support request label Jun 24, 2023
@drtinaz
Copy link

drtinaz commented Jun 24, 2023

You say default config? No changes? You need to make settings in the config according to your battery bank. One of the settings should be cell deviation. Possibly you are not going below the cell deviation requirement for float voltage. Setup instructions will tell you how.

@Micha854
Copy link
Author

yes default config. my English is not so good. sorry, which setting is that exactly?

@drtinaz
Copy link

drtinaz commented Jun 24, 2023

At the least you should configure absorption and float voltages, and cell deviation. If cell deviation setting is below what the bms is set for then you will never enter float when in linear mode. I can't remember exactly how it acts in step mode. When you open the config file every setting has explanation for how to set it and how it behaves.

@mr-manuel
Copy link
Collaborator

mr-manuel commented Jun 24, 2023

@ogurevich could you please check? I'm seeing the same since your last PR.

grafik

@mr-manuel mr-manuel added bug Something isn't working and removed support Support request labels Jun 24, 2023
@ogurevich
Copy link
Contributor

ogurevich commented Jun 24, 2023

The mode change worked perfectly for me and the cause of the problem described could be different settings.

I compare the settings in my setup with default and I suspect that the value VOLTAGE_DROP 0 - in default and 0.025 in my setup can lead to this effect

if self.max_voltage_start_time is None:
# start timer, if max voltage is reached and cells are balanced
if (
self.max_battery_voltage - utils.VOLTAGE_DROP <= voltageSum
and voltageDiff <= utils.CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL
and self.allow_max_voltage
):
self.max_voltage_start_time = int(time())
# allow max voltage again, if cells are unbalanced or SoC threshold is reached
elif (
utils.SOC_LEVEL_TO_RESET_VOLTAGE_LIMIT > self.soc
or voltageDiff >= utils.CELL_VOLTAGE_DIFF_TO_RESET_VOLTAGE_LIMIT
) and not self.allow_max_voltage:
self.allow_max_voltage = True

Would you please try and also set this value to 0.03 or 0.025 volts. This has the following meaning (according to code logic). If the battery reports a small but small penalty, the driver reduces CVL. This in turn leads to a reduction in Voltage, e.g. no longer 55.2, but to 55.18, for example. This causes us to switch back to Builk from absorption mode. VOLTAGE_DROP has a slightly different meaning here. The value indicates the tolerance limit at which we remain in absorption mode. To see the life you can uncomment 313-327 and see it in dbus-spy.

"Bulk dynamic"
# + " (vS: "
# + str(round(voltageSum, 2))
# + " - pS: "
# + str(round(penaltySum, 2))
# + ")"
if self.max_voltage_start_time is None
else "Absorption dynamic"
# + "(vS: "
# + str(round(voltageSum, 2))
# + " tDiff: "
# + str(tDiff)
# + " pS: "
# + str(round(penaltySum, 2))
# + ")"

Screenshot 2023-06-24 at 23 13 21

for 3 days:
Screenshot 2023-06-24 at 23 15 19

my current config.ini

[DEFAULT]

; If you want to add custom settings, then check the settings you want to change in "config.default.ini"
; and add them below to persist future driver updates.

; --------- Battery Current limits ---------
MAX_BATTERY_CHARGE_CURRENT    = 100.0
MAX_BATTERY_DISCHARGE_CURRENT = 100.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.45625
MAX_CELL_VOLTAGE   = 3.45
FLOAT_CELL_VOLTAGE = 3.425
;FLOAT_CELL_VOLTAGE = 3.382
TIME_TO_GO_ENABLE = False


; --------- 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 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 = True
;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.060

; -- CVL reset based on SoC option (step mode)
; Specify how long the max voltage should be kept, if reached then switch to float voltage
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 = 96

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

; --------- Bluetooth BMS ---------
; Description: List the Bluetooth BMS here that you want to install
; Example with 1 BMS: Jkbms_Ble C8:47:8C:00:00:00
; Example with 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
;
;C8:47:8C:E1:FB:B9 JK-gurgur2
;C8:47:8C:E5:50:4C JK-gurgur1

;BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:E5:50:4C, Jkbms_Ble C8:47:8C:E1:FB:B9

; --------- Additional settings ---------
; Specify only one BMS type to load else leave empty to try to load all availabe
; LltJbd, Ant, Daly, Daly, Jkbms, Lifepower, Renogy, Renogy, Ecs
BMS_TYPE = Jkbms

; Specify in seconds how often the linear values should be recalculated
LINEAR_RECALCULATION_EVERY = 10

CUSTOM_BATTERY_NAMES = /dev/ttyUSB2:SB1(Jkbms)

@ogurevich
Copy link
Contributor

Logs in details:
Screenshot 2023-06-24 at 23 39 14

I'm still trying to figure out what else could be the cause.

@ogurevich
Copy link
Contributor

@ogurevich could you please check? I'm seeing the same since your last PR.

grafik

i see in the graph (max charge voltage) it goes into float as well (last graph) the question for me why the driver left float mode and goes into bulk again. .... strange ....

@ogurevich
Copy link
Contributor

Micha854
could you send please from VRM portal these three graphs of your battery:
Screenshot 2023-06-25 at 00 03 55

@mr-manuel
Copy link
Collaborator

@ogurevich could you please check? I'm seeing the same since your last PR.
grafik

i see in the graph (max charge voltage) it goes into float as well (last graph) the question for me why the driver left float mode and goes into bulk again. .... strange ....

The first 3 days are before applying the PR. Float is left because heavy loads are turned on. I will try with the voltage diff for testing

@mr-manuel mr-manuel self-assigned this Jun 25, 2023
@ogurevich
Copy link
Contributor

@ogurevich could you please check? I'm seeing the same since your last PR.
grafik

i see in the graph (max charge voltage) it goes into float as well (last graph) the question for me why the driver left float mode and goes into bulk again. .... strange ....

The first 3 days are before applying the PR. Float is left because heavy loads are turned on. I will try with the voltage diff for testing

Ok, thanks. In your constellation, the graphic below shows that even after using the pull request, the algorithm behaves as intended.

@Micha854
Copy link
Author

Micha854 commented Jun 25, 2023

Hello guys,

here my screens of:

Limits:
grafik22

Min / Max Cell Voltage
grafik

Voltage and Current
grafik

i hope this help

@mr-manuel
Copy link
Collaborator

Found the error in my case. I set the reset SOC to 90%. Since the JKBMS has a great SOC drift it was reset immediately to absorption again. Maybe it would be better to use the voltage instead?

@Micha854 what is your SoC, when the battery reached the max voltage?

@Micha854
Copy link
Author

soc of daly bms is arround 99%

@mr-manuel
Copy link
Collaborator

mr-manuel commented Jun 25, 2023

Can you write me on Discord? Else install the latest version from my repository, if you know how. Then record the screen (e.g. with ScreenToGif) of the parameters page and post it here.

@ogurevich
Copy link
Contributor

@Micha854

Hello guys,

here my screens of:

.....

i hope this help
could you set please in config.ini

VOLTAGE_DROP = 0.125

and run. ./reinstall-local.sh

-- it will let drive to ignore these voltage deviation and keeps Absorption mode at least 300 sec.
Screenshot 2023-06-25 at 12 13 27

@ogurevich
Copy link
Contributor

Found the error in my case. I set the reset SOC to 90%. Since the JKBMS has a great SOC drift it was reset immediately to absorption again. Maybe it would be better to use the voltage instead?

a little all-clear is already very good :)
with heavy loads the voltage goes down even though the battery is almost full.

Since I cannot rely on the SOC values of my JK-BMSs, I seriously thought whether the SOC value of SmartShunt (if available)
for example an VeDbusItemImport in dbushelper.py could provide this value to battery. And "Battery" #727 cann better decide when to leave float mode.

I'm not sure yet if that's actually the driver's job to rely on values other than its own battery.
👍

@ogurevich
Copy link
Contributor

sorry for off topic:

it is interesting to see how the system works in combination with multiple batteries. Depending on the "health" of the battery, the right settings can enable the desired behavior. In this example, reducing VOLTAGE_DROP to 0.02 will "prevent" the first battery from jumping into float mode so early.
Screenshot 2023-06-25 at 12 33 32

@ogurevich
Copy link
Contributor

Found the error in my case. I set the reset SOC to 90%. Since the JKBMS has a great SOC drift it was reset immediately to absorption again. Maybe it would be better to use the voltage instead?

Another possibility of what to do at this point. From the moment we switch from absorption to float mode, we can ourselves calculate the amount of energy the battery is giving off. When this amount exceeds a threshold, that is the moment for MAX_VOLTAGE to be allowed again. We can rely on voltage and current values. What do you make of it ?

@mr-manuel
Copy link
Collaborator

This would cause, that if you have a spike in drawing the power from the battery, that the max voltage is allowed again, even if it was only for some seconds. I would keep that in mind and try to fix the SoC problem first. If that is solved, than we can think about it again.

@ogurevich
Copy link
Contributor

ogurevich commented Jun 25, 2023 via email

@towatai
Copy link

towatai commented Jun 26, 2023

I have the same problem here. The float voltage set in the driver is used, but the display does not change and remains on Absorbtion. It would be great if you could select in the config whether the SOC should be set to 100% when switching to float mode or alternatively when a certain voltage is reached. Since we LiFePo4-users have no real benefit from the float mode, you then have the choice (depending on the battery type used)

@ogurevich
Copy link
Contributor

Does it make sense to adjust the default value of VOLTAGE_DROP to 0.3 or 0.5 volts?
PS VOLTAGE_DROP in terms of (VOLTAGE_MARGIN_BOTTOM_TO_STAY_IN_ABSORPTION_MODE)

@mr-manuel
Copy link
Collaborator

@towatai the display will never change, since it's controlled by the MutliPlus itself. In this case the display is useless and should show external control. Since this is very complex and takes a lot of time, effort and money it will take a while. I'm also in contact with the JK developers to find a solution. I would appreciate it, if you donate something for all the effort we are making.

Does it make sense to adjust the default value of VOLTAGE_DROP to 0.3 or 0.5 volts?
PS VOLTAGE_DROP in terms of (VOLTAGE_MARGIN_BOTTOM_TO_STAY_IN_ABSORPTION_MODE)

@ogurevich I renamed your variable to avoid the double usage: https://github.com/mr-manuel/venus-os_dbus-serialbattery/blob/1fffdafcda0026c07b39bdb484ec8c1cff153668/etc/dbus-serialbattery/battery.py#L340-L366

I do not fully understand where you want to decrease the voltage.

@towatai
Copy link

towatai commented Jun 26, 2023

the display will never change, since it's controlled by the MutliPlus itself. In this case the display is useless and should show external control. Since this is very complex and takes a lot of time, effort and money it will take a while. I'm also in contact with the JK developers to find a solution. I would appreciate it, if you donate something for all the effort we are making.

Thank you for your insightful reply. I have already donated something to you via paypal on May 5 ;-)

@ogurevich
Copy link
Contributor

ogurevich commented Jun 26, 2023

@ogurevich I renamed your variable to avoid the double usage: https://github.com/mr-manuel/venus-os_dbus-serialbattery/blob/1fffdafcda0026c07b39bdb484ec8c1cff153668/etc/dbus-serialbattery/battery.py#L340-L366

I do not fully understand where you want to decrease the voltage.

sorry, ... had unhappily printed my thoughts
i don't mean to decrease the voltage
https://github.com/mr-manuel/venus-os_dbus-serialbattery/blob/1fffdafcda0026c07b39bdb484ec8c1cff153668/etc/dbus-serialbattery/battery.py#L306-L307

These conditions resets absorption time if voltage slightly under max_battery_voltage
But this condition is needed and is on the right place. Here we use as margin some delta. probably on this place is an other constant value would be better.

@mr-manuel
Copy link
Collaborator

This VOLTAGE_DROP is only needed, if you have a voltage drop on the cable. E.g. if the BMS measures 55.10 V, the max voltage is 55.20V and the charger is providing already the max 55.20V. So you have a voltage drop on the cable of 0.10V that you need to configure. Else it will never switch to float.

Default is 0 so there is no delta. In 95% of the cases this is not needed to configure, only if you have a very bad and/or long cable to the charger.

@ogurevich
Copy link
Contributor

This purpose is undisputed.

Algorithm sees 2 conditions for absorption mode which are:

a - Cells Voltage is close to each other (voltageDiff <= utils.CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL)
and
b - Battery voltage reached max_battery_voltage
self.max_battery_voltage - utils.VOLTAGE_DROP <= voltageSum

Let's look at Voltage Graph of @Micha854
in his case max_battery_voltage = 51,75 but under real conditions the voltage is not constant it goes up and down.
DalyVoltageGraphInAbsoption

Each time the voltage slightly goes down condition not met, and we are again in bulk mode. We need this voltage level within 300 seconds. That is what i mean. If voltage get to 51,73 volts we should stay in the absoption. It works really fine if
Condition self.max_battery_voltage - 0.03 <= voltageSum

That is the cause for this topic

ogurevich added a commit to ogurevich/dbus-serialbattery that referenced this issue Jun 26, 2023
@mr-manuel
Copy link
Collaborator

Now I understood what you mean :-)

mr-manuel pushed a commit that referenced this issue Jun 27, 2023
* Added: Tollerance to enter float voltage once the timer is triggered
@mr-manuel
Copy link
Collaborator

@Micha854 could you try the lastes nightly from the dev branch? This should be solved now.

@Micha854 Micha854 closed this as completed Jul 1, 2023
@Micha854
Copy link
Author

Micha854 commented Jul 1, 2023

@Micha854 could you try the lastes nightly from the dev branch? This should be solved now.

yes it has been working great for 1 week! Thanks very much

Louisvdw pushed a commit that referenced this issue Nov 25, 2023
* Update reinstall-local.sh: Fixed charge current parameter

Update reinstall-local.sh: Corrected charge current parameter for  initial config.ini

* Exclude devices from driver startup
This prevents blocking the serial port

* implement callback function for update

* fix comments to reflect new logic

* update changelog

* set soc=100% when charge mode changes to float, apply exponential smoothing on current readout

* remove scan for devices

the scan for devices and check if the BMS to test is present doesn't add value
if the device is not within range (or the MAC is wrong), then the subsequent start_scraping call will either fail or fail to produce usable data

* JKBMS_BLE driver fixes

* added Bluetooth signal strenght, increased debug

* Optimized reinstallation procedure
- Changed: Optimized restart sequence for the bluetooth installation
- Changed: Run serial part first and then bluetooth part. This allows the serial driver to get operative faster
- Removed: $DRIVERNAME variable for clearer paths
- Removed: Bluetooth system driver restart, since the devices get disconnected by the service before starting the dbus-serialbatterydriver

* Improved Jkbms_Ble error handling

* optimized disable procedure

* small fixes

* save custom name and make it restart persistant
#100

* changed unique identifier from string to function
function can be overridden by BMS battery class

* fix typo

* fix Sinowealth not loading
#702

* fix unique identifier function

* enable BMS over config, if disabled by default
Now you can also add more then one BMS for BMS_TYPE

* show battery port in log

* ANT BMS fixes
Fixed that other devices are recognized as ANT BMS

* Sinowealth BMS fixes
Fixed that other devices are recognized as Sinowealth BMS

* improved publish_battery error handling
switched from error count to seconds

* Improve Battery Voltage Handling in Linear Absorption Mode

* Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation
* Refactor battery voltage calculations for efficiency and clarity
* Remove penalty_buffer
* Reset max_voltage_start_time wenn we going to bulk(dynamic) mode

* updated changelog

* fix reply processing

* Reduce the big inrush current, if the CVL jumps
from Bulk/Absorbtion to Float
fix #659

* Check returned data lenght for Seplos BMS

Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos

* Validate current, voltage, capacity and SoC for all BMS
This prevents that a device, which is no BMS, is detected as BMS

* removed double check

* bump version

* fix validation if None

* updated changelog

* proposal to #659 formatted :)

* bugfix proposal to #659

* refactor setting float charge_mode

* fix type error, removed bluetooth cronjob

* updated changelog

* fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures

* fix write problem on set_soc. also changed the switch charge/discharge function, just in case

* debug msg

* Bluetooth optimizations

* Fixes by @peterohman
#505 (comment)

* fix #712

* fix meaningless time to go values

* fix meaningless time to go values

* Duration of transition to float depends on number of cells

* Float transition - Voltage drop per second

* Update hlpdatabms4s.py

* Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* cleanup

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds

* fix typo

* updated changelog

* remove debug msg

* remove debug msg

* undo debug change

* Daly BMS make auto reset soc configurable

* added debug and error information for CVL

* fix proposal for #733 (#735)

* Added: Tollerance to enter float voltage once the timer is triggered

* Add bulk voltage
Load to bulk voltage every x days to reset the SoC to 100% for some BMS

* JKBMS disable high voltage warning on bulk
reenable after bulk was completed

* fixed error

* disable high voltage warning for all BMS
when charging to bulk voltage

* fix error and change default value
measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept

* Added temperature names to dbus/mqtt

* Use current avg of last 300 cycles for TTG & TTS

* Calculate only positive Time-to-SoC points

* added current average of last 5 minutes

* make CCL and DCL more clear

* fix small error

* bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery

* black formatting

* JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761)

* feature: Allow to control charge / discharge FET
* feature: Allow to enable / disable balancer

* bugfix: Cycle Capacity is in 10 mAh

Fixes SoC with factor 100 * 100% percentage

* JBD BMS show balancer state in GUI page IO (#763)

* Bump version

* Fix typos

* Smaller fixes
- fixes #792 (comment)

* Removed comments from utils.py
This should make more clear that there are no values to change

* Updated changelog

* possible fix for LLT/JBS connection problems
#769
#777

* bugfix: LLT/JBD BMS general packet data size check

* improved reinstall and disable script

* LLT/JBD BMS - Improved error handling and automatical driver restart
in case of error. Should fix:
- #730
- #769
- #777

* Fixed Building wheel for dbus-fast won't finish on weak systems
Fixes #785

* Support for Daly CAN Bus (#169)

* support for Daly CAN Bus
* fix constructor args
* revert port, needs fix
* add can filters
* comment logger

Some changes are still needed to work with the latest version. They will follow in a next PR.

---------

Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>

* JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736)

* Introduction of automatic SOC reset for JK BMS (HW Version 11)
* Fixed value mapping
* Rework of the code to make it simpler to use without additional configuration.
Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition".
* Implementation of suggested changes
Persist initial BMS OVP and OVPR settings
Make use of max_cell_voltage to calculate trigger value for OVP alert

* Added: Daly CAN and JKBMS CAN

* added CAN bms to installation script
optimized CAN drivers

* smaller fixes

* Trigger JK BLE SOC reset when using Step Mode

* Moved trigger_soc_reset()

* fixes LLT/JBD SOC > 100%
#769

* changed VOLTAGE_DROP behaviour

* Fix JKBMS not starting if BMS manuf. date is empty

* corrected bulk, absorption and soc reset terms

* fix typo

* add JKBMS_BLE debugging data

* fix small error

* added logging to config

* add sleep before starting driver
prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before

* changed post install info

* fix error

* Daly BMS fixed embedded null byte
#837

* added info for SoC reset to default config file

* fix for #716
#716

* fix for #716 and JKBMS model recognition
#716

* optimized logging

* fix JKBMS recognition

* added debugging

* fixes #716
#716

---------

Co-authored-by: Holger Schultheiß <hoschult@web.de>
Co-authored-by: Stefan Seidel <lkml@stefanseidel.info>
Co-authored-by: Bernd Stahlbock <6627385+transistorgit@users.noreply.github.com>
Co-authored-by: seidler2547 <github@stefanseidel.info>
Co-authored-by: ogurevich <50322596+ogurevich@users.noreply.github.com>
Co-authored-by: wollew <wollew@users.noreply.github.com>
Co-authored-by: Oleg Gurevich <oleg@gurevich.de>
Co-authored-by: peterohman <psub@fieber.se>
Co-authored-by: Strawder, Paul <paul@coach-ai.com>
Co-authored-by: Paul Strawder <paulidstein@gmail.com>
Co-authored-by: Samuel Brucksch <SamuelBrucksch@users.noreply.github.com>
Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: ArendsM <136503378+ArendsM@users.noreply.github.com>
Co-authored-by: Meik Arends <github@arends.info>
Louisvdw pushed a commit that referenced this issue Feb 28, 2024
* fix Sinowealth not loading
#702

* fix unique identifier function

* enable BMS over config, if disabled by default
Now you can also add more then one BMS for BMS_TYPE

* show battery port in log

* ANT BMS fixes
Fixed that other devices are recognized as ANT BMS

* Sinowealth BMS fixes
Fixed that other devices are recognized as Sinowealth BMS

* improved publish_battery error handling
switched from error count to seconds

* Improve Battery Voltage Handling in Linear Absorption Mode

* Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation
* Refactor battery voltage calculations for efficiency and clarity
* Remove penalty_buffer
* Reset max_voltage_start_time wenn we going to bulk(dynamic) mode

* updated changelog

* fix reply processing

* Reduce the big inrush current, if the CVL jumps
from Bulk/Absorbtion to Float
fix #659

* Check returned data lenght for Seplos BMS

Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos

* Validate current, voltage, capacity and SoC for all BMS
This prevents that a device, which is no BMS, is detected as BMS

* removed double check

* bump version

* fix validation if None

* updated changelog

* proposal to #659 formatted :)

* bugfix proposal to #659

* refactor setting float charge_mode

* fix type error, removed bluetooth cronjob

* updated changelog

* fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures

* fix write problem on set_soc. also changed the switch charge/discharge function, just in case

* debug msg

* Bluetooth optimizations

* Fixes by @peterohman
#505 (comment)

* fix #712

* fix meaningless time to go values

* fix meaningless time to go values

* Duration of transition to float depends on number of cells

* Float transition - Voltage drop per second

* Update hlpdatabms4s.py

* Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* cleanup

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds

* fix typo

* updated changelog

* remove debug msg

* remove debug msg

* undo debug change

* Daly BMS make auto reset soc configurable

* added debug and error information for CVL

* fix proposal for #733 (#735)

* Added: Tollerance to enter float voltage once the timer is triggered

* Add bulk voltage
Load to bulk voltage every x days to reset the SoC to 100% for some BMS

* JKBMS disable high voltage warning on bulk
reenable after bulk was completed

* fixed error

* disable high voltage warning for all BMS
when charging to bulk voltage

* fix error and change default value
measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept

* Added temperature names to dbus/mqtt

* Use current avg of last 300 cycles for TTG & TTS

* Calculate only positive Time-to-SoC points

* added current average of last 5 minutes

* make CCL and DCL more clear

* fix small error

* bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery

* black formatting

* JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761)

* feature: Allow to control charge / discharge FET
* feature: Allow to enable / disable balancer

* bugfix: Cycle Capacity is in 10 mAh

Fixes SoC with factor 100 * 100% percentage

* JBD BMS show balancer state in GUI page IO (#763)

* Bump version

* Fix typos

* Smaller fixes
- fixes #792 (comment)

* Removed comments from utils.py
This should make more clear that there are no values to change

* Updated changelog

* possible fix for LLT/JBS connection problems
#769
#777

* bugfix: LLT/JBD BMS general packet data size check

* improved reinstall and disable script

* LLT/JBD BMS - Improved error handling and automatical driver restart
in case of error. Should fix:
- #730
- #769
- #777

* Fixed Building wheel for dbus-fast won't finish on weak systems
Fixes #785

* Support for Daly CAN Bus (#169)

* support for Daly CAN Bus
* fix constructor args
* revert port, needs fix
* add can filters
* comment logger

Some changes are still needed to work with the latest version. They will follow in a next PR.

---------

Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>

* JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736)

* Introduction of automatic SOC reset for JK BMS (HW Version 11)
* Fixed value mapping
* Rework of the code to make it simpler to use without additional configuration.
Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition".
* Implementation of suggested changes
Persist initial BMS OVP and OVPR settings
Make use of max_cell_voltage to calculate trigger value for OVP alert

* Added: Daly CAN and JKBMS CAN

* added CAN bms to installation script
optimized CAN drivers

* smaller fixes

* Trigger JK BLE SOC reset when using Step Mode

* Moved trigger_soc_reset()

* fixes LLT/JBD SOC > 100%
#769

* changed VOLTAGE_DROP behaviour

* Fix JKBMS not starting if BMS manuf. date is empty

* corrected bulk, absorption and soc reset terms

* fix typo

* add JKBMS_BLE debugging data

* fix small error

* Some changes for lost bluetooth connection / hci_uart stack restart

* added logging to config

* add sleep before starting driver
prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before

* changed post install info

* fix error

* Daly BMS fixed embedded null byte
#837

* added info for SoC reset to default config file

* fix for #716
#716

* fix for #716 and JKBMS model recognition
#716

* optimized logging

* fix JKBMS recognition

* added debugging

* fixes #716
#716

* Bind device instance to unique_identifier
#718

* added data types to battery class
disabled unused variables

* save current charge state
#840

* correct file permissions

* updated changelog

* added periodic saveChargeDetails

* fix some small errors

* fix issue with ruuvi tags
When there are hundreds of unused ruuvi tags in the settings list that where added because thei where nearby the driver does not start correctly. These stale entries are disabled on the driver startup.
The issue was already filed to Victron developers

* CVL with i-controller instead of penaltysum

* cvl_controller: switch to choose PenaltySum or ICOntroller + documentation

* docu enhancement

* Add setting and install logic for usb bluetooth module

* round temperatures

* changed battery disconnect behaviour

* Fixes #891
#891

* updated changelog

* Add bluetooth device note to config.default.ini

* Fix typo in bluetooth note in config.default.ini

* fixed error in new cvl_controller

* fixed float division by zero and code optimization

* Restart MAX_VOLTAGE_TIME_SEC if cell diff > CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART

* Calculation of the SOC based on coloumb-counting (#868)

* Calculation of the SOC in the driver based on coloumb-counting

* soc_calc: add current correction before integration

* soc_calc: correction map for current

* Soc_calc: CorrectionMap, switch to turn on/off correction, selectable initial value

* soc_calc: Bugfix

* soc_calc: Bugfix

* store soc in dbus for restart

* store soc in dbus for restart (formatted)

* store soc in dbus for restart (bugfix)

* save soc_calc only after change > 1.0

* store soc in dbus for restart (bugfix)

* logger does not work this way. do not know why

* writing and reading to dbus works

* Removed options: SOC_CALC_CURRENT_CORRECTION, SOC_CALC_RESET_VALUE_ON_RESTART, SOC_CALC_INIT_VALUE
sort soc_calc alphabetically

* fixed comments

* Updated changelog, small fixes

* Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False

* Changed: Code optimizations
- Changed some variables to be more clear
- Added comments for easier code understanding

* Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED

* Updated changelog, small fixes

* Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False

* Changed: Code optimizations
- Changed some variables to be more clear
- Added comments for easier code understanding

* Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED

* Fix #898
#898

* Changed: Fix issue loading settings from dbus

* Added nightly install option
makes it easier for users to pretest fixes

* Changed: more detailed error output when an exception happens

* Possible fix for #912
#912

* Fixes #919
#919

* Changed: Exit script with error, if port excluded
else the serialstarter stops at the dbus-serialbattery

* Fixed some smaller errors

* Updated pre-release workflow

* Fix JK BMS connection restart when bluetooth fails.

This fix installs a new thread to monitor the state of the original
scraping thread.
If scraping thread dies, it verifies that it did not because the
scraping was intentionally stopped by calling stop_scrapping.
When restarting the scrapper, it first calls the bluetooth
reset lambda function that was passed in the class contructor, such that
bluetooth is ready to make a proper connection.

* Fixes #916
#916

* Added Venus OS version to logfile

* Fix #840
#840

* Small code formatting fixes

* Optimized reinstall script. Restart GUI only on changes.

* Display debugging data in GUI when DEBUG enabled

* Install script now shows repositories and version numbers

* Update daly_can.py

Fixing #950 for DalyBMS

* Update jkbms_can.py

Fixing #950 for Jk BMS

* Fix black lint check

* Fixes #970
#970

* Fixed some errors in restoring values from dbus settings

* Moved sleep on start for all BMS

* Update config description

* Reworked a part of the default config

* fix typo in stopping services when reinstalling

* Fix Time-to-SoC and Time-to-Go calculation

* Add changelog info

* Round sum and diff voltage

* Temperature limitation variables where changed

* SoC limitation variables where changed

* Added error messages

* Remove unneeded code

* Reset SoC to 0% if empty

* Add GUIv2 for dbus-serialbattery

* Check free space before installing

* Added new GUIv2 version

* Removed Python 2 compatibility

* Changelog update

* Code cleanup
- Removed: get_temperatures()
- Removed: update_last_seen()

* Bluetooth code optimizations

* Fixed some JKBMS BLE not starting
#819

* Check if packages are already installed before install

* Fixed some SOC calculation errors

* Fixed None SOC on driver start

* Do not show and allow button change when callback is missing for:
- ForceChargingOff
- ForceDischargingOff
- TurnBalancingOff

* Check if a device instance is already used by creating a PID file

* Log and execute SOC reset to 100% or 0% only once

* Update GitHub workflow and issue templates

* Fixed LLT/JBD BMS with only on temperature sensor #791
#971

* Fix warning on reinstall

* Fix missing IO control for JBDBMS #992
#992

* Prepare for removing dev branch

---------

Co-authored-by: ogurevich <50322596+ogurevich@users.noreply.github.com>
Co-authored-by: Bernd Stahlbock <6627385+transistorgit@users.noreply.github.com>
Co-authored-by: wollew <wollew@users.noreply.github.com>
Co-authored-by: Oleg Gurevich <oleg@gurevich.de>
Co-authored-by: peterohman <psub@fieber.se>
Co-authored-by: Strawder, Paul <paul@coach-ai.com>
Co-authored-by: Paul Strawder <paulidstein@gmail.com>
Co-authored-by: Samuel Brucksch <SamuelBrucksch@users.noreply.github.com>
Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: ArendsM <136503378+ArendsM@users.noreply.github.com>
Co-authored-by: Meik Arends <github@arends.info>
Co-authored-by: Marvo2011 <Marvin.Edeler@gmail.com>
Co-authored-by: cflenker <christian.flenker@gmx.de>
Co-authored-by: cflenker <125555670+cflenker@users.noreply.github.com>
Co-authored-by: Cupertino Miranda <cupertinomiranda@gmail.com>
Co-authored-by: Martin Polehla <p0l0us@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants