Re: How to set ThinkPad battery charge thresholds?

2021-03-11 Thread Jonathan Thornburg
In message ,
Jan Stary asks for research/references supporting the claim that a
lithium-ion battery will last longer if it's not fully charged or
discharged.

None of these qualify as original research, but some sources for this
guideline include

https://www.wired.com/story/smartphone-battery-care-last-longer/

https://www.apple.com/batteries/maximizing-performance/

Table 4 and Figure 6 in
https://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries

The last of these is the most technical, and does cite some original
research.



Re: How to set ThinkPad battery charge thresholds?

2021-03-09 Thread Miko
On Tue, Mar 09, 2021 at 02:45:17PM +0100, Jan Stary wrote:
> On Mar 09 10:36:13, sn03.gene...@gmail.com wrote:
> > On 3/9/21, Jan Stary  wrote:
> > > Why would you want to stop charging before being 100% charged?
> > >
> > 
> > Say you keep the battery plugged in overnight for charging. It charges
> > to 100%, and then stays so for 5 hours till you wake up in the morning.
> > 
> > It might not sound that horrifying right now, but wait till you hear the
> > next part.
> > 
> > According to a research,
> 
> What research?
> 
> > it has been found that, at the extremes of the
> > battery's charge capacity, it stays at _high tension_, causing it to
> > degrade quicker. The nearer the battery's charge is to an extreme, the
> > more tension it is under, and the faster shall it degrade.
> 
> I doubt that.
> Can you please point to the research that proves this?
> 
It primarily comes down to you wasting battery cycles, since chargers usually 
start charging again when the battery is >100% (even if it's just 
99.999%). The more cycles you waste, the faster your battery starts 
degrading.
Gee, I thought this was misc@, not pleasexplainhowbatterieswork@.



Re: How to set ThinkPad battery charge thresholds?

2021-03-09 Thread Henri Järvinen
On Tue, Mar 09, 2021 at 02:45:17PM +0100, Jan Stary wrote:
> On Mar 09 10:36:13, sn03.gene...@gmail.com wrote:
> > On 3/9/21, Jan Stary  wrote:
> > > Why would you want to stop charging before being 100% charged?
> > >
> > 
> > Say you keep the battery plugged in overnight for charging. It charges
> > to 100%, and then stays so for 5 hours till you wake up in the morning.
> > 
> > It might not sound that horrifying right now, but wait till you hear the
> > next part.
> > 
> > According to a research,
> 
> What research?
> 
> > it has been found that, at the extremes of the
> > battery's charge capacity, it stays at _high tension_, causing it to
> > degrade quicker. The nearer the battery's charge is to an extreme, the
> > more tension it is under, and the faster shall it degrade.
> 
> I doubt that.
> Can you please point to the research that proves this?
> 
> 

Not an research but several sources sais a same.
Here is one excample: 
https://www.notebookcheck.net/Lithium-Ion-Batteries-Charging-Guide-for-Maximum-Endurance.214714.0.html

-- 
Henri Järvinen



Re: How to set ThinkPad battery charge thresholds?

2021-03-09 Thread Ottavio Caruso

On 09/03/2021 05:25, Subhaditya Nath wrote:

And the actual work is done by something called the 'natacpi framework',
which is implemented by the linux kernel itself.


Which is what I said in my previous post.

--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



Re: How to set ThinkPad battery charge thresholds?

2021-03-09 Thread Ottavio Caruso

On 09/03/2021 04:53, s...@skolma.com wrote:

perhaps as your name suguests you may be located in the Indian sub continent, and Mains Power may be intermittent.. 


God, how patronizing is that?




--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



Re: How to set ThinkPad battery charge thresholds?

2021-03-09 Thread Jan Stary
On Mar 09 10:36:13, sn03.gene...@gmail.com wrote:
> On 3/9/21, Jan Stary  wrote:
> > Why would you want to stop charging before being 100% charged?
> >
> 
> Say you keep the battery plugged in overnight for charging. It charges
> to 100%, and then stays so for 5 hours till you wake up in the morning.
> 
> It might not sound that horrifying right now, but wait till you hear the
> next part.
> 
> According to a research,

