Optimize battery voltage and current