Lithium battery voltage compensation