Ac generator works on the principle of Electromagnetic induction .
consider the following Image .we know according to lenz law
hence there must be change in magnetic field in order to crate potential so , initially the loop is given a small torque as the arrow shown in the figure .
as the loop rotates in the magnetic field the force on the branch AB is shown by .
here the Force
But wait , we have to see that in AC generator there are slip rings due to which when the loop completes one cycle it the direction of current changes , for instance .
in above figure if we start with
In this way In one complete cycle it produces the AC current by different polarity of Terminal A and B .