Does the Framework have a battery charging threshold?

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.

If that’s the 4% you’re referring to, I believe you’ve misunderstood the usage / processing of this value. It doesn’t hides 4% to background process. I knew I was smelling something…

Reserve battery level | Microsoft Docs

Here’s a simple test for you…if this was true:
Set reserve battery level to 99%. Then that means, according to you, it hides the 99% from the user. And you only have 1% left in the front end. And it should have jumped to gracefully shutdown the system.

You would get a popup alert at battery level (graphically reported) 99%…but nothing else, you would still be able to view the battery level go down as it normally would. i.e. The 99% is not hidden from you, and you would only get a graphical alert.

Also, the default for this value is not 4%. 4% from your screenshot is something that you’ve or software on your end have set.

Oops, By bad, It’s critical battery level.
image

That, too. It doesn’t “hide” the specified percentage from the front end / user. (It’s just specifies ‘when’ the action will be triggered)

@A_A Apologies if that’s not the case. I’ve usually came across this issue on my phone, where the battery is discharged, I can turn it on and it says 0%. I think this is the standard for all devices. If this is not the case for windows, it still is in effect 0%,

Example 1 : Macbooks.
When the battery is critically discharged, they shut off and display the Red-battery icon. When you plug them in and turn them on, they show 0%.
Example 2: Phones.
Same idea here. The phone can turn it’s screen on, and my Samsung reads 0% battery. This also reads when I turn it on, thats it’s 0% charging

In the above case that both of these examples above are false, then it is not in the power of windows or the firmware to change this (hardware possibly, but that involves much danger and circumventing the hardware protection). Batteries cannot be discharged to 0.0 volts, and the capacity drops exponentially the closer you get to its limit. The problem with Zero Volts stack exchange Answer.

Battery life is estimated from the voltage curve of the specific chemistry, and as it is calculated, there may be an error of a few % (No reference on this one). My main reference on the turnoff is the Battery University discharge page

1 Like