how does onboard battery charger work