A functional diagram of a dc motor
Magnetic forces can be harnessed to do work. One common device that converts direct-current energy into rotating mechanical energy is a dc motor. In a dc motor, the source of electricity is connected to a set of coils, producing magnetic fields. The attraction of opposite poles, and the repulsion of like poles, is switched in such a way that a constant torque, or rotational force, results. As the current in the coils increases, the torque that the motor can provide also increases.
Above Figure is a simplified, cutaway drawing of a dc motor. One set of coils, called the armature coil, rotates along with the motor shaft. The other set of coils, called the field coil, is stationary. The current direction is periodically reversed during each rotation by means of the commutator. This keeps the rotational force going in the same angular direction, so the motor continues to rotate rather than oscillating back and forth. The shaft is carried along by its own inertia, so that it doesn’t come to a stop during those instants when the current is being switched in polarity.
Some dc motors can also be used to generate dc. These motors contain permanent magnets in place of one of the sets of coils. When the shaft is rotated, a pulsating dc flows in the coil.