# Speed control on the DC motor

```Speed control on the DC motor _____________________________
-
Introduction
The purpose of a motor speed controller is to take a signal representing the demanded speed, and to drive a
motor at that speed. The controller may or may not actually measure the speed of the motor. If it does, it is
called a Feedback Speed Controller or Closed Loop Speed Controller, if not it is called an Open Loop Speed
Controller. Feedback speed control is better, but more complicated, and may not be required for a simple
control of DC motor design.
Motors come in a variety of forms, and the speed controller's motor drive output will be different
dependent on these forms. The speed controller presented here is a simple and cheap design, which one
Why not use an H-Bridges in order to control of DC motor for the smart car?
Well, let’s see something about H-Bridges:
An H bridge is an electronic circuit that enables a voltage to be applied across a load in either direction.
These circuits are often used in robotics and other applications to allow DC motors to run forwards and
backwards. H bridges are available as integrated circuits, or can be built from discrete components.
Structure of an H bridge (highlighted in red)
The term H Bridge is derived from the typical graphical representation of such a circuit. An H
bridge is built with four switches (solid-state or mechanical). When the switches S1 and S4
(according to the first figure) are closed (and S2 and S3 are open) a positive voltage will be applied
across the motor. By opening S1 and S4 switches and closing S2 and S3 switches, this voltage is
reversed, allowing reverse operation of the motor.
The two basic states of an H bridge
Using the nomenclature above, the switches S1 and S2 should never be closed at the same time,
as this would cause a short circuit on the input voltage source. The same applies to the switches S3
and S4. This condition is known as shoot-through.
So, if we compare the H-bridge with a transistor configuration, we concluded that is better use a
power transistor than H-bridge, because the smart car does not need run forwards and backwards
and also an H-bridge IC is easier to be affected by the heating.
-
Theory of DC motor speed control
The speed of a DC motor is directly proportional to the supply voltage, so if we reduce the supply
voltage from 12 Volts to 6 Volts, the motor will run at half the speed.
The speed controller works by varying the average voltage sent to the motor. It could do this by
simply adjusting the voltage sent to the motor, but this is quite inefficient to do. A better way is to
switch the motor's supply on and off very quickly. If the switching is fast enough, the motor
doesn't notice it, it only notices the average effect.
When you watch a film in the cinema, or the television, what you are actually seeing is a series of
fixed pictures, which change rapidly enough that your eyes just see the average effect movement. Your brain fills in the gaps to give an average effect.
Now imagine a light bulb with a switch. When you close the switch, the bulb goes on and is at full
brightness, say 100 Watts. When you open the switch it goes off (0 Watts). Now if you close the
switch for a fraction of a second, and then open it for the same amount of time, the filament won't
have time to cool down and heat up, and you will just get an average glow of 50 Watts. This is how
lamp dimmers work, and the same principle is used by speed controllers to drive a motor. When
the switch is closed, the motor sees 12 Volts, and when it is open it sees 0 Volts. If the switch is
open for the same amount of time as it is closed, the motor will see an average of 6 Volts, and will
run more slowly accordingly.
As the amount of time that the voltage is on increases compared with the amount of time that it
is off, the average speed of the motor increases.
This on-off switching is performed by power transistors. A power transistor is a device that can
turn very large currents on and off under the control of a low signal level voltage.
The time that it takes a motor to speed up and slow down under switching conditions is
dependent on the inertia of the rotor (basically how heavy it is), and how much friction and load
torque there is. The graph below shows the speed of a motor that is being turned on and off fairly
slowly:
You can see that the average speed is around 150, although it varies quite a bit. If the supply
voltage is switched fast enough, it won’t have time to change speed much, and the speed will be
quite steady. This is the principle of switch mode speed control. Thus the speed is set by PWM –
Pulse Width Modulation.
Pulse-width modulation (PWM)
Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is a commonly used
technique for controlling power to inertial electrical devices, made practical by modern electronic
power switches.
The average value of voltage (and current) fed to the load is controlled by turning the switch
between supply and load on and off at a fast pace. The longer the switch is on compared to the off
periods, the higher the power supplied to the load is.
The PWM switching frequency has to be much faster than what would affect the load, which is to
say the device that uses the power. Typically switchings have to be done several times a minute in
an electric stove, 120 Hz in a lamp dimmer, from few kilohertz (kHz) to tens of kHz for a motor
drive and well into the tens or hundreds of kHz in audio amplifiers and computer power supplies.
The term duty cycle describes the proportion of 'on' time to the regular interval or 'period' of time;
a low duty cycle corresponds to low power, because the power is off for most of the time. Duty
cycle is expressed in percent, 100% being fully on.
The main advantage of PWM is that power loss in the switching devices is very low. When a switch
is off there is practically no current, and when it is on, there is almost no voltage drop across the
switch. Power loss, being the product of voltage and current, is thus in both cases close to zero.
PWM also works well with digital controls, which, because of their on/off nature, can easily set the
needed duty cycle.
PWM has also been used in certain communication systems where its duty cycle has been used to
convey information over a communications channel.
Power delivery
PWM can be used to adjust the total amount of power delivered to a load without losses normally
incurred when a power transfer is limited by resistive means. The drawbacks are the pulsations
defined by the duty cycle, switching frequency and properties of the load. With a sufficiently high
switching frequency and, when necessary, using additional passive electronic filters the pulse train
can be smoothed and average analog waveform recovered.
High frequency PWM power control systems are easily realizable with semiconductor switches. As
has been already stated above almost no power is dissipated by the switch in either on or off
state. However, during the transitions between on and off states both voltage and current are
non-zero and thus considerable power is dissipated in the switches. Luckily, the change of state
between fully on and fully off is quite rapid (typically less than 100 nanoseconds) relative to typical
on or off times, and so the average power dissipation is quite low compared to the power being
delivered even when high switching frequencies are used.
Modern semiconductor switches such as MOSFETs or Insulated-gate bipolar transistors (IGBTs) are
quite ideal components. Thus high efficiency controllers can be built. Typically frequency
converters used to control AC motors have efficiency that is better than 98 %. Switching power
supplies have lower efficiency due to low output voltage levels (often even less than 2 V for
microprocessors are needed) but still more than 70-80 % efficiency can be achieved.
Variable-speed fan controllers for computers usually use PWM, as it is far more efficient when
compared to a potentiometer or rheostat. (Neither of the latter is practical to operate
electronically; they would require a small drive motor.)
Light dimmers for home use employ a specific type of PWM control. Home-use light dimmers
typically include electronic circuitry which suppresses current flow during defined portions of each
cycle of the AC line voltage. Adjusting the brightness of light emitted by a light source is then
merely a matter of setting at what voltage (or phase) in the AC half cycle the dimmer begins to
provide electrical current to the light source (e.g. by using an electronic switch such as a triac). In
this case the PWM duty cycle is the ratio of the conduction time to the duration of the half AC
cycle defined by the frequency of the AC line voltage (50 Hz or 60 Hz depending on the country).
These rather simple types of dimmers can be effectively used with inert (or relatively slow
reacting) light sources such as incandescent lamps, for example, for which the additional
modulation in supplied electrical energy which is caused by the dimmer causes only negligible
additional fluctuations in the emitted light. Some other types of light sources such as light-emitting
diodes (LEDs), however, turn on and off extremely rapidly and would perceivably flicker if supplied
with low frequency drive voltages. Perceivable flicker effects from such rapid response light
sources can be reduced by increasing the PWM frequency. If the light fluctuations are sufficiently
rapid, the human visual system can no longer resolve them and the eye perceives the time
average intensity without flicker (see flicker fusion threshold).
In electric cookers, continuously-variable power is applied to the heating elements such as the hob
or the grill using a device known as a Simmerstat. This consists of a thermal oscillator running at
approximately two cycles per minute and the mechanism varies the duty cycle according to the
knob setting. The thermal time constant of the heating elements is several minutes, so that the
temperature fluctuations are too small to matter in practice.
PWM frequency with a power transistor
The frequency of the resulting PWM signal is dependent on the frequency of the ramp waveform.
What frequency do we want? This is not a simple question. Some pros and cons are:




Frequencies between 20Hz and 18kHz may produce audible screaming from the speed
controller and motors - this may be an added attraction for your smart car!
RF interference emitted by the circuit will be worse the higher the switching frequency is.
Each switching on and off of the speed controller results in a little power loss. Therefore
the greater the time spent switching compared with the static on and off times, the
greater will be the resulting 'switching loss' in the power transistor.
The higher the switching frequency, the more stable is the current waveform in the
motors. This waveform will be a spiky switching waveform at low frequencies, but at high
frequencies the inductance of the motor will smooth this out to an average DC current
level proportional to the PWM demand. This spikiness will cause greater power loss in the
resistances of the wires, MOSFETs, and motor windings than a steady DC current
waveform.
This third point can be seen from the following two graphs. One shows the worst case on-off
current waveform, the other the best case steady DC current waveform:
Both waveforms have the same average current. However, when we work out the power
dissipation in the stray resistances in our motor and speed controller, for the DC case:
and for the switching case, the average power is
So in the switching waveform, twice as much power is lost in the stray resistances. In practice the
current waveform will not be square wave like this, but it always remains true that there will be
more power loss in a non-DC waveform.
Transistor Circuits
Types of transistor
There are two types of standard transistors, NPN and PNP, with different circuit symbols. The
letters refer to the layers of semiconductor material used to make the transistor. Most transistors
used today are NPN because this is the easiest type to make from silicon. Let’s see about NPN
transistors and if you are new to electronics it is best to start by learning how to use these first.
The leads are labeled base (B), collector (C) and emitter (E).
These terms refer to the internal operation of a transistor but they are not much help in
understanding how a transistor is used, so just treat them as labels!
A Darlington pair is two transistors connected together to give a very high current gain.
In addition to standard (bipolar junction) transistors, there are field-effect transistors which are
usually referred to as FETs. They have different circuit symbols and properties and they are not
(yet) covered by this report.
Functional model of an NPN transistor
The operation of a transistor is difficult to explain and understand in terms
of its internal structure. It is more helpful to use this functional model:
-
-
The base-emitter junction behaves like a diode.
A base current IB flows only when the voltage VBE across the
base-emitter junction is 0.7V or more.
The small base current IB controls the large collector current Ic.
Ic = hFE &times; IB (unless the transistor is full on and saturated) hFE is
the current gain (strictly the DC current gain), a typical value for
hFE is 100 (it has no units because it is a ratio)
The collector-emitter resistance RCE is controlled by the base
current IB:
 IB = 0 RCE = infinity transistor off


IB small RCE reduced transistor partly on
IB increased RCE = 0 transistor full on ('saturated')
- A resistor is often needed in series with the base connection to limit the base current IB and
prevent the transistor being damaged.
- Transistors have a maximum collector current Ic rating.
- The current gain hFE can vary widely, even for transistors of the same type!
- A transistor that is full on (with RCE = 0) is said to be 'saturated'.
- When a transistor is saturated the collector-emitter voltage VCE is reduced to almost 0V.
- When a transistor is saturated the collector current Ic is determined by the supply voltage and
the external resistance in the collector circuit, not by the transistor's current gain. As a result the
ratio Ic/IB for a saturated transistor is less than the current gain hFE.
- The emitter current IE = Ic + IB, but Ic is much larger than IB, so roughly IE = Ic.
Using a transistor as a switch
When a transistor is used as a switch it must be either OFF or fully ON. In the fully ON state the
voltage VCE across the transistor is almost zero and the transistor is said to be saturated because it
cannot pass any more collector current Ic. The output device switched by the transistor is usually
The power developed in a switching transistor is very small:
-
In the OFF state: power = Ic &times; VCE, but Ic = 0, so the power
is zero.
In the full ON state: power = Ic &times; VCE, but VCE = 0
(almost), so the power is very small.
This means that the transistor should not become hot in use and
you do not need to consider its maximum power rating. The important ratings in switching circuits
are the maximum collector current Ic(max) and the minimum current gain hFE(min). The
transistor's voltage ratings may be ignored unless you are using a supply voltage of more than
about 15V. There is a table showing technical data for some popular transistors on the transistors
page.
Protection diode
If the load is a motor, relay or solenoid (or any other device with a coil) a diode must be connected
across the load to protect the transistor from the brief high voltage produced when the load is
switched off. The diagram shows how a protection diode is connected 'backwards' across the load,
in this case a relay coil.
Current flowing through a coil creates a magnetic field which
collapses suddenly when the current is switched off. The
sudden collapse of the magnetic field induces a brief high
voltage across the coil which is very likely to damage
transistors and ICs. The protection diode allows the induced
voltage to drive a brief current through the coil (and diode) so
the magnetic field dies away quickly rather than instantly. This
prevents the induced voltage becoming high enough to cause
damage to transistors and ICs.
When to use a relay
Transistors cannot switch AC or high voltages (such as mains electricity) and they are not usually a
good choice for switching large currents (&gt; 5A). In these cases a relay will be needed, but note that
a low power transistor may still be needed to switch the current for the relay's coil!
-
Relays can switch AC and DC, transistors can only switch DC.
Relays can switch high voltages, transistors cannot.
Relays are a better choice for switching large currents (&gt; 5A).
Relays can switch many contacts at once.
-
Relays are bulkier than transistors for switching small currents.
Relays cannot switch rapidly; transistors can switch many times per second.
Relays use more power due to the current flowing through their coil.
Relays require more current than many ICs can provide, so a low power transistor may be
needed to switch the current for the relay's coil.
Connecting a transistor to the output from an IC
Most ICs cannot supply large output currents so it may be necessary to use a transistor to switch
the larger current required for output devices such as lamps, motors and relays. The 555 timer IC
is unusual because it can supply a relatively large current of up to 200mA which is sufficient for
some output devices such as low current lamps, buzzers and many relay coils without needing to
use a transistor.
A transistor can also be used to enable an IC connected to a low voltage supply (such as 5V) to
switch the current for an output device with a separate higher voltage supply (such as 12V). The
two power supplies must be linked, normally this is done by linking their 0V connections. In this
case you should use an NPN transistor.
A resistor RB is required to limit the current flowing into the base of the transistor and prevent it
being damaged. However, RB must be sufficiently low to ensure that the transistor is thoroughly
saturated to prevent it overheating, this is particularly important if the transistor is switching a
large current (&gt; 100mA). A safe rule is to make the base current IB about five times larger than the
value which should just saturate the transistor.
Choosing a suitable NPN transistor
The circuit diagram shows how to connect an NPN transistor, this will switch on the load when the
IC output is high. If you need the opposite action, with the load switched on when the IC output is
low (0V) please see the circuit for a PNP transistor below.
The procedure below explains how to choose a suitable switching transistor.
1. - The transistor's maximum collector current Ic(max) must be
greater than the load current Ic.
supply voltage Vs
2. - The transistor's minimum current gain hFE(min) must be at
least five times the load current Ic divided by the maximum output
current from the IC.
hFE(min) &gt; 5 &times;
Max IC current
3. - Choose a transistor which meets these requirements and make a note of its properties:
Ic(max) and hFE(min). .
4. - Calculate an approximate value for the base resistor:
RB = Vc &times; hFE
5 &times; Ic
where Vc = IC supply voltage
(in a simple circuit with one supply this is Vs)
For a simple circuit where the IC and the load share the same power supply (Vc = Vs) you may prefer to use:
RB = 0.2 &times; RL &times; hFE
Then choose the nearest standard value for the base resistor.
5.- Finally, remember that if the load is a motor or relay coil a protection diode is required.
Example
The output from a 4000 series CMOS IC is required to operate a relay with a 100 coil.
The supply voltage is 6V for both the IC and load. The IC can supply a maximum current of 5mA.
1. - Load current = Vs/RL = 6/100 = 0.06A = 60mA, so transistor must have Ic(max) &gt; 60mA.
2. - The maximum current from the IC is 5mA, so transistor must have hFE(min) &gt; 60 (5 &times;
60mA/5mA).
3. - Choose general purpose low power transistor BC182 with Ic(max) = 100mA and hFE(min) =
100.
4. - RB = 0.2 &times; RL &times; hFE = 0.2 &times; 100 &times; 100 = 2000. so choose RB = 1k8 or 2k2.
5. - The relay coil requires a protection diode.
Choosing a suitable PNP transistor
The circuit diagram shows how to connect a PNP transistor, this will
switch on the load when the IC output is low (0V). If you need the
opposite action, with the load switched on when the IC output is high
please see the circuit for an NPN transistor above.
The procedure for choosing a suitable PNP transistor is exactly the
same as that for an NPN transistor described above.
Using a transistor switch with sensors
The top circuit diagram shows an LDR (light sensor) connected so that the LED lights when the LDR
is in darkness. The variable resistor adjusts the brightness at which the transistor switches on and
off. Any general purpose low power transistor can be used in this circuit.
The 10k fixed resistor protects the transistor from excessive base
current (which will destroy it) when the variable resistor is
reduced to zero. To make this circuit switch at a suitable
brightness you may need to experiment with different values for
the fixed resistor, but it must not be less than 1k.
If the transistor is switching a load with a coil, such as a motor or
The switching action can be inverted, so the LED lights when the
LDR is brightly lit, by swapping the LDR and variable resistor. In
this case the fixed resistor can be omitted because the LDR
resistance cannot be reduced to zero.
Note that the switching action of this circuit is not particularly
good because there will be an intermediate brightness when the
transistor will be partly on (not saturated). In this state the
transistor is in danger of overheating unless it is switching a small
current. There is no problem with the small LED current, but the
larger current for a lamp, motor or relay is likely to cause
overheating.
Other sensors, such as a thermistor, can be used with this circuit,
but they may require a different variable resistor. You can calculate an approximate value for the
variable resistor (Rv) by using a multimeter to find the minimum and maximum values of the
sensor's resistance (Rmin and Rmax):
Variable resistor, Rv = square root of (Rmin &times; Rmax)
For example an LDR: Rmin = 100, Rmax = 1M, so Rv = square root of (100 &times; 1M) = 10k.
You can make a much better switching circuit with sensors connected to a suitable IC (chip). The
switching action will be much sharper with no partly on state.
Darlington pair
This is two transistors connected together so that the current amplified by the first is amplified
further by the second transistor. The overall current gain is equal to the two individual gains
multiplied together:
Darlington pair current gain, hFE = hFE1 &times; hFE2
(hFE1 and hFE2 are the gains of the individual transistors)
This gives the Darlington pair a very high current gain, such as 10000, so
that only a tiny base current is required to make the pair switch on.
A Darlington pair behaves like a single transistor with a very high current
gain. It has three leads (B, C and E) which are equivalent to the leads of a
standard individual transistor. To turn on there must be 0.7V across both
the base-emitter junctions which are connected in series inside the
Darlington pair, therefore it requires 1.4V to turn on.
Darlington pairs are available as complete packages but you can make
up your own from two transistors; TR1 can be a low power type, but
normally TR2 will need to be high power. The maximum collector
current Ic(max) for the pair is the same as Ic(max) for TR2.
A Darlington pair is sufficiently sensitive to respond to the small current passed by your skin and it
can be used to make a touch-switch as shown in the diagram. For this circuit which just lights an
LED the two transistors can be any general purpose low power transistors. The 100k resistor
protects the transistors if the contacts are linked with a piece of wire
Inductors
Before we go on to discuss the circuit designed, we must first learn something about the action of
inductive loads, and inductors. Inductors do not allow the current flowing through them to change
instantly (in the same way capacitors do not allow the voltage across them to change instantly).
The voltage dropped across an inductor carrying a current i is given by the equation
where di/dt is the rate of change of the current. If the current is suddenly changed by opening a
switch, or turning a transistor off, the inductor will generate a very high voltage across it. For
example, turning off 100 Amps in 1 microsecond through a 100 microHenry inductor generates
10kV!
-
Design of control DC motor
We are going to use a Tip120 power transistor (you can see the data sheet at the end of the
report), but before to continue with the design, we need to know how to realize the correct
calculate of the configuration circuit and also know about the transistor.
We need to saturate the transistor to use it such a switch and also we need to know how much
current the motor needs in order to proceed with the calculate, so as we can see in the transistors
datasheet, around of 20mA we need to obtain a 5mA of Ic, enough for the motor.
To calculate the RB, we need to use the below equation:
𝑅𝐵 ≤
VCC − VBE
𝐼𝐵
and if we replace the values that we know, VCC=7.2v (battery voltage), VBE=0.7 and IB=20mA:
𝑅𝐵 ≤
7.2 − 0.7
20𝑚𝐴
RB=325Ohms and we are going to use a 330 Ohms.
Some diagrams illustrating how to use the tip120 transistor to control 7.2v (actually up to 60v DC)
PCB design
Once known the circuit diagram, we're going to create a PCB with a program who it can simulate
circuits and also create PCBs, this program is called Proteus.
As this card handles more power is taken into consideration in the design of the PCB the increasing
of the width of the tracks that control high signals. The PCB design is performed using Proteus
Ares.
We need to make the circuit in Proteus Isis and become it to PCB with Proteus Ares.
The below image shows the circuit in ISIS:
And these other ones show the PCB in ARES:
http://www.kpsec.freeuk.com/trancirc.htm#model
http://en.wikipedia.org/wiki/Pulse-width_modulation
http://homepages.which.net/~paul.hills/SpeedControl/SpeedControllersBody.html
```