The task of a generator is to convert mechanical energy into electrical energy. The principle of electromagnetic induction discovered by Michael Faraday is used here: Electrical voltage is induced by the movement of a conductor in a magnetic field. Depending on the design variant, a generator can produce direct current or alternating current.