My question is at the end (to change the speed) we are controlling the input voltage of a DC motor in both PWM (pulse width modulation) and variable resistance cases. Is the only reason for choosing PWM to obtain a better precision or not consuming extra power? If it is the only reason it seems odd to use PWM equipment for simple demonstrations.
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.
Better precision is arguable; the motor acts as a filter and uses the mean value (or something related to it) of the input current to move; so it really doesn't matter to feed it with a constant current (resistance case) or a PWM. Maybe is better versatility rather than precision.
Not consuming extra power is one reason, maybe related to which I think is the main reason to use PWM: it's easy to control the motor with PWM from, say, a microcontroller unit; just code a counter for generate the PWM and connect the output to a motor drive (which gives the real power to the motor, and also gives the advantage of having control and power separated).
The PWM makes posible the use of microcontroller to drive the motor, which gives enormous versatility. Otherwise the demonstrations would be too simple (start, stop, speed up, speed down, with a potentiometer acting like a throttle).