Lithium battery internal current calculation