This article focuses on optimizing the battery management algorithm to minimize the amount of energy remaining in the battery at the end of the workload.The increasing use of renewable energy to operate agricultural robots increases the autonomy of the robot's energy supply. The volatility of renewable energy in turn increases the need for a smart battery management system. In the case of non-optimized battery management, up to 25% of the energy in the battery may remain unused, depending on the workload. A battery management algorithm was developed, which allows reducing the amount of residual energy remaining in the battery depending on the workload and increasing the time utilization factor of the agricultural robot. The concept was proven with computer models that use data of the energy consumption of the farming robot and the limitations of the workload due to the geometry of the cultivated fields.