Lithium battery pack voltage calculation