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

Referenced Current values to MAX_BATTERY_CHARGE_CURRENT & MAX_BATTERY_DISCHARGE_CURRENT #389

Merged
merged 6 commits into from
Jan 11, 2023

Conversation

vincegod
Copy link
Contributor

@vincegod vincegod commented Jan 4, 2023

Hi,

I've changed a lot of the fixed Current values to be referenced MAX_BATTERY_CHARGE_CURRENT & MAX_BATTERY_DISCHARGE_CURRENT by multiplying by 0.1, 0.2, 0.4, 0.5 etc.

I've also tweaked the temperature limit steps a little.

I'm using a JBD and will be adding a second battery late this month.

Thanks for a great driver

Vince

PS. I'm new to Python, GitHub and such so hopefully I've not broke anything :)

@Louisvdw
Copy link
Owner

Hi @vincegod
The changes to ant.py is a removal of a previous change and it seems like that is not part of your changes. If you can remove the ant bms changes I can approve the rest

@vincegod
Copy link
Contributor Author

I have removed the ant bms changes now, sorry I never intended to changed this file.

@Louisvdw Louisvdw merged commit f8a1936 into Louisvdw:master Jan 11, 2023
@ppuetsch
Copy link
Contributor

@vincegod @Louisvdw
In https://github.com/ppuetsch/dbus-serialbattery/tree/improvements_with_config I introduced reading config values from an ini file (instead of letting users change utils.py).

However, I now have some difficulties with the configuration of the attributes that were changed in this MR.

I do see the following possibilities to resolve this:
1 Only max current is configured - and the array setpoints as well as their values are derived from that. (e.g.:
CELL_VOLTAGES_WHILE_CHARGINGANDMAX_CHARGE_CURRENT_CV` reside in utils.py and are not configurable
2 The setpoints (so in the example above CELL_VOLTAGES_WHILE_CHARGING) can be configured, but the corresponding limits will be derived based on max current. This approach kind of resembles what is already present - but I don't like it as it makes the configuration strange
3.: Both arrays can be configured. This gives the most flexibility - however it's kind of reverting this PR here.

What do you think?

@mr-manuel
Copy link
Collaborator

Would it also be possible to configure CELL_VOLTAGES_WHILE_CHARGING, MAX_CHARGE_CURRENT_CV, CELL_VOLTAGES_WHILE_DISCHARGING, MAX_DISCHARGE_CURRENT_CV, TEMPERATURE_LIMITS_WHILE_CHARGING, MAX_CHARGE_CURRENT_T, TEMPERATURE_LIMITS_WHILE_DISCHARGING, MAX_DISCHARGE_CURRENT_T, CC_CURRENT_LIMIT1, CC_CURRENT_LIMIT2, CC_CURRENT_LIMIT3, DC_CURRENT_LIMIT1, DC_CURRENT_LIMIT2, DC_CURRENT_LIMIT3 as it is now in the INI file with fixed values and if this values are not defined or commented out (maybe as default) the calculations of this PR are used?

@Louisvdw
Copy link
Owner

The problem with seperate settings for each of the different CCCM types are that it makes it difficult for the average user to change their max current limits. To make it easier should be the goal.

On the other side we want to be flexable so that users can adjust to their setup.

We can do something like @mr-manuel suggest where a default apply with ratios like in this PR, but then you can override that in the settings. However I can already see that people would then not know which values are applied.

For the GUI Settings I planned to have values in the settings, but when you apply a new (dis)charge limit it would adjust all the values according to a ratio like in this PR which the user can then adjust again. So the ratio only comes into play in the GUI when the "master charge limits" are changed. Not sure if we can do something similar here?

@ppuetsch
Copy link
Contributor

I will implement it like follows: The Current limits in the configuration will always be relative to max_(dis)charge_current - e.g.:

CELL_VOLTAGES_WHILE_DISCHARGING = 2.70,2.80,2.90,3.10
MAX_DISCHARGE_CURRENT_CV = 0,0.08,0.5,1

So one can configure everything in a fine grained manner, but for most cases it's sufficient to only set charge/discharge limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants