Regarding my fixes for the mini-cycles charge / idle / discharge bug in the EC. There has been no peep from FW as to whether they wish to include my changes or not.
I had an initial email thread open with them regarding one aspect, whether all FW main boards supported the IDLE state, they have been silent since then.
So, I have no idea whether or not they will actually really fix all the edge cases with their upcoming BIOS release.
Here are some of the edge cases:
- The battery BMS re-calibrates itself periodically. This can result in the charge % changing, thus trigger charge / idle / discharge cycles.
- Not all uses wish the battery to discharge with the AC PSU connected. So if the user changes the battery limit from 80% to 60% they don’t expect it to immediately discharge, whereas others do like that behavior. This should therefore be configurable.
- There is need for a hysteresis around the transition between IDLE and Normal (Charge).
- There is a need for a hysteresis around the Discharge / Idle. During charge there is a possibility for the charge of overshoot the battery limit %. It should switch to IDLE here, instead of immediately discharge back to the battery limit %. It add unnecessary charge/discharge cycles.
- The charge can skip the battery limit value, e.g. during a BMS re-calibration, and in this case, currently it just keeps charging up to 100%.
My EC fixes, cover all these edge cases by improving the battery sustain code to have 3 limits.
Limits are: lower, upper, discharge
SOC = Current charge %
State NORMAL (Charge if AC connected).
If SOC > upper, switch to IDLE.
if SOC > discharge, switch to DISCHARGE
State IDLE (Don’t try to charge, even if AC connected)
If SOC < lower, switch to NORMAL
if SOC > discharge, switch to DISCHARGE
State DISCHARGE (Discharge the battery, even if AC is connected)
if SOC < upper, switch to IDLE.
if SOC < lower, switch to NORMAL.
If the user does not wish to ever force the DISCHARGE state, they set the “discharge” limit to > 100%, e.g. 120%, so it can never be reached.
It is a very simple state machine, but covers all the edge cases well.