Does the Framework have a battery charging threshold?

I found this post: https://www.reddit.com/r/Ubuntu/comments/p2so5n/how_to_limit_battery_charging_to_60_in_ubuntu/

about checking the same thing, but on a Lenovo.

For clarification, what I’m wanting to ensure, is, if the laptop detects that it is plugged in most of the time, it won’t need to change. (to preserve battery life)

I think MacOS has this feature, and, it’s a cool idea, that I think the better thermals of frame.work would do better with :sweat_smile:

There is a feature in the current BIOS, where you can set your maximum battery percentage. Works great. I set mine to 80 and it stays there (or maybe 81).

2 Likes

anyway to update that when you already have your OS booted?

You cannot update the BIOS settings while booted to the OS. You will have to reboot and hit F2 on the splash screen to access the BIOS menu.

You can configure charging settings (such as max/min charge levels) using TLP instead of the BIOS settings if you would prefer to be able to manipulate your configuration from the OS. TLP is a package available from the normal apt repositories so you can just install it from Ubuntu.

This article looks a little dated but might still be helpful for getting started if you are interested in that: https://vitux.com/improving-battery-life-in-ubuntu-with-tlp/

Edit:

I stand corrected: @D.H mentions below that you can interact with the BIOS menu from the booted OS. I did not know that! :smiley:

1 Like

Theres a thread here called “Exploring the Embedded Controller” that explains controlling this and several other things in userland.

It’s NOT the BIOS menu that can be read and in certain cases written to from userland, it’s the embedded controller. Not quite the same thing. As I understand it the BIOS writes certain values to the embedded controller once on boot, then the EC handles the majority of things from there. @DHowett could probably explain it more eloquently and elegantly than that though…

2 Likes

That is fascinating. I recall seeing the embedded controller was posted to GitLab, but I did not realize interaction from the booted OS was possible. Very cool!

I believe I have found the thread you mentioned here: Exploring the Embedded Controller

I am definitely going to give that a read, thanks the tip.

do you know where this is? I couldn’t find it. :frowning:

oof, this involves disabling secure boot, which I’m not wanting to do :sweat_smile:

any chance a signed app will be created or Ubuntu will natively support changing stuff in the Embedded Controller?

Its in BIOS in the “Advanced” Tab, the second from the bottom. It has been added in version 3.07, so maybe you have to update it first.

I have set the charging level to 80 percent in the BIOS but I’m not sure if I understand it correctly what happens when the laptop reaches 80%. Will it stop to charge completely and only use the charger? Or will it still use the battery power but charge it like every time it drops to 79 percent ?
I have noticed that the charging LED blinks when the charging state reaches 80 percent. Does this mean the laptop doesn’t charge any more and only runs with the charger power without the battery being used?

It will charge to 80% and keep the battery there. Whenever you plug in a charger it will charge to 80% again

this doesn’t sound like what I want :thinking:

once charged to 80, if the power is still attached, the battery is not needed

It doesnt use the battery when its plugged in (at least as far as I can tell).
Maybe I described it badly, sorry for that. English is not my first language.

The battery is however used, if your power supply cant supply the full 65W and the laptop needs more, than the PSU can deliver. That happend to me while benchmarking the laptop on a 35W PSU.

1 Like

The battery reads 81% for one reason only: No (sane) laptop will ever fully discharge to zero when it reads 0%. By default, there is a 4% reservoir on windows, and it adjusts behind-the-scenes. 100% is 100%, but 0% is 4% (saves your battery).
Here’s a graph that explains it (X-axis is actual charge, y-axis is displayed)
image
Because it’s 80.8%, it rounds up over 80.5%

Any reference? - 20 chars -

Windows shuts down the computer before the battery is completely drained. So it can do the full safe shutdown, rather than hard crashing when the power cuts out.

It’s not exactly an issue of signing… it’s just that fw-ectool today requires access to the processor’s raw port I/O facilities. By default, modern versions of the kernel lock down access to those instructions unless you’re (1) privileged and call iopl(3) and (2) not running in lockdown mode. Lockdown is enabled by default when Secure Boot is. :smile:

Once this patch series merges, fw-ectool can stop using port I/O and start using /dev/cros_ec. The responsibility for handling IO moves into the kernel, which is of course not subject to userspace lockdown restrictions. It’s ready for that day (and after a recent merge-up with my other MEC development branch, it will prefer /dev/cros_ec.)

3 Likes

That’s a power profile configuration, on the front end.

StarrEngineer is talking about something in the backend (“behind-the-scenes”), and that’s what I’m asking about.

Your battery does not like being force fed to 100% all the time. It’s like a whole 24" pizza with all the toppings is 100% of a battery charge.

Well imagine how uncomfortable you feel with two slices to go…that’s what a battery feels like from 80% onwards. So you then stuff the last two slices in…but you then can’t digest till several hours or even days later…

Stressful.

2 Likes

The 4% figure is due to the default power profile settings on windows, in advanced settings
image

The reason you get the battery displayed that way is because it’s the OS’s job to do such things. It automatically hides the processing in the background, so it both can save the battery from catching fire (and prevent the laptop from being used), and shut down safely.