How does a typical generator produce alternating current?
A commutator changes the induced current from direct to alternating current.
The magnetic field inside the generator turns off and on again between turns.
The magnetic field inside the generator changes direction once each turn.
After every half turn, the current in the armature’s wires reverses direction.