Mammoth Memory

Using a commutator

To reverse the electrical direction of a coil, between a magnet, you can use a commutator.

Commutator setup in use

When the wire coil is vertical there is an instance where the brushes switch the electrical direction of the current. 

Commutator position when wire coil is vertical between the two magnets

Below we have the wire coil which has switched electrical direction completely and the forces on the wire have reversed.

Commutator position when wire coil has turned 180 degrees between the two magnets

A continual spinning of the coil can occur. 

More Info