A motor — or a generator — requires some normal magnets and some electromagnets. The usual arrangement is to have a brushed commutator that both powers the electromagnets and switches their polarity ...
Despite the best efforts of the RepRap community over the last twenty years, self-replicating 3D printers have remained a stubbornly elusive goal, largely due to the difficulty of printing electronics ...