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

feat(fronius::schedule): Adding hysteresis logic when charging #57

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

atbore-phx
Copy link
Owner

#47

SBAM is checking battery charge conditions every cycle, which can lead to frequent charging and discharging if the battery level is hovering around the target.
To reduce this behavior, I suggest implementing a hysteresis logic with static thresholds.

For example:
Upper threshold: 500 Wh above the target charge.
Lower threshold: 200 Wh below the target charge.
If the target charge is 3000 Wh, the thresholds would work as follows:
Charging will stop when the battery reaches 3500 Wh (target + 500 Wh).
Discharging will stop when the battery drops to 2800 Wh (target - 200 Wh).

This approach prevents the system from cycling too frequently around the target and ensures smoother operation.
These thresholds can be adjusted to suit specific needs, allowing flexibility in controlling the charge/discharge behavior.
The hysteresis logic could be applied to both reserve and general changing operations.

@atbore-phx atbore-phx self-assigned this Jan 21, 2025
@atbore-phx atbore-phx added this to the V1.4.0 milestone Jan 21, 2025
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.70%. Comparing base (0dd7554) to head (ddea2f9).
Report is 1 commits behind head on release/v1.4.0.

Additional details and impacted files
@@               Coverage Diff               @@
##           release/v1.4.0      #57   +/-   ##
===============================================
  Coverage           98.70%   98.70%           
===============================================
  Files                  10       10           
  Lines                 309      310    +1     
===============================================
+ Hits                  305      306    +1     
  Misses                  4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@atbore-phx atbore-phx merged commit 0f762d9 into release/v1.4.0 Jan 21, 2025
4 checks passed
atbore-phx added a commit that referenced this pull request Jan 22, 2025
* feat(init): init release v1.4.0

* feat(fronius::schedule): Net power available is derived from the reserve rather than the actual battery capacity (#55)

* Feat/time reserve battery triggering (#56)

* feat(fronius::schedule): The reserve battery is now charged based on time

* feat(params): tuning parameters

* feat(doc): adding doc

* feat(ha): fixing regexp

* Update DOCS.md

* fix(ha): adding start and end battery reserve hours for export

* feat(fronius::schedule): Adding hysteresis logic when charging (#57)

* feat(fronius::schedule): Adding hysteresis logic when charging

* fix(doc): adding doc

* Update DOCS.md

* fix(test): fix test build script dir

* fix(forecast): if forecast site is unavailable disable forecast charging only (#58)
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.

1 participant