function of slip ring commutator in ac generator