Defy battery drops explained

Search This thread

Quza

Senior Member
Jan 5, 2011
116
6
Bamberg
I have CM 7.1.0, and my battery drops from 69% to 49%, from 29% to 20% and from 10% to 4%
This is too much... can I do something to fix this? I have the original 1500 mAh battery.

Im on cm7 7.2.0 and i have same problems with the jumps and still lookin for ways to fix or stablize or sumit

Same problem here, have you found anything to fix this issue? CM 7.2 is pretty awesome, apart from the battery level ignoring ~45%, thats too much :/
(~65-49, ~45-19)
Is there a competitive ROM that gets it right? MIUI?
 

funto

Senior Member
Dec 6, 2010
52
15
But all this doesn't explain why drops are present in one rom and in other they aren't. (latest Quarx, huge battery drops, Sevenrocks's unofficial rom not at all)
 

czarekusa

New member
Oct 12, 2012
3
0
so i'm trying to play with the battd settings to see if i can at least test one of the fixes buy my folder seems to be empty so I can't even change the permissions.
Can anyone help?
screenshot-20130227-035434pm.png


I'm having the following situations happening daily. This is a 2nd battery that I purchased but my wife's defy is not doing this, even when we swap batteries.
screenshot-20130227-035601pm.png
 

LetoKynes

Senior Member
Dec 1, 2010
91
9
Hey guys

I finally replaced my phone's battery after about 2 years and was impressed with the battery life even on its second cycle (see first pic, that was with regular wifi/data use).
However, last night in the middle of the night I felt the phone was quite warm to touch and the battery had drained by something like 30% not even a quarter through the night. I know this happens when something has kept it awake, so I checked BetterBatteryStats and found some things keeping a Kernel Wakelock - some NETMUX thing and ehci_pm.

Any ideas what I can do to prevent this from happening again? The phone was running extremely slowly during that period. But after reboot and switch on/off airplane mode it's fine now. Not sure if related but I wasn't able to see my airplane mode icon at the time until I rebooted.

Thanks in advance for any help!

P. S. I'm on 17/2 Quarx CM10 + JellyX

Sent from my MB525
 

Attachments

  • uploadfromtaptalk1362210320025.jpg
    uploadfromtaptalk1362210320025.jpg
    46.4 KB · Views: 634
  • uploadfromtaptalk1362210355181.jpg
    uploadfromtaptalk1362210355181.jpg
    23.8 KB · Views: 616

magkaki

Member
Mar 15, 2013
6
1
question

Hi i hava a question and i want a straight answer. I own a Motorola Defy+ MB526 and i want to install Android 4.1.2 Jellybean CM10-20130307-NIGHTLY-mb526.zip latest Quarz release. Should i install battery fix or not? And what is the proper fix file?
 
  • Like
Reactions: jokermithun

VI_2480

Member
Mar 22, 2013
8
0
I have several Defy phones and one particular one (MB526) I bought off ebay from someone who flashed JB and after that the battery drained dramatically. I figured I'd just flash the standard rom on it and it should fix it, but no luck.

If I fully charge the battery and turn the phone off within 12 hours the battery is flat (15%).
I swapped batteries from another phone to be sure it wasn't being reported incorrectly but the phone really is running down batteries even when switched off.

Can anyone offer any explanation or idea what's happening ?
 

xuefer

Senior Member
Feb 22, 2013
169
245
Shenzhen
github.com
are MB860 and Defy use same chip? all notes seems to apply to MB860 except that new battd is still running under system id 9000 on epiter's CM10 rom

# ls -l /data/battd/
total 33
-rw-rw---- 1 9000 9000 24 Apr 23 15:42 cc_data
-rw-rw---- 1 9000 9000 24 Apr 23 15:44 cc_data_old
-rw-rw---- 1 9000 9000 99 Apr 23 15:42 powerup
-rw-rw---- 1 9000 9000 8 Apr 8 13:15 uid

(new battd cc_data = 24 bytes - new battd.)

# md5sum /system/*/*bat*
b296b3c81f2ec5e871adc94e46650fe2 /system/bin/battd
522716692b003ab5fc10dbcbbbe7b864 /system/lib/libbattd.so

# ps |grep battd
19802 9000 0:00 /system/bin/battd
# grep -A4 battd /*.rc
/init.olympus.rc:service battd /system/bin/battd
/init.olympus.rc- class core
/init.olympus.rc: socket battdsock stream 0660 system system
/init.olympus.rc- user root
/init.olympus.rc- group system system
/init.olympus.rc- oneshot
 

adyo13

Senior Member
Sep 14, 2007
60
28
New batery (custom 2400mAh) and I still have drops :(. During charge it jumps from ~80 to 100%, and during discharge, below ~30%, it jumps very fast (5minutes) to 19-14-4% and the phone shuts down (seams the same defective amount from the charge cycle). I did charged the baterry to 12+ hours first 2 times and I have enough charge cycles to be concerned.
Defy green lens with cm10.1_15/4.
(Shoud I try a battery fix? Like the one for the 1700mAh battery?)
Thanks
 

Feche

Senior Member
Oct 5, 2012
611
288
Buenos Aires
New batery (custom 2400mAh) and I still have drops :(. During charge it jumps from ~80 to 100%, and during discharge, below ~30%, it jumps very fast (5minutes) to 19-14-4% and the phone shuts down (seams the same defective amount from the charge cycle). I did charged the baterry to 12+ hours first 2 times and I have enough charge cycles to be concerned.
Defy green lens with cm10.1_15/4.
(Shoud I try a battery fix? Like the one for the 1700mAh battery?)
Thanks

If you are using CM10 you don't need to do this since it has an custom battery driver, correct me if I'm wrong.
 

SebaS-DG

Senior Member
Aug 21, 2011
355
39
I have two drops, then i let it discharge to 1% and my phone stay awake with full brightness for 45 min w/o any problem.
 

royrules26

Member
Mar 23, 2013
29
3
in the /data/battd/ path i dont have any cc_data file
it just contains 2 files : 892B667A260050B5 and batt_data

iam on MB525 running on CM 10
 

tartza

New member
May 21, 2012
2
4
So, if you have battery drops or unaccurate estimations, open as text file with some root file manager /sys/devices/platform/cpcap_battery/power_supply/battery/uevent
You'll find POWER_SUPPLY_CHARGE_FULL_DESIGN = your detected battery capacity
If "your detected battery capacity" is not near battery nominal mAh then you have a worn cell of battery, but not necessary,
it could also be the PCB of the battery.
eg. a good cell but an broken pcb could report 500mAh and the calculations will be made with this value by the battd deamon.
For those who are wondering why the battery temperature is not indicated correctly, there should be a thermistor which is replaced by a simple resistance (10kOhm).
 

Sparky_12

Member
May 15, 2013
16
1
Battery Fix needed

Hi there,

Forgive me, I'm a noob to these forums, but am currently running Whiterabbit 2.1.1 on my Green lens Defy Mb525 and am looking for a battery fix which actually works.

There seem to be patches available for the Defy+ but can't find anything suitable for the Defy.

Can anyone point me towards effective battery solutions that will give me decent battery life again and prevent these frequent drops?

Any help much appreciated.

Thank you!
 

adyo13

Senior Member
Sep 14, 2007
60
28
So, if you have battery drops or unaccurate estimations, open as text file with some root file manager /sys/devices/platform/cpcap_battery/power_supply/battery/uevent
You'll find POWER_SUPPLY_CHARGE_FULL_DESIGN = your detected battery capacity
If "your detected battery capacity" is not near battery nominal mAh then you have a worn cell of battery, but not necessary,
it could also be the PCB of the battery.
eg. a good cell but an broken pcb could report 500mAh and the calculations will be made with this value by the battd deamon.
For those who are wondering why the battery temperature is not indicated correctly, there should be a thermistor which is replaced by a simple resistance (10kOhm).

If I put in the old, broke, percentage dropping and swollen original motorola battery, the POWER_SUPPLY_CHARGE_FULL_DESIGN reports 1500, but if I use a new 1600 mAh POLAR CELL battery (way better/long lasting than the old one), the POWER_SUPPLY_CHARGE_FULL_DESIGN reports 1140 (same thing with a fake 2430 mAh chinese battery, still 1140, even after a full sbf reinstal). With the pollar cell I have ~2 days battery life, but the last 6 hours it reports 1% (from about 3700 mAh down), hope it will get better after few charges. Don't know about the 1140 report from the POWER_SUPPLY_CHARGE_FULL_DESIGN file tho, if it affects something.

Also, with the custom batteries, I don't have temperature readings anymore. It only shows 25 or 26 degrees, even if the phone is getting hot in my hand (old battery still indicates correctly the temp)
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 145
    Recently many users of the Motorola Defy phone have encountered sudden drops in battery charge after installing a new ROM. Such as, drops from 67% to 49%, from 34% to 19%, from 7% to 4%, etc.
    I also have encountered such problem when installed CM7.2 after being used stock Froyo ROM for more than an year. I had searched forums for possible fix, but no method has helped.

    Finally, I have made some tests with my phone and found interesting points about Defy battery that explain battery percentage drops.

    Our Defy have very simple battery controller (it is referred as cpcap by Motorola). The controller does not calculate and provide battery percentage. It provides only a battery voltage and a current. The battd daemon do the battery percentage estimation. It seems some overcomplicated estimation algorithm is used to do that (I've seen the Coulomb counter technique is mentioned in the battd sources).

    There are several battery percentage checkpoints at 5%, 20%, 50%, 80%, 100%. It seems the battd daemon have a voltage-percentage mapping table for these checkpoints. When a battery voltage reaches a checkpoint value then the percentage is immediately set to a corresponding value. All other intermediate percentage values are estimated by the battd daemon. The estimation is based on a battery capacity (requested from the battery itself) and the active current. A stock battery reports 1500 capacity. A 1700mAh Chinese battery, I also have, reports only 1200 capacity :laugh: battd stores the last calculated battery percentage and voltage in the /data/battd/cc_data file. Data from the /data/battd/cc_data file is read on start-up and the percentage from this file is used as base and reported to the system. When battery is drained, the percentage is decremented. When you delete the cc_data and reboot, battd uses the current voltage and looks for the nearest checkpoint voltage value and sets the percentage accordingly.

    How have I found the checkpoint values above?

    Assume we have a brand new original Defy battery and it shows 25% of charge.
    If you delete the cc_data file and then reboot the phone, battd will recreate the file and request the battery controller(?) for the current battery status. The controller will return 50% and battd show 49% to you (not 49% not 50%, due to rounding to the lowest integer). But the real charge is 25%! Now let the battery discharge. It will show to you 48%, 47%, 46%, etc. Great! But at 40-44% you get the instant drop to 19%, since the battery controller had reported real 20% charge at that point and battd has been forced to sync its estimated charge value to the real charge value.

    When a battery is wearing its actual capacity is decreased. For example, it may be 1300 mAh after an year of usage. But battery still reports it have 1500 capacity and battd uses this capacity for its calculations. battd should decrement percentage a bit faster for this worn battery, but it still use the same decrement speed as for a new 1500 battery. When battery voltage reaches a check point value, battd updates percentage to corresponding checkpoint value and you register a drop.

    battd has some battery information and correction data in the /pds/public/battd folder. This data helps battd to estimate battery charge more correctly. This folder contain 3 files:
    Code:
    batt_offset_data
    batt_phasing_data
    batt_tuning_data

    Without this correction data you may encounter slight drops even on a new stock battery,

    For Defy there at least 2 versions of battd. (Defy+ uses a different battd) Let's name them as old and new ones. To find out which version you have, check the size of the /data/battd/cc_data file.
    cc_data = 16 bytes - old battd,
    cc_data = 24 bytes - new battd.

    Early stock Froyo ROMs have the old battd, newer stock ROMs have the new battd. CM7.2 is bundled with the new battd.

    Is the battd version makes any difference in the battery readings? YES. The difference is in a user account which is used to run a battd daemon.
    The old battd uses the mot_accy user account, The new battd uses the system account. The corresponding owner and group should be set for the /pds/public/battd folder and files inside it. Otherwise battd will not be able to read battery data from the /pds/public/battd folder and defaults will be used, which cause inaccurate estimations.

    If you have used stock old Froyo ROM or old custom ROM, you had the old battd. The /pds/public/battd folder has permissions for the mot_accy user account only.
    You install the CM7.2 ROM with the new battd and it can not read battery data from the /pds/public/battd folder, since battd is run under the system user account. You have inaccurate battery estimation and percentage drops even on a brand new battery.
    That's why installing the old battd (and its companion lib libbattd.so) on CM7.2 resolves battery drops issue for some users.
    If you are using CM7.2 or any newer CM you can just change the owner and group for the /pds/public/battd folder and files inside it. Set both owner and group to system and the new battd will be able to read battery data files.

    If you still have battery drops then your battery is worn to some degree and battd can not estimate its charge properly between checkpoints.
    Is it possible to correct this? Probably yes.

    I was able to adjust checkpoint voltage values and eliminate drops on checkpoints. BUT the discharging speed is still the same and I have good discharge without drops from 100% to 10% and phone is turned off on 10% since a battery reaches critical voltage of 3.050V.
    To adjust checkpoints it is needed to change the /pds/public/battd/batt_offset_data file. I have changed the last 3 bytes to 0xA0. It offsets voltage value for checkpoints on 50%, 20% and 5%.

    The batt_phasing_data file have not helped at all in my tests. It contains correction values for displayed voltage, temperature, current.

    The batt_tuning_data file is total mystery atm.

    So the goal is to find a way to force battd to decrement percents faster for worn batteries. The simplest way is to patch the battd with hardcoded capacity value (e.g. 1300) instead of reading this value from the battery.

    The other (better) option is to create a custom battery driver and use a very simple mapping from current voltage to percentage. Such method is used to display battery status in touch boot menu. Also Quarx started a custom battery driver some time ago in his git repository.

    Important:
    The battery calibration is a myth! The /data/system/batterystats.bin file is not related to battery charge/life/status (exactly as Google devs stated earlier).
    In case of our Defy, charge the battery to 100% and keep charging for few hours after that. Then disconnect it battd will display correct 99%. That's all you need when changing ROMs or batteries! Do not waste your time on "battery calibration"!

    Conclusion:
    • Find out which version of battd you are using.
    • Check owner and permissions for the /pds/public/battd folder and files inside it. Correct owner/permissions if needed.
    • Charge your battery to 100% and keep charging for few hours more.
    If you still have battery percentage drops after that, your battery is worn to some degree. The sum of dropped percents indicates how bad is your battery (-10%, -15% etc, compared to a new battery). There is no way to magically increase real life for this battery. Drops just a display issue due to crappy cheap battery controller in our Defy and weak battd estimation logic. That's why stock ROMs have 10% steps for battery charge - to hide such issues.
    6
    i went to check the capacity of my battery and went to /sys/devices/platform/cpcap_battery/power_supply/battery/uevent
    i got values for POWER_SUPPLY_CHARGE_FULL_DESIGN = 500 and the temperature is stuck at 25c
    so its a possible fake battery.

    I read in the previous post that I can transplant the PCB of my original defy battery.
    I tried unwrapping both original and the fake one. It clearly shows that they are both different inside.

    The original battery is on the right side with the PCB exposed.
    psfhaIF.jpg


    Close up for the original battery.
    I9Q7ivy.jpg


    Close up for the fake battery.
    i6JqNez.jpg



    Now the transplant begins.
    original defy battery with PCB off
    gTfj6uD.jpg


    NpgSaHU.jpg


    fake battery with PCB off
    MHX4xw9.jpg


    gUQQdXS.jpg



    transplanted the PCB of the original battery to the fake battery.
    4RDq7nq.jpg


    rRzZdDZ.jpg


    eFvjC8w.jpg


    now reinforced with some tape. i'm not the best person in packing the battery so I just left it as it is. So may be i can try other batteries.
    Right now the value for POWER_SUPPLY_CHARGE_FULL_DESIGN = 1500 and temperature now vary from 35c to 40 when charging.
    lkJVqeC.jpg
    3
    ive done a rom in the development section wich outperforms stock rom(froyo)when comes to battery http://xdaforums.com/showthread.php?t=1774870 this rom has ported battd from system/bin,but also libbatd.so from system/lib therefore the rom kernel scheduler is more aware of the defy mb 525 1500 mah battery since most ports come with different libbat.so,does better task scheduling and proper battery reads.This rom charges battery similar to froyo but it uses better as google stated gingerbread advantage over froyo and some xda devs about using a froyo kernel on gingerbread

    have put the battd and libbattd.so from the rtcee rom http://sbf.droid-developers.org/umt...RDNFRYORTCEE_P016_A016_HWp3_Service1FF.sbf.gz into a update zip for cwm, maybe it helps some ppl
    2
    there's also hoop while charging which "compensates" the drop. moreover, there are no sudden voltage drops or so which would mean the battery is just fine, only the readings fail.
    i wonder if can it be fixed or so by our devs?

    Slightly worn battery does not have voltage drops, it just discharges faster due to lower capacity. battd expects slower discharging speed (as in a new battery) while making calculations. That's why the drops occurs when the real charge got from the controller. Drops are just a display issue, but your battery is worn to some degree (-10%, -15%, etc)
    2
    Something is missing here... because when I flash cm9 for the first time in my 1 month defy, suffer the battery drops in a really weird way (67 to 30, 30-19, 19-4) in just 10 mins. So, this happen even in a new battery.

    Enviado desde mi MB525 usando Tapatalk 2