Rockbox Technical Forums

Support and General Use => Hardware => Topic started by: KhronX on December 17, 2017, 04:59:16 PM

Title: iPod 5.5g battery voltage reading
Post by: KhronX on December 17, 2017, 04:59:16 PM
So, i have my old (bought used in 2007) 80GB iPod Video, which last year i shoehorned a 256GB mSATA SSD into, as well as a 1000mAh battery.

It all works fine, except for one glaring issue - the battery voltage, at least as far as the firmware is concerned, has an offset of about 0.3V.
Specifically, the firmware thinks the battery voltage is lower than it actually is. I'm measuring for example 4V on pins 4-5 ("BAT") of the LTC4066 (http://cds.linear.com/docs/en/datasheet/4066fc.pdf), while in the Debug section, the value reported hovers around the 3.7V mark.

After booting into the stock Apple firmware, the battery shows as fully charged (measuring 4.18V on the above-mentioned pins 4-5 of the charging chip).
Rebooting into rockbox, with the display off, i'm measuring 4.05V, still close-enough to what should be "fully charged". And yet, Rockbox is only seeing it at 3.76V / 12%.
I'm sure you'll agree, that's not right, and it's highly doubtful it's a hardware issue. unless it's somehow related to the ADC that's doing that particular measurement.

I'm on the latest stable Rockbox, with the added patch from BeyondWind (https://web.archive.org/web/20150307065100/http://beyondwind.duckdns.org/?page_id=51), that fixed an apparently common ATA error with SSD's.

I'd appreciate whatever thoughts and ideas some of you more knowledgeable folks might be able to provide...
Title: Re: iPod 5.5g battery voltage reading
Post by: KhronX on February 27, 2018, 09:17:22 AM
Anyone...?   :-\
Title: Re: iPod 5.5g battery voltage reading
Post by: dreamlayers on March 29, 2018, 02:56:13 PM
The most easily accessible battery voltage is averaged / smoothed, to reduce the effect of fluctuations such as when spinning up a hard drive.

So, go to System -> Debug -> View battery, and then scroll one screen clockwise so you see the screen with "Pwr status:", "Battery:", "USB pwr:", etc. You should notice that the battery voltage there is changing all the time. That is the real time reading. If that is wrong then you really are encountering a problem.
Title: Re: iPod 5.5g battery voltage reading
Post by: KhronX on March 29, 2018, 03:10:59 PM
That is indeed the reading i was comparing with what my multimeter was telling me (in real time).

<edit> If memory serves, i was probing (near) the pin of the LTC4066 chip, where the battery positive terminal goes - i wanted to see if there's any drop between the battery and the chip, thinking it might be reading wrong, but nope.

Rockbox and/or the circuitry (the ADC in the SoC?) in my particular iPod seems to be consistently reading the battery a good 2-300mV lower than it really is.
Title: Re: iPod 5.5g battery voltage reading
Post by: dreamlayers on April 01, 2018, 08:48:28 AM
Did you look at the LTC4066 OUT pin? There should be some voltage drop between the BAT pin connected to the battery, and the OUT pin powering the device. The iPod may be measuring the OUT pin. But, they're connected via an "ideal diode" circuit and the drop ought to be less than what you're measuring. LTC4066 datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/4066fc.pdf
Title: Re: iPod 5.5g battery voltage reading
Post by: KhronX on April 02, 2018, 09:07:13 AM
I just took the iPod apart to probe things again.

On pin 1 of the LTC4066 (Out) i'm reading 3.88v, on pin 2 (Bat) about 3.91v, while Rockbox (in System - Debug - View Battery) is reporting 3.6-3.65v.

The battery graph indicator at the top of the screen is (allegedly) almost empty, by the way. If 3.6v is supposed to be close to "empty", that seems like a slightly too conservative value to me; 3.2-3.3v or so would be a bit more... practical, shall we say?
Title: Re: iPod 5.5g battery voltage reading
Post by: KhronX on April 02, 2018, 02:21:08 PM
Just to "double-check", i recharged the battery under the stock firmware (ie. booted with the "Hold" switch on), went up as one might expect to 4.15v.

Right now i've booted back into Rockbox, i'm measuring 4.12v on the "Bat" pins of the LTC4066, while Rockbox says the voltage is hovering around 3.85v, give or take.

Changing the battery capacity in the Settings menu doesn't seem to change anything.
Title: Re: iPod 5.5g battery voltage reading
Post by: dreamlayers on April 03, 2018, 07:42:09 PM
Can you boot into original firmware and try to see if battery voltage measurements are wrong there? I wonder if there's a hardware problem in your iPod. But if there is a fixed relationship between measured and actual voltage, you could create a custom build which corrects the voltage measurement.
Title: Re: iPod 5.5g battery voltage reading
Post by: KhronX on April 04, 2018, 04:23:03 AM
In the original Apple firmware, that battery bar-graph thingie at the top shows something around 60-70% or so (eyeballing it), while i'm measuring about 4.10V. That doesn't sound 100% right to me either.

I'm starting to wonder... In newer li-ion / li-po powered equipment, there's usually a "gas gauge" chip of some sort. Is that somehow implemented in software in this iPod perhaps, or..?  :o

Does Rockbox only use that battery voltage as a source for the battery indication?
Title: Re: iPod 5.5g battery voltage reading
Post by: saratoga on April 04, 2018, 08:16:31 AM
Does Rockbox only use that battery voltage as a source for the battery indication?

Yes, but voltage is the only way to assess the state of charge of a lithium ion battery without discharging it completely.  There are no other parameters you can measure in real time.
Title: Re: iPod 5.5g battery voltage reading
Post by: KhronX on April 04, 2018, 08:28:34 AM
Kinda figured as much. That's all well and good, but it would seem i'm still stuck with this mysterious(?) voltage reading offset  :-[

Does Rockbox only use that battery voltage as a source for the battery indication?

Yes, but voltage is the only way to assess the state of charge of a lithium ion battery without discharging it completely.  There are no other parameters you can measure in real time.