Repository navigation
fix battery drain when battery charge threshold is set - #84
hojjatabdollahi wants to merge 1 commit into
Conversation
cb9a63f to
d413b14
Compare
|
Data point from a Laptop 13 Pro (AMD Ryzen AI 300 Series): the same code path applies there, but I could not reproduce the drain on my unit. Some notes from the ISL9241 datasheet (FN8945 Rev 6.01) and from measurements, which may help with reviewing this. Setup: Ryzen AI 9 HX 370, BIOS 04.02, EC Where the thin margin applies: What the datasheet says about it:
Measurements at 60% (target 1-8 mV above the reported VBAT): steady and bursty (5 s on/off) 7-Zip loads on all threads put the charger into turbo (Information1 bit 0 = 1, input current loop active, battery 0.3-0.8 A). After both load ends (and one more at 48%), the battery current returned to 0 within 2-4 s, turbo was off, and it stayed at 0 over 10 minute watches. So on this unit the charger takes the load back each time. On the fix itself: with |
When the battery sustainer parks the pack at a charge limit it enters
CHARGE_CONTROL_IDLE, which sets manual current and voltage to 0.charge_request()then takes the!voltage || !currentpath and, on NVDC chargers, requestsVBAT + one voltage_step. Per the comment on that branch, the margin exists so that "the BGATE FET body diode" does not "conduct and discharge the battery".However one voltage_step does not appear to be enough margin: if the rail sags below VBAT under load the diode conducts and the pack supplies part of the system current. Charge current is pinned at 0 in IDLE, so it is never replenished, SoC falls until it crosses the sustainer's lower threshold and triggers a full recharge.
This is what I observe: a shallow charge/discharge between min/max charge threshold. The EC automatically sets
max-5as the min. When I set the charge threshold to 60%, it charges to 60%, then goes to IDLE (observed in ec console) but then as soon as there is some load on the system, it starts drawing a constant 5-9W from the battery. Until it gets to 55% and charges back up to 60%.Stock EC, Min=55%, Max=60%
Stock EC, Min=Max=60%
Patched EC, Min=55%, Max=60%
This patch potentially applies to other boards too.
My framework forum post: https://community.frame.work/t/puzzling-battery-threshold-behavior/83941
EDIT: looks like this was found before: here.