how does on board battery charger work