Why is PWM used to control DC motor speed instead of using a variable resistance?
Power efficiency The induction of the motor will cause the current to average. At the same time the transistors in PWM mode have very low impedance and therefore a low voltage drop and low power dissipation. In case of a series resistor a lot of power is dissipated in the series resistor.
Speed control behavior With PWM the motor will 'see' a very low power supply impedance, even though the power supply is constantly switching between high and low voltages. The result is that the motor has a much higher torque. With a series resistance the motor will experience a very weak power supply and it will be easy to stall the rotor.
Control circuit For a control electronics (eg. a microcontroller) it is very easy to switch on/off transistors. Outputting an analog voltage or controlling a series resistor requires much more expensive circuitry and in turn will cause more power dissipation.
We can definitely control Speed of a motor with a Potentiometer, but this wastes power and energy in the form of heat across the resistor,as having a resistor in series does have a voltage drop, hence heat loss.
Having a PWM, means you do not have a resistor in series,meaning no waste in the form of heat. We just shuttle the Motor between ON & OFF, and the average gives us the voltage. So , no waste of power is there.
Having a 0.5 Duty Cycle for a 12V supply, gives a 6V on avaerage, and using the switching we control the speed.