Commutator is an attachment, connected to the armature of motor or generator through which electrical connection is made and ensures that the current is flowing like a direct current
And it is a device for reversing the direction of flow of electrical current.
In addition by using induction the current is induced in a circuit due to a change or motion in a magnetic field is so directed as to oppose the change in flux "is the surface magnetic divided by time" and to exert a mechanical force opposing the motion of the spin of wire coil.