Release Better battery charging (beta)

Discussion in 'Software Releases' started by WizardStan, Feb 5, 2011.

  1. ZXDunny

    ZXDunny Deep avatar

    Joined:
    Oct 12, 2010
    Messages:
    2,510
    Yeah, that would be good, or just make the "deep" cycle not quite so deep. I don't like my battery to be at less than 95% when I leave the house, and tbh I prefer it at 100%. If the firmware starts to decide that I can't have a full battery when I want a full battery (recharging times taken into account of course) then I'm going to rip that part of the firmware out, disable it or just downgrade to a previous version of the firmware.


    From what I have seen of bloated batteries, it happened after many months of continuous charging - which is something that doesn't happen to my Panda, as it gets taken off charge every day (or two days if I'm not at work) and almost runs dry.


    D.
     
  2. tsh

    tsh Active Member

    Joined:
    Dec 19, 2008
    Messages:
    773
    Location:
    Cambridge
    pndevmapperd.c
     
  3. urjaman

    urjaman "I Know. We're going for a ride."

    Joined:
    Jan 6, 2009
    Messages:
    1,111
    Location:
    Finland
    Yeah, blinking is from userspace. Fixing pndevmapperd should be quite straightforward. Just modify the code to check for bq27500 current AND percentage (not just only for percentage).


    But I think the bigger question is how much led control we want to do from userspace / from kernel?


    I mean with more modes to show there will propably be some sort of conflict to be expected if we control some from kernel and some from userspace :p
     
  4. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,650
    Oh, I see. I think I disagree with the userspace LED control in this case. Seems a better idea to leverage the existing LED control system, at least to me. I'll have a look.
     
  5. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,650
    Right, so, since I fail at figuring out kernel patches to get unionfs into the kernel I'm trying to test with, I opted instead to just write a simple executable here.


    It tweaks the end of charge sensitivity and sets the restart to what I estimate to be about 95%. All you have to do is run it (with sudo) and it should stop charging shortly after reaching 100% and restart at about 95%. I want to get some further confirmation from others that my numbers are more-or-less correct, and acceptable, then I'll push my kernel patches up to notaz or skeezix to include in the trunk.
     
  6. alerino

    alerino Well-Known Member

    Joined:
    Aug 11, 2007
    Messages:
    3,200
    sudoing the charge hack doesn't output any message, is that normal? I'm in the process of charging, currently at 83% , i'll let you know what happens
     
  7. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,650
    yeah, it only produces output if something went wrong. I could probably fix that, but I don't intend this to be anything close to a fix, I just want to know if the values I've picked work for everyone else.
     
  8. alerino

    alerino Well-Known Member

    Joined:
    Aug 11, 2007
    Messages:
    3,200
    dunno if i did something wrong, but i don't think it's working as intended.


    i expected the red light to go off after a few minutes, but it didn't, instead i noticed a slowdown when i tried to check some dmesg output, system seemed to have crashed (it reminded that 14mhz low power mode bug), like a general slowdown, had to cold boot


    what should i do?
     
  9. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,650
    uh... it doesn't touch anything related to the CPU. It just sends i2c messages to the charge chip. I have no idea. Is it back to normal?
     
  10. alerino

    alerino Well-Known Member

    Joined:
    Aug 11, 2007
    Messages:
    3,200
    yes, cold booting solved the problem, then i tried issuing the hack again at 100%, but nothing happened, was i supposed to run it before connecting to mains?


    if you can, have the red light to turn off, as a message that the charging is over,


    thanks
     
  11. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,650
    It does turn off the LED. 100% doesn't mean the battery is done charging though. Just run the hack and leave it. It should turn off the LED when it really is full, which may be several minutes after it reads 100%. It will take longer if the Pandora is in use: put it into low power mode and it'll detect full charge sooner.
     
  12. alerino

    alerino Well-Known Member

    Joined:
    Aug 11, 2007
    Messages:
    3,200
    Stan, it's 100% for at least 15 minutes, red light still on


    no slowing down this time, but an odd behaviour, for a few seconds, instead of 0:00 remaining time, 648:00 showed up


    EDIT: as soon as i flicked power switch to the right, red light started blinking! Voilá? I think it works now!


    I also think that if pandora is not on low power mode, if wifi is on, it keeps draining battery, postponing charging interruption.


    EDIT2: it seems to blink only in low power mode


    EDIT3: i'll give it some more testings, maybe i didn't wait enough for the red light to go off, let me know
     
    Last edited by a moderator: Mar 14, 2011
  13. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,650
    That's the charge chip trying to decide whether it's charged enough or not. It should do that for about 10 or 15 seconds, and then stay off. It's behavior that is not documented anywhere in the spec sheet, but seems to be consistent, at least on mine.


    If it stays blinking, that means the "fully charged" value I picked still isn't quite enough. Wikipedia says it should stop at about 2-3% of maximum charge rate, but may be a little higher or lower. I increased it from 1.5% to 3%, but I may bump it to an even 4% if people have problems still.


    edit: also, the reason that it may not complete charge while in use is that it doesn't detect full when the voltage reaches a certain level, but detects full when the amount of energy it can keep putting into the battery drops below a certain threshold. If the battery is in use, it may be discharging at a higher value than this threshold, effectively meaning that you are draining the battery at the same rate it is charging. As soon as it draws less power, it'll be able to detect the battery is topped off and stop the charging. This is by design of the chip and shouldn't cause any problems. Unless your Pandora is in use 24 hours a day, it'll detect a full battery eventually.
     
    Last edited by a moderator: Mar 14, 2011
  14. alerino

    alerino Well-Known Member

    Joined:
    Aug 11, 2007
    Messages:
    3,200
    I can confirm that it works fine. After battery hits 100% (at 15:45), in low power mode, red light went off after ~30 minutes (can't say exactly, got into a meeting with my boss, got back at 16:30, battery shows 98% now).
     
  15. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,650
    It should fall to between 93% and 98%. If you wouldn't mind checking when the charge led comes back on? Takes my Pandora about 2 hours before it drops low enough to start charging again.


    Did your Pandora ever automatically stop charging before, or was yours one of the ones that continued to charge forever?
     
  16. alerino

    alerino Well-Known Member

    Joined:
    Aug 11, 2007
    Messages:
    3,200
    forever stuck at 100%.


    At first i thought it wouldn't be a problem, but thanks to your research about trickling , we now have info and a tool to make our batteries live longer .


    i will reconnect my pandora to mains and check when charging will restart. Thanks.
     
    Last edited by a moderator: Mar 14, 2011
  17. alerino

    alerino Well-Known Member

    Joined:
    Aug 11, 2007
    Messages:
    3,200
    there it goes:


    17:47 - battery hits 100%, goes into low power mode


    18:09 – red light goes out


    19:29 – red light turns on at 93% (normal mode, lcd on most of the time)
     
    Last edited by a moderator: Mar 14, 2011
  18. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,650
    Close enough for me. :) Much better than the 80% it used to be.


    Anyone else want to chime in with some numbers?
     
  19. alerino

    alerino Well-Known Member

    Joined:
    Aug 11, 2007
    Messages:
    3,200
    c'mon, you lazy bastards! :p
     
  20. Nation.A.List

    Nation.A.List Member

    Joined:
    Apr 10, 2009
    Messages:
    434
    Location:
    England
    I assume your referring to the production team ;)
     

Share This Page

Loading...