What research?

> it has been found that, at the extremes of the
> battery's charge capacity, it stays at _high tension_, causing it to
> degrade quicker. The nearer the battery's charge is to an extreme, the
> more tension it is under, and the faster shall it degrade.

I doubt that.
Can you please point to the research that proves this?



Re: How to set ThinkPad battery charge thresholds?

2021-03-09 Thread sub



‐‐‐ Original Message ‐‐‐
On Tuesday, March 9, 2021 7:30 AM, Ottavio Caruso 
 wrote:

> On 08/03/2021 17:35, Jean-Pierre de Villiers wrote:
>
> > Refer to sensorsd(8) and acpibat(4). Given those and related manual
> > pages I'm relatively certain you should be able to achieve this.
> > OpenBSD is well-known for its clear and extensive documentation so use
> > this to your advantage. The apropos(1) utility is your best friend :).
> > Your second and third best friends are the FAQ and the mailing list
> > archives.
> > I am working under the assumption that no proprietary blobs are
> > necessary to accomplish your goal. Otherwise, I am afraid you are out
> > of luck as OpenBSD does not and never will contain any such blobs.
> > They are "black boxes" and thus cannot be trusted.
> > Regards,
> > JP
> > On 21/03/08 07:05pm, Subhaditya Nath wrote:
> >
> > > I have a Thinkpad E495 that has Battery Charge threshold support. i.e.
> > > it can be set such that the battery starts charging at a specified
> > > amount of charge (say, 70%) and automatically stops charging at a
> > > specified charge (say, 80%). This feature is also available on Linux by
> > > using TLP (made by linrunner, his website is linrunner.de)
> > > The problem is, I searched for this option in OpenBSD, but I couldn't
> > > find it.
> > > It is a very crucial functionality for me. So, if somebody can please
> > > tell me where I can set it, I would be very very thankful.
> > > (Pardon my bad english, it's not my first language)
>
> acpibat, as it stands, doesn't and cannot set/manipulate battery charge
> threshold levels.
>
>
>


Hi Subhaditya,
nice to see another AMD ThinkPad #495 user.
I am writing from a T-495. although i have no direct openbsd technical advice 
for you, i thought i would ask about your reason for TLP ? often by 
understanding your requirements, the community may be able to offer alternate 
solutions.
perhaps as your name suguests you may be located in the Indian sub continent, 
and Mains Power may be intermittent.. and your looking to get through a days 
work.. or perhaps you want to maximise your Mobile work sitting in a park ? or 
perhaps you jsut really like 80% battery :)

