Difference between revisions of "Template:Battery Testing"

From FreekiWiki
Jump to navigation Jump to search
Line 1: Line 1:
 +
__NOTOC__
 
===Understanding Laptop Batteries===
 
===Understanding Laptop Batteries===
 
The rechargeable batteries that power today's laptops are much more complex than the batteries typically found in other consumer electronic devices. They use sophisticated chemistry and control circuitry to maximize their runtime and longevity across years of use and potentially hundreds of charge/discharge cycles. Understanding their behavior - especially ones that have seen significant use - can be difficult but is very important for our Laptop Build processes. This guide is intended to help you measure and interpret a battery's vital signs and determine how much useful capacity remains.
 
The rechargeable batteries that power today's laptops are much more complex than the batteries typically found in other consumer electronic devices. They use sophisticated chemistry and control circuitry to maximize their runtime and longevity across years of use and potentially hundreds of charge/discharge cycles. Understanding their behavior - especially ones that have seen significant use - can be difficult but is very important for our Laptop Build processes. This guide is intended to help you measure and interpret a battery's vital signs and determine how much useful capacity remains.
  
'''Checking the State of a Battery''' <br>
+
===='''Checking the State of a Battery'''====
 
&#9744; To check and monitor the state of the battery, open a terminal and type: <br>
 
&#9744; To check and monitor the state of the battery, open a terminal and type: <br>
 
<code>
 
<code>
 
  watch -n3 -d cat /proc/acpi/battery/*/*
 
  watch -n3 -d cat /proc/acpi/battery/*/*
 
</code>
 
</code>
* The window should now display many lines of information about the battery that refresh every 3 seconds or so. The most important lines to look for are shown below with values taken from a healthy battery as an example. Other lines have been intentionally left out of this example and replaced with a '''-''', but will appear in real-world use. Real-world values may be significantly different, use different units, or missing entirely.
+
* The window should now display many lines of information about the battery that refresh every 3 seconds or so. The most important lines to look for are shown below with values taken from a healthy battery as an example. Other lines have been intentionally left out of this example and replaced with a '''-''', but will appear in real-world use. Real-world values may be significantly different, use different units, or be missing entirely. <br>
'''Example'''<br><code>
+
'''Example:'''<br>
 +
<code>
 +
-
 
  design capacity:      5200 mAh
 
  design capacity:      5200 mAh
 
  last full capacity:    4331 mAh     
 
  last full capacity:    4331 mAh     
Line 18: Line 21:
 
  remaining capacity:    3679 mAh
 
  remaining capacity:    3679 mAh
 
  present voltage:      12358 mV
 
  present voltage:      12358 mV
</code>
+
</code>
 +
====Interpreting Battery State====
 
'''Battery Capacity'''<br>
 
'''Battery Capacity'''<br>
 
In this example we can see from the difference between the <code>last full capacity</code> and <code>design capacity</code> that the battery has seen some use but still has about 83% of its original capacity. If the <code>last full capacity</code> is less than 30% of the <code>design capacity</code>, the battery may end up being too worn out to function correctly. <br>
 
In this example we can see from the difference between the <code>last full capacity</code> and <code>design capacity</code> that the battery has seen some use but still has about 83% of its original capacity. If the <code>last full capacity</code> is less than 30% of the <code>design capacity</code>, the battery may end up being too worn out to function correctly. <br>
 +
 
'''Charging'''<br>
 
'''Charging'''<br>
We can also see from the <code>charging state</code> and <code>present rate</code> that it is charging at a healthy rate, and we would expect the value for <code>remaining capacity</code> to increase steadily until it is at or near the value for <code>last full capacity</code>. A battery will typically charge slower and slower as it approaches its <code>last full capacity</code>; when it is fully charged the <code>charging state</code> should change to <code>charged</code> and the <code>present rate</code> should be at or very near <code>0 mA</code>. <br>
+
We can also see from the <code>charging state</code> and <code>present rate</code> that it is charging at a healthy rate, and we would expect the value for <code>remaining capacity</code> to increase steadily until it is at or near the value for <code>last full capacity</code>. A fully discharged battery will typically charge at several hundred mA at first, then faster (1000 - 3500 mA), then slower and slower as it approaches its <code>last full capacity</code>; when it is fully charged the <code>charging state</code> should change to <code>charged</code> and the <code>present rate</code> should be at about <code>0 mA</code>. <br>
 +
 
 
