The controller converts the battery's DC into AC (for AC motors) and regulates the energy flow from the battery.