how alternator charges battery