'''Battery Voltage'''<br>
 
'''Battery Voltage'''<br>
You may also have noticed that the <code>present voltage</code> is actually somewhat higher than the <code>design voltage</code>; this is normal for a healthy battery, and when the battery is discharging the value will drop initially then settle in around or a bit below its <code>design voltage</code>. If a battery has  
+
You may also have noticed that the <code>present voltage</code> is actually somewhat higher than the <code>design voltage</code>; this is normal for a healthy battery. When the battery is discharging the value will usually drop initially then settle in very near or a bit below its <code>design voltage</code>. If the <code>present voltage</code> continues to drop well below the <code>design voltage</code> as it discharges, it may suddenly shut off entirely even when the <code>remaining capacity</code> is high; this type of failure usually indicates a worn out or damaged battery.
 
+
<blockquote>
 +
'''Note:'''<br>
 +
If a battery has not been charged or used for a long time (like 6 months or more), its present voltage may be significantly below its design voltage, and won't charge normally until it "pre-charges" its voltage back to healthy levels. When this is the case, the <code>charging state</code> will read "<code>charging</code>" and the <code>present rate</code> will be much lower than usual (e.g. <400 mA) or even read 0 mA, but the <code>present voltage</code> will slowly increase. When the <code>present voltage</code> gets within about 1500 mV of its <code>design voltage</code>, you should notice the <code>present rate</code> increase significantly and the <code>remaining capacity</code> begin to increase as well. The battery should then more or less charge normally.
 +
</blockquote>
 
===Battery Charging and Testing===
 
===Battery Charging and Testing===
 
'''Confirm the Battery is Fully Charged''' <br>
 
'''Confirm the Battery is Fully Charged''' <br>
Line 33: Line 42:
 
  watch -n3 -d cat /proc/acpi/battery/*/*
 
  watch -n3 -d cat /proc/acpi/battery/*/*
 
</code>
 
</code>
*If the battery seems like it is healthy and charging normally, check the '''Start''' box next to Battery Charge on the Keeper Label and let it finish charging. <br>
+
*If the battery seems like it is healthy and charging normally, check the '''Start''' box next to Battery Charge on the Keeper Label and let it finish charging. <br><br>
  
 
'''Test Battery Life'''<br>
 
'''Test Battery Life'''<br>
&#9744; When the battery is fully charged, open a terminal and run the following command: <br>
+
&#9744; When the battery is fully charged, open a terminal and run: <br>
 
  <code>batterytest</code><br>
 
  <code>batterytest</code><br>
*Open a second Terminal ('''hint:''' press '''Super''' + '''T''' to quickly open a new terminal window) and run:
+
&#9744; Open a second Terminal ('''hint:''' press '''Super''' + '''T''' to quickly open a new terminal window) and run:
 
  <code>
 
  <code>
 
  while : ; do stress-test ; sleep 300 ; done
 
  while : ; do stress-test ; sleep 300 ; done
 
  </code>
 
  </code>
 
&#9744; Disconnect the AC adapter from the power outlet, but keep it with the laptop for later. <br>
 
&#9744; Disconnect the AC adapter from the power outlet, but keep it with the laptop for later. <br>
 +
&#9744; Get a '''Battery Testing''' label from the wall next to the testing shelf and stick it to the palm rest of the laptop.
 
<blockquote>
 
<blockquote>
 
'''How it works'''<br>
 
'''How it works'''<br>
The laptop will run the stress-test in a loop until it runs out of power. For every minute the laptop is on during battery testing, a line of text is logged in a file called <code>bat_mon</code>. When battery test is run again, the script counts up the number of lines of text in the <code>bat_mon</code> file, and outputs the number as the number of minutes the battery lasted.
+
The laptop will run 3 minutes of <code>stress-test</code>, then 5 minutes at idle, in a loop until it runs out of power and shuts off. For every minute the laptop is on during battery testing, a line of text is logged in a file called <code>bat_mon</code>. When battery test is run again, the script checks for the <code>bat_mon</code> file and counts up the number of lines of text in the file, then outputs the number as the number of minutes the battery lasted.
 
