Professional Documents
Culture Documents
By:
Omar Sayied
James Spaulding
Basier Akbary
Prepared to partially fulfill the requirements for ECE402
Department of Electrical and Computer Engineering
Colorado State University
Fort Collins, Colorado 80523
Project advisor: Sid Suryanarayanan
Approved by Dr. Sid Suryanarayanan
1
Abstract
The main goal of this project was to create a software system that analyzed data collected from
smart meters and alerted the user of power quality issues. Power quality, for the purposes of this
project, will be defined as IEEE Std 1159 states, a wide variety of electromagnetic phenomena
that characterize the voltage and current at a given time and at a given location on the power
system. Power quality metrics are defined by a percentage variance from the nominal value over
a period of time. The metrics focused on in this report were limited by the resolution of data
collected from the smart meters, which was 16.67 ms. This resolution allowed us to analyze
disturbances including voltage sags, voltage swells, and harmonics (these disturbances will be
further discussed in the body of the report). Along with these disturbances, we also found
intervals in the data where low power factor (PF) was of concern.
During phase one; we researched definitions, causes, and effects of the aforementioned
disturbances. From this, we determined that the best approach to classify these issues would be
to use the per-unit system and classify them according to parameters set for power quality issues
described in IEEE Std 1159. Once enough data was collected, algorithms were written to extract
the data from a comma separated value (.csv) file and uploaded into MatLab. Once the data was
uploaded into MatLab, techniques such as the fast Fourier transform (FFT) and averaging sliding
window were carried out to locate disturbances. The FFT gave us a means to traverse between
the time domain and the frequency domain. The averaging sliding window acted as a low pass
filter and got rid of noise that would otherwise flag the beginning of a disturbance haphazardly,
ultimately slowing down our algorithms. The algorithms were written as functions, tested and
compared with known results from other sources, and then added to a graphical user interface
(GUI). The GUI was designed to logically allow any user to plot and textually output any power
quality issues, found within our resolution limits, for their own inspection.
TABLE OF CONTENTS
Title
Abstract
Table of Contents
List of Figures
List of Tables
I.
Introduction
II.
Smart Meters
III.
IV.
Effective Values
10
V.
Harmonics
12
VI.
Power Factor
14
VII.
Voltage Disturbances
15
VIII.
17
IX.
Per-Unit System
18
X.
19
XI.
21
XII.
24
Power Factor
27
Voltage Sag/Swell
28
Harmonics
29
XIII
GUI Interface
31
XIV.
33
References
35
Appendix A - Abbreviations
37
Appendix B - Budget
37
38
Appendix D - Code
41
LIST OF FIGURES
Figure 1
Figure 2
10
Figure 3
10
Figure 4
11
Figure 5
12
Figure 6
13
th
Figure 7
13
Figure 8
Power triangle
14
Figure 9
14
Figure 10
14
Figure 11
Voltage Sags
15
Figure 12
Under voltage
15
Figure 13
Voltage Swells
16
Figure 14
Overvoltage
16
Figure 15
19
Figure 16
Customizable Interface
21
Figure 17
22
Figure 18
23
Figure 19
23
Figure 20
25
Figure 21
27
Figure 22
27
Figure 23
27
Figure 24
28
Figure 25
29
Figure 26
29
Figure 27
30
Figure 28
31
LIST OF TABLES
Table 1
12
Table 2
17
Table 3
20
Table 4
22
Table 5
26
Chapter 1: Introduction
A good way to measure the power quality is to compare the voltage and current wave-shapes to
an ideal sinusoid of the desired nominal frequency and magnitude. Since establishments push to
keep the waveforms of their power systems as close as possible to a nominal level, any variation
of waveforms from the nominal waveform may be considered a power quality issue. With the
rise in high-power semiconductor switches, non-sinusoidal load currents have become more
common [1]. Proper management of new integration techniques such as wind and solar, which
introduce non-sinusoidal waveforms due to power electronic interfaces, is necessary to mitigate
issues relating to power quality. However, to mitigate any power quality problem, it is necessary
to quantify the deviation from ideal conditions. We use metrics that are commonly in practice on
data gathered from meters to quantify the loss of power quality.
Power quality indices are used to measure the quality of the power supply. Some of the best
known indices are the following: total harmonic distortion (THD), PF, telephone influence factor
(TIF), flicker factor (FF), and unbalance factor (UF). Due to the resolution of data from the smart
meters, our indices were limited to THD and PF. Within these indices, the phase voltages and
currents were analyzed for harmonics, disturbances, and low PF.
Voltage sags, voltage swells, harmonics, and a low power factor greatly contribute to a decrease
in power quality and it is important for entities to closely monitor these phenomena. Utility
power companies charge their customers for lower power quality, therefore entities will want to
continuously monitor their overall power quality to ensure that it is at an optimal value.
Monitoring the power quality will provide the entity with the prospect of ensuring that their
power grid is efficiently delivering power. Due to the fact that there are multiple motors,
generators, air conditioning units, heaters, refrigerators, etc. in entities that own large buildings,
it is important that they keep their power quality as efficient as possible. They will be able to
save a lot of money while at the same time slightly cutting back on the total pollution that can
result from having low power quality. In detail, cutting losses on transmission, distribution, and
utilization of total power reduces power supply generation which in result, helps cut back on
pollution.
The common format of the data that was extracted from the power meters was in the .csv format.
This format separates the data with a comma as the delimiter. We opened the .csv data sheet in
Excel which properly placed the data in respective columns. After the data had been put into
excel form, for easier understanding, we then analyzed it through MatLab using algorithms. Our
system stored each column, which represents a variable, from the input data into a separate
database of arrays. MatLab then ran through the array and analyzed each value according to the
characteristics defined by IEEE Std 1159.
Once the algorithms were tested and properly outputting desired results, they were put into a
GUI designed in MatLab. The GUI gives the user the ability to upload data files and find power
quality issues if any exist. The algorithms were written for the finest resolution obtained by the
meters and were manipulated to classify varying events where a power quality issue was present.
By changing the time parameters classifying an event, the same algorithm was used to find
another classification of an event since the equations used to characterize an issue are solved
similarly.
6
This report will examine common areas and variables that distort power quality. Some variables
include effective values, harmonics, and power factor. The most common disturbances seen in a
power system will be defined and analyzed, such as voltage sags and swells. With the aid of
IEEE standards, specifically IEEE 1159 and IEEE 519, harmonics and disturbances are properly
categorized and further analyzed.
After the standards are generalized, a concise explanation of the importance of per unit analysis
and its importance regarding this project are presented. The later parts of the report include a
brief introduction to a sampling technique that helps speed up the algorithms known as the
windowed FFT. Following this, new metering devices known as smart meters are described and
a brief mention of ethical concerns currently surrounding smart meters is introduced. Next, the
report will detail testing performed and give a brief synopsis of what issues we found. The GUI
design and algorithmic implantation into the GUI are both described. Lastly, the report
concludes with recommendations and plans for future work.
[20]
(4.1)
( ) = ( ) ( ) =
( ) =
()2
()
(4.2)
(4.3)
V(t)
0.5
0
-0.5
-1
0
20
40
60
80
100
120
t (s)
140
160
180
200
Looking at only the numerator of equation 4.3, we plot the voltage in figure 4. To find the total
amount of energy in this waveform, we take the average voltage over one period. To find the
average we sum all of the energy up under the curve and divide by the period of the summed
amount of energy, shown in equation 4.4.
1
()2
(4.4)
10
Now, we would like to find an effective voltage that will represent a direct current (DC) value.
To do this, we use equation 4.5.
=
(4.5)
= 0 ()2
(4.6)
= 0 ()2
(4.7)
Setting the effective voltage equal to our average, or mean voltage, we are able to derive a value
for the effective voltage which relates the DC value and AC value together. For the rest of the
text we will use E to represent effective voltage.
1
V(t)2
0.8
0.6
0.4
0.2
0
0
20
40
60
80
100
120
t (s)
140
160
180
200
An even easier relation between the AC rms value and the DC value is found by solving the
integral. Since we are dealing with the cosine component of the voltage throught the resister, we
can solve equation 4.7 and get the result shown in equation 4.8.
1
= = 0 ()2 = 0 ()2 2 =
()
2
(4.8)
The same result will be found for the effective current represented by equation 4.9.
=
()
2
(4.9)
The important relation between the DC and AC rms value is that they share the same amount of
energy although their amplitudes are different. This means that the effective AC voltages share
the same thermal limitations and ability to carry superimposed harmonics as the DC voltages.
11
Chapter 5: Harmonics
Pure sinusoidal waveforms are idealistic when considering the quality of power. Sinusoidal
waveforms are generated for the transmission of power across the power supply network known
as the grid. Sinusoidal waveforms have many beneficial qualities when considering transmission
of power. One such benefit is the ability to use three separate phases to drive loads. Using three
phases to drive a motor, for instance, is less damaging due to less vibration on motor components
when compared to a single-phase motor. A general plot of the smoothing effect three phases
generate is shown in figure 5.
All loads are manufactured to receive
pure sinusoidal waveforms but due to
non-linear loads, the pure sinusoidal
waveforms
are
distorted
by
electromagnetic phenomena called
harmonics. Harmonics are the content
of the signal whose frequency is an
integer multiple of the systems
fundamental frequency. [2]
Figure 5: Three-phase motor rotating coils through magnetic field. Notice three phases generating constant
peaks of current staying above the zero crossing. [19]
Fundamental
60 Hz
2nd Harmonic
120 Hz
3rd Harmonic
180 Hz
Nth Harmonic
N(60) Hz
The power grid in the United States (US) uses a fundamental frequency of 60 Hz. Harmonics for
this frequency are shown in table 1. Non-linear loads that cause harmonics are magnetic devices,
converters, and rotating machines. Many motors that are used in industrial applications are
composed of magnetic materials and are driven by a changing flux and magnetic field. This
produces a back electromotive force (emf) and directly contributes to a type of harmonic
distortion known as voltage distortion. Faradays law of induction relates this phenomenon and
is shown in equations 5.1 and 5.2.
=
(5.1)
(5.2)
12
To achieve the greatest flux (), motors are built to have zero angle between the surface area
vector () and the magnetic field vector (). To better understand figure 5 is provided below.
The emf sends a voltage out onto the distribution lines creating a voltage distortion. This causes
inefficiency in the power flow of the grid. In fact, Industry
and infrastructures consume more than 31% of the available
energy and electrical motors, alone, represent more than
60% of this.[3] Voltage distortion may be seen in figure 6.
Voltage distortion is composed of the sum of all harmonics
and the fundamental sinusoid. Equation 5.3 is used to
calculate distorted voltage.
Figure 7: Voltage distortion between fundamental waveform and 5th harmonic. [4]
= 2 + 2
(5.3)
= 22 + 32 + + 2
(5.4)
Equation 5.4 represents the total amount of effective voltage harmonics present. The
relationship for effective currents is derived exactly the same as for effective voltages. When
describing the harmonic distortion we may consider the total effective voltage distortion or the
total effective current distortion. Both describe the total harmonic distortion (THD).
To describe the amount of distortion for voltages or currents we will use the THD. The THD is
the effective value of all the harmonics divided by the effective value of the fundamental.[4]
This is shown in equation 5.5.
=
2
22 +32 ++
2
2
(5.5)
Harmonics are a leading cause of power quality issues in areas where non-linear loads are
concerned. The values of THD will be classified and categorized according to standard IEEE
1159 and analyzed by techniques described in standard IEEE 519 discussed in chapter 8.
13
(6.1)
= 2 + 2
(6.2)
(6.2)
14
The two figures above represent an instantaneous voltage sag (upper figure) and a voltage sag
that lasts more than one cycle (lower figure). As can be seen, the magnitude of the voltage during
the voltage sag is much lower than the nominal magnitude.
t > 1 min
Figure 12: Represents an under voltage due to the fact that the voltage sag lasts for more than 1 min. [12]
15
A voltage swell is defined as an occurrence where the RMS voltage is more than the nominal
voltage at the power frequency of a power system. IEEE 1159 defines a voltage swell as a value
that is 110% to 180% of the nominal voltage of the system that lasts from 0.5 cycles to 1 minute.
Voltage swells are typically caused by an instant reduction in the load of a circuit. Long duration
voltage swells, or voltage swells that last longer than 1 minute, are referred to as over voltages.
Over voltages in a system can also damage or cause malfunctions in motors or appliances. If the
input voltage drastically increases above the max voltage rating of a motor or appliance, it will
increase the heat in the motor or appliance and either damage internal parts or drastically shorten
its life.
The two figures above represent an instantaneous voltage swell (upper figure) and a voltage
swell that lasts more than one cycle (lower figure). As can be seen by the two red lines on the
lower figure, the magnitude of the voltage is about 10% higher than the nominal magnitude.
t>1
i
Figure 14: Represents an overvoltage due to the fact that the voltage swell lasts for more than 1 min. [13]
16
17
18
() = =0 ()
(10.1)
where is the resolution in frequency domain and is the sample rate of f(t). For power
quality analysis, the discrete Fourier transform will use a sliding, adjustable window technique,
where N-1 is the window length.
In order to analyze large data volume efficiently, speed needs to be a priority. For speed analysis,
the FFT will use a large window size with a slow sample rate. However, the sample rate must be
fast enough to capture high frequency events. Once it does capture a disturbance, the window is
shortened and the sample rate is increased to get a very accurate analysis of the phenomena.
After the disturbance is analyzed, the window length and sample rate will be adjusted for rapid
analysis when no high frequency phenomena are present. This process is illustrated in the figure
below.
The WFFT analysis does introduce some errors that need to be accounted for. Some of these
errors can be limited by selecting proper parameters (e.g. sample time and window length) and
applying digital filters to suppress noise. One of the obstacles is speed versus accuracy. As
explained earlier, based on the window length and sample rate parameters, a trade-off between
speed and accuracy is created. Another obstacle is edge data. At the edge of a disturbance, the
window will contain both normal and disturbance amplitudes. This cannot be analyzed by the
FFT so that data is discarded. Aliasing is a third obstacle with the WFFT. When the sample rate
is too low, the high frequency components are translated into lower frequencies. This error can
19
be avoided by increasing the sampling frequency. Because the FT analysis is truncated in the
time domain, leakage will occur in the frequency domain. Leakage is another barrier that spreads
energy from one frequency to another. Setting an integer number of cycles in each window,
however, will remove all leakage. The last important hurdle is the picket-fence effect, which is
like looking at the data through a picket fence. This happens when the desired frequency is not
an integer multiple of the fundamental frequency. A frequency in the nth and (n+1)th harmonics
will affect the magnitudes. A technique to reduce this effect is to increase the resolution of the
analysis.
The application for the WFFT analysis is to locate and categorize disturbances. The disturbances
are classified and categorized beyond the WFFT analysis, based on the IEEE 1159 Standard.
Some practical events are shown in the table below. From these events, the WFFT can analyze
the specified power quality voltage and current problems. For example, in the event of a fault,
the WFFT can analyze the voltage sags and neutral currents caused by it. Note that both current
types include nonlinear load types and transformer saturation.
One alternative to power quality assessment is wavelet analysis. Wavelet analysis is similar to
the WFFT analysis in that it uses large wavelets to analyze low frequency effects such as flicker
and small wavelets to analyze high frequency, short term effects such as momentary outages and
fast transients. A benefit to wavelet analysis is it gives accurate dilation and shift data that the
WFFT does not. However, wavelet analysis does not generate any frequency data like phase and
magnitude. Therefore, the WFFT analysis is preferred.
20
However, we ran into some difficulties with our customer as he was transferred to another state
with a new project. Therefore, our senior design group needed to look for other power meters
locally and work with those instead.
We setup a meeting with the CSU head of power metering, Chuck Sawyer, and gained access to
the ION and Eaton meters installed on campus. The ION meters used the power quality
measuring program, ION Setup, which is a very basic form of power monitoring. These meters
sampled key variables like voltages, currents, power factor and harmonics and uploaded and
displayed them every second through the secure online CSU site. ION Setup only stored a
limited amount of data at a low resolution. It stored the real and reactive power measured every
15 minutes for the last three months, and it stored any information regarding voltage sags and
swells that occurred during those three months. This software created some challenges for us
because we had to manually record most of the data ourselves. This process made it difficult to
obtain data at quick sample rates. We avoided these meters because of the lack of useful data it
provides. An example table output that ION Setup provides is shown in table 4.
21
The Eaton meters used a program called Power Xpert Meter. We accessed this program through
the secure CSU site like ION Setup. Power Xpert Meter was a more advanced software that
plotted and exported much more data than ION Setup. We had some difficulties in accessing the
full Power Xpert Meters software through the secure site because of a Java error we obtained and
could not find a solution for. We have asked Chuck if he knows of any workarounds to the error
and we implemented his suggestions but it did not help. We could access the software without
Java active, but we only get access to very basic information like the three phase voltages and
currents, power factor and frequency. This basic information was updated every 10 seconds and
the stored data could not be accessed without Java. Eaton did have a live demo of their software
actively monitoring on their website. Therefore, we used the Eaton site to get more acquainted
with the software and know exactly the type of data it export. In the end, we extracted some of
our data for our code from the Eaton live demo site. The figure below shows the user interface of
Power Xpert Meters and an example of the plots it provides.
We configured Pronto to record ten days worth of data. The Pronto data logger allowed us to get
plots for real and reactive power and any voltage swells that occurred. Pronto exported a comma
separated value (.csv) file that logged all three phase AC RMS voltages and currents, real and
apparent power readings every one second for a 24 hour period. We also extracted higher
resolution readings of the real and apparent power over a duration of one hour with 16.67 ms
intervals. A plot showing the apparent power measured during the ten day period is shown in the
figure below.
With access to these three different meters, it gave us many options on how to progress this
project. We ended up using the Pronto recordings for most of our code and relied on the high
resolution Eaton recordings for our harmonics analysis code.
23
24
25
We used IEEE 1159 table of characteristics for electromagnetic phenomena to classify this
disturbance as a momentary voltage swell. To do this we extracted the maximum and minimum
values of the square wave form and found the duration of the event. The data collected is shown
below in table 5.
Time
04:08.0
04:09.0
04:10.0
By comparing the data in the table to the kVA 2 second data log graph in figure 19 we found the
duration of the event to be:
= 9.481 8.614 = 867
1 =
1
= 16.7
60
867
= 52
16.7
1
(30 ) = 500 3
60
We used similar techniques using the WFFT to find disturbances and irregularities and then
classify and log the event for the user.
Following a similar method as was performed when capturing a momentary swell, we developed
algorithms to use for determining and locating the waveform variances prescribed. As each
function of code was developed, they were tested by using data collected from the Pronto
software .csv files. We calculated the expected disturbances using Excel and compared the
results with the output of the functions written in MatLab. By doing this, we ensured ourselves a
correct result for referencing ultimately aiding in finding errors.
26
Power Factor
We calculated the power factor by using (12.1).
=
(12.1)
Figure 21: Data opened in Microsoft Excel. The second to last column refers to the real power and the last
column refers to the apparent power.
0.94
0.92
0.9
0.88
0.86
0.84
0.82
0.8
0.78
0.76
3537
3537.2
3537.4
3537.6
3537.8
3538
3538.2
3538.4
3538.6
3538.8
3539
Figure 23: Power factor between 3537 and 3539 seconds showing result of approximately 0.76.
27
Voltage Sag/Swell
The nominal voltage is calculated by taking the average every 60 seconds. The nominal voltage
value is then compared to the actual voltage at each time stamp.
: /
If the Calculated Value is between 0.1-0.9, then the disturbance is classified as a voltage sag. If
the Calculated Value is between 1.1-1.8, then the disturbance is classified as a voltage swell. For
precision purposes, we designed our software to classify a voltage sag if it dropped below 0.95 of
the nominal voltage, and a voltage swell if it increased above 1.05 of the nominal voltage.
The nominal voltage can be calculated by looking at the integer multiple
of 60 seconds that falls in a specific range of data time stamps. The value
of the voltage at all 60 seconds is 281.7 except for the values at times 484
and 485 seconds. Therefore the nominal voltage can be calculated by
adding all voltages:
58 281.7 + 266.7 + 265.7 = 16871
= 16871/60 = 281.183333333
At points 484 and 485 seconds, the voltage looks to be smaller than the nominal voltage.
Therefore, we can calculate if there is a voltage sag at these points. At 484 seconds:
266.7 / 281.183333 = 0.9484914954
As stated earlier, our code was designed to define anything under .95 as a voltage sag. Therefore
we should expect a voltage sag at points 484 and 485 seconds (since the voltage at 485 seconds
is smaller than the voltage at 484 seconds). We then tested our code to see if the voltage sag at
these two time stamps was recognized. Figure 24 was taken from the command window of
MatLab after running our code.
As can be seen, it is found that there is a voltage sag at both of those points.
28
Harmonics
The harmonics for a waveform are calculated by use of the Fast Fourier Transform. We input the
current waveform in the data into the fft() function in MatLab to find the harmonics of the
waveform. Since the fft() function represents the harmonics in a mirror image, we only looked at
the first half of the calculated values. The data is then converted to the frequency domain by
utilizing the sampling frequency and length of the data. The sampling frequency can be
calculated by the function [frequency = 1/time] where time is the difference between two time
values in the data. We used the psd() (Power Spectral Density) function in MatLab to test the
harmonics function of the code. The psd() function shows the current waveform in terms of
power/frequency in the frequency domain. The figure below is the output of the psd() function.
PSD of Data
70
60
Power/frequency (dB/Hz)
50
40
30
20
10
-10
50
100
150
200
250
Frequency (mHz)
300
350
400
450
It can be seen that the magnitude of power/frequency increases at the integer multiples of the
fundamental frequency (60 Hz). The magnitude is highest at 60Hz, as expected, since it is the
fundamental frequency, then there is an increase in magnitude at 180Hz, 300Hz, and 420 Hz.
The magnitudes of the harmonics from largest to smallest in terms of frequency are 60Hz,
180Hz, 420Hz, and 300Hz.
Running the harmonics code with the same current wave form data used in the psd() function
provides the following figure.
29
500
450
400
350
300
250
200
150
100
50
0
-100
200
100
300
400
500
As can be seen, the harmonics occur at the same frequencies, and further analysis shows that
magnitudes match the magnitudes obtained in the psd() function. Just looking at the integer
multiples of the fundamental frequency, the magnitudes of the harmonics from largest to smallest
in terms of frequency are 60Hz, 180Hz, 420Hz, and 300Hz, which match the data obtained
above. The Total Harmonic Distortion (THD) is then calculated by the use of the following
function:
=
22 +32 ++2
1
(12.2)
V1 is the RMS voltage at the fundamental frequency. Our code then displays the percentage of
Total Harmonic Distortion in the GUI. The snippet below is taken from MatLab, which shows
that our system displays the total harmonic distortion of the current wave used above.
>> Harmonics_THD
Total Harmonic Distortion = 3.99886%.
30
Uncluttered interface
User friendly for all skill levels
Quick and direct
MatLab provides a template that allows the designer to create infinite unique analysis
environments. The main controls used for this project were a popup menu, an axes, and a text
box. A logical flow of usability was implemented into the design by placing the procedures in a
similar manner as one would follow if they were reading a book, i.e. from left to right, top to
bottom.
One issue we found during the uploading of data from the .csv file into MatLab was the time
stamp. Time stamp labeled for each sample was changed into units. This means that the data we
collected and separated by 16.67 ms was turned into units of 1, 2, and 3 and so on. To plot the
data and return the information back to ms intervals was not achieved in the time limit we were
faced with. Some of the data we used for the voltage sags and swells were in 1 second intervals
so this worked towards our benefit, however, as the resolution of data became finer, we had to
write code to transfer our intervals from units to the original time stamps. This issue was not
resolved during the time limit of the project.
The GUI provided useful options helping to keep the design organized and professional. For
instance, alignment tools and a design layout of a grid with snap on features were used to make
sure all axes and features were aligned properly. Also, use of space was considered for
aesthetics and usability. By aligning related objects, such as the pop-up menu, axes, and output
text box, the user would see the output of data in a related grouping structure.
32
allow the user to interact with our system using a graphical layout rather than a text layout. Our
goal is to create a GUI with graphical and numerical representations of the data being monitored.
The GUI will have separate menus, which can be navigated to, that will display information
about the respective disturbance or irregularity. The GUI will provide the user with the option to
look at respective data in a graphical or numerical depiction. The interface between the system
and the GUI will allow the user to see the exact time and value that a disturbance or irregularity
occurs, for each variable in the input data. The GUI will also provide the user with a total count
of occurrences of each type of disturbance.
The Graphic User Interface allows for interaction with our system using a graphical and visual
layout. The GUI graphs the data related to the disturbance (voltage sag/swell, harmonic)
alongside related power quality data (apparent power, real power, power factor). The interface
between the system and the GUI allows the user to see the exact time and value related to a
disturbance or irregularity.
The system is written to take the data as an input and perform all calculations and analysis and
output the respective data in terms of located disturbances and irregularities. Using the specific
criteria outlined in the report along with a few other corresponding factors, our system analyzes
data and informs the user of precise aspects through both textual and graphical representations.
The system can be very useful due to the fact that it will provide the status of the power grid in
an applied area/building. It will inform the user of any implications that are caused by the natural
phenomena as discussed in the report, and will allow for determination of any ongoing issues in
the power system that need to be resolved.
If this project were continued, there are multiple areas we can add and improve to our project.
The first notion would be to add more power quality parameters to our program, like calculation
and analysis of energy, flicker, noise, transients and phasors. Due to time and data gathering
constraints, we were not able to implement these parameters. Another area that could be
improved is the Graphic User Interface. The GUI can be designed outside of MatLab to look
more professional and allow for more implementation features. A more sophisticated GUI will
make the program stand out more, increase its marketability, and allow for better analysis of the
power quality parameters. The next step beyond this would be to analyze any power quality
issues that arise and generate a recommended actions list that users should take if that event
occurs.
34
References
[1]
Heydt.G. T. "Power Quality Engineering." IEEE Power Engineering Review. Sept 2001.
[2]
Shah, Haren. Harmonics-A Power Quality Problem. Electrical & Electronics. September
October 2005. PDF. http://www.mecoinst.com/media-releases/documents/harmonics.pdf
[3]
Perrat, Alexandre. Energy Efficiency for Machines: the smart choice for the
motorization. Schneider Electric [White Paper], 2010. http://www2.schneiderelectric.com/documents/original-equipment-manufacturers/pdf/motion_control.pdf
[4]
Wildi, Theodore. Electric Machines, Drives, and Power Systems. 5th Edition. Prentice Hall:
Pearson Education, 2002.
[5]
[6]
[7]
IEEE Recommended Practice for Monitoring Electric Power Quality. IEEE Standard
1159-2009. The Institute of Electrical and Electronics Engineers. June 26, 2009.
[8]
[9]
36
Appendix A: Abbreviations
AC - Alternating Current
CSV - Comma Separated Value
EMF - Electromotive Force
FF - Flicker Factor
FT - Fourier Transform
FFT - Fast Fourier Transform
GUI - Graphic User Interface
GUIDE - GUI Development Environment
IEEE - Institute of Electrical and Electronics Engineers
MS SQL - Microsoft Structured Query Language
PF - Power Factor
RMS - Root Mean Square
SPM7 - StruxureWare Power Monitoring 7.0
TIF - Telephone Influence Factor
THD - Total Harmonic Distortion
UF - Unbalance Factor
WFFT - Windowed Fast Fourier Transform
Appendix B: Budget
Our project is strictly software creation through MatLab R2012a/R2012b. MatLab is provided to
us at no charge by the Engineering Department at Colorado State University. The GUI will also
be created through the GUIDE tool provided in MatLab. We will also use IEEE standards which
are provided to us by the Engineering Department. Therefore, at this point in time, we do not
have any costs related to the design and implementation of our system and software.
37
Researching Terms
Website
Software
Power Meters
Testing/Debugging I
James
Harmonics
Voltage Sags
(accomplished)
What is MODBUS?
(accomplished)
Set up meeting with CSU
metering department
(accomplished)
Gain access/training on
CSU software that
communicates with
Schneider meters (ION)
(accomplished)
Get meter access from
Pronto meters provided
by the City of Fort
Collins
(accomplished)
Test power factor
equation in Excel
(accomplished)
Basier
Amperage
Power Acceptability
(accomplished)
Learning Software
layout
(accomplished)
Understand the type of
data that will be
extracted from power
meters
(accomplished)
Gain access\training on
CSU software that
communicates with
Schneider meters (ION)
(accomplished)
Learn software
communicating with
Eaton meters provided
by the metering
department at CSU
(accomplished)
Omar
Power Factor
Transients
(accomplished)
Design
(accomplished)
Maintain
Regularly Update
(in progress)
Understand the type of
data that will be
extracted from power
meters
(accomplished)
Gain access\training on
CSU software that
communicates with
Schneider meters (ION)
(accomplished)
Learn software
communicating with
Eaton meters provided
by the metering
department at CSU
(accomplished)
38
Data Extraction II
Flowcharts II
Storing Frequency of
Occurrences and
Categorizing Events
Testing/Debugging III
Reports/E-Days
Basier
PHASE 4
MatLab function that
finds duration of events
(accomplished)
PHASE 5
MatLab Function that
MatLab Function that
records frequency of
plots the frequency of
categorized events
categorized events
(accomplished)
(accomplished)
To be started after
completion of code
during phase 5
(accomplished)
Powerpoint, roughdraft,
and E-Days poster
design
(all rough drafts)
(accomplished)
To be started after
completion of code
during phase 5
(accomplished)
Powerpoint, roughdraft,
and E-Days poster
design
(all rough drafts)
(accomplished)
Omar
MatLab function that
classifies events by their
characteristics from IEEE
1159
(accomplished)
39
Testing/Debugging IV
Due 5/10
PHASE 6
Signaling device and
Signaling device and
using GUI in MatLab to
using GUI in MatLab to
finalize project
finalize project
(accomplished)
(accomplished)
To be started after
To be started after
completion of code
completion of code
during phase 6
during phase 6
(in progress)
(in progress)
40
Appendix D: Code
function varargout = PQ(varargin)
% PQ MATLAB code for PQ.fig
%
PQ, by itself, creates a new PQ or raises the existing
%
singleton*.
%
%
H = PQ returns the handle to a new PQ or the handle to
%
the existing singleton*.
%
%
PQ('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in PQ.M with the given input arguments.
%
%
PQ('Property','Value',...) creates a new PQ or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before PQ_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to PQ_OpeningFcn via varargin.
%
%
*See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
%
instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help PQ
% Last Modified by GUIDE v2.5 18-Apr-2013 22:40:07
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @PQ_OpeningFcn, ...
'gui_OutputFcn', @PQ_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback',
[]);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
41
% --- Outputs from this function are returned to the command line.
function varargout = PQ_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output1 args (see VARARGOUT);
% hObject
handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Get default command line output1 from handles structure
varargout{1} = handles.output1;
%
%
%
%
%
42
Time_Data = Data_Array(:,1);
Data_Length=length(Current_Data);
N = 2^nextpow2(Data_Length);
Sampling_Frequency = 1000*(1/(Time_Data(2)-Time_Data(1)));
Current_Fourier=fft(Current_Data,N);
Half_Current_Fourier = Current_Fourier(1:N/2);
Frequency = ((0:N/2-1))*Sampling_Frequency/(N);
Magnitude_Value = abs(Half_Current_Fourier);
length(Magnitude_Value);
Total_Harmonics = sum(Magnitude_Value.^2);
Fundamental_Harmonic = max(Magnitude_Value);
Total_Harmonic_Distortion = 100*sqrt(Total_HarmonicsFundamental_Harmonic^2)/sqrt(Total_Harmonics);
%fprintf('Total Harmonic Distortion = %g%%.',
Total_Harmonic_Distortion);
%fprintf('\n');
toprint = sprintf('Total Harmonic Distortion - %g%%.',
Total_Harmonic_Distortion);
set(handles.edit2,'String',toprint)
bar(handles.large_Axes,Frequency/60,Magnitude_Value/(N/2));
title(handles.large_Axes,'Harmonics','Color','w')
xlabel(handles.large_Axes,'Harmonic Order','Color','w')
ylabel(handles.large_Axes,'Magnitude (V)','Color','w')
plot(handles.upper_Axes,Time_Data, Current_Data)
title(handles.upper_Axes,'Current Waveform','Color','w')
xlabel(handles.upper_Axes,'Time (ms)','Color','w')
ylabel(handles.upper_Axes,'Magnitude (V)','Color','w')
case 3
%Power_Factor Algorithm
% Function that traverses across 1 second intervals over an 18 hour
period
% and finds and stores low power factor incidents using a tolerance
level
% of 0.8. Plots and counts all occurances on same graph. Also,
prints the
% value of the low pf and warns the user of the incident.
cla;
clc;
temp_text0= '';
set(handles.large_Axes,'NextPlot','replacechildren')
set(handles.upper_Axes,'NextPlot','replacechildren')
Data_Array = xlsread('data.csv');
%creates a matrix of data file
RealPower = Data_Array(:,8);
Time_Data = linspace(0,length(RealPower)-1,length(RealPower));
PowerFactor = zeros(1,length(Time_Data));
%preallocates vector space size of time variable
risk = zeros(1,length(Time_Data));
%preallocates vector space
ApparentPower = Data_Array(1:length(Time_Data),9);
%creates a column vector of P values
43
44
set(handles.upper_Axes,'NextPlot','replacechildren')
Time_Data = linspace(0,86400,86401);
Data_Array = xlsread('data.csv');
Voltage_Data = Data_Array(:,2);
Time_Data_Counter = 0;
Voltage_Data_Counter = 0;
Voltage_Minimum = 0;
Location_Counter = 2;
for j=2:length(Time_Data)
Voltage_Minimum = Voltage_Minimum + Voltage_Data(j);
Voltage_Data_Counter = Voltage_Data_Counter + 1;
Location_Counter = Location_Counter + 1;
if(Voltage_Data_Counter == 60)
if(j == length(Time_Data))
Voltage_Average =
(Voltage_Minimum/Voltage_Data_Counter);
for k=(length(Time_Data)-(length(Time_Data) Location_Counter)):length(Time_Data)
if(abs(1-(Voltage_Data(k)/Voltage_Average)) >
.05)
if(Time_Data_Counter == 0)
fprintf('******************************\n');
end
Time_Data_Counter = Time_Data_Counter + 1;
if((1-(Voltage_Data(k)/Voltage_Average))>0)
fprintf('Voltage Sag has lasted %g
seconds.\n', Time_Data_Counter);
fprintf('Deviation - %g%%\n',abs(1(Voltage_Data(k)/Voltage_Average)));
fprintf('\n');
end
if((1-(Voltage_Data(k)/Voltage_Average))<0)
fprintf('Voltage Swell has lasted %g
seconds.\n', Time_Data_Counter);
fprintf('Deviation - %g%%',abs(1(Voltage_Data(k)/Voltage_Average)));
fprintf('\n');
end
else
Time_Data_Counter = 0;
end
Voltage_Minimum = 0;
Voltage_Data_Counter = 0;
end
else
Voltage_Average = (Voltage_Minimum/60);
for k=(Location_Counter - 60):Location_Counter
if(abs(1-(Voltage_Data(k)/Voltage_Average)) >
.05)
if(Time_Data_Counter == 0)
t1 =
sprintf('******************************\n');
temp_text = sprintf('%s%s',temp_text, t1);
end
Time_Data_Counter = Time_Data_Counter + 1;
45
elseif((abs(1-(Voltage_Data(k)/Voltage_Average))
< .05) && Time_Data_Counter ~= 0)
if((1-(Voltage_Data(k1)/Voltage_Average))>0)
if(Time_Data_Counter < 3)
t2 = sprintf('Momentary Voltage
Sag has lasted %g seconds.\nDeviation - %g%%\n',Time_Data_Counter,100*abs(1(Voltage_Data(k-1)/Voltage_Average)));
temp_text =
sprintf('%s%s',temp_text, t2);
end
if(Time_Data_Counter >= 3)
t3 = sprintf('Temporary Voltage
Sag has lasted %g seconds.\nDeviation - %g%%\n',Time_Data_Counter,100*abs(1(Voltage_Data(k-1)/Voltage_Average)));
temp_text =
sprintf('%s%s',temp_text, t3);
end
end
if((1-(Voltage_Data(k1)/Voltage_Average))<0)
if(Time_Data_Counter < 3)
t4 = sprintf('Momentary Voltage
Swell has lasted %g seconds.\nDeviation %g%%\n',Time_Data_Counter,100*abs(1-(Voltage_Data(k-1)/Voltage_Average)));
temp_text =
sprintf('%s%s',temp_text, t4);
end
if(Time_Data_Counter >= 3)
t5 = sprintf('Temporary Voltage
Swell has lasted %g seconds.\nDeviation %g%%\n',Time_Data_Counter,100*abs(1-(Voltage_Data(k-1)/Voltage_Average)));
temp_text =
sprintf('%s%s',temp_text, t5);
end
end
Time_Data_Counter = 0;
end
Voltage_Minimum = 0;
Voltage_Data_Counter = 0;
end
end
end
end
set(handles.edit2,'String',temp_text)
plot(handles.large_Axes,Time_Data(2:end),Voltage_Data(2:end))
title(handles.large_Axes,'Voltage Waveform','Color','w')
xlabel(handles.large_Axes,'Time (s)','Color','w')
ylabel(handles.large_Axes,'Magnitude','Color','w')
title(handles.upper_Axes,'','Color','w')
xlabel(handles.upper_Axes,'','Color','w')
46
ylabel(handles.upper_Axes,'','Color','w')
case 5
%Power_Factor Algorithm
% Function that traverses across 1 second intervals over an 18 hour
period
% and finds and stores low power factor incidents using a tolerance
level
% of 0.8. Plots and counts all occurances on same graph. Also,
prints the
% value of the low pf and warns the user of the incident.
cla;
clc;
temp_text_1= '';
set(handles.large_Axes,'NextPlot','replacechildren')
set(handles.upper_Axes,'NextPlot','replacechildren')
Data_Array = xlsread('data.csv');
%creates a matrix of data file
RealPower = Data_Array(:,8);
Time_Data = linspace(0,length(RealPower)-1,length(RealPower));
%preallocates vector space size of time variable
ApparentPower = Data_Array(1:length(Time_Data),9);
hold all;
plot(handles.large_Axes,Time_Data(2:end),RealPower(2:end),'r')
set(handles.large_Axes,'NextPlot','add')
plot(handles.large_Axes,Time_Data(2:end),ApparentPower(2:end),'b')
plot(handles.upper_Axes,Time_Data(2:end), RealPower(2:end),'r')
hold off;
t_1 = sprintf('Real Power - Red\nApparent Power - Blue');
set(handles.edit2,'String',t_1)
title(handles.large_Axes,'Real/Apparent Power','Color','w')
xlabel(handles.large_Axes,'Time (s)','Color','w')
ylabel(handles.large_Axes,'Magnitude (V)','Color','w')
title(handles.upper_Axes,'Real Power','Color','w')
xlabel(handles.upper_Axes,'Time (s)','Color','w')
ylabel(handles.upper_Axes,'Magnitude (V)','Color','w')
end
% Hints: contents = cellstr(get(hObject,'String')) returns popup1 contents as
cell array
%
contents{get(hObject,'Value')} returns selected item from popup1
47
48
% --- Executes on key press with focus on edit2 and none of its controls.
function edit2_KeyPressFcn(hObject, eventdata, handles)
% hObject
handle to edit2 (see GCBO)
% eventdata structure with the following fields (see UICONTROL)
%
Key: name of the key that was pressed, in lower case
%
Character: character interpretation of the key(s) that was pressed
%
Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
% handles
structure with handles and user data (see GUIDATA)
49