|
Rockbox mail archiveSubject: charging algorithm averagingcharging algorithm averaging
From: Uwe Freese <mail_at_uwe-freese.de>
Date: Mon, 12 Aug 2002 18:08:03 +0200 Hello Heikki, Comment to charging algorithm: An average gradient (the delta), I would calculate like this (s1,s2,... are the voltage samples here for a shorter explanation): instead of delta = (s6 - s1) / 6 calculate if by delta = ((s4 + s5 + s6) - (s1 + s2 + s3)) / 6 and for the long term small positive delta: instead delta = (s30 - s1) / 30 calculate it by delta = ((s26 + s27 + s28 + s29 + s30) - (s1 + s2 + s3 + s4 + s5)) / 30 For the real code, the first looks like this (CHARGE_END_NEGD has to be at least 6): delta = ( power_history[POWER_HISTORY_LEN-1] + power_history[POWER_HISTORY_LEN-2] + power_history[POWER_HISTORY_LEN-3] - power_history[POWER_HISTORY_LEN-1-CHARGE_END_NEGD] - power_history[POWER_HISTORY_LEN-1-CHARGE_END_NEGD+1] - power_history[POWER_HISTORY_LEN-1-CHARGE_END_NEGD+2] ) * 100 / CHARGE_END_NEGD; Bye, Uwe. Received on 2002-08-12 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |