Three principles for battery charging