Skip to content

Generalize iRemaining & iRunTimeToEmpty calculations to support capacities != 100 #30

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

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

forderud
Copy link
Contributor

@forderud forderud commented Oct 15, 2024

The iRemaining (capacity) and iRunTimeToEmpty calculations currently assume iFullChargeCapacity==100. Generalize the formulas, so that they still give reasonable results also if changing iFullChargeCapacity to a smaller or larger value.

@forderud forderud changed the title Generalize iRemaining & iRunTimeToEmpty calculations to also support capacities other than 100 Generalize iRemaining & iRunTimeToEmpty calculations to support capacities != 100 Oct 15, 2024
@forderud
Copy link
Contributor Author

@abratchik Would it be possible for you to take a look at this proposal?

@abratchik
Copy link
Owner

@abratchik Would it be possible for you to take a look at this proposal?

Hi @forderud , I checked your proposal, it's ok for me but please remove the commit amending the comment. I'm currently working on the actual UPS project where the remaining battery charge is defined using a completely different method, not involving any analog reads. That is why it is important to keep the original comment - to let other developers know that this part is only an example.

@forderud
Copy link
Contributor Author

Hi @forderud , I checked your proposal, it's ok for me but please remove the commit amending the comment. I'm currently working on the actual UPS project where the remaining battery charge is defined using a completely different method, not involving any analog reads. That is why it is important to keep the original comment - to let other developers know that this part is only an example.

Sure! I've now updated the PR accordingly.

@forderud
Copy link
Contributor Author

Does the PR look better now @abratchik ?

@abratchik abratchik merged commit 6f6442f into abratchik:master Jan 18, 2025
@forderud forderud deleted the remaining-scale branch January 19, 2025 10:06
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.

2 participants