How a generator works
Generators are machines that convert mechanical energy into electrical energy. The principle of operation of a generator is based on the phenomenon of electromagnetic induction, when an EMF is induced in a conductor moving in a magnetic field and crossing its magnetic lines of force. Consequently, we can consider such a conductor as a source of electrical energy.
The method of obtaining the induced EMF, in which the conductor moves in the magnetic field, moving up or down, is very inconvenient in its practical use. Therefore, in generators, not a straight line, but a rotary motion of the conductor is used.
The main parts of any generator are: a system of magnets or most often electromagnets, creating a magnetic field, and a system of conductors crossing this magnetic field.
Let’s take a conductor in the form of a curved loop, which we will further call a frame (Fig. 1), and place it in the magnetic field created by the poles of the magnet. If such a frame is given a rotational motion relative to the axis 00, its sides facing the poles will cross magnetic lines of force and an EMF will be induced in them.
By attaching an electric bulb to the frame with soft conductors, we thereby close the circuit and the bulb lights up. The light bulb will continue to burn as long as the frame rotates in the magnetic field. Such a device is a simple generator, which converts the mechanical energy used to rotate the frame into electrical energy.
Such a simple generator has a rather significant disadvantage. After a short period of time the soft conductors connecting the bulb to the rotating frame will twist and break. In order to avoid such breaks in the circuit, the ends of the frame (Fig.2) are connected to two copper rings 1 and 2 rotating with the frame.
These rings are called contact rings. Feeding electric current from the contact rings into an external circuit (to the bulb) is carried out by the elastic plates 3 and 4, adjacent to the rings. These plates are called brushes.

With this connection of the bogie to the external circuit, there is no interruption of the connecting wires and the generator operates normally.
Let us now consider the direction of the emf induced in the conductors of the frame, or the direction of the current induced in the frame when the external circuit is closed.
With the frame rotating in the direction shown in Fig. 2, the left conductor AA is induced in the direction away from us beyond the drawing plane and the right conductor BB is induced from beyond the drawing plane toward us.
Since the two halves of the frame conductor are connected in series, the induced emf in them adds up to create a positive pole at brush 4 and a negative pole at brush 3.
Trace the change in induced electromotive force during one complete revolution of the frame. When the frame is rotated 90° clockwise from the position shown in Fig. 2, the conductor halves at that point move along the magnetic lines of force, and the induction of emf into the frame ceases.
Further rotation of the frame by 90° causes the conductors of the frame to cross the magnetic field lines (Fig. 3), but conductor АА moves downward instead of upward with respect to the field lines, and conductor В, on the other hand, crosses the field lines upward.

At the new position of the frame, the direction of the induced emf in conductors AL and BB reverses. This results from the fact that the direction in which each of these conductors crosses the magnetic lines of force has changed in this case. As a result, the polarity of the alternator brushes also changes: brush 3 now becomes positive and brush 4 negative.
Turning the frame further, conductors AA and BB again move along the magnetic lines of force and subsequently repeat all the processes from the beginning.
Thus, during one complete rotation of the frame, the induced emf changed its direction twice, and its value also reached the highest values twice in the same time (when the conductors of the frame passed under the poles) and was equal to zero twice (in the moments of movement of the conductors along the magnetic lines of force).
It is quite clear that an emf varying in direction and magnitude in a closed external circuit causes an electric current varying in direction and magnitude.
For example, when a light bulb is connected to the terminals of this simple generator, the electric current flows through the bulb in one direction during the first half turn of the frame and in the other direction during the second half turn.
The curve in Fig. 4 gives an idea of how the current changes when the frame is rotated 360°, i.e. in one complete revolution. 4. An electric current that continuously changes in magnitude and direction is called alternating current.