The working principle behind any DC motor is the attraction and repulsion of magnets. The simplest motors useelectromagnetson a shaft, with permanent magnets in the case of the motor that attract and repel the electromagnets. The reason for using electromagnets is so that it is possible to flip their magnetic field (their north and south poles).
So the electromagnet is attracted to one of the permanent magnets. As soon as it reaches the permanent magnet, it’s north and south poles flip so that it is repelled from that magnet and attracted to the other permanent magnet.
a motor is anelectrical machinewhich converts electrical energy into mechanical energy. Theprinciple of working of a DC motoris that "when a current carrying conductor is placed in a magnetic field, it experiences a mechanical force".The direction of this force is given byFleming's left hand ruleand it's magnitude is given by F = magnetic flux density (B) * current (I) * length (L).
Fleming's left hand rule: if we extend index finger, middle finger and thumb of our left hand, perpendicular to each other, and direction of magnetic field is represented by index finger, direction of current is represented by middle finger, then the thumb represents the direction of the force experienced by the current carrying conductor.
Whenarmature windingsare connected to DC supply, current sets up in the winding. Magnetic field may be provided by field winding (electromagnetism) or by usingpermanent magnets. In this case, current carrying armature conductors experience force due to the magnetic field, according to the principle stated above.
Commutator is made segmented to achieve unidirectional torque. Otherwise, the direction of force would have reversed every time when the direction of movement of conductor is reversed the magnetic field.
This is how a DC motor works!