dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Rockbox for the player

Re: Rockbox for the player

From: Andrew Jamieson <>
Date: Thu, 12 Sep 2002 22:48:29 +1000

You'd want to watch the slope thingie, if the battery is monitored
arbitrarily. The battery voltage will drop considerably (compared to the
idle voltage) when the drive is spinning up due to the extra current draw
and the internal impedance of the batteries. I've worked with a device that
used a similar averaging algo to that which you propose, except that it
discards values that too widely fluctuate from the average, to avoid
erroneous results due to instantaneous current draw.


----- Original Message -----
From: "Paul Suade" <>
To: <>
Sent: Thursday, September 12, 2002 9:38 PM
Subject: Re: Rockbox for the player

> Okay, there just a minor difference : my code was intended to be called
> periodically whatever hd is pinning up or not so you can have a more
> occurate snapshot of battery level (average is only here to flatten
> fluctuation), using a second ring which contains the average values of
> first ring and can serve for historical and correction purpose. Which is
> basically you seem to do.
> Another possibility is to compute also the average difference between
> average values to determine its average "slope" and display the battery
> level according its average "value" AND its average "slope".
> higher the average slope is, higher the discharge is. Another purpose of
> slope computation : how many hours are theorically left for rockbox
> fine ?
> ----- Original Message -----
> From: "Heikki Hannikainen" <>
> To: "Rockbox" <>
> Sent: Thursday, September 12, 2002 8:50 AM
> Subject: Re: Rockbox for the player
> > On Thu, 12 Sep 2002, Paul Suade wrote:
> >
> > > Well, maybe using an average for a short time might flat the
> > > value; I mean using a small array like a ring to put your battery
> and
> > > computing the average that way :
> >
> > This is what we do already - see firmware/powermgmt.c. We take 4
> > a minute, discard samples taken while the disk is spinning to smooth it
> > some more, calculate an average of the samples left, and put it in a
> > containing one sample per minute.
> >
> > battery_level() which returns a "percentage" of battery level
> > an average over the last three values in the table, ie. average of 3
> > minutes. This really does not jump up/down too much any more and is much
> > better than the direct voltage sample which we used before (it varied A
> > LOT).
> >
> > The only jump you will usually get is in the beginning after the first
> > minute. When the device boots, we quickly take (in power_init()) a
> > sample and initialize the history table with it so that we would have
> > something to use before we have the first full minute sample. At
> > boot-time, the disk has been spinning for a while loading the firmware,
> > and the battery is a bit lower than average, and the next sample is
> > usually a bit higher than the boot-time sample. But I don't think this
> > much of a problem.
> >
> > - Hessu
> >
> >
Received on 2002-09-12

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy