Contribute
Register

Battery Manager with Fix for Boot without Batteries

Status
Not open for further replies.
The good news that I now have battery meter working. My problem is now that the battery meter doesn't show a charge over 85%.
 
The good news that I now have battery meter working. My problem is now that the battery meter doesn't show a charge over 85%.

It could be your battery is degraded such that it can only charge to 85% of DesignCapacity.

Run this in terminal:
Code:
ioreg -n AppleSmartBattery -r AppleSmartBattery

MaxCapacity/DesignCapacity is max percentage.
CurrentCapacity/DesignCapacity is current charged percentage.
 
This is the output I get from the command:

Code:
+-o AppleSmartBattery  <class AppleSmartBattery, id 0x1000001f9, registered, ma$
    {
      "PostChargeWaitSeconds" = 120
      "TimeRemaining" = 73
      "InstantTimeToEmpty" = 65535
      "ExternalChargeCapable" = Yes
      "CellVoltage" = (2096,2096,2096,2096)
      "PermanentFailureStatus" = 0
      "BatteryInvalidWakeSeconds" = 30
      "Voltage" = 8384
      "MaxCapacity" = 5543
      "Quick Poll" = No
      "AtWarnLevel" = No
      "Manufacturer" = "ASUSTeK"
      "CurrentCapacity" = 4843
      "LegacyBatteryInfo" = {"Amperage"=574,"Flags"=7,"Capacity"=5543,"Current"$
      "FirmwareSerialNumber" = 0
      "BatteryInstalled" = Yes
      "CycleCount" = 104
      "DesignCapacity" = 6167
      "AvgTimeToFull" = 73
      "ManufactureDate" = 0
      "AtCriticalLevel" = No
      "BatteryType" = "LIon"
      "InstantTimeToFull" = 80
      "BatterySerialNumber" = "M3N- "
      "PostDischargeWaitSeconds" = 120
      "Serial" = " "
      "Temperature" = 0
      "InstantAmperage" = 525
      "MaxErr" = 0
      "FullyCharged" = No
      "DeviceName" = "M3N"
      "IOGeneralInterest" = "IOCommand is not serializable"
      "Amperage" = 574
      "IsCharging" = Yes
      "ExternalConnected" = Yes
      "AvgTimeToEmpty" = 65535
    }

The good news is that after letting the laptop sleep for 10-20 minutes I got extra 2%. The bad news is that the "x:xx until full" keeps going up. Once I disconnect my charger, the battery goes to 90%.
 
This is the output I get from the command:

Code:
+-o AppleSmartBattery  <class AppleSmartBattery, id 0x1000001f9, registered, ma$
    {
      "PostChargeWaitSeconds" = 120
      "TimeRemaining" = 73
      "InstantTimeToEmpty" = 65535
      "ExternalChargeCapable" = Yes
      "CellVoltage" = (2096,2096,2096,2096)
      "PermanentFailureStatus" = 0
      "BatteryInvalidWakeSeconds" = 30
      "Voltage" = 8384
      "MaxCapacity" = 5543
      "Quick Poll" = No
      "AtWarnLevel" = No
      "Manufacturer" = "ASUSTeK"
      "CurrentCapacity" = 4843
      "LegacyBatteryInfo" = {"Amperage"=574,"Flags"=7,"Capacity"=5543,"Current"$
      "FirmwareSerialNumber" = 0
      "BatteryInstalled" = Yes
      "CycleCount" = 104
      "DesignCapacity" = 6167
      "AvgTimeToFull" = 73
      "ManufactureDate" = 0
      "AtCriticalLevel" = No
      "BatteryType" = "LIon"
      "InstantTimeToFull" = 80
      "BatterySerialNumber" = "M3N- "
      "PostDischargeWaitSeconds" = 120
      "Serial" = " "
      "Temperature" = 0
      "InstantAmperage" = 525
      "MaxErr" = 0
      "FullyCharged" = No
      "DeviceName" = "M3N"
      "IOGeneralInterest" = "IOCommand is not serializable"
      "Amperage" = 574
      "IsCharging" = Yes
      "ExternalConnected" = Yes
      "AvgTimeToEmpty" = 65535
    }

The good news is that after letting the laptop sleep for 10-20 minutes I got extra 2%. The bad news is that the "x:xx until full" keeps going up.

You can see from that output that your batttery is degraded. MaxCapacity=5543 and DesignCapacity=6167. That's only 72%. It must be that OS X reports CurrentCapacity/MaxCapacity which is 87%.

Keep in mind the time to full is an estimate based on CurrentCapacity/DesignCapacity,etc. But it appears your battery is charging (Amperage=574). The estimate can fluctuate depending on what the DSDT code reports.
 
I see, but is it normal behavior that once I remove the AC adapter the battery percentage goes to 90%+ (on AC adapter it is capped at 87%)?

Sorry to sound repetitive, but I do not understand why the battery does not charge more than 87%.
 
I see, but is it normal behavior that once I remove the AC adapter the battery percentage goes to 90%+ (on AC adapter it is capped at 87%)?

Sorry to sound repetitive, but I do not understand why the battery does not charge more than 87%.

I don't know what is normal for your laptop. All you can do is look at the numbers being reported by your DSDT and try to make sense out of them. What you see is totally dependent on what the DSDT code reports.

From the last output you gave, your battery is at 87% and *still charging*.
 
Hello! I apologise if I am not exactly using a HP Probook, but I have tested your AppleSmartBatteryManager and yes, it works; it correctly shows whether I am on AC or battery. The only problem is that it shows the battery fully charged at 87%, as I have posted on the attachment.
Now, this is what ioreg says:

Code:
ioreg -n AppleSmartBattery -r AppleSmartBattery
+-o AppleSmartBattery  <class AppleSmartBattery, id 0x100000268, registered, matched, active, busy 0 (0 ms), retain 6>
    {
      "PostChargeWaitSeconds" = 120
      "TimeRemaining" = 65535
      "InstantTimeToEmpty" = 65535
      "ExternalChargeCapable" = Yes
      "CellVoltage" = (4162,4162,4162,4162)
      "PermanentFailureStatus" = 0
      "BatteryInvalidWakeSeconds" = 30
      "Voltage" = 16648
      "MaxCapacity" = 4922
      "Quick Poll" = No
      "AtWarnLevel" = No
      "Manufacturer" = "ASUSTek"
      "CurrentCapacity" = 4260
      "LegacyBatteryInfo" = {"Amperage"=0,"Flags"=5,"Capacity"=4922,"Current"=4260,"Voltage"=16648,"Cycle Count"=70}
      "FirmwareSerialNumber" = 0
      "BatteryInstalled" = Yes
      "CycleCount" = 70
      "DesignCapacity" = 5342
      "AvgTimeToFull" = 65535
      "ManufactureDate" = 0
      "AtCriticalLevel" = No
      "BatteryType" = "LIon"
      "InstantTimeToFull" = 65535
      "BatterySerialNumber" = "G73--52- "
      "PostDischargeWaitSeconds" = 120
      "Serial" = " "
      "Temperature" = 0
      "InstantAmperage" = 0
      "MaxErr" = 0
      "FullyCharged" = Yes
      "DeviceName" = "G73--52"
      "IOGeneralInterest" = "IOCommand is not serializable"
      "Amperage" = 0
      "IsCharging" = No
      "ExternalConnected" = Yes
      "AvgTimeToEmpty" = 65535
    }

Curiously enough, when I disconnect the AC charger, the battery percentage goes up to 91%. :\

Could it be a DSDT problem? And if so, can I kindly ask for your help, since I'm completely a newbie when it comes to DSDT?
Thank you in advance.
 

Attachments

  • Screen Shot 2013-05-19 at 13.03.16.png
    Screen Shot 2013-05-19 at 13.03.16.png
    31.6 KB · Views: 162
Hello! I apologise if I am not exactly using a HP Probook, but I have tested your AppleSmartBatteryManager and yes, it works; it correctly shows whether I am on AC or battery. The only problem is that it shows the battery fully charged at 87%, as I have posted on the attachment.
Now, this is what ioreg says:

Code:
ioreg -n AppleSmartBattery -r AppleSmartBattery
+-o AppleSmartBattery  <class AppleSmartBattery, id 0x100000268, registered, matched, active, busy 0 (0 ms), retain 6>
    {
      "MaxCapacity" = 4922
      "CurrentCapacity" = 4260
      "DesignCapacity" = 5342
    }

Curiously enough, when I disconnect the AC charger, the battery percentage goes up to 91%. :\

Could it be a DSDT problem? And if so, can I kindly ask for your help, since I'm completely a newbie when it comes to DSDT?
Thank you in advance.

I don't see anything particularly wrong there. 4260/4922 is .8655 (87%). Your battery is somewhat degraded at this point, given that MaxCapacity is currently at 92% of DesignCapacity. If your battery stops charging at 4260, eventually that will become the new MaxCapacity. When the DSDT/EC does this adjustment is anyone's guess.

It could be a DSDT problem, but you would need to analyse the code in the related battery methods to see if Asus has a bug...
 
Over the past couple of weeks, I have been taking note of my charge cycles.

It seems that the batter never charges beyond 89% (it stays stuck). Is this "normal" or do I have a problem with my DSDT code?
 
Over the past couple of weeks, I have been taking note of my charge cycles.

It seems that the batter never charges beyond 89% (it stays stuck). Is this "normal" or do I have a problem with my DSDT code?

It could be DSDT, or it could be your battery/charging system.

You'd have to look at the system battery stats at the time it gets stuck:

Code:
# percent charged is CurrentCapacity/MaxCapacity
# as battery degrades, MaxCapacity becomes smaller percentage of DesignCapacity
ioreg -n AppleSmartBattery -r AppleSmartBattery | grep -y capacity | grep -yv legacy
# InstantAmperage is the rate of charge/discharge (discharge is negative)
# Amperage is an decaying average rate of charge/discharge
ioreg -x -n AppleSmartBattery -r AppleSmartBattery | grep -y amperage | grep -yv legacy
# or the whole works
ioreg -x -n AppleSmartBattery -r AppleSmartBattery | grep -yv legacy

Causes of a stuck 89% would be:
- DSDT doesn't adjust MaxCapacity lower when CurrentCapacity cannot be reached (eg. battery has further degraded).
- charging system is not charging the battery to its MaxCapacity because of other reasons (battery temperature, other malfunction, etc)
- other bugs in DSDT
 
Status
Not open for further replies.
Back
Top