Solar power station battery charging algorithm