it's my personal finding that TLP on linux since kernel 5.x does very little.. 
i am using right now Pop_OS! (because of citrix/MS-teams for work), and i get 
about 5-7 hours run time..
with OpenBSD i get about 5-6. (no citrix/MS-teams)
MS-Windows-10 to my chagrin, outperforms both bsd/linux reaching closer to 
10hrs.
so if battery runs times are important to you, you might have the wrong mix :(

-Sub.
 
-
>
> Ottavio Caruso
>
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?




Re: How to set ThinkPad battery charge thresholds?

2021-03-08 Thread Subhaditya Nath
On 3/8/21, Subhaditya Nath  wrote:
> I have a Thinkpad E495 that has Battery Charge threshold support. i.e.
> it can be set such that the battery starts charging at a specified
> amount of charge (say, 70%) and automatically stops charging at a
> specified charge (say, 80%). This feature is also available on Linux by
> using TLP (made by linrunner, his website is linrunner.de)

I just investigated a little more about it, and what do I see? Surprise!
It's just a shell script! Yeah! And how does it do the threshold thing?
Simple! It just writes the required values to -
/sys/class/power_supply/BAT0/charge_start_threshold
/sys/class/power_supply/BAT0/charge_stop_threshold
Done!


And the actual work is done by something called the 'natacpi framework',
which is implemented by the linux kernel itself. I don't know :shrug:
(I just gathered the above sentence after a few minutes of googling. I
know very little about the kernel and all)


For those who are curious, below is the output of `tlp-stat -b`.

Note this line -
natacpi= active (data, thresholds)


--- TLP 1.3.1 

+++ Battery Features: Charge Thresholds and Recalibrate
natacpi= active (data, thresholds)
tpacpi-bat = active (recalibrate)
tp-smapi   = inactive (ThinkPad not supported)

+++ ThinkPad Battery Status: BAT0 (Main / Internal)
/sys/class/power_supply/BAT0/manufacturer   = SMP
/sys/class/power_supply/BAT0/model_name = 01AV446
/sys/class/power_supply/BAT0/cycle_count=205
/sys/class/power_supply/BAT0/energy_full_design =  45280 [mWh]
/sys/class/power_supply/BAT0/energy_full=  42750 [mWh]
/sys/class/power_supply/BAT0/energy_now =  26430 [mWh]
/sys/class/power_supply/BAT0/power_now  =   6810 [mW]
/sys/class/power_supply/BAT0/status = Discharging

/sys/class/power_supply/BAT0/charge_start_threshold = 75 [%]
/sys/class/power_supply/BAT0/charge_stop_threshold  = 80 [%]
tpacpi-bat.BAT0.forceDischarge  =  0

Charge  =   61.8 [%]
Capacity=   94.4 [%]



Re: How to set ThinkPad battery charge thresholds?

2021-03-08 Thread Subhaditya Nath
On 3/8/21, Jean-Pierre de Villiers  wrote:
> Refer to sensorsd(8) and acpibat(4).  Given those and related manual
> pages I'm relatively certain you should be able to achieve this.
>
I did. acpibat(4) contains no information about how to use it. If I
understood correctly, it is simply a ACPI driver for batteries.

sensord(8) contains information about how to check the current battery
percentage, but I can't see how to _stop_ the battery from charging.
I also couldn't find an option in sysctl for this.

It might be worth mentioning that this feature is implemented in
hardware, not software. The software is needed to set the correct
thresholds in the Charging Controller hardware (firmware, maybe?).

> OpenBSD is well-known for its clear and extensive documentation so use
> this to your advantage.  The apropos(1) utility is your best friend :)
> Your second and third best friends are the FAQ and the mailing list
> archives.
>
Yep, I searched marc.info for half and hour. Couldn't find it. Maybe I
am doing something wrong? This is my first interaction with a mailing
list :P

I also searched the man pages using `apropos` and `man -k`, still
nothing. In fact, I had done all of these before posting here. :)

(If dera...@openbsd.org is listening... The first mail is very very
helpful! Thanks)

> I am working under the assumption that no proprietary blobs are
> necessary to accomplish your goal.  Otherwise, I am afraid you are out
> of luck as OpenBSD does not and never will contain any such blobs.
> They are "black boxes" and thus cannot be trusted.
>
I know that OpenBSD is against blobs. In fact, that's the main reason I
want to switch from linux to OBSD. I want to support Doctor Puffystein
rather than Blobby ;-)

