Brushed it up a little

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4919 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2004-07-23 08:45:34 +00:00
parent 6c7011415b
commit 25a60a54e7

View file

@ -1,16 +1,17 @@
CHARGING ALGORITHM CHARGING ALGORITHM
This doc and a part of the charger implementation (especially voltage courves, This doc and a part of the charger implementation (especially voltage curves,
remaining time estimation, trickle charge) is written by Uwe Freese. If you miss remaining time estimation, trickle charge) is written by Uwe Freese. If you
some information here, write to mail@uwe-freese.de. miss some information here, write to mail@uwe-freese.de.
[INTRODUCTION] [INTRODUCTION]
This doc describes how the charging works for the recorder. The algorithm can be This doc describes how the charging works for the recorder. The algorithm can
found in firmware/powermgmt.[c|h]. Debug output is done in apps/debug_menu.c. be found in firmware/powermgmt.[c|h]. Debug output is done in
Charging for the player and the FM recorder is done by the hardware and apps/debug_menu.c.
Charging for the player and the FM/V2 recorder is done by the hardware and
therefore isn't implemented in rockbox. Only the functions that calculate the therefore isn't implemented in rockbox. Only the functions that calculate the
battery level are also used for these models. battery level are also used for these models.
@ -24,14 +25,14 @@ All following information is related to the recorder.
- We can switch the charging current (about 350mA, constant) on and off. - We can switch the charging current (about 350mA, constant) on and off.
[VOLTAGE COURVES] [VOLTAGE CURVES]
See http://www.uwe-freese.de/rockbox for some voltage courves taken while See http://www.uwe-freese.de/hardware-projekte/rockbox/ladeverfahren.html
charging and decharging an AJB. for some voltage curves taken while charging and decharging an AJB.
These voltage courves are implemented as arrays in rockbox. We can then These voltage curves are implemented as arrays in rockbox. We can then
calculate how full the batteries are (in percent) after taking the actual calculate how full the batteries are (in percent) after taking the actual
voltage. Both voltage courves (charging and decharging) are used here. voltage. Both voltage curves (charging and decharging) are used here.
[CHARGE OVERVIEW] [CHARGE OVERVIEW]
@ -43,27 +44,29 @@ voltage. Both voltage courves (charging and decharging) are used here.
regulation at a high value). regulation at a high value).
- After that, do trickle charge (max. 12 hours with voltage regulation at a - After that, do trickle charge (max. 12 hours with voltage regulation at a
lower value). lower value).
- When trickle charge is done and you did not disconnect or shut off your AJB by - When trickle charge is done and you did not disconnect or shut off your AJB
now, the AJB decharges normally since it reaches a low voltage and everything by now, the AJB decharges normally since it reaches a low voltage and
starts from the beginning. everything starts from the beginning.
[NORMAL CHARGE] [NORMAL CHARGE]
When charging is started, the charger is turned on. The batteries are charged When charging is started, the charger is turned on. The batteries are charged
with a constant current of about 350mA. The charging is stopped for three reasons: with a constant current of about 350mA. The charging is stopped for three
reasons:
- the voltage goes down in a 5 min interval (delta peak, see below) - the voltage goes down in a 5 min interval (delta peak, see below)
- the voltage goes up only a little bit in an 30 min interval (is mainly constant) - the voltage goes up only a little bit in an 30 min interval (is mainly
constant)
- the charging duration exceeds a maximum duration - the charging duration exceeds a maximum duration
[DYNAMIC MAX DURATION CALCULATION] [DYNAMIC MAX DURATION CALCULATION]
The max duration is calculated dynamically. The time depends on how full the The max duration is calculated dynamically. The time depends on how full the
battery is when charging is started. For a nearly full battery, the max duration battery is when charging is started. For a nearly full battery, the max
is low, for an empty one, it is a high value. The exact formula can be found in duration is low, for an empty one, it is a high value. The exact formula can
the source code. The battery capacity is also considered here. be found in the source code. The battery capacity is also considered here.
[LIION BATTERY IN FM RECORDER] [LIION BATTERY IN FM RECORDER]
@ -79,13 +82,14 @@ batteries are full.
Two facts on batteries are the reason why this works: Two facts on batteries are the reason why this works:
- If the batteries are full, the charging current cannot charge the battery anymore. - If the batteries are full, the charging current cannot charge the battery
anymore.
So the energy is absorbed by heating up the battery. So the energy is absorbed by heating up the battery.
- Each battery has a negative temperature coefficient, that means the voltage goes - Each battery has a negative temperature coefficient, that means the voltage
down when the temperature goes up. goes down when the temperature goes up.
NiMH batteries have a smaller delta peak than NiCd, but is is enough for Rockbox NiMH batteries have a smaller delta peak than NiCd, but is is enough for
to detect that the batteries are full. Rockbox to detect that the batteries are full.
Related documents on the web: Related documents on the web:
@ -102,16 +106,16 @@ Related documents on the web:
[TOP OFF CHARGE AND TRICKLE CHARGE] [TOP OFF CHARGE AND TRICKLE CHARGE]
After a normal charge is completed, trickle charging is started. That means After a normal charge is completed, trickle charging is started. That means
charging to keep the batteries full. While trickle charge in other (stand alone) charging to keep the batteries full. While trickle charge in other (stand
chargers means charging the amount that the battery loses because of self alone) chargers means charging the amount that the battery loses because of
decharging, here it's charging the amount the AJB consumes when it's on. That's self decharging, here it's charging the amount the AJB consumes when it's on.
because it is not possible to switch off the AJB when charging is done. It goes That's because it is not possible to switch off the AJB when charging is done.
on again and then the archos firmware charger code would charge again. So we It goes on again and then the archos firmware charger code would charge again.
have trickle charge in rockbox. So we have trickle charge in rockbox.
In simple words, rockbox charges about 15 seconds per minute in trickle mode. An In simple words, rockbox charges about 15 seconds per minute in trickle mode.
AJB consumes 100 mA when it's on and the charging current is about 300mA. So An AJB consumes 100 mA when it's on and the charging current is about 300mA.
charging 15 s and decharge 45 s will keep the batteries full. So charging 15 s and decharge 45 s will keep the batteries full.
But the number of seconds the charger is on in trickle charge mode is also But the number of seconds the charger is on in trickle charge mode is also
adjusted dynamically (between 1 and 24 sec). Rockbox tries to hold the battery adjusted dynamically (between 1 and 24 sec). Rockbox tries to hold the battery
@ -120,21 +124,22 @@ full") for 90 minutes, then a level of 5,45 V. If the voltage drops below the
wanted value, rockbox will charge one second more the next minute. If is is wanted value, rockbox will charge one second more the next minute. If is is
greater than this value, is will charge one second less. greater than this value, is will charge one second less.
Trickle charging runs 12 hours after finishing the normal charging. That should Trickle charging runs 12 hours after finishing the normal charging. That
be enough for charging the AJB over night and then unplug the charger sometime should be enough for charging the AJB over night and then unplug the charger
in this 12 hour trickle charge time. It is not recommended to trickle charge sometime in this 12 hour trickle charge time. It is not recommended to trickle
over days, that's because it is stopped after 12 hours. charge over days, that's because it is stopped after 12 hours.
Many chargers do top off and trickle charge by feeding a constant (low) current Many chargers do top off and trickle charge by feeding a constant (low)
to the batteries. Rockbox, as described, makes a voltage regulation. That's current to the batteries. Rockbox, as described, makes a voltage regulation.
because the power consumption of the AJB changes when backlight is on/disk is That's because the power consumption of the AJB changes when backlight is
spinning etc. and doing a voltage regulation is the simplest way to charge on/disk is spinning etc. and doing a voltage regulation is the simplest way
exactly the needed amount. to charge exactly the needed amount.
There are two charge ICs I want to mention here: The Philips TEA1102 and TEA1103 There are two charge ICs I want to mention here: The Philips TEA1102 and
do voltage regulation for NiCd and NiMH at 1,325 V per cell. That would be 5,3 V TEA1103 do voltage regulation for NiCd and NiMH at 1,325 V per cell. That
for four cells, but I think 5,45 V is best for Rockbox with the maximum time of would be 5,3 V for four cells, but I think 5,45 V is best for Rockbox with the
12 hours. Note that the voltage values are taken in the part of a minute where maximum time of 12 hours.
Note that the voltage values are taken in the part of a minute where
the charger is off, so the values are a little bit smaller than the actual the charger is off, so the values are a little bit smaller than the actual
average of the whole 60 seconds. average of the whole 60 seconds.
The Philips TEA1102 top-off charge time (with 0,15 C) is one hour. The Philips TEA1102 top-off charge time (with 0,15 C) is one hour.
@ -155,11 +160,11 @@ In simple words, it is
remaining time = remaining battery energy / power consumption of AJB remaining time = remaining battery energy / power consumption of AJB
With using the battery courves described above and the battery capacity you With using the battery curves described above and the battery capacity you
selected in the settings menu, the remaining capacity is calculated. For the selected in the settings menu, the remaining capacity is calculated. For the
power consumption, a usual constant value is used. If the LED backlight is set power consumption, a usual constant value is used. If the LED backlight is set
to always on, it is also considered. Having a modified Jukebox with 8 MB of RAM to always on, it is also considered. Having a modified Jukebox with 8 MB of
leads to about 22 percent longer estimated running time. RAM leads to about 22 percent longer estimated running time.
[BATTERY DISPLAY HOW THE USER EXPECTS IT] [BATTERY DISPLAY HOW THE USER EXPECTS IT]
@ -168,15 +173,15 @@ To not confuse the user with the shown battery level, some tricks are used in
the battery level calculation (this does not affect the charging algorithm, the battery level calculation (this does not affect the charging algorithm,
because it uses the raw voltages): because it uses the raw voltages):
- if charging is completed, top-off charge or trickle charge is running, always - if charging is completed, top-off charge or trickle charge is running,
set the battery level to 100% always set the battery level to 100%
- the battery level is only allowed to change 1% per minute (exception: when usb - the battery level is only allowed to change 1% per minute (exception: when
is connected, is is allowed to go 3% down/min) usb is connected, it is allowed to go 3% down/min)
- if charging just started (or stopped), ignore the battery voltage for the - if charging just started (or stopped), ignore the battery voltage for the
first 25 minutes first 25 minutes
- after turning on the device, add another 5% to the battery level, because the - after turning on the device, add another 5% to the battery level, because
drive is used heavily when booting and the voltage usually gets a little higher the drive is used heavily when booting and the voltage usually gets a
after that little higher after that
[WHICH CHARGING MODE TO USE] [WHICH CHARGING MODE TO USE]
@ -190,9 +195,9 @@ charge on" (that the batteries remain full).
A special case: If you fill up the batteries that are still nearly full every A special case: If you fill up the batteries that are still nearly full every
night, it is recommended that you make a complete charge cycle from time to night, it is recommended that you make a complete charge cycle from time to
time. Select "deep discharge on" and "trickle charge on" and wait till the whole time. Select "deep discharge on" and "trickle charge on" and wait till the
cycle is over (you can speed up the discharging a little bit by turning on the whole cycle is over (you can speed up the discharging a little bit by turning
LED backlight). Even if the battery sellers say NiMH cells don't show a memory on the LED backlight). Even if the battery sellers say NiMH cells don't show a
effect, I recommend making this procedure from time to time (every 10th charging memory effect, I recommend making this procedure from time to time (every 10th
cycle). BUT: Don't recharge the batteries completely every time if you don't charging cycle). BUT: Don't recharge the batteries completely every time if
have to. you don't have to.