feat(fronius::schedule): Adding hysteresis logic when charging #57
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.
#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.