FS#10890 - Dynamic runtime estimation (iPod Video, iPod nano 2G)
Attached to Project:
Rockbox
Opened by Andree Buschmann (Buschel) - Sunday, 03 January 2010, 14:41 GMT
Last edited by Andree Buschmann (Buschel) - Tuesday, 16 November 2010, 07:06 GMT
Opened by Andree Buschmann (Buschel) - Sunday, 03 January 2010, 14:41 GMT
Last edited by Andree Buschmann (Buschel) - Tuesday, 16 November 2010, 07:06 GMT
|
DetailsThis patch is a proof-of-concept for an adaptive runtime estimation.
Reason to implement such behaviour is that different user settings and user behaviour have large impact to the power consumption and -- as a result -- to the runtime. E.g. disabling LCD will save lots of power, but some users do not want to disable the LCD to keep readability in daylight. This patch therefor adapts the estimation of runcurrent() based upon real measurements of the current consumption. The algorithm starts with a default (CURRENT_NORMAL which is defined in the config-file of each player) and uses a weighting scheme with a large time constant to adapt the estimation of the current consumption. The time constant is 1024, which should equal ~20 minutes as the runcurrent()-function is called once per second. With a smaller time constant the runtime estimation is "pumping" too much when the HDD is active. This first version is just a hard coded experimental solution. Nevertheless something like an actual_current()-function can be implemented for each player in its own powermgmt-file. Players with capability to read the current will return this measured real current, all others still return the fixed default CURRENT_NORMAL. |
This task depends upon
- introduce a new define "HAVE_DYNAMIC_RUNTIME_ESTIMATION"
- introduce a new interface function "read_battery_current()" to powermgmt.h
- implement read_battery_current() for iPod nano 2G, iPod Video and for PCSim
- use read_battery_current() for current estimation (low pass filtered with time constant = 1024 sec)
- use read_battery_current() in debug_menu.c
This implementation easily allows to add this functionality to other targets.
firmware/target/arm/ipod/powermgmt-ipod-pcf.c:140:32: warning: "MEM" is not defined
firmware/target/arm/ipod/powermgmt-ipod-pcf.c:142:32: warning: "MEM" is not defined
firmware/target/arm/ipod/powermgmt-ipod-pcf.c:145:6: error: #error HAVE_DYNAMIC_RUNTIME_ESTIMATION defined without adc routine known.
I know that now there is no differences in code for the 32 and 64 MB ipodvideo, but the code in that point differs for the two models.
What is the right one?
firmware/target/arm/ipod/powermgmt-ipod-pcf.c: In function ‘read_battery_current’:
firmware/target/arm/ipod/powermgmt-ipod-pcf.c:141: error: ‘probed_ramsize’ undeclared (first use in this function)
firmware/target/arm/ipod/powermgmt-ipod-pcf.c:141: error: (Each undeclared identifier is reported only once
firmware/target/arm/ipod/powermgmt-ipod-pcf.c:141: error: for each function it appears in.)
make: *** [build_bootloader/firmware/target/arm/ipod/powermgmt-ipod-pcf.o] Errore 1
Could you validate it, please?