Controlling the motor by varying the switching frequency of switches connected to a DC supply and the motor phases