Linux: Any way to limit the battery's max charge level?

Given how the Framework laptop is all about repairability and longevity, any Linux folks aware of a way to set the maximum charge level to 80% to prolong battery life?

Thanks all!

7 Likes

I was about to post this request too.
I have been using a couple ā€œchargieā€ brand devices for a few weeks on my phones, and it works great.
My car has always had a ā€œnormalā€ setting of 80% charge. If going on a long trip, I can set it to ā€œtripā€ full charge by dash or phone and get more range.
Four years on the battery, and has a bit more range than new, about 300 miles vs about 270.
Having this on all devices, especially ones with locked in, glued batteries would greatly benefit.

2 Likes

See Battery Charge Options - #3 by Kieran_Levin

I know thereā€™s an option for this in KDE on my current laptop (Lenovo Thinkpad X1C6). I think it can be done using TLP as well. Since these are both software, youā€™d likely need to keep the laptop powered on while charging to not exceed the chosen limit. If powered off, firmware would allow for a full charge.

2 Likes

Setting charging thresholds only available on ThinkPads :sob: according to TLP config documentation.

1 Like

Yeah, youā€™re right. Alas

1 Like

Iā€™m glad I searched the forum before posting this same question.

Iā€™d also like this option. I spend most of my time plugged in so it would really be suitable for me.

FWIW ā€“ the fact that I can replace the battery does mitigate this need, given that any other laptop would become significantly less useful if the battery fails.

2 Likes

Itā€™s funny you mention that. My plan is to buy a spare battery for that just-in-case scenario. This is all more the reason FW needs support financially for the battery R&D. Iā€™m sure they would like to see a longer lasting battery in their systems. Until thenā€¦OPTIMIZATION FTW!

2 Likes

Replying to this thread as a means of voting for this. I was Googling and came across TLP and it looks like a clean, well-integrated solution for this problem: Battery Care ā€” TLP 1.5 documentation

Framework team, please carve out some development cycles to get this implemented in TLP upstream! It would really be a standout feature, especially given that target customers are likely tech savvy and would see this as a differentiator when comparing with other brands.

5 Likes

I would also love to see a BIOS-level battery limit option added in at some point. @nrp

1 Like

My Pixel phone has a feature where it doesnā€™t charge up to 100% until a little before the next alarm triggers. That minimizes the time it spends at 100% instead of charging up soon after I go to bed and sitting at 100% for six or seven hours every night. Since my laptop is plugged in most of the time I vote for a BIOS setting that would make the maximum charge configurable by percentage.

1 Like

I also support this being added as a bios function, it would be excellent if my replaceable framework battery outlasted the rest of my batteries so I wouldnā€™t even have to replace it as often.

I would like to see this too. at least the batteries are not very expensive on the marketplace. I hope they will still be available in a few years when the first set of batteries will deteriorate.

This should be a userland writeable setting, not just in BIOS. Best case is to be able to set a ā€œdefault charge to targetā€, and to have a procedure that a user could call to ā€œcharge to 100% one time nowā€.

2 Likes

GUI tools to set hardware settings vary wildly by DE, so the option may be there, but not exposed. I set my settings in the terminal on Thinkpads.

I donā€™t yet have a Framework to test, but someone who does could perhaps check in /sys/class/power_supply/BAT0/, and see if there is some file that looks correct? On my Thinkpad itā€™s labeled charge_control_end_threshold and charge_control_start_threshold.

The former sets the peak charge percentage, the latter the minimum charge percentage to begin charging.

Unfortunately I do not see those files.

$ ls /sys/class/power_supply/BAT1
alarm	  capacity_level  charge_full_design  current_now  device  manufacturer  power	  serial_number  subsystem   type    voltage_min_design
capacity  charge_full	  charge_now	      cycle_count  hwmon2  model_name	 present  status	 technology  uevent  voltage_now

Thatā€™s a bummer. Just to make sure, you donā€™t have a BAT0 folder?

FWIW Iā€™ve been using the 3.07 BIOS (BIOS 3.07 + Windows 10 and (11 Alpha) driver bundle) and have it set to stop at 80%. Works great. Would be better to have it configurable in the OS, but the BIOS setting is certainly most of the way there.

Since the last update on this thread (Nov ā€˜21), Iā€™ve determined that it is possible to set through userland and documented everything Iā€™ve found here: Exploring the Embedded Controller

3 Likes

By having it enabled at the bios level, you remove the need for the OS to support it. This greatly streamlines the support for the feature.

Thanks @DHowett for your efforts!!! You might just get me to install Linux once again on mine!!