Motor Control Unit
| Introduction | Constant Voltage | Pulse-Width Modulation | Design Ideas |
This Motor Control Unit (MCU) is based on the LM317 voltage regulator IC. Indeed the basic design employs the standard design as shewn on the data sheet; here is the circuit diagram:

In this circuit, the diodes protect the regulator against spikes from the motor, and the capacitors also provide suppression. This leaves the two resistors which "programme" the output voltage delivered by the circuit.
The regulator's function is to maintain a voltage of 1.2 Volts between its Adjustment (Adj) and Output (Out) terminals. As the resistance across the variable resistor is increased, a potential divider is formed, and the regulator compensates to maintain the afore mentioned 1.2 Volts. This results in the output voltage increasing accordingly.
A limitation of this design is that the minimum output voltage is 1.2 Volts, although in my experiments this was not quite sufficient to drive 12V motors, although some of the better models were moving with just 2.0 Volts applied. Furthermore, once the maximum voltage has been reached, increasing the slider will have no effect - this just renders a small section of the slider redundant for certain voltage ranges.
This could be used advantagously, however, since if a 1k potentiometer is used for example, the maximum voltage is 6.2 Volts, which means that a 6V motor can be driven from a 12V supply, which can be useful for driving some accessories.
Digital Programming
Research into the LM317 data sheet again yields well, as it shews a method by which the voltage can be programmed from the output of a computer or other digital device. This circuit uses a ULN2803A which allows direct interfacing from TTL or CMOS circuits (the supression comonents have been removed for clarity).

Selecting the resistor values can be tricky, depending upon how you wish to use this circuit. It is possible to alter the number of resistors/buffers used; all that may be needed are further ULN2803As. For the purposes of this discussion, it is assumed that the circuit is configured as shewn.
On the face of it, there are 256 (28) possible combinations of resistors, when you consider all options of parallelled resistors. Although this sounds excellent in theory, in practice it can be difficult to acquire the required values. For example, using the circuit as shewn, I discovered that a linear range of values is impossible, and in fact one tends to finish with something more of the reciprocal form. A spreadsheet below concludes my experimental findings:
What these results do shew, however, is that there is a large linear region with large numbers of neighbouring values - something which could be exploited to yield ~192 useful values.