Battery usage algorithm