Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I often observe the following behaviour:
When reaching MAX_CELL_VOLTAGE and the current is dropping towards zero the cells with higher voltage come down and the cells with lower voltage come up, then crossing each other and drifting away again before the balancer brings them finally all together.
At the point of time when they are crossing (celldiff<
CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL
) the battery pack seems to be balanced an the timer ofMAX_VOLTAGE_TIME_SEC
starts. So afterMAX_VOLTAGE_TIME_SEC
the control_voltage is lowered to FLOAT-Voltage no matter how well they are together at this point of time (as long as they are not more thanCELL_VOLTAGE_DIFF_TO_RESET_VOLTAGE_LIMIT
away from each other).In reality the battery is not completely balanced and MAX_VOLTAGE is stopped to early:
My proposal would be to introduce one more threshold for cell-deviation that causes MAX_VOLTAGE_TIME_SEC to restart if celldiff gets above this threshold:
So celldiff has to be smaller than
CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART
forMAX_VOLTAGE_TIME_SEC
to start the transition to float.As default value
CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART
can be choosen much bigger thanCELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_UNTIL
so this change has no impact for existing configurations and to prevent that some configurations (where the celldiff has a lot of noise) would never change to float.For my configuration it has a very positiv effect: