Pulse width modulation or familiarly known as PWM is used to control the delivered power to load without loosing the efficiency. The speed of an electric motor is controlled by controlling the power source of the motor. The simplest method to provide a variable power supply is by providing a variable series resistance between the motor and the supply, and this is common in AC motor since the series resistance can be replaced by a series inductance that doesn’t dissipate any power. In DC motor system, this method can be done but unfortunately the inductance cannot work and we should go with a resistance that dissipate a lot of power. This power dissipation is too bad for the power efficiency since the power is wasted as heat. By using a PWM, the controller acts like a switch that is turned on and off rapidly to mimic the variable power supply without wasting the power.
Here is an example of PWM controller for DC motor, taken from freecircuitdiagram.com
Although the circuit shows a voltage range of 3-18 volts for the LM555 IC, it’s a good thing to keep the voltage range for this IC between 9-12 Volts. Below 9V, the MOSFET would not be maximally switched on, while above 12 Volt the 555 IC would be normally suffer an overheating. If the DC motor voltage is specified between 9-12 Volts then we can use the same voltage source for both 555 IC and the motor, but if the DC motor operating is higher then you sould use a separate power supply for the Motor (only the ground line is connected together). Up to 50 Volts DC motor voltage can be safely driven by this circuit.