Skip to content

fix battery drain when battery charge threshold is set - #84

Open
hojjatabdollahi wants to merge 1 commit into
FrameworkComputer:fwk-lotus-azalea-19573from
hojjatabdollahi:hojjat/fix-charge-threshold
Open

fix battery drain when battery charge threshold is set#84
hojjatabdollahi wants to merge 1 commit into
FrameworkComputer:fwk-lotus-azalea-19573from
hojjatabdollahi:hojjat/fix-charge-threshold

Conversation

@hojjatabdollahi

@hojjatabdollahi hojjatabdollahi commented Aug 7, 2026

Copy link
Copy Markdown

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 || !current path and, on NVDC chargers, requests VBAT + 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-5 as 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%

  • Note it stayed parked for some time, but then suddenly started draining at a constant rate
image

Stock EC, Min=Max=60%

  • Ignore the first couple of charge/discharges, I was testing something.
  • Notice how much more it stayed parked, going below 60% switches to Normal mode and replenishes the diode
image

Patched EC, Min=55%, Max=60%

image

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.

@hojjatabdollahi
hojjatabdollahi force-pushed the hojjat/fix-charge-threshold branch from cb9a63f to d413b14 Compare August 7, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant