working principle of dc motor