i have made a script based on real discharge graphs it is based on idle voltage but it works really well http://talk.maemo.org/showpost.php?p=872446&postcount=3