A commutator is a rotary electrical switch that periodically reverses the current direction between the rotor and the external circuit in certain types of electric motors and electrical generators). In a DC machine, each armature coil contains two commutators attached to its end. The commutator is a device connected to the armature, which enables the switching of current. The basic purpose of commutation is to ensure that the torque acting on the armature is always in the same direction. The voltage generated in the armature is alternating in nature, and the commutator converts it to direct current. The commutator turns the coils on and off to control which direction the electromagnetic fields are pointing.
In a motor, the commutator applies an electric current to the windings. By reversing the current direction in the rotating windings each half turn, a steady rotating force (torque) is produced). The commutator assures that the current from the generator always flows in one direction. Commutators are used in DC machines (DC motors and DC generators) and universal motors. Commutators are relatively inefficient and require periodic maintenance such as brush replacement). Brushless DC motors also require commutation, but for brushless designs, commutation is carried out electronically, via an encoder or Hall effect sensors that monitor the position of the rotor to determine when and how to switch the current.