-
1 | P a g e
DEPARTMENT OF ELECTRICAL ENGINEERING
FINAL YEAR PROJECT THESIS
REAL TIME DISTRIBUTION FACTOR
METER FOR NON LINEAR LOADS
BY
Moiz Ahmed Rana BSEE01093080R
Sultan Zahoor BSEE01093041
Muhammad Ashfaq BSEE01103161
Ghulam Mustafa BSEE01113156
Advisor: Hafiz Tehzeeb ul Hassan
This thesis is submitted to The University of Lahore, Pakistan,
for partial
fulfillment of the requirements for the degree of Bachelor of
Science in
Electrical Engineering.
-
2 | P a g e
DEDICATION Dedicated to our beloved parents and family who
provided us every opportunity to achieve our
goals and whose prayers resulted in the completion of this
project and to our teachers who tried
the level best to convey us the knowledge they had.
-
3 | P a g e
DECLARATION We declare that the work submitted in this report is
our own and any help taken from authenticated
sources is duly referenced.
Moiz Ahmed Rana BSEE01093080R
Sultan Zahoor BSEE01093041
Ghulam Mustafa Tabassam BSEE01113156
Mohammad Ashfaq BSEE01103161
June 2015
-
4 | P a g e
CERTIFICATE OF APPROVAL It is to certify that this project has
been done under my supervision by this group having title Real
time distribution factor meter for non linear loads the end
result is from the original work done
by the group members and, to the best of my knowledge, is not
aided by any unfair means. The
members tried their best to prepare this report.
Signature of project advisor: ____________________
Dated: ____________________
Signature of Head of Department: ____________________
Dated: ____________________
Institute: The University of Lahore
-
5 | P a g e
ACKNOWLEDGMENT We would first like to thank our parents for all
the support they have given us throughout our
University time and everything before.
We would like to thank our respected advisor Hafiz Tehzeeb ul
Hassan for his help and guidance
throughout the course of the project.
Special thanks to all our friends for helping us with conducting
tests. We would like to extend our
appreciation to our colleagues who share their knowledge and
experiences. Without them this
project would be a failure.
In addition we like to thanks those who support direct and
indirectly in any respect during the
completion of the project.
-
6 | P a g e
TABLE OF CONTENTS
Abstract.11
Chapter # 1 Introduction12
1.1 Problem statement..12
1.2 Objectives..12
Chapter # 2 Basic
concepts........................................................14
2.1 Linear loads..14
2.2 Non linear loads...15
2.2.1 Characteristics of non linear
loads........................................................15
2.2.2 Effects of non linear loads on power system16
2.2.3 Comparison between linear and non linear loads.17
2.3 Power factor.17
2.3.1
Causes.......................................................17
2.3.2 Disadvantages of low power factor...18
2.3.3 Power factor for linear loads.18
2.3.4 Power factor for non linear loads..19
2.3.5 Power factor correction for linear loads20
2.3.6 Power factor correction for non linear loads.20
2.4 Harmonics21
2.5 Distortion factor...21
2.6 Design recommendations for systems having harmonics22
2.7 Treatment for harmonic
problems.......................................................23
Chapter # 3 Design and working...24
3.1 Current and voltage
measurement.......................................................25
3.2 Power measurement.27
3.3 Power factor
measurement.......................................................28
3.4 Distortion factor measurement.29
Chapter # 4 Electrical components32
-
7 | P a g e
4.1 Current transformer32
4.2 Potential transformer..33
4.3 Zero crossing detector.34
4.4 B380 (Bridge rectifier).36
4.5 Power supply circuit36
4.6 LM7805 (Voltage regulator)37
4.7 LCD display.37
4.8 Load.38
Chapter # 5
Microcontroller.......................................................40
5.1 Overview..40
5.2 Working of microcontroller.41
5.2.1 Algorithm for current and voltage measurement..42
5.2.2 Algorithm for power measurement...43
5.2.3 Algorithm for power factor measurement.44
5.2.4 Algorithm for distortion factor measurement...46
5.2.5 LCD initialization.49
Chapter # 6 Conclusion..54
6.1 Results..54
6.2 Future Work.55
References..56
-
8 | P a g e
LIST OF FIGURES
2.1 Linear load waveform......15
2.2 Non linear load
waveform.......................................................16
2.3 Power triangle..19
2.4 Third harmonic effect..22
3.1 Main stages..24
3.2 Current and voltage
measurement.......................................................26
3.3 Power measurement.27
3.4 Power factor
measurement.......................................................28
3.5 Distortion factor measurement.29
3.6 Complete
layout.......................................................31
4.1 CT circuit.32
4.2 Potential transformer33
4.3 PT circuit..34
4.4 Zero crossing explanation35
4.5 Zero crossing detector..35
4.6 B380.36
4.7 Power supply circuit36
4.8 LM780537
4.9 LCD Display38
4.10 Load...39
5.1 PIC pin
configuration.......................................................40
5.2 Algorithm for current and voltage measurement.....42
5.3 Algorithm for power measurement..43
5.4 Algorithm for power factor measurement45
5.5 Algorithm for distortion factor measurement..47
5.6 LCD and microcontroller interface..53
6.1 Phase 1 Results54
-
9 | P a g e
6.2 Phase 2 Results54
6.3 Phase 3 Results54
6.4 Power factor and distortion factor...55
-
10 | P a g e
LIST OF TABLES
2.1 Comparison of linear and non linear loads..17
4.1 CT circuit simulation results33
4.2 PT circuit simulation results34
4.3 LCD pin configuration.37
5.1 PIC characteristics...41
-
11 | P a g e
ABSTRACT
Our project named Real time distribution factor meter for non
linear loads is a three phase meter
which measures the distribution factors for non linear loads. By
distribution factor, we mean all
the factors which are involved in power distribution. They are
current, operating voltage, power
being consumed, power factor and the harmonic distortion factor.
The meter focuses essentially
on the non linear loads. The purpose for focusing on non linear
loads is because the majority of
the loads installed in industries and homes is non linear. Non
linear loads are those loads which do
not follow Ohms Law. They include mostly inductive and
capacitive loads. These kinds of loads
have power factor issues and they generate serious amount of
harmonics and noise. There is a need
to check and monitor these issues. This is the main objective
and motivation behind this project.
We have approached the problem by first measuring the current
and voltage of the load by means
of current and potential transformers. These quantities are fed
to the microcontroller which
calculates the distribution factors. The microcontroller which
we selected is PIC18F452. The
reason was its reasonable price and the features like ADC, USART
and other functions.
-
12 | P a g e
CHAPTER # 1
INTRODUCTION
1.1 PROBLEM STATEMENT Large industries and electrical utilities
are very concerned about the presence of non linear loads
in their electrical power systems.
Power systems that are conceived to operate at the fundamental
frequency are prone to abnormal
behavior as more and more nonlinear loads are connected to the
network. Harmonics increase the
resistances of the conductors due to skin effect and cause an
abnormal neutral-ground voltage
difference. The more nonlinear loads connected, the higher the
overall sum of harmonics, though
the total sum is less than the sum of the individual magnitudes.
Harmonics can damage components
like fuses and circuit breakers, and can cause utility meters to
record wrong measurements.
There is great concern about the distribution transformers that
supply the nonlinear loads, since
they suffer from:
1. Overheating of windings, insulation, and oil
2. Additional eddy current heating in metallic parts
3. Higher stress in tap changers, bushings, and cable end
connections
This project is a three phase meter which displays the following
parameters:
1. Current
2. Operating voltage
3. Power being consumed
4. Power factor
5. Distortion factor
1.2 OBJECTIVES
To determine the distribution factor of non linear load.
Non linear load distribution includes changing current magnitude
required by the non linear
load
Distribution factor measurement also includes the changing
voltage needs of non linear
load.
It also includes the measurement of determination of the
distortion occurred due to non
linearity in the actual sine wave provided to the load by the
system.
Determining the power factor of the non linear load that is
provided.
Determining the overall changing behavior and needs of the non
linear load .
Determining all the factors in one place that affect the
consumption needs of the non linear
loads.
-
13 | P a g e
Determining all these factors and putting them in perspective
according to the project
requirement
At last combining these factors together to apply a solution of
the damage caused by the
non linearity.
To determine certain techniques so that the non linearity does
not affect the overall system
-
14 | P a g e
CHAPTER # 2
BASIC CONCEPTS
Generally the loads installed in homes and in the industries are
of two types. Linear and non-linear.
In this section, we shall describe the difference between linear
and non-linear loads. Their
characteristics, behavior, effect on the power system and their
examples will be discussed.
2.1 LINEAR LOADS
In linear loads, the output response is directly proportional to
that of input. In the case of AC, it
means that the application of a sinusoidal voltage results in a
sinusoidal current. As the
instantaneous voltage changes over the period of sine wave, the
instantaneous current which rises
and falls in proportion to the voltage so that the waveform of
the current is also a sine wave. The
current at any time is proportional to voltage and these loads
does not change the shape of the
waveform of the current, but may change the relative timing
(phase) between voltage and current.
The impedance of linear loads remains fixed with changing the
applied voltage. The fixed
impedance means that the current drawn by the linear load will
be sinusoidal as like the voltage
and the current at any time will be proportional to voltage.
Linear loads dont produce any new
frequency (harmonics) or change the applied frequency.
Linear loads are made of linear components. Generally resistive
loads are referred to as linear
loads. Power factor improvement capacitors, indecent lamps and
heaters are the common devices
which are classified as linear loads.
If you increase the voltage from 10V to 20V, current should
double. Resistors will do that.
Linear loads generally do not cause any sort of distortion in
the power system.
When sinusoidal voltage is applied on a linear load, the result
is also sinusoidal which has been
explained earlier. It is shown in the figure below.
-
15 | P a g e
Figure 2.1 (Linear load waveform)
2.2 NON LINEAR LOADS
Non linear Electrical Load is a load where the wave shape of the
steady state current does not
follow the wave shape of the applied voltage.
2.2.1 Characteristics of non linear loads 1. Non linear loads
change the shape of the current waveform from a sine wave to some
other
form.
2. Non linear loads create harmonic currents in addition to the
original (fundamental
frequency) AC current causing distortion of the current waveform
leading to distortion of
the voltage waveform. Under these conditions, the voltage
waveform is no longer
proportional to that of current.
3. Impedance of non linear load changes with the applied
voltage. The changing impedance
means that the current drawn by the non linear load will not be
sinusoidal even when it is
connected to a sinusoidal voltage. These non-sinusoidal currents
contain harmonic currents
that interact with the impedance of the power distribution
system to create voltage
distortion that can affect both the distribution system
equipment and the loads which are
connected to it.
-
16 | P a g e
2.2.2 Effects of non linear loads on power system The non linear
loads will generate harmonics in the electrical distribution
network and these
harmonics will create:
1. Large load currents in the neutral wires of a 3 phase system.
Theoretically the neutral
current can be up to the sum of all 3 phases therefore causing
overheating of the neutral
wire. Since only the phase wires are protected by circuit
breakers or fuses, this can result
in a potential fire hazard.
2. Overheating of standard electrical supply transformers which
shortens the life of a
transformer and will eventually destroy it. When a transformer
fails, the cost of lost
productivity during the emergency repair is much more than the
replacement cost of the
transformer itself.
3. Poor power factor conditions that result in monthly utility
penalty fees for major users
(factories, manufacturing, and industrial) with a power factor
0.9 and less.
4. Resonance that produces over current surges. In comparison,
this is equivalent to
continuous audio feedback through a PA system. This results in
destroyed capacitors and
their fuses and damaged surge suppressors which will cause an
electrical system shutdown.
5. False tripping of branch circuit breakers.
6. High frequency harmonics can be induced into phone lines and
data cabling. The end result
is noisy phone lines and unexplained data lose or data
corruption in your LAN or WAN.
7. Heat generation in special facilities such as call centers or
data centers due to the large
concentration of monitors and PCs so the air computer room
(CRAC) or building air
conditioning system will run longer or harder, therefore
requiring more energy to maintain
the desired temperature.
Current pulses are produced instead of a continuous current wave
due to harmonics. They are
shown in the figure below.
Figure 2.2 (Non linear load waveform)
-
17 | P a g e
Examples for non linear loads include electronic equipment,
electronic/electric-discharge lighting,
adjustable-speed drive systems, and similar equipment.
At this point, a comparison between linear and non linear loads
is necessary. Given below is a
table for comparison between linear and non linear loads.
2.2.3 Comparison between linear and non linear loads Linear
Loads Non Linear Loads
Ohms Law Ohms law is applicable Ohms law is not applicable
Crest Factor Crest Factor= 1Peak/1 RMS
= 2=1.41
Crest Factor could be 3 to 4
Power Factor Power factor = Watts/ (V X
I) = Cos
Power factor = Watts/ (V X I)
Cos = Displacement
factor X Distortion factor
Harmonics Load current does not contain
harmonics.
Load current contains all
ODD harmonics.
Load Category Could be inductive or
capacitive.
Cant be categorized. As
leading or lagging Loads.
Load Type Resistive, Inductive or
capacitive
Usually an equipment with
Diode and Capacitor.
Neutral Current Zero neutral current if 1 Ph.
Loads are equally balanced
on 3Ph. Mains (Vector sum
of line current)
Neutral current could be 2.7
times the line current even if
1Ph. Loads are equally
balanced on 3 Ph. Mains
Inrush Current May not demand high inrush
currents while starting.
Essentially very high inrush
current (20 time of I Normal)
is drawn while starting for
17pprox.. One cycle.
Table 2.1 (Comparison of linear and non linear loads)
2.3 POWER FACTOR Power factor is the ratio of the real power to
the apparent power of a load. It is a dimensionless
unit. It lies in the range of -1 to 1. Real power is the
capacity of the circuit for performing work in
a particular time. Its unit is watts. Apparent power is the
product of the current and voltage of the
circuit. Its unit is volt amperes.
2.3.1 Causes The cause of positive power factor is that if
energy stored in the load is returned to the source, or
due to a non linear load that distorts the wave shape of the
current drawn from the source, the
apparent power will be greater than the real power. Whereas, a
negative power factor occurs when
the device (which is normally the load) generates power, which
then flows back towards the source
(which is normally considered the generator).
-
18 | P a g e
2.3.2 Disadvantages of low power factor The disadvantages of a
low power factor are listed below.
1. The electrical machinery e.g. transformers, alternators,
switchgears are generally rated in
kVAs. So as the power factor decreases, the rating of machinery
will have to be increased
which will make the equipment more expensive.
2. Lower power factor results in a larger conductor size due to
larger current.
3. Larger current results in greater 2 losses in all components
of the power system. This results in poor efficiency.
4. Low power factor results in poor voltage regulation. This
results in unavailability of
voltage at the supply end. Voltage regulators are used in order
to keep voltage within
permissible range.
5. Lagging power factor decreases the overall handling capacity
of the system.
2.3.3 Power factor for linear loads In a purely resistive AC
circuit, voltage and current waveforms are in phase, changing
polarity at
the same instant in each cycle. All the power entering the load
is consumed. In loads where reactive
loads are present, such as with capacitors or inductors, energy
storage in the loads results in a phase
difference between the current and voltage waveforms. During
each cycle of the AC voltage, extra
energy, in addition to any energy consumed in the load, is
temporarily stored in the load in electric
or magnetic fields, and then returned to the power grid in a
fraction of the period later. This
nonproductive power increases the current in the line. Thus, a
circuit with a low power factor will
use higher currents to transfer a given quantity of real power
than a circuit with a high power
factor. A linear load does not change the shape of the waveform
of the current, but may change
the relative phase between voltage and current.
Circuits containing purely resistive elements have a power
factor of 1. Circuits containing
inductive or capacitive elements often have a power factor below
1.
AC power has three components:
1. Real power (P)
2. Reactive power (Q)
3. Apparent power (S)
So the power factor is given by:
cos =
Where, is the phase angle between voltage and current. Now
consider the following power triangle.
-
19 | P a g e
Figure 2.3 (Power triangle)
From the above figure, it can be observed that:
2 = 2 + 2
2.3.4 Power factor for non linear loads As described earlier,
non linear loads generate harmonics. So, the power factor of non
linear loads
cannot be calculated in the traditional way like that of linear
loads.
The power factor of non linear loads is calculated by taking in
account the harmonics generated
by the load. This is done by calculating the distortion power
factor.
Distortion power factor is a measure of how much the harmonic
distortion of a load current can
decrease the average power transferred to the load. It is given
by:
Distortion power factor = 1
1+2 =
1,
Here THD is the total harmonic distortion. 1, is the fundamental
component of the current and
is the total current. Both are root mean square-values.
Distortion power factor can also be used to describe individual
order harmonics, using the corresponding current in place of
total
current. This definition with respect to THD assumes that the
voltage stays undistorted (sinusoidal,
without harmonics). This simplification is often a good
approximation for stiff voltage sources.
THD of typical generators from current distortion in the network
is on the order of 12%, which
can have larger scale implications but can be ignored in common
practice.
-
20 | P a g e
2.3.5 Power factor correction for linear loads Power factor can
be improved by the following methods:
1. Static capacitors can be used to improve the power factor.
They are connected in parallel
of the equipment or load whose power factor is to be
improved.
2. Synchronous condensers are a good way to improve the power
factor. They are basically
synchronous motors running in over excited condition thus acting
as capacitors. When it is
connected with the load, it takes the leading current thus
improving the power factor.
2.3.6 Power factor correction for non linear loads
Passive PFC
The easiest way to control the harmonic current is to use a
filter that passes current only at line
frequency (50 or 60 Hz). The filter consists of capacitors or
inductors, and makes a non linear
device act like a linear load.
A disadvantage of passive PFC is that it requires larger value
of inductors or capacitors than an
equivalent power active PFC circuit. Also, in practice, passive
PFC is often less effective at
improving the power factor.
Active PFC
Active PFC is the use of power electronics to change the
waveform of current drawn by a load to
improve the power factor. Some types of the active PFC are
boost, buck, buck-boost and
synchronous condenser. Active PFC can be single-stage or
multi-stage.
In the case of a switched-mode power supply, a boost converter
is inserted between the bridge
rectifier and the main input capacitors. The boost converter
tries to maintain a constant DC bus
voltage on its output while drawing a current that is always in
phase with and at the same frequency
as the line voltage. Another switched-mode converter inside the
power supply produces the desired
output voltage from the DC bus. This approach requires further
semiconductor switches and
control electronics, but allows cheaper and smaller passive
components. It is frequently used in
practice.
Dynamic PFC
Dynamic power factor correction is also known as real-time power
factor correction, is used for
electrical stabilization in cases of rapid load changes (e.g. at
large manufacturing sites). DPFC is
useful when standard power factor correction would cause over or
under correction. DPFC uses
semiconductor switches, mostly thyristors, to quickly connect
and disconnect capacitors or
inductors from the network in order to improve power factor.
-
21 | P a g e
2.4 HARMONICS
As stated previously, non linear loads generate harmonics which
can lower the power quality. A
harmonic is a sinusoidal component of a periodic wave or a
quantity having a frequency that is an
integer multiple of the fundamental frequency, i.e. if the
fundamental frequency is f, the harmonics
have frequencies 2f, 3f, 4f . . . etc. The harmonics have the
property that they are all periodic at
the fundamental frequency, therefore the sum of harmonics is
also periodic at that frequency. As
multiples of the fundamental frequency, successive harmonics can
be found by repeatedly adding
the fundamental frequency. For example, if the fundamental
frequency (first harmonic) is 25 Hz,
the frequencies of the next harmonics will be 50 Hz (2nd
harmonic), 75 Hz (3rd harmonic), 100 Hz
(4th harmonic) and so on.
Harmonic voltages and currents in an electric power system are a
result of non-linear electric loads.
Harmonic frequencies in the power grid are a major cause of
power quality problems. Harmonics
in power systems result in increased heating in the equipment
and conductors, misfiring in variable
speed drives, and torque disturbance in motors. Reduction of
harmonics is considered important.
2.5 DISTORTION FACTOR Distortion factor of a signal is a
measurement of the harmonic distortion present and is defined
as
the ratio of the sum of the powers of all harmonic components to
the power of the fundamental
frequency expressed as a percent of the fundamental. In power
systems, lower distortion factor
means reduction in peak currents, heating, emissions, and core
loss in motors.
Distortion factor is also known as total harmonic distortion or
harmonic factor. It is given by:
THD = 2
2+32+4
2++2
1 x 100
Where is the RMS voltage of nth harmonic and n = 1 is the
fundamental frequency.
Nonlinear loads, such as inverters, solid-state rectifiers used
in welders, DC power supplies,
variable-frequency drives, and electronic ballasts for lighting
are sources of harmonics in the
electrical system feeding these loads. There are specific
harmonics associated with each item of
equipment, and equipment manufacturers can usually provide
information on the magnitude and
order of harmonics generated by their equipment.
To fully understand what a third harmonic can do to a normal
sine wave, consider the following
figure in which a third harmonic adds with a sine wave.
-
22 | P a g e
Figure 2.4 (Third harmonic effect)
2.6 DESIGN RECOMMENDATIONS FOR DISTRIBUTION
SYSTEMS HAVING HARMONICS 1. Use double-size neutral wires or
separate neutrals for each phase.
2. Specify a separate full-size insulated ground wire rather
than relying on the conduit alone
as a return ground path.
3. On a branch circuit use an isolated ground wire for sensitive
electronic and computer
equipment.
4. Isolate sensitive electronic and computer loads on separate
branch circuits all the way back
to the electrical panel.
5. Run a separate branch circuit for every 10 Amperes of
load.
6. Install a comprehensive exterior copper ground ring and
multiple deep driven ground rods
as part of the grounding system to achieve 5 ohms or less
resistance to earth ground.
7. Oversize phase wires to minimize voltage drop on branch
circuits.
-
23 | P a g e
8. Shorten the distance on branch circuits from the power panel
to minimize voltage drop.
9. Oversize all local power sources (generators, UPS) to
overcome harmonics effects on them.
2.7 TREATMENT FOR HARMONIC PROBLEMS Harmonic treatment can be
performed by two methods:
Filtering.
Cancellation.
1- Filtering
A harmonic filter consists of a capacitor bank and an induction
coil. The filter is designed or
tuned to the predetermined non-linear load and to filter a
predetermined harmonic frequency
range. Usually this frequency range only accounts for one
harmonic frequency. This
application is mostly used when specified for a UPS or variable
frequency drive motor in a
manufacturing plant.
2- Cancellation
Harmonic cancellation is performed with harmonic canceling
transformers also known as
phase shifting transformers. A harmonic canceling transformer is
a relatively new power
quality product for solving harmonic problems in electrical
distribution systems. This type of
transformer has built-in electromagnetics technology designed to
remove high neutral current
and the most harmful harmonics from the 3rd through 21st. The
technique used in these
transformers is known as low zero phase sequencing and phase
shifting. These transformers
can be used to treat existing harmonics in buildings or
facilities. This same application can be
designed into new devices to prevent future harmonics
problems.
-
24 | P a g e
CHAPTER # 3
DESIGN AND WORKING This project is a three phase meter whose
purpose is to display the distribution factors which are
power, current, voltage, power factor and the distortion
factor.
The following figure will explain the stages of the project.
Figure 3.1 (Main stages)
1. Load is connected to the current and potential
transformers.
2. The value of voltage is stepped down in the PT.
3. The CT reduces the value of current to a suitable value which
can be measured.
-
25 | P a g e
4. The CTs and PTs are then connected to their circuits.
5. The role of these circuits is to rectify the AC coming from
the load.
6. These circuits contain a bridge rectifier and capacitors.
7. The bridge rectifier converts AC into DC.
8. The ripples are then removed by the capacitors.
9. The outputs from the bridge rectifier are also connected to
zero crossing detectors.
10. The zero crossing detectors detect the instant at which the
current or voltage wave passes
the zero mark.
11. The outputs of CT circuit, PT circuit and zero crossing
detectors are connected to the
microcontroller.
12. The microcontroller chosen for this project is
PIC18F452.
13. The microcontroller processes the results and sends it to
the LCD display.
14. Final results are shown on the LCD display.
The flowcharts and the descriptions for how the results are
processed individually are given next.
3.1 CURRENT & VOLTAGE MEASUREMENT
1. As described earlier, the load is connected to CTs and
PTs.
2. These CTs and PTs are connected to their respective
circuits.
3. The rectified and filtered waveforms of the currents and the
voltages are provided by the
circuits to the microcontroller.
4. The microcontroller stores them in the ADC.
5. ADC stands for analogue to digital conversion.
6. As the name implies, the ADC converts the analogue values
coming from the circuits into
digital and stores them.
7. These values are then sent to the LCD display.
-
26 | P a g e
Figure 3.2
-
27 | P a g e
3.2 POWER MEASUREMENT
Figure 3.3
1. The procedure to display the power being consumed by the load
is almost as similar to
that of voltage and current display.
2. For the display of voltage and current the microcontroller
sends their values directly to
the LCD display.
-
28 | P a g e
3. In the case of power, the microcontroller multiplies the
values of current and voltage. As,
Power = Voltage x Current
4. This value of power is then sent to LCD display.
3.3 POWER FACTOR MEASUREMENT
Figure 3.4
-
29 | P a g e
1. For the measurement of power factor, output is taken from CT
and PT.
2. This output is rectified and then fed to the zero crossing
detectors.
3. Zero crossing detectors detect the point at which the current
and voltage waves cross the
zero line mark.
4. This output is given to the microcontroller.
5. The microcontroller compares the difference between the zero
crossing value of current
and the voltage.
6. The phase difference between the zero crossings of current
and voltage is the power factor.
3.4 DISTORTION FACTOR MEASUREMENT
Figure 3.5
Load
PT circuit
Comparison with standard sine function
Calculate amplitude difference
Display result in percentage
-
30 | P a g e
For measuring the distortion factor, multiple techniques can be
applied. One such technique is
to compare the distorted wave with an ideal sine wave.
1. As we know that the fundamental frequency of the system is 50
Hz.
2. Harmonics are the multiples of the fundamental frequency
which makes the second and
third harmonics as 100Hz and 150Hz respectively.
3. For the calculation of distortion factor, the AC voltage is
compared with a standard sine
function.
4. The amplitude of the distorted wave is calculated and it is
compared with that of standard
wave.
5. The amplitude difference is calculated.
6. Result is shown in percentage form.
The next figure represents the complete layout of the project.
It shows all the transformers and
circuits. It also shows their connections to the
microcontroller.
Each phase of the load is connected to the current and the
potential transformers. The following
are the inputs being provided to the microcontroller.
3 inputs from CT circuits
3 inputs from PT circuits
3 inputs from CT zero crossing detectors
3 inputs from PT zero crossing detectors
In addition to this, power supply for the microcontroller has
been connected.
The microcontroller is providing output to the LCD display which
will display the results.
-
31 | P a g e
Figure 3.6 (Complete layout)
-
32 | P a g e
CHAPTER # 4
ELECTRICAL COMPONENTS
4.1 CURRENT TRANSFORMER A current transformer is a device which
is used to measure AC current. It reduces the value of AC
current to such a value which is safe for the other components
which are connected to it.
A current transformer has primary and secondary windings along
with a magnetic core. The current
to be measured flows in the primary winding which produces
alternating magnetic field in the
magnetic core. As a result, an alternating current is induced in
the secondary winding. This
secondary current is linearly proportional to the primary
current.
Figure 4.1 (CT circuit)
In our CT circuit, a bridge rectifier is installed to convert AC
into DC. This is done to provide the
output to the microcontroller. The output from the bridge
rectifier contains many ripples. To
overcome this problem, capacitors have been introduced after the
bridge rectifier. They help in
reducing the ripples.
The current transformer is connected in series with the
load.
-
33 | P a g e
Parameter Result (Volts)
Input Voltage 212
Voltage after passing through load 32.1m
Voltage after passing through transformer 3.07
Output Voltage 0.97
Table 4.1 (CT circuit simulation results)
4.2 POTENTIAL TRANSFORMER Potential transformers are also called
voltage transformers. In our project, it is being used for
voltage measurement. A potential transformer steps down the AC
voltage to a safe level so it can
be measured.
Just like a CT, a potential transformer or simply PT has primary
and secondary windings wound
on a metallic core. Primary of this transformer is connected
across the phase and ground.PT has
lower turns winding at its secondary. The system voltage is
applied across the terminals of primary
winding of that transformer, and then proportionate secondary
voltage appears across the
secondary terminals of the PT.
In an ideal PT, when rated burden gets connected across the
secondary, the ratio of primary and
secondary voltages of transformer is equal to the turns ratio
and furthermore, the two terminal
voltages are in phase opposite to each other. But in actual
transformer, there must be an error in
the voltage ratio as well as in the phase angle between primary
and secondary voltages.
In our PT circuit, a bridge rectifier is installed to convert AC
into DC. This is done to provide the
output to the microcontroller. The output from the bridge
rectifier contains many ripples. To
overcome this problem, capacitors have been introduced after the
bridge rectifier. They help in
reducing the ripples.
The potential transformer is connected in parallel with the
load. The transformer which we have
used as the rating of 240/12 volts.
Figure 4.2 (Potential transformer)
-
34 | P a g e
Figure 4.3 (PT circuit)
Parameter Result (Volts)
Input voltage 212
Voltage after stepping down 11.6
Output Voltage 2.30
Table 4.2 (PT circuit simulation results)
4.3 ZERO CROSSING DETECTOR It is a circuit which is used to
detect the time at which the wave crosses the zero mark. It is
installed
on all the boards of CTs and PTs.
In our project, zero crossing detector is being used to find the
power factor. The zero crossing
detectors installed with the CTs and PTs detect the point at
which their waves cross the zero mark.
This data is provided to the microcontroller which calculates
the difference between the zero
crossing values of current and voltage waves. As power factor is
the phase difference between
current and voltage waves, it is displayed on the LCD display.
This is shown in the figure shown
before.
Note that the bridge rectifier used in the zero crossing
detector and the CT or PT circuit on which
it will be installed will be common. Unlike shown in the figure,
the rectifier will not be provided
220 volts. It is shown here for demonstration only.
-
35 | P a g e
Figure 4.4 (Zero crossing explanation)
Figure 4.5 (Zero crossing detector)
-
36 | P a g e
4.4 B380 (BRIDGE RECTIFIER) This is the rectifier which we have
used. In the given circuits diodes have been shown to represent
the rectifier.
Figure 4.6 (B380)
4.5 POWER SUPPLY CIRCUIT The power supply circuit is the circuit
which is used to provide power to the microcontroller. It
contains a step down transformer which steps down the AC
voltage. The output of the transformer
is connected to a bridge rectifier which converts AC into DC.
The output from the rectifier is then
passed through capacitors to filter the ripples. A voltage
regulator is installed which further lowers
the voltage and is followed by capacitors.
Figure 4.7 (Power supply circuit)
-
37 | P a g e
4.6 LM7805 (VOLTAGE RGULATOR) This voltage regulator has been
used in the power supply circuit. It can provide an output
voltage
up to 24V.
Figure 4.8 (LM7805)
4.7 LCD DISPLAY LCD (Liquid Crystal Display) screen is an
electronic display module and is used in a wide range
of applications. In this project, we have used 16x2 LDC display.
A 16x2 LCD display is a very
basic module and is very commonly used in various devices and
circuits. LCDs are economical,
easily programmable, have no limitation of displaying special
& can even have custom characters,
animations and so on.
A 16x2 LCD means it can display 16 characters per line and there
are 2 such lines. In this LCD
each character is displayed in 5x7 pixel matrix. This LCD has
two registers, namely, Command
and Data.
The command register stores the command instructions given to
the LCD. A command is an
instruction given to LCD to do a predefined task like
initializing it, clearing its screen, setting the
cursor position, controlling display etc. The data register
stores the data to be displayed on the
LCD. The data is the ASCII value of the character to be
displayed on the LCD.
Pin # Name Function
1 Ground Ground (0V)
2 Supply voltage; 5V (4.7V 5.3V) 3 Contrast adjustment; through
a variable resistor 4 Register select Selects command register when
low; and data register
when high
5 Read/Write Low to write to the register; High to read from
the
register
6 Enable Sends data to data pins when a high to low pulse is
given
7 DB0 8 bit data pin
8 DB1 8 bit data pin
9 DB2 8 bit data pin
10 DB3 8 bit data pin
11 DB4 8 bit data pin
12 DB5 8 bit data pin
13 DB6 8 bit data pin
14 DB7 8 bit data pin
-
38 | P a g e
15 LED +
16 LED -
Table 4.3 (LCD pin configuration)
Figure 4.9 (LCD Display)
4.8 LOAD
1. Three phase load has been made for this project.
2. The load consist of three inductive chokes.
3. Each choke has a rating of 40 watts.
4. In addition to the chokes, a bulb socket has also been
installed in series with each of the
choke.
5. Resistive or inductive load can be connected in the load in
these sockets.
6. The purpose is to show the change in the distortion level and
power factor upon adding a
certain type of load i.e. inductive, resistive or
capacitive.
-
39 | P a g e
Figure 4.10 (Load)
-
40 | P a g e
CHAPTER # 5
MICROCONTROLLER
5.1 OVERVIEW
The PIC18F452 belongs to the PIC family of the microcontrollers.
This
microcontroller has 40 pins. Its pin configuration is given
below.
Figure 5.1 (PIC pin configuration)
The main characteristics of PIC18F452 are given below.
-
41 | P a g e
Parameter Value
Program Memory Type Flash
Program Memory (KB) 32
CPU Speed (MIPS) 10
RAM Bytes 1536
Data EEPROM (bytes) 256
Digital Communication Peripherals 1-UART, 1-A/E/USART, 1-SPI,
1-I2C1-
MSSP(SPI/I2C)
Capture/Compare/PWM Peripherals 2 CCP
Timers 1 x 8-bit, 3 x 16-bit
ADC 8 ch, 10-bit
Temperature Range (C) -40 to 125
Operating Voltage Range (V) 2 to 5.5
Pin Count 40
Table 5.1 (PIC characteristics)
5.2 WORKING OF THE MICROCONTROLLER
The microcontroller plays the most vital role in this project.
Its job is to get the data from the
analogue input devices which are current and potential
transformers along with the zero crossing
detectors.
An important part of the microcontroller is the analogue to
digital converter or ADC. The function
of the ADC is to convert the analogue data coming from the
circuits into digital form. There are
ICs available in the market which can perform this task but they
will make the circuit more
complex. To avoid their usage, we will use the built in ADC
feature of PIC.
The ADC of PIC microcontroller has the following
specifications:
1. 10 bit resolution output meaning that an analogue input gets
converted into a corresponding
10 bit digital output.
2. 13 channels which means that a total of 13 analogue signals
can be converted
simultaneously into digital.
3. Vref+ (RA3) and Vref- (RA2) pins for external reference
voltage.
4. 8 selectable clock options.
5. ADC can be in auto triggering mode for continuous A/D
conversion.
The following code initializes the ADC with variables and
configures the pins.
#define zc_a1 portc.f0
#define zc_a2 portc.f1
#define zc_a3 portc.f2
#define zc_v1 portc.f3
#define zc_v2 portd.f0
#define zc_v3 portd.f1
-
42 | P a g e
long volt,amp,watt,pf=0,cont=0,far;
long
volt1=0,volt2=0,volt3=0,amp1=0,amp2=0,amp3=0,watt1=0,watt2=0,wat
t3=0,pf1=0,pf2=0,pf3=0,dis=0;
ADCON1 = 0x80;
TRISA = 0xFF;
TRISb = 0x00;
portb = 0x00;
TRISC = 0X0f;
TRISd = 0X00;
portd = 0x00;
portc = 0x00;
5.2.1 Algorithm for measurement of voltage and current
Figure 5.2 (Voltage & current measurement algo.)
-
43 | P a g e
1. Get the input from potential and current transformers.
2. Set a resolution by: +
1024 1
3. Multiply this value by the input obtained from PT
circuit.
4. The same resolution can be applied to calculate the
current.
5. For calculating the current, multiply the resolution with the
input from the CT circuit.
6. Send the obtained values to the LCD for display.
5.2.2 Algorithm for power measurement
1. The algorithm for power calculation uses the values of
current and voltage calculated in
the previous algorithm.
2. The code for power calculation multiplies the values of
current and voltage.
3. This result is then sent to the LCD interface.
Figure 5.3 (Power measurement algo.)
The following code is used for the measurement of current,
voltage and power:
while (1) {
-
44 | P a g e
//**********************
amp1 = adc_read(0);
amp1 = ( amp1 * 500 ) / 1023;;
//**********************
amp2 = adc_read(1);
amp2 = ( amp2 * 500 ) / 1023;;
//**********************
amp3 = adc_read(2);
amp3 = ( amp3 * 500 ) / 1023;;
//**********************
volt1 = adc_read(3);
volt1 = ( volt1 * 500 ) / 1023;;
//**********************
volt2 = adc_read(4);
volt2 = ( volt2 * 500 ) / 1023;;
//**********************
volt3 = adc_read(5);
volt3 = ( volt3 * 500 ) / 1023;;
//**********************
watt1 = ( volt1 * amp1 ) / 100;
watt2 = ( volt2 * amp2 ) / 100;
watt3 = ( volt3 * amp3 ) / 100;
//****************************************
5.2.3 Algorithm for power factor measurement
1. For the measurement of power factor, the output from the zero
crossing detector comes
into act.
2. When the voltage or current wave crosses the zero mark, the
circuit generates a signal.
3. This signal is provided to the ADC.
4. If the wave crosses the zero mark, the ADC will give an
output of 1, otherwise zero.
5. The phase difference for the zero crossing values is
calculated.
-
45 | P a g e
6. This difference is the power factor.
Figure 5.4 (Power factor measurement algo.)
The code for power factor is given as:
while(!zc_v1);
while(!zc_a1){pf1++;}
pf1=9500-pf1;
pf1=pf1/100;
while(!zc_v1);
while(!zc_a1){pf1++;}
pf1=9500-pf1;
-
46 | P a g e
pf1=pf1/100;
//****************************************
while(!zc_v2);
while(!zc_a2){pf2++;}
pf2=9500-pf2;
pf2=pf2/100;
while(!zc_v2);
while(!zc_a2){pf2++;}
pf2=9500-pf2;
pf2=pf2/100;
//****************************************
while(!zc_v3);
while(!zc_a3){pf3++;}
pf3=9500-pf3;
pf3=pf3/100;
while(!zc_v3);
while(!zc_a3){pf3++;}
pf3=9500-pf3;
pf3=pf3/100;
5.2.4 Algorithm for measurement of distortion factor
1. For the calculation of the distortion factor, the output from
the PT circuit is needed.
2. The AC voltage cannot be directly used as the microcontroller
is only capable for 5V.
3. This input is compared with a standard sine function which is
provided to the
microcontroller in numerical form.
4. The amplitude difference is calculated between the sine and
obtained values is calculated.
5. The result is calculated in percentage.
-
47 | P a g e
Figure 5.5 (Distortion factor measurement algo.)
Following is the standard sine wave function.
unsigned const SINE_WAVE[200] = {
8,8,8,9,9,9,10,11,12,13,14,15,16,18,19,21,23,
25,27,29,31,33,36,38,41,43,46,49,52,54,57,61,64,67,70,74,77,
80,84,87,91,95,98,102,106,109,113,117,120,124,128,132,136,
139,143,147,150,154,158,161,165,169,172,176,179,
182,186,189,192,195,199,202,204,207,210,213,215,218,220,223,
225,227,229,231,233,235,237,238,240,241,242,243,244,245,246,
247,247,247,248,248,248,248,248,247,247,247,246,245,244,243,
-
48 | P a g e
242,241,240,238,237,235,233,231,229,227,225,223,220,218,215,
213,210,207,204,202,199,195,192,189,186,182,179,176,172,169,
165,161,158,154,150,147,143,139,136,132,128,124,120,117,113,
109,106,102,98,95,91,87,84,80,77,74,70,67,64,61,57,54,52,49,
46,43,41,38,36,33,31,29,27,25,23,21,19,18,16,15,14,13,12,11,
10,9,9,9,8,8};
The code for distortion factor measurement is given as:
//****************phase1************************
while(!zc_v1);
for(far=0;far
-
49 | P a g e
//**********************
volt3 = adc_read(5);
volt3 = ( volt3 * 500 ) / 1023;;
if(SINE_WAVE[far] == volt3){
dis++;
}}
//************************
dis = dis / 600;
dis = pf1+pf2+pf3;
dis = (dis / 3)-((watt1+watt2+watt3)/150);
5.2.5 LCD initialization
The readings of all the factors will be displayed in LCD
display. For this purpose, LCD has to be
initialized. The input ports for the LCD are initialized in this
process.
The following code is used for this purpose.
//*******************************
Lcd_Init(&PORTB);
LCD_Cmd(LCD_CURSOR_OFF);
LCD_Cmd(LCD_CLEAR);
LCD_Out(1,1,"Init.....");
delay_ms(2000);
LCD_Cmd(LCD_CLEAR);
The code to display the data is given as:
//***************************data
displ***************************************
LCD_Cmd(LCD_CLEAR);
//********************
Lcd_Out(1,1,"V1=");
lcd_chr_cp(48+((volt1 / 100)%10));
lcd_chr_cp(48+((volt1 / 10)%10));
-
50 | P a g e
lcd_chr_cp(48+((volt1 / 1)%10));
//********************
Lcd_Out(1,9,"A1=");
lcd_chr_cp(48+((amp1 / 100)%10));
lcd_chr_cp('.');
lcd_chr_cp(48+((amp1 / 10)%10));
lcd_chr_cp(48+((amp1 / 1)%10));
//********************
Lcd_Out(2,1,"W1=");
lcd_chr_cp(48+((watt1 / 100)%10));
lcd_chr_cp(48+((watt1 / 10)%10));
lcd_chr_cp(48+((watt1 / 1)%10));
delay_ms(3000);
LCD_Cmd(LCD_CLEAR);
//********************
Lcd_Out(1,1,"V2=");
lcd_chr_cp(48+((volt2 / 100)%10));
lcd_chr_cp(48+((volt2 / 10)%10));
lcd_chr_cp(48+((volt2 / 1)%10));
//********************
Lcd_Out(1,9,"A2=");
lcd_chr_cp(48+((amp2 / 100)%10));
lcd_chr_cp('.');
lcd_chr_cp(48+((amp2 / 10)%10));
lcd_chr_cp(48+((amp2 / 1)%10));
//********************
Lcd_Out(2,1,"W2=");
lcd_chr_cp(48+((watt2 / 100)%10));
-
51 | P a g e
lcd_chr_cp(48+((watt2 / 10)%10));
lcd_chr_cp(48+((watt2 / 1)%10));
delay_ms(3000);
LCD_Cmd(LCD_CLEAR);
//********************
Lcd_Out(1,1,"V3=");
lcd_chr_cp(48+((volt3 / 100)%10));
lcd_chr_cp(48+((volt3 / 10)%10));
lcd_chr_cp(48+((volt3 / 1)%10));
//********************
Lcd_Out(1,9,"A3=");
lcd_chr_cp(48+((amp3 / 100)%10));
lcd_chr_cp('.');
lcd_chr_cp(48+((amp3 / 10)%10));
lcd_chr_cp(48+((amp3 / 1)%10));
//********************
Lcd_Out(2,1,"W3=");
lcd_chr_cp(48+((watt3 / 100)%10));
lcd_chr_cp(48+((watt3 / 10)%10));
lcd_chr_cp(48+((watt3 / 1)%10));
delay_ms(3000);
LCD_Cmd(LCD_CLEAR);
//********************
Lcd_Out(1,1,"PF1=");
lcd_chr_cp(48+((pf1 / 100)%10));
lcd_chr_cp('.');
lcd_chr_cp(48+((pf1 / 10)%10));
lcd_chr_cp(48+((pf1 / 1)%10));
-
52 | P a g e
//********************
Lcd_Out(1,9,"PF2=");
lcd_chr_cp(48+((pf2 / 100)%10));
lcd_chr_cp('.');
lcd_chr_cp(48+((pf2 / 10)%10));
lcd_chr_cp(48+((pf2 / 1)%10));
//********************
Lcd_Out(2,1,"PF3=");
lcd_chr_cp(48+((pf3 / 100)%10));
lcd_chr_cp('.');
lcd_chr_cp(48+((pf3 / 10)%10));
lcd_chr_cp(48+((pf3 / 1)%10));
//********************
Lcd_Out(2,10,"D=");
lcd_chr_cp(48+((dis / 100)%10));
lcd_chr_cp(48+((dis / 10)%10));
lcd_chr_cp(48+((dis / 1)%10));
lcd_chr_cp('%');
delay_ms(3000);
}}//~!
The figure given shows the connections of the microcontroller to
the LCD display.
-
53 | P a g e
Figure 5.6 (LCD and microcontroller interface)
-
54 | P a g e
CHAPTER # 6
CONCLUSION
6.1 RESULTS
After running the project, results were obtained. The following
figures show the results for all
three phases.
Figure 6.1 (Phase 1 results)
Figure 6.2 (Phase 2 results)
Figure - 6.3 (Phase 3 results)
-
55 | P a g e
Figure 6.4 (Power factors and distortion factor)
6.2 FUTURE WORK
Power factor and distortion factor are two major problems in the
power system. They cause a lot
of disruptions in the power flow and affect the power quality
greatly. Hence it is desirable for the
power generating companies and utility companies to overcome
these problems.
Many mitigation techniques for improving the power factor are
being applied these days to
improve the power factor. They have been discussed previously.
In the same way, improving
techniques for distortion factor have also been discussed.
Now a days the power research industry is making efforts in
finding more efficient ways to
overcome the noise problem. One such research is being carried
out by Lahore electric supply
company (LESCO). They are evaluating the noise levels being
generated by the distribution
transformers. The harmonics which are being generated by the
distribution transformers are
causing a lot of capital to the company. A similar kind of
research is also being funded by
Islamabad electric supply company (IESCO).
Upon the successful determination of noise levels, suitable
filters shall be designed.
PLC which stands for power line carrier is a relatively new
technique which is being applied now
a days in power distribution. It utilizes communication
techniques for power distribution.
Researchers are working on high distortion levels in PLC. So it
explains how much harmonics can
affect power distribution.
This meter successfully displays the distribution factors
including power and distortion factor.
Most of the industries have installed power factor meters and
they are continuously monitoring
their power factor. But if they start to monitor the distortion
factor, it can contribute greatly towards
improving the power quality. The same can be applied for
domestic and commercial users.
-
56 | P a g e
REFERENCES
http://www.engineering.com/Ask@/qactid/1/qaqid/1916.aspx
http://www.electrical-knowhow.com/2012/03/electrical-load-classification-and_07.html
http://www.visionics.a.se/html/curriculum/Experiments/Zero%20Crossing%20Detector/Z
ero%20Crossing%20Detector1.html
http://www.engineersgarage.com/electronic-components/16x2-lcd-module-datasheet
http://en.wikipedia.org/wiki/Power_factor
http://en.wikipedia.org/wiki/Total_harmonic_distortion
http://www.kmitl.ac.th/~kswichit/PICTHD/picthd.htm
http://microcontrollerslab.com/ac-voltage-measurement-using-microcontroller/
Power factor, harmonic distortion; causes, effects and
consideration by Lorenzo Cividino
Power Factor in Electrical Power Systems with Non-Linear Loads
by Gonzalo Sandoval
PIC based AC power meter by Rick Bay
Measurement and Simulation of Power Factor using PIC16F877 by
Sabir RUSTEMLI,
Muhammet ATES
http://www.engineering.com/Ask@/qactid/1/qaqid/1916.aspxhttp://www.electrical-knowhow.com/2012/03/electrical-load-classification-and_07.htmlhttp://www.visionics.a.se/html/curriculum/Experiments/Zero%20Crossing%20Detector/Zero%20Crossing%20Detector1.htmlhttp://www.visionics.a.se/html/curriculum/Experiments/Zero%20Crossing%20Detector/Zero%20Crossing%20Detector1.htmlhttp://www.engineersgarage.com/electronic-components/16x2-lcd-module-datasheethttp://en.wikipedia.org/wiki/Power_factorhttp://en.wikipedia.org/wiki/Total_harmonic_distortionhttp://www.kmitl.ac.th/~kswichit/PICTHD/picthd.htmhttp://microcontrollerslab.com/ac-voltage-measurement-using-microcontroller/2.2.1
Characteristics of non linear loads2.2.2 Effects of non linear
loads on power system2.2.3 Comparison between linear and non linear
loads2.3.1 Causes2.3.2 Disadvantages of low power factor2.3.3 Power
factor for linear loads2.3.4 Power factor for non linear loads2.3.5
Power factor correction for linear loads2.3.6 Power factor
correction for non linear loads2.5 DISTORTION FACTOR2.6 DESIGN
RECOMMENDATIONS FOR DISTRIBUTION SYSTEMS HAVING HARMONICS2.7
TREATMENT FOR HARMONIC PROBLEMS3.4 DISTORTION FACTOR MEASUREMENT4.1
CURRENT TRANSFORMER4.2 POTENTIAL TRANSFORMER4.3 ZERO CROSSING
DETECTOR4.4 B380 (BRIDGE RECTIFIER)4.5 POWER SUPPLY CIRCUIT4.6
LM7805 (VOLTAGE RGULATOR)4.7 LCD DISPLAY