</blockquote>
 
</blockquote>
 
[[Category:Laptops]]
 
[[Category:Laptops]]

Revision as of 13:50, 12 October 2013

Understanding Laptop Batteries

The rechargeable batteries that power today's laptops are much more complex than the batteries typically found in other consumer electronic devices. They use sophisticated chemistry and control circuitry to maximize their runtime and longevity across years of use and potentially hundreds of charge/discharge cycles. Understanding their behavior - especially ones that have seen significant use - can be difficult but is very important for our Laptop Build processes. This guide is intended to help you measure and interpret a battery's vital signs and determine how much useful capacity remains.

Checking the State of a Battery

☐ To check and monitor the state of the battery, open a terminal and type:

watch -n3 -d cat /proc/acpi/battery/*/*

  • The window should now display many lines of information about the battery that refresh every 3 seconds or so. The most important lines to look for are shown below with values taken from a healthy battery as an example. Other lines have been intentionally left out of this example and replaced with a -, but will appear in real-world use. Real-world values may be significantly different, use different units, or be missing entirely.

Example:

-
design capacity:       5200 mAh
last full capacity:    4331 mAh     
-
design voltage:        11100 mV
-
charging state:        charging
present rate:          1549 mA
remaining capacity:    3679 mAh
present voltage:       12358 mV

Interpreting Battery State

Battery Capacity
In this example we can see from the difference between the last full capacity and design capacity that the battery has seen some use but still has about 83% of its original capacity. If the last full capacity is less than 30% of the design capacity, the battery may end up being too worn out to function correctly.

Charging
We can also see from the charging state and present rate that it is charging at a healthy rate, and we would expect the value for remaining capacity to increase steadily until it is at or near the value for last full capacity. A fully discharged battery will typically charge at several hundred mA at first, then faster (1000 - 3500 mA), then slower and slower as it approaches its last full capacity; when it is fully charged the charging state should change to charged and the present rate should be at about 0 mA.

Battery Voltage
You may also have noticed that the present voltage is actually somewhat higher than the design voltage; this is normal for a healthy battery. When the battery is discharging the value will usually drop initially then settle in very near or a bit below its design voltage. If the present voltage continues to drop well below the design voltage as it discharges, it may suddenly shut off entirely even when the remaining capacity is high; this type of failure usually indicates a worn out or damaged battery.

Note:
If a battery has not been charged or used for a long time (like 6 months or more), its present voltage may be significantly below its design voltage, and won't charge normally until it "pre-charges" its voltage back to healthy levels. When this is the case, the charging state will read "charging" and the present rate will be much lower than usual (e.g. <400 mA) or even read 0 mA, but the present voltage will slowly increase. When the present voltage gets within about 1500 mV of its design voltage, you should notice the present rate increase significantly and the remaining capacity begin to increase as well. The battery should then more or less charge normally.

Battery Charging and Testing

Confirm the Battery is Fully Charged
☐ Set the laptop on the testing shelf and make sure it is plugged in to a power outlet.
☐ To monitor the state of the battery, open a terminal and type:

watch -n3 -d cat /proc/acpi/battery/*/*

  • If the battery seems like it is healthy and charging normally, check the Start box next to Battery Charge on the Keeper Label and let it finish charging.

Test Battery Life
☐ When the battery is fully charged, open a terminal and run:

batterytest

☐ Open a second Terminal (hint: press Super + T to quickly open a new terminal window) and run:


while : ; do stress-test ; sleep 300 ; done

☐ Disconnect the AC adapter from the power outlet, but keep it with the laptop for later.
☐ Get a Battery Testing label from the wall next to the testing shelf and stick it to the palm rest of the laptop.

How it works
The laptop will run 3 minutes of stress-test, then 5 minutes at idle, in a loop until it runs out of power and shuts off. For every minute the laptop is on during battery testing, a line of text is logged in a file called bat_mon. When battery test is run again, the script checks for the bat_mon file and counts up the number of lines of text in the file, then outputs the number as the number of minutes the battery lasted.