A LabVIEW Based Virtual Instrument for Power Analyzers
Jen-Hao Teng* Shun-Yu Chan** Jin-Chang Lee* Roy Lee*
Member IEEE
*Department of Electrical Engineering,I-Shou University,Kaohsiung,Taiwan, R. 0. C.
**Department Electrical Engineering,Cheng-Shiu Institute of Technology,
Kaohsiung,Taiwan,R. 0. C.
Abstract: In this paper, a PC-based Virtual Instrument (VI) for power analyzer is developed. Instead of theoretical research, a practical VI that can be integrated into existent VI system is developed. The functions of power analyzer developed in this paper include the harmonic analyzer and instantaneous power measurement. The proposed VI is based on the LabVIEW (Laboratory Virtual Instrument Engineering Workbench) language under the workbench of the MS Windows 95/98 operating system. The capability of the proposed method can be expanded according to the requirements of users. Some sub-VIS for the power analyzer are developed in this paper and the idea of software Integrated Circuit (IC) can be achieved by using these sub-VIS. All sub-VIS developed in the paper are free for non-commercial use.
Keywords:Virtual Instruments Power Analyzer Harmonic Analyzer Instantaneous Power Measurement LabVIEW Software IC
1.Introduction
In recent years, with the extensive uses of the personal computer (PC), the interest with the heuristic applications both on the software tools for the development of VIS and the tools for the computer interconnection at great distance had increased steadily.
This interest is mainly due to the cost of the experimental laboratories can be reduced and the speed of development can be accelerated. Virtual measurement systems which is the most widely used for power systems have been introduced to simplify the design,implementation, and use of programmable measurement system by adopting a visual interface. Visual programming allows for a straightforward implementation of measuring algorithm, even to people who are not expert in computer programming. The algorithm is, in fact, created by graphically selecting and interconnecting the functional blocks available in the system-development library. Graphical interfaces resembling the real instruments make the use and comprehension of the VI more immediate for individuals accustomed to working with the conventional instrumentation [ 1-7] .
One of the most attractive facts is that a welldeveloped VI can be considered as a software IC and then can be used to design a large-scale or complex system.. The reuse of the existed VIS makes the development of a new VI easier. For these reasons, many computer languages are designed to conquer the difficulties between the connections of controlled hardware, software and the different operating systems,
which the traditional languages can not handle easily.Those new computer languages such as JavaScript, VB Scripts, Borland C++ Builder, Visual Basic and LabVIEW etc. are suitable for the development of software applications. In the research of VI, the Borland C++ Builder and LabVIEW languages have been widely used. The Borland C++ Builder language has the inherent merits of the visualization and the objectoriented programming and is powerful in the integration of hardware and software. It is almost a non-constrained language. LabVIEW is a data-flow- and graphic-based language; this language is very suitable for designing a man-machine interface. LabVIEW interacts with the users in two separate forms: 1) block diagrams, where the data flow and control function can be designed, and 2) front panel, in which switches, counters and graphs can be displayed and accessed by direct cursor manua control.
In this paper, a PC-based VI for power analyzer is developed. Instead of theoretical research, a practical VI that can be integrated into existent VI is developed. The functions of power analyzer developed in this paper are the harmonic analyzer and instantaneous power measurement. Some sub-VIS for the power analyzer are developed and all sub-VIs developed in the paper are free for non-commercial use.
2.virtual Instrument Architecture
The hardware architecture of the proposed VI is shown in Fig. 1. The PCI-6024E of National Instruments and a PentiumⅡ (350) PC are used as the data acquisition I/O device and VI terminal PC respectively.
Fig. 2 shows the front panel of the power analyzer.From Fig. 2, it can be seen that this VI can be a generalized oscilloscope with two power analyzer functions, they are harmonic analyzer and power measurement. The oscilloscope provides four channels for data acquisition, data save, and waveform display. It also has two channels to read data files, which were saved before. When this oscilloscope is employed as a power analyzer, users can utilize the voltage channel and current channel as shown in the bottom of Fig. 2 to decide which channel will be the voltage samples and current samples, respectively.
Fig.3 shows the block diagram of the proposed VI.A block diagram is composed of nodes, terminals and wire. Nodes are program execution elements; they can be analogies to statements, sub-VIS, functions, and subroutines in text-based programming languages.Terminals are ports through which data passes between the block diagram and the front panel or between nodes of the block diagram. Terminals are analogous to parameters and constants. Wires are data paths between terminals; data can flow in only one direction, from a source terminal to one or more destination terminals.Different wire patterns represent different data types. In this paper, in order to simplify the figure expression, we use to represent an array and to represent a calar. For example, a sub-VI DAQ, which is designed to choose the input channels and output waveforms, is eveloped for the oscilloscope as shown in Fig. 4. In Fig.4, it can be seen that the sub-VI has 10 terminals. 6 erminals, which are channels A-D, number of samples nd scan rate, are used for data input, and 4 terminals,which are waveforms A-D are used for waveform outputs. The inputs of number of samples and scan rate are used to program the data acquisition device.
Fig. 4: The Node Terminals of sub-VI DAQ
The principle that governs a LabVIEW program execution is called data flow. A node executes only when data is available at all its input terminals and supplies data to all of its output terminals. When it finishes executing, data passes immediately ftom source to destination terminals.
3. Power Analyzer Functions
Section 2 presents the basic fimctions of the proposed power analyzer, and it is used as an oscilloscope. In this section, the advanced functions of the power analyzer including the harmonic analyzer and power measurement are described in detail. The
theoretical background of a power analyzer can be found in [8-14], and is not shown here.
Harmonic Analyzer
In order to develop a Harmonic Analyzer (HA) VI,the following sub-VIs need to be designed first.Harmonic Components (HC): The sub-VI HC is designed to execute harmonic analysis. Its node terminals are shown in Fig. 5. In this sub-VI, we use the
Fast Fourier Transform (FFT) to process the sampled data and display the harmonic spectrum. Harmonic frequency and harmonic current of each order can be obtained easily.
Total Harmonic Distortion (THD(%)): The sub-VI THD(%)is designed to calculate the THD of the sampled data. Its node terminals are shown in Fig. 6. If the harmonic currents have been obtained from the sub-VIHC, then the THD of the sampled data can be calculated.
Frequency Analysis (FA): The sub-VI FA is designed to find the system frequency. Its node terminals are shown in Fig. 7. By integrating the data of number of samples,scan rate and sampled signal, the system frequency can be obtained.
By using the sub-VIs developed above, we can design the block diagram of VI HA just like the wiring of an IC. The block diagram of the VI HA is shown in Fig.8 that can be used like a 9-pin software chip. The node terminals of this VI are shown in Fig. 9.
In order to develop a Power Measurement (PM) VI,the following sub-VIs need to be designed first.Instantaneous Power (IP) measurement: The sub-VI IP is designed to calculate the instantaneous power and output its waveform. Its node terminals are shown in Fig. 10.The input terminals are voltage samples and current samples, and the output terminal is the instantaneous power waveform
Average Power (AP) measurement: The sub-VI AP is designed to calculate the average power. Its node terminals are shown in Fig. 11. By summing the instantaneous power value calculated from sub-VI IP, the average power can be obtained.
Power Factor (PF) calculation: The sub-VI IP is designed to calculate the power factor and power angle. Its node terminals are shown in Fig. 12. Using the voltage
samples, current samples, scan rate and system fiequency obtained from the sub-VI FA, the power angle and power factor can be obtained.
By using the sub-VI developed above, we can design the block diagram of VI PM like a 9-pin chip as shown in Fig. 13. The node terminals of this VI are shown in Fig. 14.
By utilizing the developed sub-VIs as software ICs,we can develop the power analyzer very efficient. The only work needs to be done is to connect wires between
the sub-VIS, and then power analyzer functions such as the harmonic analyzer and instantaneous measurement can be obtained easily. The procedure is very efficient, practical and suitable for industrial uses and the developed sub-VIS are very useful for power analyzer developments.
4. Experimental Results
Many experiments have been conducted to make sure that the proposed VI can be applied to real power systems. Only some simple experimental results are presented here. Using the data samples as shown in Fig.2 and choosing the Channel A as voltage samples and Channel B as current samples, the results of the harmonic analysis for current samples and the power measurement are shown in Fig. 15 and 16, respectively.From Fig. 15, it can be clearly seen that the THD, system frequency and harmonic spectrum of each order are displayed. The corresponding harmonic current and harmonic fiequency of each order are also shown in the bottom of Fig. 15. The voltage waveform, current waveform and instantaneous power waveform are all shown in Fig. 16. The power factor and power angle can also found in Fig. 16.
5. Conclusion and Discussion
A PC-based VI for power analyzer is proposed in this paper. Instead of theoretical research, this paper presents a very practical research. Some sub-VIS for power analyzer are developed in this paper, it can not only used in the future research, but also for the applications of industry and academic research.Comparing with the conventional instrument, we can find that a VI has the following advantages:
User defines the functions of the instrument.
Sub-VI can be reused by other applications:
Development speed can be accelerated.
Connections between different workbench instrument .
Costs for research and design can be reduced.would be easier.
Eventually, much more sub-VIS, such as the Wavelet Transform based harmonic analyzer and voltage flicker detector, which accomplish more complicated functions will be developed in the future research.
6. Acknowledgement
This paper was sponsored by National Science Council, Taiwan, R. 0. C. (NSC 89-2213-E-230-019-)
7. References.
[1] M. Santori, “An Instrument that Isn’t Really(Laboratory Virtual Instrument Engineering Workbench) IEEE Spectrum, Volume: 27 8, pp.
[2] H. J. W. Spoelder, “Virtual Instrumentation and Virtual Environments,” IEEE Instrumentation &Measurement Magazine, Vol. 2, No. 3, Sept. 1999,
[3] L. Cristaldi, A. Ferrero, and V. Piuri “Programmable instruments, virtual instruments, and distributed measurement systems: what is really useful, innovative and technically sound?,” IEEE Instrumentation & Measurement Magazine, Vol. 2,
No. 3, Sept. 1999, pp. 20 -27.
[4] “LabVIEW User Manual,” National Instrument,1996.
[5] Foster, K.R., “New Math for LabVIEW,” IEEE Spectrum, Vol. 34 6, June 1997, pp. 66-66.
[6] A. Ferrero and V. Piuri, “A Simulation Tool for Virtual Laboratory Experiments in a WWW environment,” IEEE Trans. on Instrumentation and Measurement, Vol. 48, No. 3, pp. 741-746, June 1999.
[7] House, R., “Choosing the Right Software for Data Acquisition” IEEE Spectrum Vol. 32, No. 5, May
[8] Cristaldi, L. and Ferrero, A. Harmonic, “Power Flow Analysis for‘ the Measurement of the Electric Power Quality,” IEEE Trans. on Instrumentation and Measurement, Vol. 44 3, June 1995, pp.683 -685
[9] Cristaldi, L. and Ferrero, A., “A Method and Related Digital Instrument for the Measurement of the Electric Power Quality” IEEE Trans. on Power Delivery, Vol. 10 3, July 1995, pp. 1183 -1 189
[10] J. Arrilliaga, D. A. Bradley, P. S. Bodger, “Power System Harmonics,” John Wiley and Sons, New York, 1985.
[11] Benton, J.S., ”Virtual Instrument Measures Harmonic Filter Duty,” IEEE Computer Applications in Power, Vol. 8 4, Oct. 1995, pp. 43 -46
[12] S. Nuccio, “A Digital Instrument for Measurement of Voltage Flicker,” IEEE Instrumentation and Measurement Technology Conference, pp. 28 1-284, 1997.
[13] Caldara, S., Nuccio, S. and Spataro, C., “A Viea1 Instrument for Measurement of Flicker,” IEEE Trans. on Instrumentation and Measurement, Vol.
[14] Zrudsky, D.R. and Pichler, J.M., “Virtual Instrument for Instantaneous Power
Measurements,” IEEE Trans. on Instrumentation and Measurement, Vol. 41 4, Aug. 1992, pp. 528 -534.47 5, Oct. 1998, pp. 1155 -1 158.Jen-Hao Teng was born in 1969 in Tainan, Taiwan. He received his BS, MS and Ph.D. degrees in electrical engineering from the National Sun Yat-Sen University in 199 1, 1993 and 1996 respectively. He has been with the I-Shou University, Taiwan, since 1998. His current research interests are Distribution Automation, Power Quality and Virtual Instruments.Shun-Yu Chan received his Ph.D. degree in electrical engineering from National Sun Yat-Sen University in 1998. He is now teaching in Cheng-Shiu Institute of Technology. His current research interests are Virtual Instruments and Power System Quality. Jin-Chang Lee is currently pursuing his MS degree in the I-Shou University. His current research interest is Virtual Instruments.Roy Lee is an undergraduate student in I-Shou University. He is very interesting in the design of Virtual.