Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category
  • Assigned To No-one
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by jock765 - 2006-01-18
Last edited by jock765 - 2006-01-26

FS#2927 - V1 charging algorithm changes

1. Use short term - delta change only when long term
delta is fairly static - this avoids false trips early
in the cycle.
2. Use a much lower value for long term delta as low
rates of change on high capacity batteries will be
common. In fact long term delta can probably only
really capture a slow moving negative change, which is
what it now does. Also only use this - long term change
if there was no disc use in this period (causing maybe
a small voltage drop). Also for long term delta ignore
glitches in the middle of the sample period - only need
stability around where the measuring points are.
3. Extend the maximum charge time accordingly when the
disc is used during charging - otherwise the maximum
charge period will not be long enough.
4. When moving to Topup or Trickle charge modes, make
the target voltage relative to the voltage acheived
during charging as this voltage will vary from battery
type and temperature at the time amoung other things.
Have made trickle voltage the voltage at termination
minus 0.1v.

Closed by  hohensoh
2006-03-04 09:49
Reason for closing:  Accepted
Project Manager

Great! Now we need only two things:

1) Your real name

2) The patch :-)

whoops - (never checked the file tickbox) should be there now

Real name - Alun Thomas

update to reflect CVS change to powermgmt.c
also seperate .diff file for powermgmt.c and .h

Update for further CVS activity

Also fixed bug of no target voltage for trickle or topup
charge when first plugged in.

Major critique:
Changed block starting with the comment “Start the charger
full strength”

Max charge time was the maximum of
1) 135% the estimated battery discharge level (more tha 100%

   to make up for battery inefficiencies)

2) The absolute maximum time constant based on the battery

   (the constant has been in the algorithm forever and was
   undoubtedly picked based on battery recharge reserch).

The original’s intent was to set the maximum charge time to
_less_ than the absolute max time if the battery was not
fully discharged.

This patch modifies the max change time to be the absolute
maximum time constant (#2 above) _increased_ by the
estimated battery discharge level. This is increasing the
maximum charge time beyond the previously determined
absolute maximum. I don’t see any justification for this
change and don’t agree with it. Give me a justification and
I may change my mind ;-)

Minor critique:
The target voltage if the negative delta is seen is set to
power_history[0] (the negative delta is -5 centivolts). The
other cases set it to power_history[0] - 10. To be
consistant, we should subtract 5 centivolts for the negative
delta case and -10 (-15?) for the positive delta case.

Quibbles
Please use “cvs diff -u” (or equivalent) to get a unified
diff file. That is easier to read and more robust for patching.

Disk is generally spelled with a “k” for hard drives,
including everywhere else in the module.

Please maintain comment styles. I would prefer to match the
original (and predominant) comment style:

               /*
                * Start the charger full strength
                * max_time calculated for 12v (safest)
                */

rather than:

               /* Start the charger full strength
               * max_time calculated for 12v (safest) */

Yeah, OK, I’m over sensitive about comment styles, but the
above doesn’t match any common comment style and is just
plain ugly IMHO.

Please trim trailing whitespace (even the lines where it
wasn’t your fault :-).
$ sed “s/ *$//” < powermgmt.c > tmp.c
$ mv tmp.c powermgmt.c

A. Returned original Maximum Time Calculation to algorithm
- on reflection there is probably alot of research behind it
- would be silly to throw it away as it was not the cause of
any problems.
B. Tidy up target voltage assignments as noted by vanbargw
- topup target voltage is maximum voltage acheived - 0.05v.
trickle target voltage is topup target -0.1v.
C. Minor formatting changes as suggested.

Update patch for CVS activity.

Update for CVS - 24th.Feb.2006

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing