An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Topic Options
#12015 - 09/26/10 11:43 AM PowerBook battery question
MikeS Offline


Registered: 08/04/09
Sorry to join in late.
I usually - for reasons I can't recall at this moment in time - run my powerbook off the battery until it reaches about 50% and then run off mains until 100% , then off battery until 50% again and so on and calibrate every month or so if I can remember. However, a couple of nights ago, just after the battery had reached 100%, I turned off at mains and shut the lid.
I usually shut down the laptop every evening after use, but on this occasion I proceeded to forget to do so, which, effectively means that the laptop has been asleep for about 48 hours. When I opened the lid tonight I noticed that the battery power had reduced to 53% shocked Surely, this seems somewhat excessive to drop 47% whilst asleep for 2 days?
Something else I've just remembered is that I have noticed that when the battery is re-charging, it does so much more quickly whilst I am still using the laptop than if the lid was down/asleep.
Any comments or whatever? Regards. Mike


Edited by MikeS (09/26/10 02:47 PM CST)


Edited by moderator: detached from Should leave cord in laptop?


Edited by dianne (09/27/10 03:48 PM)
Edit Reason: changed Subject line.

Top
#12018 - 09/26/10 02:31 PM Re: PowerBook battery question [Re: MikeS]
kevs Offline


Registered: 12/07/09
Interesting, I was at internet cafe.
I did not want to leave the laptop alone unattended.
I closed the lid, walked to the bathroom.
but after I opened the lid, everything was black.

Had to boot up.

and this laptop often cannot find the system for some reason, so had to do whole boot up with option key.

New rule: keep that lid open!

Top
#12030 - 09/27/10 11:32 AM Re: PowerBook battery question [Re: kevs]
MikeS Offline


Registered: 08/04/09
And I thought my laptop/battery behaviour was cause for confusion!
Regards. Mike

Top
#12034 - 09/27/10 03:56 PM Re: PowerBook battery question [Re: MikeS]
dianne Offline

Moderator

Registered: 08/04/09
Hi, Mike

Let us know what is reported when you go to System Profiler > Hardware > Power > Health Information:
  • Cycle count:
  • Condition:
_________________________
dianne • moderator

Back up everything you can't afford to lose – documents, mail, movies, music, photos, and other data and settings.

Top
#12039 - 09/27/10 10:07 PM Re: PowerBook battery question [Re: dianne]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
Here's my new 2010 MBP, for comparison:

system_profiler SPPowerDataType |grep -A2 Health
Code:
      Health Information:
          Cycle count: 16
          Condition: Normal

Top
#12051 - 09/28/10 07:38 AM Re: PowerBook battery question [Re: kevs]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
Sometimes laptops have issues with sleep and wake. It's often an OS issue. I have a rule of thumb I try to follow with my mbp, my primary computer.

When I get ready to go, I unplug all cables, THEN close the lid. The sleep light comes on at 50% and stays solid. After about 20 sec, (varies on amount of ram installed and open apps) the light starts pulsing.

I do NOT put it in the bag until it pulses. If it fails to pulse, most of the time when I reopen it, it's still very much awake. Sometimes closing the lid the second time works. Sometimes not. If it DOESN'T work, it's NOT going to sleep, and I shut it down instead. (and then, sometimes it fails to shut down properly)

If I don't follow this rule, on the rare times it fails to sleep, it'll continue to run in my bag, sometimes for an hour or more, quickly exhausting its battery and overheating due to being closed in the bag. When i get where I'm going, the mbp is OFF, HOT, and the battery is TOTALLY DEAD. (and will be FSCK'ing for a slow startup when I turn it back on) Thankfully I carry a spare battery, but still, something I try to avoid.

Never trust your computer to finish preparing for sleep. Always wait for it and verify it's asleep before leaving it.
_________________________
I work for the Department of Redundancy Department

Top
#12059 - 09/28/10 11:22 AM Re: PowerBook battery question [Re: dianne]
MikeS Offline


Registered: 08/04/09
Why thank you for your concern. wink
As for the health of the battery, its pulse seems fine when asleep. smirk However, probably due to the fact that I'm running OSX 10.4.11, I can find no "Health Information" regarding "Condition".
"Cycle Count" is 180, in fact, here are all the details :-

Battery Information:

Battery Installed: Yes
First low level warning: No
Full Charge Capacity (mAh): 3357
Remaining Capacity (mAh): 2930
Amperage (mA): -1071
Voltage (mV): 16168
Cycle Count: 180

I hope this means more to someone else than it does to myself, although in my own "defence" I do understand the significance of "Cycle Count". laugh
I would point out that this battery is only about nine months old and was a replacement for one that only "lasted" less than twelve months. Although I don't consider £80 (about $130) to be cheap, perhaps, with hindsight, a more expensive "Apple" replacement may have been a better course of action.
Thanks again. Regards. Mike


Top
#12063 - 09/28/10 01:20 PM Re: PowerBook battery question [Re: MikeS]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
Originally Posted By: MikeS
Battery Information:

