If you don't know how to control the speed of a Permanent Magnet DC motor, then let me tell you there are two basic methods to do it. One is using DAC (Digital to Analog Converter) and the other method is using PWM (Pulse width modulation).
Using DAC method, the output of the DAC varies as the input binary pattern varies: the transistor is biased at the output of DAC and hence changes the speed of the motor connected across. Whereas in the later, PWM instead of giving fixed voltage provides an average change in voltage by changing the duty cycle - giving you ones's and zero's instead the fixed analog voltege. As the duty cycle varies the average voltage varies and hence the speed of DC motor.
PWM or DAC ?
PWM method to control the speed of DC Motor has certain advantages over the DAC method. Though DAC can provide you precise reading, but the disadvantage is that the transistor biased at the output of DAC works in linear region which is responsible for the continuous power loss due to Collector to Emitter drop (Vce). This might weaken the batteries over a long run. On the other hand, the transistor at the output of PWM generator, say microcontroller, works in saturated or cutoff region only, due to the fact that PWM generates alternating ones and zeros on contrary to fixed analog voltage in the case of DAC.
Due to the reasons mentioned above , PWM is preferred over DAC.
More to Follow