(https://www.openbsd.org/lyrics.html#39 - for those who are wondering)



Re: How to set ThinkPad battery charge thresholds?

2021-03-08 Thread Subhaditya Nath
On 3/9/21, Jan Stary  wrote:
> Why would you want to stop charging before being 100% charged?
>
This email wasn't CC'd to the mailing list, right?

Say you keep the battery plugged in overnight for charging. It charges
to 100%, and then stays so for 5 hours till you wake up in the morning.

It might not sound that horrifying right now, but wait till you hear the
next part.



According to a research, it has been found that, at the extremes of the
battery's charge capacity, it stays at _high tension_, causing it to
degrade quicker. The nearer the battery's charge is to an extreme, the
more tension it is under, and the faster shall it degrade.

Imagine it like food. If somebody makes you eat so much that your
stomach is 100% full, and then ensures that it remains 100% full for 5
hours, how would you feel? (For a comparison, we mostly feel comfortable
when our stomach is ~50% full, and we feel well-fed when it's ~80% full)

The same goes for 0%. This is obvious. Would you like to stay hungry?
Like, really REALLY hungry? No, absolutely not!



So, the researchers suggest that you should always keep your battery
charged between 40-80%. Don't let it drop below 40%, and don't let it go
above 80%. Charge as frequently as you can ('Deep Charge a battery' is a
myth. It decreases battery lifespan rather than increasing it). Simply
doing this can increase your battery life span by about. about.
umm.dang it, I forgot! It was something between 1.5x to 2.5x ...



P.S. I forgot to mention that the above-mentioned facts are true only
for the Li-ion batteries found in modern Smartphones and Laptops (IIRC)

---
meh, I'm gonna CC it to the mailing list anyway. This is something
everybody should know.



Re: How to set ThinkPad battery charge thresholds?

2021-03-08 Thread Ottavio Caruso

On 08/03/2021 17:35, Jean-Pierre de Villiers wrote:

Refer to sensorsd(8) and acpibat(4).  Given those and related manual
pages I'm relatively certain you should be able to achieve this.

OpenBSD is well-known for its clear and extensive documentation so use
this to your advantage.  The apropos(1) utility is your best friend :).
Your second and third best friends are the FAQ and the mailing list
archives.

I am working under the assumption that no proprietary blobs are
necessary to accomplish your goal.  Otherwise, I am afraid you are out
of luck as OpenBSD does not and never will contain any such blobs.
They are "black boxes" and thus cannot be trusted.

Regards,
JP


On 21/03/08 07:05pm, Subhaditya Nath wrote:

I have a Thinkpad E495 that has Battery Charge threshold support. i.e.
it can be set such that the battery starts charging at a specified
amount of charge (say, 70%) and automatically stops charging at a
specified charge (say, 80%). This feature is also available on Linux by
using TLP (made by linrunner, his website is linrunner.de)

The problem is, I searched for this option in OpenBSD, but I couldn't
find it.

It is a very crucial functionality for me. So, if somebody can please
tell me where I can set it, I would be very very thankful.

(Pardon my bad english, it's not my first language)






acpibat, as it stands, doesn't and cannot set/manipulate battery charge 
threshold levels.



--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



Re: How to set ThinkPad battery charge thresholds?

2021-03-08 Thread Ottavio Caruso

On 08/03/2021 13:35, Subhaditya Nath wrote:

I have a Thinkpad E495 that has Battery Charge threshold support. i.e.
it can be set such that the battery starts charging at a specified
amount of charge (say, 70%) and automatically stops charging at a
specified charge (say, 80%). This feature is also available on Linux by
using TLP (made by linrunner, his website is linrunner.de)

The problem is, I searched for this option in OpenBSD, but I couldn't
find it.

It is a very crucial functionality for me. So, if somebody can please
tell me where I can set it, I would be very very thankful.

(Pardon my bad english, it's not my first language)




As far as I know, you can't achieve that in the BSD ecosystem. TLP uses 
a Linux kernel model (acpi-call-dkms).


https://github.com/mkottman/acpi_call


--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



Re: How to set ThinkPad battery charge thresholds?

2021-03-08 Thread Jean-Pierre de Villiers
Refer to sensorsd(8) and acpibat(4).  Given those and related manual
pages I'm relatively certain you should be able to achieve this.

OpenBSD is well-known for its clear and extensive documentation so use
this to your advantage.  The apropos(1) utility is your best friend :).
Your second and third best friends are the FAQ and the mailing list
archives.

I am working under the assumption that no proprietary blobs are
necessary to accomplish your goal.  Otherwise, I am afraid you are out
of luck as OpenBSD does not and never will contain any such blobs.
They are "black boxes" and thus cannot be trusted.

Regards,
JP


On 21/03/08 07:05pm, Subhaditya Nath wrote:
> I have a Thinkpad E495 that has Battery Charge threshold support. i.e.
> it can be set such that the battery starts charging at a specified
> amount of charge (say, 70%) and automatically stops charging at a
> specified charge (say, 80%). This feature is also available on Linux by
> using TLP (made by linrunner, his website is linrunner.de)
>
> The problem is, I searched for this option in OpenBSD, but I couldn't
> find it.
>
> It is a very crucial functionality for me. So, if somebody can please
> tell me where I can set it, I would be very very thankful.
>
> (Pardon my bad english, it's not my first language)
>