WizardStan: How does it determine when it should switch off? Is that a different indicator than the one that reports the %age?
It uses the built in End Of Charge sensor of the charge chip to trigger an interrupt. When the charge chip detects the battery is full, it sends the EOC interrupt signal which stops the charging to prevent the battery from puffing.
The important thing to note about lithium batteries is that 100% is not the same as full. 100% just means 4.2 volts is reached. After 100% is reached, the charge chip will still attempt to put a little more energy into it, topping it up to the point of being completely full, but it does this by reducing the amps being pushed into the battery, slowly trickling energy in. As more energy goes in, the amount of amps that can go in gets lower and lower. It can never reach zero though: there's energy coming out of the battery as it is being used, and even if it were charging just a standalone battery, there would still be heat lost. So there's a threshold: when the amps the chip can stuff into the battery drops below this threshold, it signals the battery is full, fires off the EOC interrupt which stops the charging.
The problem with this is that if the Pandora is drawing more power than the threshold, charge rate will never drop below that threshold so it keeps charging. That's why it triggers end of charge sooner when in lower power, because it is that much further below the threshold, it's easier to top up the battery. The original value was too low for almost everyone, even in low power mode it was drawing above the threshold, so I calculated the estimated power draw and increased the threshold accordingly. That seemed to be good for everyone with my original charge hack, but I guess still not perfect for everyone. Slight differences in resistances of traces on the board is probably leading to ever so slightly more energy consumption in some systems over others: to put into perspective, a 4000mah battery that lasts 10 hours in one Pandora will probably last 10 hours and 12 seconds (or 9 hours and 48 seconds, 12 second difference either way) due to these minor variations.
I'll send you the value to increase it further. I could just increase it to the maximum safe value. That'll definitely work. At worst it'll decrease the battery life by a few minutes because it stopped charging before the battery was completely full. Can't increase it too far, though, otherwise it'll actually prevent charging in low amp situations such as USB. Already it'll struggle to charge via USB if the the port is only providing 100ma. If it is increased further, you will not be able to "charge" off anything less than a 500ma USB socket. I put a quote around "charge" because at 100ma it's really more like "slower discharge".
Increasing the efficiency of lid closed and low power modes would also be useful: the default value would have been perfect if the battery could provide about 50 hours of downtime.