A motor — or a generator — requires some normal magnets and some electromagnets. The usual arrangement is to have a brushed commutator ... hardest part of this is winding the large electromagnets.