Professional Documents
Culture Documents
Submitted For The Partial Fulfillment of The Requirement For The Degree of
Submitted For The Partial Fulfillment of The Requirement For The Degree of
Project Report
On
Speed control of DC motor
Using PID controller
Submitted for the partial fulfillment of the requirement for the
degree
of
Bachelor of Technology
in
Electrical Engineering
Submitted by:
Navneet Verma (1706820018)
Puranjan Singh (1706820020)
Shashi kant (1706820027)
This is to certify that project report entitled “Speed control of DC motor using PID
controller” which is submitted in partial fulfillment of the requirements for the award of degree
of Bachelor of Technology in Electrical Engineering, Meerut institute of Engineering &
Technology, during the academic year 2020-2021 comprises only our own work. The work has
not been submitted to any other institute for any degree or diploma. Wherever we have used
supporting material (data, theoretical analysis, figures and text) from other sources, we have
given due credits by citing the references for the details, in the text of the report. We have
followed the guidelines provided by the institute in preparing the project report.
Approved By:
Dr. Ramesh Chandra Chourasia
(Associate Professor)
2
CERTIFICATE
This is certified that this project report entitled “Speed control of DC motor using PID
controller”, submitted by Navneet Verma (1706820018), Puranjan Singh (1706820020),
and Shashi Kant (1706820027), is in fulfillment of the requirements for the award of the
degree of Bachelor of Technology in Electrical Engineering, from Meerut Institute of
Engineering & Technology, Meerut. The work presented in this project report carried out under
my supervision and has not been submitted for the award of any other degree/diploma, to the
best of my knowledge.
Approved By:
3
ACKNOWLEDGEMENT
We would like to place on record our deep sense of gratitude to Mr. Avinash Kumar,
Assistant Professor & HOD of the Electrical Engineering Department of this institute for
his generous guidance, help, moral support and valuable suggestions. We are extremely
thankful to Dr. Mayank Garg, Director, M.I.E.T, Meerut for providing the excellent
infrastructure, laboratory and computing facilities for the project work. We gratefully
acknowledge constructive feedback and suggestions of the worthy faculty members of the
Department of Electrical Engineering.
4
ABSTRACT
DC motors are used in numerous industrial applications like servo systems and speed control
applications. For such systems, the Proportional + Derivative (PID) controller is Integral
+ usually the controller of choice due to its ease of implementation, ruggedness, and easy
tuning. All the classical methods for PID controller design and tuning provide initial
workable values, and which are further manually finetuned for achieving desir ed
performance. The manual fine tuning of the PID controller parameters is an arduous job
which demands expertise and comprehensive knowledge of the domain. In this research
work, some metaheuristic algorithms are explored for designing PID controller and a
comprehensive comparison is made between these algorithms and classical techniques as
well for the purpose of selecting the best technique for PID controller design and parameters
tuning.
5
LIST OF ABBREVIATIONS
IM - Induction motor
H-Effect - Hall effect
6
TABLE OF CONTENTS
Declaration (i)
Certificate (ii)
Acknowledgments (iv)
Abstract (v)
List of Abbreviations (viii)
List of Symbols (x)
Table of Contents (xii)
List of Figures (xvi)
CHAPTER 1:INTRODUCTION 10-11
1.1 Overview 10
CHAPTER 2: LITERATURE REVIEW 12-16
2.1 Speed Control of Three Phase Induction motor 12
2.2 Equivalence between Fuzzy PID Controllers 12
2.3 Speed Control of Induction Motor Using Fuzzy-PI Controller. 13
2.4 A Novel Self - Tuning Fuzzy Based PID Controller 14
CHAPTER 3: MATERIALS AND METHODS 17-41
3.1 Platform used and software requirements 17
3.2 Temperature Sensor 17
3.3 Voltage Transformers 20
3.4 Rectifier 24
3.5 Voltage Regulators 26
3.6 Relays 33
3.7 Crystal Oscillator 35
3.8 Capacitor 36
3.9 Resistor 38
3.10 Transistors 40
CHAPTER 4: PROJECT DESCIPTION AND WORKING 42-57
4.1Aim of the project 42
4.2 Block Diagram 42
4.3 Circuit diagram 43
7
4.4 Working of project 44
4.5 Circuit Description 44
4.6 Analog to digital converter 53
CHAPTER 5: RESULT AND DISCUSSION 58-59
CHAPTER 6: SUMMARY AND CONCLUSION 60
CHAPTER 7: APPLICATIONS AND FUTURE SCOPE 61
REFERENCES 62
BIBLIOGRAPHY 63
8
LIST OF FIGURES
9
LIST OF TABLES
Figure Page
Number Name of The Table Number
10
CHAPTER 1
INTRODUCTION
1.1Overview
In this modern industrial age, there is hardly any industrial application in which DC motors
are not being used. This is so because of ease of control, low-cost maintenance especially of
brushless DC motor type, low price, and ruggedness of DC motor over a wide range of
applications. Some industrial applications, which are worth mentioning, in which DC motors
are being used widely are machine tools, paper mills, textile industry, electric traction, and
robotics. The flexibility in controller design of DC motors is due to the fact that armature
winding, and field winding could be controlled separately. In most of the applications of
speed control of DC motors, the current in field winding is kept constant and the current in
armature winding is varied or vice versa which gives excellent speed control performance
over a wide range of desired values. In these applications, the purpose is to track the speed
command by keeping output speed at desired level and to achieve desire speed or position
control in minimum time without having large overshoots and settling times.
11
designing and tuning PID controller parameters which are widely understood and easily
applied, one of the main disadvantages of these classical techniques is that, for tuning PID
controller through these techniques, expertise and experience are required. This is so because
these methods provide a starting point and achieving desired performance fine tuning of
parameters through hit-and-trial method is required. However, metaheuristic techniques may
be a good choice to its dynamic nature.
Over the years, many metaheuristic and stochastic optimization techniques have been
developed which are being applied in every discipline of life. These techniques are nature
inspired depending upon the swarm intelligence, evolutionary, or foraging behaviour of
different species. Some of the widely used techniques are genetic algorithm (GA), particle
swarm optimization (PSO), and simulated annealing (SA). These metaheuristic algorithms
have been successfully applied also in various fields of control systems and results obtained
through these techniques have proven their supremacy over the classical techniques.
There have been previously many attempts for the nature inspired PID controller tuning;
however, according to the best of our knowledge there has been a little work done in
exploiting the power of hybrid techniques for the PID controller tuning. In this work, a PID
controller design for speed control of DC motor is presented. First, the design through
classical techniques like Zeigler-Nichols and Cohen-Coon methods is presented for
establishing a base line. Then, six metaheuristic optimization algorithms are used to find the
best possible parameters of PID controller subjected to minimization of a cost function and
among these three of the hybrid techniques are used to establish the superiority of hybrid
metaheuristic techniques over the others. A comprehensive comparison is made between the
classical techniques and the metaheuristic techniques to show the strength, stability, and
efficiency of these methods over the classical techniques. Although some stochastic
algorithms have been used previously for design of PID controller for different applications,
this study presents some hybrid techniques by combining the global and local search
techniques of swarm intelligence and evolutionary algorithms for PID controller design and
it could provide a framework of PID controller tuning by considering the hybrid nature of
metaheuristic techniques.
12
CHAPTER 2
LITERATURE REVIEW
2.1 DC Motor Speed Control using PID Controller, IR Sensor and PWM Hysteresis.
Hardik S Jain, Akshat Palak, Sandesh Agrawal, Krishnam Tibrewal, Malaya Kumar
Hota
The Proportional Integral Differential (PID) controller design and selection of various
Proportional, Integral and Differential control parameters according to various system
responses is proposed in this paper. MATLAB is a multi-paradigm numerical computing
environment and proprietary programming language. It allows matrix manipulations, plotting
of functions and data, implementation of algorithms. An additional package, Simulink, adds
graphical multi-domain simulation and model-based design for dynamic and embedded
systems. We are using Simulink to implement the Proportional Integral Differential (PID)
controller that can be used to control the speed of DC motor and bring it at the desired speed.
Pulse width Modulation (PWM) is another technique which involves the use of the same
simulation software. Hardware implementation requires the use of Infrared (IR) sensors and
Arduino (open source platform for building Electronic project) for measuring the Rotations
per minute (RPM) of the DC motor. Motor speed was measured using three techniques and a
further comparison between these techniques is carried out according to the desired and
control speed.The applications of our research could be in conveyors, turntables and others
for which adjustable speed and constant or low-speed torque are required. It also works well
in dynamic braking and reversing applications, which are common in many industrial
machines.
The PID controllers always have been broadly utilized for control of speed in dc engine. In
all strategies the speed is controlled by monitoring the armature voltage, armature present,
terminal voltage and by control-ling the field current of dc engine. Numerous experimental
techniques are utilized for tuning of the PID parameters like inherited calculation, GSA
calculation, ICA calculation, fluffy tuning, microcontroller tuning and so forth the yield for
the speed control is gotten through the expansion of rotor shaft. Speed regulator of dc engine
was having an issue with different information sources and controlling factors for speed.
Some of the methods which can be used to control DC motor speed are: Flux control method
13
Variable resistance in series with motor Voltage control method Using IR sensor and Arduino
Using MATLAB and Simulink (PID controller) Using PWM Hysteresis Using Fuzzy logout
of these, this paper will focus on three techniques and compare their results. They include IR
sensor and Arduino method (hardware), PID controller and PWM Hysteresis (software)
Fatiha Loucif
2.3 Speed Control of DC Motor Using PID Controller Based on Artificial Intelligence
Techniques
The aim of this paper is to design a speed controller of a DC motor by selection of a PID
parameters using genetic algorithm (GA) and Adaptive Neuro-Fuzzy Inference System
(ANFIS). DC motor could be represented by a nonlinear model when nonlinearities such as
magnetic saturation are considered. To provide effective control, nonlinearities and
uncertainties in the model must be taken into account in the control design.The model of a
DC motor is considered as a third order system. And this paper compares three kinds of tuning
methods of parameter for PID controller. One is the controller design by the Ziegler and
Nichols, second is the controller design by the Genetic Algorithm method and third is the
controller design by Adaptive Neuro-Fuzzy Inference System (ANFIS). The proposed
methods could be applied to the higher order systems.
14
DC motors have been widely used in industry even though its maintenance costs are higher
than the induction motor. Proportional-Integral Derivative (PID) controllers have been
widely used for speed and position control of DC motor. The paper achievement is to design
a control system using Genetic Algorithm with considering of non linearity effective of the
system. Genetic Algorithm or in short GA is a stochastic algorithm based on principles of
natural selection and genetics. Genetic Algorithms (GAs) are a stochastic global search
method that mimics the process of natural evolution. Using genetic algorithms to perform the
tuning of the controller will result in the optimum controller being evaluated for the system
every time. Furthermore, the effective of applying Adaptive Neuro -Fuzzy Inference
SYSTEM (ANFIS) based on genetic algorithms will be studied. The objective of this paper
is to show that by employing the GA method with and without ANFIS of tuning a system, an
optimization can be achieved. This can be seen by comparing the results of the GA optimized
system against the Ziegler-Nichols tuned system.
The designed PID with Adaptive Neuro-Fuzzy Inference System based GA has much faster
response than response of the classical method. The classical method is good for giving us as
the starting point of what are the PID values. However Adaptive Neuro-Fuzzy Inference
System based GA designed PID is much better in terms of the rise time and the settling time
than the conventional method. Finally the Artificial Intelligence Techniques provides much
better results compared to the conventional methods. And also the error associated with the
Adaptive Neuro-Fuzzy Inference System based GA is much lesser than the error calculated
in the conventional scheme.
2.3 DC Motor Speed Control using PID Controller Tuned by Jaya Optimization
Algorithm
Direct current (DC) motor plays an important role in industries to convert energy from
electrical to mechanical. The speed of DC motor is important in the process control industries
so we have to control the speed of DC motor. For this speed control proportional-integral-
derivative (PID) controllers are used. For better performance and optimum parameters, PID
tuning is used. Traditional tuning techniques for classical PID controller suffer from many
disadvantages like non-customized performance measure and insufficient process
information. In this paper, we use the Jaya optimization algorithm (JOA) for better
performance in speed control and time response of the system. Experimental results are
15
presented to study the performance of JOA based PID controller in comparison with particle
swarm optimization (PSO) based PID controller. Practical validation is done on QNET 2.0
DC motor by using LabVIEW® software.
This paper presents the application of PSO and JOA to tune the PID controller for controlling
the speed of Quanser QNET 2.0 DC motor. The speed control of DC motor in different
algorithms are compared which are without PID controller, with PID controller by PSO
algorithm and JOA. It is concluded that PSO algorithm based speed control of DC motor
gives the best steady state response and JOA algorithm based speed control gives the best
transient response that means speed of response
Ms. Priti Sathe, Ms. Snehal Tetambe, Mr. Sahil Jadha Mr. Tejharsh Khedekar , Ms. Mayor
Joshi
Based on present literature review authors concluded that PID controller is very effective and
powerful controller and has better control approach in order to sustain speed of the motor.
The parameter values of PID controller are set up by tuning methods. ANFIS has faster
response than response of other traditional methods. [1] It is better in rise time, settling time
and less steady state error. All tuning methods are compared to optimize the values of
parameters like Mp, Tr, Ess and Ts. Some new methods like JOA, PSO, LQR and MPC also
give better and smoother response than traditional methods.[5]Still there is much scope in
improving the PID controller design to make it more simple.
Genetic Algorithm method -. Here separately excited dc motor is taken and its circuit model
using MATLAB is created. Firstly, parameters of PID controller are decided by conventional
method by increasing Kp. So the systems parameters like maximum overshoot and settling
time are not tuned to its optimum. GA is hereditary calculation approach.
16
Chapter – 3
Material & Methods
3.1 Platform Used & Software Requirements
Software Used
1. Microcontroller PIC16F72
2. PID controller section
3. Crystal Oscillator
4. Resistor
5. Capacitor
6. Connectors
7. Buzzer
8. Transformer
9. Transistor
10. Led
11. Relay
National Semiconductor’s LM335 IC has been used for sensing the temperature. It is an
integrated circuit sensor that can be used to measure temperature with an electrical output
proportional to the temperature (in oC). The temperature can be measured more accurately
with it than using a thermistor. The sensor circuitry is sealed and not subject to oxidation, etc.
The voltage control is performed by changing the turns ratio. This is a done by provision of
taps in the windings. The volts per turn available in large transformers is quite high and
hence a change of even one turn on the LV side represents a large percentage change in
the voltage.
17
Fig 3.2 LM335 temperature sensor
Features:
Functional description:
• The output of LM35 is amplified using a single power supply (+5V) op-amp.
18
Table 3.2 Temperature Sensor Readings
19
Transformer voltage control and Tap changing
Regulating the voltage of a transformer is a requirement that often arises in a power
application or power system.
In an application it may be needed
1. To supply a desired voltage to the load.
2. To counter the voltage drops due to loads.
3. To counter the input supply voltage changes on load.
On a power system the transformers are additionally required to perform the task of regulation
of active and reactive power flows.The voltage control is performed by changing the turns
ratio. This is done by provi-sion of taps in the winding. The volts per turn available in large
transformers is quite high and hence a change of even one turn on the LV side represents a
large percentage change in the voltage.
Also the LV currents are normally too large to take out the tapping from
the windings. LV winding being the inner winding in a core type transformer adds to the
Technology Madras difficulty of taking out of the taps. Hence irrespective of the end use for
which tapping is put to, taps are provided on the HV winding. Provision of taps to control
voltage is called tap changing.
In the case of power systems, voltage levels are some times changed by injecting a suitable
voltage in series with the line. This may be called buck-boost arrangement. In ad- dition to the
magnitude, phase of the injected voltage may be varied in power systems. The tap changing
arrangement and buck boost arrangement with phase shift are shown in. Tap Changi
-ng can be effected when a) the transformers is on no- load and b) the load
its still remains connected to the transformer. These are called off load tap changing and on
load tap changing. The Off load tap changing relatively costs less. The tap positions are
changed when the transformer is taken out of the circuit and reconnected. The on-load tap
changer on the other hand tries to change the taps without the interruption of the load current.
In view of this requirement it normally costs more.
20
one winding to another winding by a varying magnetic field produced by alternating current
. An electrical voltage is induced when there is a relative motion between a wire and a
magnetic field. Alternating current (AC) provides the motion required by changing direction
which creates a collapsing and expanding magnetic field.
NOTE: Direct current (DC) is not transformed, as DC does not vary its magnetic fields A
transformer usually consists of two insulated windings on a common iron (steel) core: The
two windings are linked together with a magnetic circuit which must be common to both
windings. The link connecting the two windings in the magnetic circuit is the iron core on
which both windings are wound. Iron is an extremely good conductor for magnetic fields.
The core is not a solid bar of steel, but is constructed of many layers of thin steel called
laminations. One of the windings is designated as the primary and the other winding as the
secondary. Since the primary and secondary are wound the on the same iron core, when the
primary winding is energized by an AC source, an alternating magnetic field called flux is
established in the transformer core. The flux created by the applied voltage on the primary
winding induces a voltage on the secondary winding. The primary winding receives the
energy and is called the input. The secondary winding is discharges the energy and is called
the output.The primary and secondary windings consist of aluminum or copper conductors
wound in coils around an iron core and the number of ?turns? in each coil will determine the
voltage transformation of the transformer. Each turn of wire in the primary winding has an
equal share of the primary voltage . The same is induced in each turn of the secondary.
Therefore, any difference in the number of turns in the secondary as compared to the primary
will produce a voltage change.
Step Down Transformers: If there are fewer turns in the secondary winding than in the
primary winding, the secondary voltage will be lower than the primary.
21
Step Up Transformers: If there are fewer turns in the primary winding than in the secondary
winding, the secondary voltage will be higher than the secondary circuit.
Note: The primary winding is the winding which receives the energy; it is not always the
high-voltage winding. When the primary winding and the secondary winding have the
same amount of turns there is no change voltage, the ratio is 1/1 unity.
As an example, suppose we have a transformer with a 4 to 1 turns ratio. With 480 volts input,
the output would be 120 volts. Suppose the line voltage is less than the normal or 456 volts.
This would produce an output voltage of 114 volts which is not desirable. By placing a tap in
the primary winding, we could change the turns ratio so that with 456 volts input we could
still get 120 volts output.
This relationship between the number of turns in the secondary and primary is often called
the turns ratio (also referred to as the voltage ratio). It is customary to specify the turns ratio
by writing the primary (input) number first. Example: 30 to 1 is a step-down transformer,
whereas a 1 to 30 would be a step-up transformer.
Winding Physical Location: In most transformers the high voltage winding is wound directly
over the low voltage winding to create efficient coupling of the two windings.
22
Note: Other Designs may have the high voltage winding wound inside, side-by-side or
sandwiched between layers of the low voltage winding to meet special requirements. As
stated previously, the voltage transformation is a function of the turns ratio. It may be
desirable to change the ratio in order to get rated output voltage when the incoming voltage
is slightly different than the normal voltage. As an example, suppose we have a transformer
with a 4 to 1 turns ratio. With 480 volts input, the output would be 120 volts. Suppose the
line voltage is less than the normal or 456 volts. This would produce an output voltage of 114
volts which is not desirable. By placing a tap in the primary winding, we could change the
turns ratio so that with 456 volts input we could still get 120 volts output. This is called
primary output voltage tap and standard transformers may have from two to six taps for the
purpose of the adjusting to actual line voltages.
The above transformer has a tap (2) 2 1/2% below normal and one at 5% below , it is said to
have (2) 2 1/2% full capacity below normal taps (FCBN). This would give a 5% voltage
range. When the transformer has taps above normal as shown, they would be full capacity
above normal (FCAN). For Standardization purposes, these taps are in 2 1/2% or 5% steps.
The taps are so designed that full capacity output can be obtained when the transformer is set
on any of these taps. The universal tap arrangement used on many of our transformers ((2) 2
1/2% FCAN and (4) 2 1/2% FCBN) provides a 15% range of tap voltage adjustments. Note:
taps are only to be used for steady state input line variations. They are not designed to provide
a constant secondary voltage when the input line is constantly fluctuating.
A transformer is a device that transfers electrical energy from one circuit to another by
magnetic coupling without requiring relative motion between its parts. It usually comprises
two or more coupled windings, and, in most cases, a core to concentrate magnetic flux. A
transformer operates from the application of an alternating voltage to one winding, which
creates a time-varying magnetic flux in the core. This varying flux induces a voltage in the
other windings. Varying the relative number of turns between primary and secondary
windings determines the ratio of the input and output voltages, thus transforming the voltage
by stepping it up or down between circuits.
23
is termed the magnetising current; in the ideal transformer it is considered to be negligible.
The MMF drives flux around the magnetic circuit of the core.
An electromotive force (EMF) is induced across each winding, an effect known as mutual
inductance. The windings in the ideal transformer have no resistance and so the EMFs are
equal in magnitude to the measured terminal voltages. In accordance with Faraday's law of
induction, they are proportional to the rate of change of flux:
and
where
and are the induced EMFs across primary and secondary windings,
and are the numbers of turns in the primary and secondary windings,
and are the time derivatives of the flux linking the primary and secondary windings.
In the ideal transformer, all flux produced by the primary winding also links the secondary,
The ratio of primary to secondary voltage is therefore the same as the ratio of the number of
turns; alternatively, that the volts-per-turn is the same in both windings.
3.4 Rectifier
A bridge rectifier is an arrangement of four diodes connected in a bridge circuit as shown
below, that provides the same polarity of output voltage for any polarity of the input voltage.
When used in its most common application, for conversion of alternating current (AC) input
into direct current (DC) output, it is known as a bridge rectifier. The bridge rectifier provides
full wave rectification from a two wire AC input (saving the cost of a center tapped
transformer) but has two diode drops rather than one reducing efficiency over a center tap
based design for the same output voltage.
24
Fig 3.4 (a) Schematic of a bridge rectifier
Basic Operation: When the input connected at the left corner of the diamond is positive with
respect to the one connected at the right hand corner, current flows to the right along the
upper colored path to the output, and returns to the input supply via the lower on.When the
right hand corner is positive relative to the left hand corner, current flows along the upper
colored path and returns to the supply via the lower colored path.
In each case, the upper right output remains positive with respect to the lower right one. Since
this is true whether the input is AC or DC, this circuit not only produces DC power when
supplied with AC power: it also can provide what is sometimes called "reverse polarity
protection". That is, it permits normal functioning when batteries are installed backwards or
DC input-power supply wiring "has its wires crossed" (and protects the circuitry it powers
against damage that might occur without this circuit in place). Prior to availability of
integrated electronics, such a bridge rectifier was always constructed from discrete
components. Since about 1950, a single four-terminal component containing the four diodes
connected in the bridge configuration became a standard commercial component and is now
available with various voltage and current ratings. Output Smoothing: For many applications,
25
especially with single phase AC where the full- wave bridge serves to convert an AC input
into a DC output, the addition of a capacitor may be important because the bridge alone
supplies an output voltage of fixed polarity but pulsating magnitude. The function of this
capacitor, known as a 'smoothing capacitor' (see also filter capacitor) is to lessen the variation
in (or 'smooth') the raw output voltage waveform from the bridge. One explanation of
'smoothing' is that the capacitor provides a low impedance path to the AC component of the
output, reducing the AC voltage across, and AC current through, the resistive load. In less
technical terms, any drop in the output voltage and current of the bridge tends to be cancelled
by loss of charge in the capacitor. This charge flows out as additional current through the
load.
Thus the change of load current and voltage is reduced relative to what would occur without
the capacitor. Increases of voltage correspondingly store excess charge in the capacitor, thus
moderating the change in output voltage / current. The capacitor and the load resistance have
a typical time constant τ = RC where C and R are the capacitance and load resistance
respectively. As long as the load resistor is large enough so that this time constant is much
longer than the time of one ripple cycle, the above configuration will produce a well smoothed
DC voltage across the load resistance. In some designs, a series resistor at the load side of the
capacitor is added. The smoothing can then be improved by adding additional stages of
capacitor–resistor pairs, often done only for sub-supplies to critical high-gain circuits that
tend to be sensitive to supply voltage noise.
26
LM317 (3-Terminal Adjustable Regulator): The LM317 is an adjustable three-terminal
positive-voltage regulator capable of supplying more than 1.5 A over an output-voltage range
of 1.2 V to 37 V. It is exceptionally easy to use and requires only two external resistors to set
the output voltage. Furthermore, both line and load regulation are better than standard fixed
regulators. The LM317 is packaged in the KC (TO-220AB) and KTE packages, which are
easy to handle and use. In addition to having higher performance than fixed regulators, this
device includes on-chip current limiting, thermal overload protection, and safe-operating-
area protection. All overload protection remains fully functional, even if the ADJUST
terminal is disconnected. The LM317 is versatile in its applications, including uses in
programmable output regulation and local on-card regulation. Or, by connecting a fixed
resistor between the ADJUST and OUTPUT terminals, the LM317 can function as a precision
current regulator. An optional output capacitor can be added to improve transient response.
The ADJUST terminal can be bypassed to achieve very high ripple-rejection ratios, which
are difficult to achieve with standard three-terminal regulators. The LM317 is characterized
for operation over the virtual junction temperature range of 0°C to 125°C.
27
The MC78XX/LM78XX/MC78XXA series of three terminal positive regulators are available
in the TO-220/D-PAK package and with several fixed output voltages, making them useful
in a wide range of applications. Each type employs internal current limiting, thermal shut
down and safe operating area protection, making it essentially indestructible. If adequate heat
sinking is provided, they can deliver over 1A output current. Although designed primarily as
fixed voltage regulators, these devices can be used with external components to obtain
adjustable voltages and currents.
Features:
• Output Current up to 1A
• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
• Thermal Overload Protection
• Short Circuit Protection
• Output Transistor Safe Operating Area Protection
Each pixel of an LCD consists of a layer of liquid crystal molecules aligned between two
transparent electrodes, and two polarizing filters, the axes of polarity of which are
perpendicular to each other. With no liquid crystal between the polarizing filters, light passing
through one filter would be blocked by the other.
The surfaces of the electrodes that are in contact with the liquid crystal material are treated
so as to align the liquid crystal molecules in a particular direction. This treatment typically
consists of a thin polymer layer that is unidirectional rubbed using a cloth (the direction of
the liquid crystal alignment is defined by the direction of rubbing). Before applying an electric
field, the orientation of the liquid crystal molecules is determined by the alignment at the
surfaces. In a twisted pneumatic device (the most common liquid crystal device), the surface
alignment directions at the two electrodes are perpendicular, and so the molecules arrange
themselves in a helical structure, or twist. Because the liquid crystal material is birefringment
(i.e. light of different polarizations travels at different speeds through the material), light
passing through one polarizing filter is rotated by the liquid crystal helix as it passes through
the liquid crystal layer, allowing it to pass through the second polarized filter. Half of the light
is absorbed by the first polarizing filter, but otherwise the entire assembly is transparent.
28
When a voltage is applied across the electrodes, a torque acts to align the liquid crystal
molecules parallel to the electric field, distorting the helical structure (this is resisted by
elastic forces since the molecules are constrained at the surfaces). This reduces the rotation
of the polarization of the incident light, and the device appears gray. If the applied voltage is
large enough, the liquid crystal molecules are completely untwisted and the polarization of
the incident light is not rotated at all as it passes through the liquid crystal layer. This light
will then be polarized perpendicular to the second filter, and thus be completely blocked and
the pixel will appear black. By controlling the voltage applied across the liquid crystal layer
in each pixel, light can be allowed to pass through in varying amounts, correspondingly
illuminating the pixel.
With a twisted pneumatic liquid crystal device it is usual to operate the device between
crossed polarizers, such that it appears bright with no applied voltage. With this setup, the
dark voltage-on state is uniform. The device can be operated between parallel polarizers, in
which case the bright and dark states are reversed (in this configuration, the dark state appears
blotchy). Both the liquid crystal material and the alignment layer material contain ionic
compounds. If an electric field of one particular polarity is applied for a long period of time,
this ionic material is attracted to the surfaces and degrades the device performance. This is
avoided by applying either an alternating current, or by reversing the polarity of the electric
field as the device is addressed (the response of the liquid crystal layer is identical, regardless
of the polarity of the applied field).
When a large number of pixels is required in a display, it is not feasible to drive each directly
since then each pixel would require independent electrodes. Instead, the display is
multiplexed. In a multiplexed display, electrodes on one side of the display are grouped and
wired together (typically in columns), and each group gets its own voltage source. On the
other side, the electrodes are also grouped (typically in rows), with each group getting a
voltage sink. The groups are designed so each pixel has a unique, unshared combination of
source and sink. The electronics or the software driving the electronics then turns on sinks in
sequence, and drives sources for the pixels of each sink. In color LCDs each individual pixel
is divided into three cells, or sub pixels, which are colored red, green, and blue, respectively,
by additional filters (pigment filters, dye filters and metal oxide filters). Each sub pixel can
be controlled independently to yield thousands or millions of possible colors for each pixel.
Older CRT monitors employ a similar method. Color components may be arrayed in various
pixel geometries, depending on the monitor's usage. If software knows which type of
29
geometry is being used in a given LCD, this can be used to increase the apparent resolution
of the monitor through sub pixel rendering. This technique is especially useful for text anti-
aliasing.
PASSIVE AND ACTIVE MATRIX : LCDs with a small number of segments, such as those
used in digital watches and pocket calculators, have a single electrical contact for each
segment. An external dedicated circuit supplies an electric charge to control each segment.
This display structure is unwieldy for more than a few display elements.
Small monochrome displays such as those found in personal organizers, or older laptop
screens have a passive-matrix structure employing super twist neumatic (STN) or double-
layer STN (DSTN) technology (DSTN corrects a color-shifting problem with STN). Each
row or column of the display has a single electrical circuit. The pixels are addressed one at a
time by row and column addresses. This type of display is called a passive matrix because
the pixel must retain its state between refreshes without the benefit of a steady electrical
charge. As the number of pixels (and, correspondingly, columns and rows) increases, this
type of display becomes less feasible. Very slow response times and poor contrast are typical
of passive-matrix LCDs. High-resolution color displays such as modern LCD computer
monitors and televisions use an active matrix structure. A matrix of thin-film transistors
(TFTs) is added to the polarizing and color filters. Each pixel has its own dedicated transistor,
allowing each column line to access one pixel. When a row line is activated, all of the column
lines are connected to a row of pixels and the correct voltage is driven onto all of the column
lines. The row line is then deactivated and the next row line is activated. All of the row lines
are activated in sequence during a refresh operation. assive matrix addressing is an addressing
scheme used in early LCDs. This is a matrix addressing scheme meaning that only m + n control
signals are required to address an m × n display. A pixel in a passive matrix must maintain its
state without active driving circuitry until it can be refreshed again. Passive matrix addressed
displays, such as Ferro Liquid Display, do not need the switch component of an active matrix
display, because they have built-in bistability. Technology for electronic paper also has a form of
bistability. Displays with bistable pixel elements are addressed with a passive matrix addressing
scheme, whereas TFT LCD displays are addressed using active addressing.Active-matrix
displays are much brighter and sharper than passive-matrix displays of the same size, and
generally have quicker response times, producing much better images. LCDs can add a lot to
our applications in terms of interfacing with the user. The most common connector used is
with 14 pins in a row.
30
1 Contrast Voltage
4 E clock
The interface is a parallel bus allowing, allowing simple and fast reading/writing of the data
to and from the LCD. A simple waveform for writing something on the LCD is as follows:
This waveform will write an ASCII byte onto the LCD screen. The ASCII code to be
displayed is 8 bits long & is sent to the LCD 4 bits or 8 bits at a time. If four bit mode is used,
two ‘nibbles’ of data (sends higher 4 bits and then lower 4 bits each with an ‘E’ clock pulse)
are sent to make a full eight bit transfer. The ‘E’ clock is used to initiate the data transfer
within LCD. Eight bit mode is best used when speed is required in an application and at least
10 I/O pins are available. Four bit mode requires a minimum of 6 bits. The R/S mode is used
to select whether the data or an instruction is being transferred between the microcontroller
and the LCD. If the bit is set then the byte at the current LCD “cursor” position can be read
or written. When the bit is reset then either a bit is being sent to the LCD or the execution
status of the last instruction is read back.
4 5 14 13 12 11 10 9 8 7 Pins
0 0 0 0 0 0 0 0 0 1 Clear display
0 0 0 0 0 0 0 0 1 * Return cursor to
home position
0 0 0 0 0 0 0 1 ID S Set cursor move
direction
0 0 0 0 0 0 1 D C B Enable
display/cursor
31
0 0 0 0 0 1 SC RL * * Move cursor/shift
display
0 0 0 0 1 DL N F * * Set interface length
0 0 0 1 A A A A A A Move cursor to
CGRAM
0 0 BF A A A A A A A Move cursor to
display
0 1 F * * * * * * * Poll the busy flag
ID- increment the cursor after each byte written to the display if set
S- shift display when byte written to the display
D- turn display on (1)/off (0)
C-turn cursor on (1)/off (0)
B-cursor blink on/ (1) off (0)
SC-display shift on (1)/off (0)
RL-direction of shift right (1)/left (0)
DL-set data interface length 8(1)/4(0)
N-Number of display lines1 (0)/2(1)
C-Character font 5x10(1)/5x7(0)
BF-This bit is while the bit is processing
A-Address
D-Data
32
3.6 RELAYS
A relay is an electrically operated switch. Current flowing through the coil of the relay creates
a magnetic field, which attracts a lever and changes the switch contacts. The coil current can
be on or off so relays have two switch positions and they are double throw (changeover)
switches. Relays allow one circuit to switch a second circuit that can be completely separate
from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC
mains circuit. There is no electrical connection inside the relay between the two circuits, the
link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can
be as much as 100mA for relays designed to operate from lower voltages. Most ICs (chips)
cannot provide this current and a transistor is usually used to amplify the small IC current to
the larger value required for the relay coil. The maximum output current for the popular 555
timer IC is 200mA so these devices can supply relay coils directly without amplification.
Relays are usually SPDT or DPDT but they can have many more sets of switch contacts, for
example relays with 4 sets of changeover contacts are readily available. For further
information about switch contacts and the terms used to describe them please see the page on
switches.
Most relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay. The supplier's catalogue
should show you the relay's connections. The coil will be obvious and it may be connected
either way round. Relay coils produce brief high voltage 'spikes' when they are switched off
and this can destroy transistors and ICs in the circuit. To prevent damage you must connect
a protection diode across the relay coil. The animated picture shows a working relay with its
coil and switch contacts. You can see a lever on the left being attracted by magnetism when
33
the coil is switched on. This lever moves the switch contacts. There is a one of (SPDT) in the
foreground and another behind them, making the relay DPDT.
COM = Common, always connect to this, it is the moving part of the switch.
NC = Normally Closed, COM is connected to this when the relay coil is off.
NO = Normally Open, COM is connected to this when the relay coil is on.
Connect to COM and NO if you want the switched to circuit to be on when the relay coil is on.
Connect to a COM and NC if you want the switched circuits to be on when the relay coil is off.
Physical size and pin arrangement
If you are choosing a relay for an existing PCB you will need to ensure that its dimensions and
pin arrangement are suitable. You should find this information in the supplier's catalogue. The
relay's coil voltage rating and resistance must suit the circuit powering the relay coil. Many
relays have a coil rated for a 12V supply but 5V and 24V relays are also readily available.
Some relays operate perfectly well with a supply voltage which is a little lower than their rated
value.
Coil resistance
The circuit must be able to supply the current required by the relay coil. You can use Ohm's law
to calculate the current:
example: A 12V supply relay with a coil resistance of 400 passes a current of 30mA. This is
OK for a 555 timer IC (maximum output current 200mA), but it is too much for most ICs and
they will require a transistor to amplify the current.
34
• Relays are a better choice for switching large currents (> 5A).
• Relays can switch many contacts at once.
Disadvantages of relays:
35
figures will undoubtedly employ temperature compensation components and regulated power
supplies, together with environmental control (good ventilation and ambient temperature
regulation) and “battleship” mechanical construction. This has been done in some
communications receivers used by the military and commercial HF communication receivers
built in the 1950-1965 era, before the widespread use of digital frequency synthesis. But these
receivers were extremely expensive, large, and heavy. Many modern consumer grade AM,
FM, and shortwave receivers employing crystal controlled digital frequency synthesis will do
as well or better from a frequency stability standpoint. An oscillator is basically an amplifier
and a frequency selective feedback network (Fig 1). When, at a particular frequency, the loop
gain is unity or more, and the total phaseshift at this frequency is zero, or some multiple of
360 degrees, the condition for oscillation is satisfied, and the circuit will produce a periodic
waveform of this frequency. This is usually a sine wave, or square wave, but triangles,
impulses, or other waveforms can be produced. In fact, several different waveforms often are
simultaneously produced by the same circuit, at different points. It is also possible to have
several frequencies produced as well, although this is generally undesirable.
3.8 Capacitor
A capacitor or condenser is a passive electronic component consisting of a pair of conductors
separated by a dielectric (insulator). When a potential difference (voltage) exists across the
conductors, an electric field is present in the dielectric. This field stores energy and produces
a mechanical force between the conductors. The effect is greatest when there is a narrow
separation between large areas of conductor, hence capacitor conductors are often called
plates. An ideal capacitor is characterized by a single constant value, capacitance, which is
measured in farads. This is the ratio of the electric charge on each conductor to the potential
difference between them. In practice, the dielectric between the plates passes a small amount
of leakage current. The conductors and leads introduce an equivalent series resistance and the
dielectric has an electric field strength limit resulting in a breakdown voltage. Capacitors are
widely used in electronic circuits to block the flow of direct current while allowing alternating
current to pass, to filter out interference, to smooth the output of power supplies, and for many
other purposes. They are used in resonant circuits in radio frequency equipment to select
particular frequencies from a signal with many frequencies. Charge separation in a parallel-
plate capacitor causes an internal electric field. A dielectric (orange) reduces the field and
increases the capacitance.
36
Fig 3.8 A simple demonstration of a parallel-plate capacitor
Sometimes charge build up affects the mechanics of the capacitor, causing the capacitance to
vary. In this case, capacitance is defined in terms of incremental changes:
In SI units, a capacitance of one farad means that one coulomb of charge on each conductor
causes a voltage of one volt across the device. Work must be done by an external influence
to move charge between the conductors in a capacitor. When the external influence is
removed, the charge separation persists and energy is stored in the electric field. If charge is
later allowed to return to its equilibrium position, the energy is released. The work done in
establishing the electric field, and hence the amount of energy stored, is given by:
37
3.9 RESISTOR
Resistors are used to limit the value of current in a circuit. Resistors offer opposition to the
flow of current. They are expressed in ohms for which the symbol is ‘’. Resistors are
broadly classified as
(1) Fixed Resistors
(2) Variable Resistors
Fixed Resistors: The most common of low wattage, fixed type resistors is the molded-carbon
composition resistor. The resistive material is of carbon clay composition. The leads are made
of tinned copper. Resistors of this type are readily available in value ranging from few ohms
to about 20M, having a tolerance range of 5 to 20%. They are quite inexpensive. The
relative size of all fixed resistors changes with the wattage rating.
Another variety of carbon composition resistors is the metalized type. It is made by deposition
a homogeneous film of pure carbon over a glass, ceramic or other insulating core. This type
of film-resistor is sometimes called the precision type, since it can be obtained with an
accuracy of 1%.
Lead
Tinned Copper Material
A Wire Wound Resistor : It uses a length of resistance wire, such as nichrome. This wire is
wounded on to a round hollow porcelain core. The ends of the winding are attached to these
metal pieces inserted in the core. Tinned copper wire leads are attached to these metal pieces.
This assembly is coated with an enamel coating powdered glass. This coating is very smooth
and gives mechanical protection to winding. Commonly available wire wound resistors have
resistance values ranging from 1 to 100K, and wattage rating up to about 200W.
Coding Of Resistor : For fixed, moulded composition resistor four colour bands are printed
on one end of the outer casing. The colour bands are always read left to right from the end
that has the bands closest to it. The first and second band represents the first and second
38
significant digits, of the resistance value. The third band is for the number of zeros that follow
the second digit..
For example, if a resistor has a colour band sequence: yellow, violet, orange and gold.
Then its range will be—
This resistor has red (2), violet (7), yellow (4 zeros) and gold bands.
So its value is 270000 = 270 k .
The standard colour code cannot show values of less than 10 . To show these small values
two special colours are used for the third band: gold, which means 1× 0.1 and silver which
means × 0.01. The first and second bands represent the digits as normal.
For example:
red, violet, gold bands represent 27 × 0.1 = 2.7
blue, green, silver bands represent 56 × 0.01 = 0.56
The fourth band of the colour code show the tolerance of the resistor. The Tolerance is the
precision of the resistor and it is given as a percentage. For example a 390 resistor with a
39
tolerance of ±10% will have a value within 10% of 390 , between 390 - 39 = 351 and
390 + 39 = 429 (39 is 10% of 390).
A special colour code is used for the fourth band tolerance:
silver ±10%, gold ±5%, red ±2%, brown ±1%.
If no fourth band is shown the tolerance is ±20%.
VARIABLE RESISTOR: In electronic circuits, sometimes it becomes necessary to adjust
the values of currents and voltages. For n example it is often desired to change the volume
of sound, the brightness of a television picture etc. Such adjustments can be done by using
variable resistors. Although the variables resistors are usually called rheostats in the other
applications, the smaller variable resistors commonly used in electronic circuits are called
potentiometers.
3.10. TRANSISTORS
A transistor is an active device. It consists of two PN junctions formed by sandwiching either
p-type or n-type semiconductor between a pair of opposite types.
• n-p-n transistor
• p-n-p transistor
40
Emitter: The section on one side that supplies charge carriers is called emitter. The emitter is
always forward biased w.r.t. base.
Collector: The section on the other side that collects the charge is called collector. The
collector is always reversed biased.
Base: The middle section which forms two pn-junctions between the emitter and collector is
called base.
A transistor raises the strength of a weak signal and thus acts as an amplifier. The weak signal
is applied between emitter-base junction and output is taken across the load Rc connected in
the collector circuit. The collector current flowing through a high load resistance Rc produces
a large voltage across it. Thus a weak signal applied in the input appears in the amplified
form in the collector circuit.
Heat sink:
Waste heat is produced in transistors due to the current flowing through them. Heat sinks are
needed for power transistors because they pass large currents. If you find that a transistor is
becoming too hot to touch it certainly needs a heat sink! The heat sink helps to dissipate
(remove) the heat by transferring it to the surrounding air.
CONNECTORS:
Connectors are basically used for interface between two. Here we use connectors for having
interface between PCB and 8051 Microprocessor Kit. There are two types of connectors they
are male and female. The one, which is with pins inside, is female and other is male. These
connectors are having bus wires with them for connection.
For high frequency operation the average circumference of a coaxial cable must be limited to
about one wavelength, in order to reduce multimodal propagation and eliminate erratic
reflection coefficients, power losses, and signal distortion. The standardization of coaxial
connectors during World War II was mandatory for microwave operation to maintain a low
reflection coefficient or a low voltage standing wave ratio.
41
Chapter 4 Project Description & Working
4.1 Aim of the project
The advance technology in the market today are coming up with a great extra hardware
circuit(PID) due to which they become bulky and costly so we have made this project by
using PID controller or pic microcontroller. We have reduced the size and cost of the
electronic and electrical circuit very significantly. In our project we are using inbuilt ADC of
pic microcontroller the ADC sense the analog voltage and we decode the incoming voltage
through software and display it on the LCD. Our aim is Speed change of fan with the help of
room temperature.
MICROCONTROLLER
UNIT
POWER LCD
42
4.3 Circuit Diagram
43
Hardware
Fig 4.3(b)Hardware
44
3. Capacitor: It is an electrolytic capacitor of rating 1000M/35V used for filtering to give
the peak dc. Capacitor is the component used to pass the ac and block the dc.
4. Regulator: LM7805 is used to give a fixed 5v regulated supply.
5. Capacitor: It is again an electrolytic capacitor 10M/65v used for filtering to give pure dc.
6. Capacitor: It is an ceramic capacitor used to remove the spikes generated when frequency
is high(spikes). So the output of supply section is 5v regulated dc.
Microcontroller Section :
It Requires three connections to be successfully done for it’s operation to begin. +5v supply:
This +5v supply is required for the controller to get start which is provided from the power supply
section. This supply is provided at pin no.20 of the PIC 16F72 controller.
Crystal Oscillator: A crystal oscillator of 4 MHz is connected at pin no.9 and pin no.10 to
generate the frequency for the controller. The crystal oscillator works on piezoelectric effect.
The clock generated is used to determine the processing speed of the controller. Two
capacitors are also connected one end with the oscillator while the other end is connected with
the ground. As it is recommended in the book to connect two ceramic capacitor of 20 pf—
40pf to stabilize the clock generated.
Reset section: It consists of an rc network consisting of 104 pf capacitor and one resistance
of 1k. This section is used to reset the controller connected at pin no.1 of PIC 16F72.
BUZZER SECTION:
This section includes a buzzer as well as a resistance to limit the current. The buzzer operates
in the range of 20-25mA. The voltage given to the buzzer is 5v and also the buzzer can operate
between 3V-24V. The resistance used is calculated by using the ohm’s law. Buzzer is an
indicating device which is used for checking the software condition and also used for
indicating any specific condition.
Next step is the necessary connections of the controller like reset and the crystal oscillator for
resetting and speed respectively.
45
Then comes the LCD interfacing, we are using 16x2 LCD for display, pin no. 7 to 14 are the
data lines of the LCD which has to be interfaced with the microcontroller input/output pins.
Port p0 has been used for the interfacing of data lines.
Since the display becomes very easy when we use microcontroller hence we have made this
project and we have tried to show different display using the switch.
PCB LAYOUT:
46
o Dry the negative in the photo cure machine.
o Take the PCB board of the size of the layout and clean it with steel wool to make the
surface smooth.
o Now dip the PCB in the liquid photoresist, with the help of dip coat machine.
o Now clip the PCB next to the negative in the photo cure machine, drying
for approximate 10-12 minute.
o Now place the negative on the top of the PCB in the UV machine, set the timer for
about 2.5 minute and switch on the UV light at the top.
o Take the LPR developer in a container and rigorously move the PCB in it.
o After this, wash it with water very gently.
o Then apply LPR dye on it with the help of a dropper so that it is completely covered
by it.
o Now clamp the PCB in the etching machine that contains ferric chloride solution for
about 10 minutes.
o After etching, wash the PCB with water, wipe it a dry cloth softly.
o Finally rub the PCB with a steel wool, and the PCB is ready.
MICROCONTROLLER UNIT:
CRITERIA FOR CHOOSING A MICROCONTROLLER:
The basic criteria for choosing a microcontroller suitable for the application are:
1) The first and foremost criterion is that it must meet the task at hand efficiently and cost
effectively. In analyzing the needs of a microcontroller-based project, it is seen whether an
8- bit, 16-bit or 32-bit microcontroller can best handle the computing needs of the task most
effectively. Among the other considerations in this category are:
(a) Speed: The highest speed that the microcontroller supports.
(b) Packaging: It may be a 28-pin DIP (dual inline package) or a QFP (quad flat package),
or some other packaging format. This is important in terms of space, assembling, and
prototyping the end product.
(c) Power consumption: This is especially critical for battery-powered products.
(d) The number of I/O pins and the timer on the chip.
(f) How easy it is to upgrade to higher –performance or lower consumption versions.
(g) Cost per unit: This is important in terms of the final cost of the product in which a
microcontroller is used.
2) The second criterion in choosing a microcontroller is how easy it is to develop products
around it. Key considerations include the availability of an assembler, debugger, compiler,
technical support.
3) The third criterion in choosing a microcontroller is its ready availability in needed
quantities both now and in the future.
47
DESCRIPTION:
This powerful (200 nanosecond instruction execution) yet easy-to-program (only 35 single
word instructions) CMOS FLASH-based 8-bit microcontroller packs Microchip's powerful
PIC® architecture into an 28-pin package and is upwards compatible with the PIC16C5X,
PIC12CXXX and PIC16C7X devices. The PIC16F72 features 5 channels of 8-bit Analog-to-
Digital (A/D) converter with 2 additional timers, capture/compare/PWM function and the
synchronous serial port can be configured as either 3-wire Serial Peripheral Interface (SPI™)
or the 2-wire Inter-Integrated Circuit (I²C™) bus. All of these features make it ideal for more
advanced level A/D applications in automotive, industrial, appliances and consumer
applications.
DEVICE SPECIFICATION:
High Performance RISC CPU:
• Only 35 single word instructions to learn
• All single cycle instructions except for program branches, which are two-cycle
• Interrupt capability
49
Fig 4.5(a) Pin Diagram of Microcontroller
50
BLOCK DIAGRAM OF MICROCONTROLLER:
51
PIN DESCRIPTION: Following table shows the pin description of microcontroller
52
4.6 ANALOG-TO-DIGITAL CONVERTER (A/D) MODULE
The analog-to-digital (A/D) converter module has five inputs for the PIC16F72. The A/D
allows conversion of an analog input signal to a corresponding 8-bit digital number. The
output of the sample and hold is the input into the converter, which generates the result via
successive approximation. The analog reference voltage is software selectable to either the
device’s positive supply voltage (VDD) or the voltage level on the RA3/AN3/VREF pin. The
A/D converter has a unique feature of being able to operate while the device is in SLEEP
mode. To operate in SLEEP, the A/D conversion clock must be derived from the A/D’s
internal RC oscillator.
The A/D module has three registers:
• A/D Result Register ADRES
• A/D Control Register 0 ADCON0
• A/D Control Register 1 ADCON1
A device RESET forces all registers to their RESET state. This forces the A/D module to be
turned off and any conversion is aborted. The ADCON0 register, shown in Register 10-1,
controls the operation of the A/D module. The ADCON1 register, shown in Register 10-2,
configures the functions of the port pins. The port pins can be configured as analog inputs
(RA3 can also be a voltage reference) or a digital I/O. The analog-to-digital (A/D) converter
module has five inputs for the PIC16F72. The A/D allows conversion of an analog input
signal to a corresponding 8-bit digital number. The output of the sample and hold is the input
into the converter, which generates the result via successive approximation. The analog
reference voltage is software selectable to either the device’s positive supply voltage (VDD)
or the voltage level on the RA3/AN3/VREF pin. The A/D converter has a unique feature of
being able to operate while the device is in SLEEP mode. To operate in SLEEP, the A/D
conversion clock must be derived from the A/D’s internal RC oscillator.
The port pins can be configured as analog inputs (RA3 can also be a voltage reference) or a
digital I/O. The analog-to-digital (A/D) converter module has five inputs for the PIC16F72
53
ANALOG TO DIGITAL CONVERSION REGISTER 0:
54
4.6.2 ANALOG TO DIGITAL REGISTER1:
55
A/D conversion:
1. Configure the A/D module:
• Configure analog pins/voltage reference and digital I/O (ADCON1)
• Select A/D input channel (ADCON0)
• Select A/D conversion clock (ADCON0)
• Turn on A/D module (ADCON0)
2. Configure A/D interrupt (if desired):
• Clear ADIF bit
• Set ADIE bit
• Set GIE bit
3. Wait the required acquisition time.
4. Start conversion:
• Set GO/DONE bit (ADCON0)
5. Wait for A/D conversion to complete, by either:
• Polling for the GO/DONE bit to be cleared OR
• Waiting for the A/D interrupt
6. Read A/D Result register (ADRES), clear bit ADIF if required.
7. For next conversion, go to step 1 or step 2 as required. The A/D conversion time per bit is
defined as TAD. A minimum wait of 2 TAD is required before the next acquisition starts.
4.6.3 INSTRUCTION SET SUMMARY:
Each PIC16F72 instruction is a 14-bit word divided into an OPCODE that specifies the
instruction type and one or more operands that further specify the operation of the instruction.
The PIC16F72 instruction set summary in Table below lists byte-oriented, bit-oriented, and
literal and control operations. Table below shows the opcode field descriptions. For byte-
oriented instructions, ‘f’ represents a file register designator and ‘d’ represents a destination
designator. The file register designator specifies which file register is to be used by the
instruction. The destination designator specifies where the result of the operation is to be
placed. If ‘d’ is zero, the result is placed in the W register. If ‘d’ is one, the result is placed in
the file register specified in the instruction. For bit-oriented instructions, ‘b’ represents a bit
field designator which selects the number of the bit affected by the operation, while ‘f’
represents the number of the file in which the bit is located. For literal and control operations,
‘k’ represents an eight or eleven-bit constant or literal value.
56
The instruction set is highly orthogonal and is grouped into three basic categories:
• Byte-oriented operations
• Bit-oriented operations
• Literal and control operations
All instructions are executed within one single instruction cycle, unless a conditional test is
true or the program counter is changed as a result of an instruction. In this case, the execution
takes two instruction cycles, with the second cycle executed as a NOP. One instruction cycle
consists of four oscillator periods. Thus, for an oscillator frequency of 4 MHz, the normal
instruction execution time is 1 s. If a conditional test is true, or the program counter is
changed as a result of an instruction, the instruction execution time is 2S.
57
CHAPTER 5
The designed PID with Adaptive Neuro-Fuzzy Inference System based GA has much faster
response than response of the classical method. The classical method is good forgiving us as
the starting point of what are the PID values. However Adaptive Neuro-Fuzzy Inference
System based GA designed PID is much better in terms of the rise time and the settling time
than the conventional method. Finally the Artificial Intelligence Techniques provides much
better results compared to the conventional methods. And also the error associated with the
Adaptive Neuro-Fuzzy Inference System based GA is much lesser than the error calculated
in the conventional scheme
In the project, we have designed a PID to be utilized in the speed control on induction motor.
The designing has been done with the help of Microcontroller. This controller takes in crisp
inputs, viz. speed error (e) and change in error (Δe) and gives an output called change in
control. The output changes according to the rules laid down by the user. These have been
verified with the help of FIS rule Viewer. Four different values of e and Δe were taken and
the results were obtained as shown.
It was found that the PID controller used in the project worked quite effectively. The PID
Controller was then tuned and the some simulations were run. It was found that now the
motor speed exactly follows the reference speed even after the speed changes. Hence, this
modified controller is superior to that of the prior controller(PI). 78
Each PIC16F72 instruction is a 14-bit word divided into an OPCODE that specifies the
instruction type and one or more operands that further specify the operation of the instruction.
The PIC16F72 instruction set summary in Table below lists byte-oriented, bit- oriented,
and literal and control operations. Table below shows the opcode field
58
descriptions. For byte-oriented instructions, ‘f’ represents a file register designator and ‘d’
represents a destination designator. The file register designator specifies which file register
is to be used by the instruction. The destination designator specifies where the result of the
operation is to be placed. If ‘d’ is zero, the result is placed in the W register. If ‘d’ is one, the
result is placed in the file register specified in the instruction. For bit-oriented instructions,
‘b’ represents a bit field designator which selects the number of the bit affected by the
operation, while ‘f’ represents the number of the file in which the bit is located. For literal
and control operations, ‘k’ represents an eight or eleven-bit constant or literal value. The
instruction set is highly orthogonal and is grouped into three basic categories:
• Byte-oriented operations
• Bit-oriented operations
• Literal and control operations
All instructions are executed within one single instruction cycle, unless a conditional test is
true or the program counter is changed as a result of an instruction. In this case, the execution
takes two instruction cycles, with the second cycle executed as a NOP. One instruction cycle
consists of four oscillator periods. Thus, for an oscillator frequency of 4 MHz, the normal
instruction execution time is 1 s. If a conditional test is true, or the program counter is
changed as a result of an instruction, the instruction execution time is 2S.
59
Chapter – 6
❖ The modified design of the PID Controller was found to have a decent performance. The
steady state error was found to be zero. Whenever the induction machine was loaded the
speed of the machine fell, but only to a very little extent. The rise time and the settling time
of the system were not affected much, but the peak overshoot of the system was found to
have reduced as compared to the earlier design. Hence, this controller can now be used in
other applications. But now the system has to be optimized so as to achieve an optimum
value for the rise time, settling time and peak overshoot.
❖ Instead of all conventional strategies, PID and PID controllers are very different in nature
and are efficient for speed controlling of three phase ac induction motor. But PID controller
is very much useful because it uses auto tuning. Once it is tuned it tracks the output according
to the provided input. But it suffers from more overshoot and settling time. As evident from
response curve the PID in simulated and real time implemented forms has greater over shoots
besides longer settling time. The also depicts the response of PID controller intended to drive
the three-phase induction motor. Fuzzy Controller has offered negligible settling time than
PID controller and with almost no overshoot. The work reveals that that speed controlling of
induction motor with PID controller is smooth and easy than PID controlling method. A new
that improve the performance of scalar Induction Motor speed drives has been proposed.
This speed controller gives maximum torque over the entire speed range The method uses
the new linguistic rule table in PID knowledge based controller to adjust the motor control
speed and this PID can achieve a good system performance of the Induction Motor scalar
drive, and it is possible to implement a PID instead the traditional PI controller.
60
CHAPTER 7
61
REFERENCES
[1] J.L. Silva Neto & Hoang Le “Fuzzy Logic Based Controller For Induction Motor” IEEE
1996 pp 631-634.
[2] R. Megartsi “Speed Control of an Induction Motor using Fuzzy Logic Approach” IEEE
1997 pp 1168-1172.
[3] Thmoas Brehm & Kuldip S Rattan “Hybrid Fuzzy PID controller” IEEE 1994 pp1682-
1687
.[4] Muhammad Arrofiq & Nordin Saad “Control of Induction Motor Drives Using
Modified-Fuzzy Logic Methods” IEEE 2010 pp 612-619.
Volume-1, Number-1 of Jan 2010, serial number 39, pp. 273-277, ISSN: 0973-7391.
62
BIBLIOGRAPHY
➢ Mehta V.K., “ Principles of Electronics “
S.Chand & Co. Ltd., New Delhi
WEB SITES
➢ www.microtutorials.com
➢ www.datasheets.com
➢ www.freenowave.co.in
➢ www.archives.com
➢ www.atmel.com
➢ www.seimens.com
63