The illustration of the working principle of an electromagnetic generator, that is, a loop turns under a magnetic field. Due to this movement, the flux through the loop varies, causing an induced current which, in this case, is an alternating current, with its value changing and its direction periodically reversed.
In order for the current to always have the same direction, we can replace the two rings with a ring divided into two parts, called a commutator. In this way, we obtain a pulsating current that always has the same direction.
A direct current generator is formed by a large number of turns, which rotate with the same angular velocity, but each at different angles. The commutator is subdivided into a greater number of parts, which causes the currents generated by the various turns to vary, so that the resulting current is practically constant.