Battery Installed: Yes
First low level warning: No
Full Charge Capacity (mAh): 3357
Remaining Capacity (mAh): 2930
Amperage (mA): -1071
Voltage (mV): 16168
Cycle Count: 180


The FCC of 3357 is still doing pretty good. Known best limit would depend on your model but I'd say anything over 2700 or so is going to have fair runtime. (mine's fairly new, over 5000) -1071 means you're discharging (running on battery) 180 cycle count is a bit over 1/2 toward getting a new battery. The rest of the information isn't very useful to you concerning battery health.

I'm going to make two more posts, containing a checking program I wrote and a summary program I wrote also. Leave me alone those of you that know bash, it's been awhile since I wrote it and I'm too lazy to clean it up since it works wink

Run the first one and follow the directions. when your computer force sleeps (or shuts off), plug it back in and wake it up/start it up and run the second one to get a nice graph showing the discharge curve which we can look at to see if there's a problem.
_________________________
I work for the Department of Redundancy Department

Top
#12064 - 09/28/10 01:21 PM battmonitor [Re: MikeS]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
Code:
#!/bin/bash

cd "${0%/*}"

# poll battery every x seconds
resolution=5

clear
echo
read -p "Be sure screen and computer sleep are disabled, press RETURN: " x
clear
echo
echo "Recommended steps for use:"
echo "1) disable energysaver settings that will put the computer to sleep"
echo "2) wait for the battery to become fully charged, or as far as it will go"
echo "3) start battmonitor"
echo "4) immediately unplug ac power"
echo "5) allow the computer to deplete the battery and go to forced sleep"
echo "6) plug the computer back into ac power and immediately wake it up"
echo "7) allow the computer to fully charge the battery"
echo "8) ctrl-c to stop battmonitor, and run battsummary to view resuls"
echo
echo

if [ -f battcheck.txt ] ; then
  echo "battcheck.txt file already exists."
  echo
  echo "If the computer shut down instead of sleep, you can resume"
  echo "the recording now to analyze the charge process as well."
  echo "This is best done immediately after ac power was restored."
  echo
  while true ; do
    read -p "Resume recording or Create new? (R/C): " rc
    rc=$(echo "$rc" | tr a-z A-Z)
    if [ "$rc" == "C" ] ; then
      rm battcheck.txt
      echo
      echo "(old recording file has been cleared)"
      break
    elif [ "$rc" == "R" ] ; then
      echo
      echo "(resuming recording)"
      break
    fi
  done
fi

echo
echo
echo "monitoring battery...  use battsummary to view results later."
echo
while true ; do
  x=$(system_profiler SPPowerDataType | grep -i remaining)
  y=$(date)
  echo "$y $x"
  echo "$y $x" >> battcheck.txt
  sleep $resolution
done
_________________________
I work for the Department of Redundancy Department

Top
#12065 - 09/28/10 01:21 PM battsummary [Re: MikeS]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
Code:
#!/bin/bash

# only thing left to do is trim off "fully charged" dups at the end of the input file

clear
cd "${0%/*}"

file3="battcheck.txt"
file1="battcheck0.txt"
file2="battcheck2.txt"

if ! [ -f "$file3" ] ; then
  echo "Cannot find \"$file3\" in this folder, did you run the battmonitor?"
  exit
fi

newfile="battsummary $(date "+%Y-%m-%d %H.%M").txt"
if [ -f "$newfile" ] ; then
  rm "$newfile"
fi
touch "$newfile"
echo
echo "Will create \"$newfile\""
echo

# trim off any duplicats at the end
x=$(tail -n 1 "$file3")
x=$(echo "$x" | cut -c $((${#x}-6))-99)
head -n $(($(cat "$file3" | wc -l)-$(cat "$file3" | grep "$x" | wc -l)+1)) "$file3" > "$file1"
r=$(($(cat "$file3" | wc -l)-$(cat "$file1" | wc -l)))
if [ $r -gt 10 ] ; then
  echo "(trimmed $r duplicate samples from end of $file3)"
  echo
fi

tot=$(($(cat "$file1" | wc -l)))
echo "Read $tot lines from \"$file1\""

echo
echo
echo

if [ -f "$file2" ] ; then
  rm "$file2"
fi
# read in source file, with lines like:
# Mon Aug 25 18:17:19 CDT 2008           Charge remaining (mAh): 6036
# and make another file with lines like:
# 1219706233	6036
# where first field is epoch seconds, and second field is mAh
# also, track min and max values of mAh
echo -n "      converting $file1 to raw data..."
n=0
lowcharge=9999
highcharge=0
while read x ; do
  file1epoch=$(date -j -f "%a %b %d %T %Z %Y" "$(echo "$x" | cut -c 1-28)" "+%s")
  file1mah=$(echo "$x" | cut -c $((${#x}-6))-999 | cut -d ' ' -f 2)
  echo ${file1epoch}$'\t'${file1mah} >> "$file2"
  n=$((n+1))
  echo -n $'\r'$((n*100/tot))" "
  if [ $lowcharge -gt $file1mah ] ; then
    lowcharge=$file1mah
  elif [ $highcharge -lt $file1mah ] ; then
    highcharge=$file1mah
  fi
done < "$file1"
echo "done"
echo
rm "$file1"

echo "mAh ranges from $lowcharge to $highcharge over $((highcharge-lowcharge))"
echo "mAh ranges from $lowcharge to $highcharge over $((highcharge-lowcharge))" >> "$newfile"


# 101 characters
bar="*****************************************************************************************************"

starttime=$(head -n 1 "$file2" | cut -f 1)
finishtime=$(tail -n 1 "$file2" | cut -f 1)

deltatime=$((finishtime-starttime))

echo "Time ranges from $(date -j -f "%s" "$starttime") to $(date -j -f "%s" "$finishtime") over $(date -j -f "%s" "$(($deltatime+21600))" "+%H:%M:%S")"
echo "Time ranges from $(date -j -f "%s" "$starttime") to $(date -j -f "%s" "$finishtime") over $(date -j -f "%s" "$(($deltatime+21600))" "+%H:%M:%S")" >> "$newfile"
echo "(in epoch seconds, $starttime to $finishtime over $deltatime)"
echo "(in epoch seconds, $starttime to $finishtime over $deltatime)" >> "$newfile"

echo
echo >> "$newfile"

deltacharge=$((highcharge-lowcharge))

pct=0
sampletime=0
gap=0
sampleinc=$(($deltatime/100))
while [ $pct -le 100 ] ; do
  finddtime=$(($deltatime*$pct/100))
  findtime=$(($starttime+$finddtime))
  while [ $sampletime -lt $findtime ] ; do
    read sample
    sampletime=$(echo "$sample"| cut -f 1)
  done
  samplecharge=$(echo "$sample"| cut -f 2)
  pctcharge=$(($samplecharge*100/$highcharge+1))
  sampledtime=$(($sampletime-$starttime))
  barcharge=$(echo "$bar" | cut -c 1-${pctcharge})
  reltimeh=$(date -j -f "%s" "$(($sampledtime+21600))" "+%H:%M:%S")
  sampletimeh=$(date -j -f "%s" "$(($sampletime))" "+%H:%M:%S")
  if [ $(($sampletime-$findtime)) -gt $sampleinc ] ; then
    gap=$((gap+1))
    if [ $lastok ] ; then
      echo "--:-:-- / --:-:-- --- (no readings)"
      echo "--:-:-- / --:-:-- --- (no readings)" >> "$newfile"
      lastok=
    fi
  else
    echo "$sampletimeh / $reltimeh $checkcharge $pctcharge $barcharge"
    echo "$sampletimeh / $reltimeh $checkcharge $pctcharge $barcharge" >> "$newfile"
    lastok=1
  fi
  pct=$((pct+1))
done < "$file2"

norm=100
amp=$((100*norm/(100-gap)))
#echo "gap=$gap, amp=$amp"
if [ $amp -gt 120 ] ; then
  echo
  echo >> "$newfile"
  echo "Normalizing to $norm readings..."
  echo "Normalizing to $norm readings..." >> "$newfile"
  echo
  echo >> "$newfile"
  pct2=0
  sampletime=0
  sampleinc=$(($deltatime/100))
  while [ $pct2 -le $amp ] ; do
    pct=$((pct2*100/amp))
    finddtime=$(($deltatime*pct2/amp))
    findtime=$(($starttime+$finddtime))
    while [ $sampletime -lt $findtime ] ; do
      read sample
      sampletime=$(echo "$sample"| cut -f 1)
    done
    samplecharge=$(echo "$sample"| cut -f 2)
    pctcharge=$(($samplecharge*100/$highcharge+1))
    sampledtime=$(($sampletime-$starttime))
    barcharge=$(echo "$bar" | cut -c 1-${pctcharge})
    reltimeh=$(date -j -f "%s" "$(($sampledtime+21600))" "+%H:%M:%S")
    sampletimeh=$(date -j -f "%s" "$(($sampletime))" "+%H:%M:%S")
    if [ $(($sampletime-$findtime)) -gt $sampleinc ] ; then
      if [ $lastok ] ; then
        echo "--:-:-- / --:-:-- --- (no readings)"
        echo "--:-:-- / --:-:-- --- (no readings)" >> "$newfile"
        lastok=
      fi
    else
      echo "$sampletimeh / $reltimeh $checkcharge $pctcharge $barcharge"
      echo "$sampletimeh / $reltimeh $checkcharge $pctcharge $barcharge" >> "$newfile"
      lastok=1
    fi
    pct2=$((pct2+1))
  done < "$file2"
fi


echo
echo "Output saved to \"$newfile\""
echo

rm "$file2"
_________________________
I work for the Department of Redundancy Department

Top
#12095 - 09/29/10 11:48 AM Re: PowerBook battery question [Re: Virtual1]
MikeS Offline


Registered: 08/04/09
Thanks for your reply - I'm more reassured already.
I will check out the other two posts when I feel more adventurous.
Thanks again. Regards. Mike

Top

Moderator:  alternaut, dianne, MacManiac