Design of a comprehensive power quality testing system
2026-04-06 07:24:35··#1
With the widespread application of power electronic equipment, power quality issues in power systems have attracted the attention of relevant departments worldwide. Many countries have formulated standards to limit power harmonics and negative sequence currents, and my country has also formulated relevant standards. In the design of power supply systems, it is essential to reasonably estimate harmonics, load current levels, and power factors and take corresponding measures (such as adding filters and reactive power compensation devices). The design of a comprehensive power quality testing system is significant for improving design levels, exploring power quality improvement schemes, and understanding power load patterns. [b]1 Hardware Design[/b] Traditional circuit testing is accomplished by combining discrete instruments, such as power devices (active power meters, reactive power meters, power factor meters, and electricity meters), waveform monitoring devices (analog or digital oscilloscopes, waveform recorders), harmonic analysis devices, and negative sequence devices. The main drawbacks of this testing method are the large size of the devices, low automation, and the difficulty in performing relevant analysis due to the lack of centralized data. The new generation of testing systems, based on computer control, automated testing platforms, and virtual instrument technology, consists of sensors, signal acquisition, multiplexers, analog-to-digital converters, interface circuits, and a computer, arranged in the order of information processing. This overcomes the shortcomings of traditional testing methods. Currently, suitable hardware for power quality testing includes PCs with acquisition cards, GP-IP systems, CAMAC systems, and VXI systems. Among these, PCs with acquisition cards offer significant advantages such as simple structure, low cost, and short development cycle, making them particularly suitable for applications with fewer than 32 analog channels and requiring portability. GP-IP, CAMAC, and VXI systems are widely used standard interface systems worldwide, easily integrating into a large, multifunctional comprehensive testing system when there are many channels and a considerable number of interface-equipped testing instruments are available. When the analog quantity under test is high voltage or high current, it typically needs to be converted into a low-level signal suitable for an analog-to-digital converter (ADC). The existing voltage transformers (PTs) and current transformers (CTs) in the substation convert high voltage and high current into 100V voltage and 5A current signals, and the accuracy of their conversion meets the test requirements [3, 4]. Therefore, the only work to be done is to design voltage-to-voltage and current-to-voltage linear conversion circuits and a multi-channel synchronous acquisition system. The analog signal acquisition module is shown in Figure 1. This module is divided into two parts: signal sensing and data acquisition. The linear conversion of voltage signals consists of voltage transformers and voltage sensors (PS), and the linear conversion of current signals consists of current transformers and current sensors (CS). [b]2 Software Design[/b] This section only discusses the software design based on the PC + acquisition card hardware solution. To facilitate user use and make the analysis results as intuitive and clear as possible, Windows 95 is selected as the software platform. Practice has shown that Windows 95's graphical user interface (GUI), multithreading and multitasking, inter-process communication (DDE) and other technologies are very beneficial to completing the comprehensive test. [b](1) System Functions[/b] The software can be divided into steady-state data acquisition, data processing, and transient waveform recording according to its functions. Data processing can be divided into real-time processing and offline analysis according to the processing time. Real-time processing includes Fast Fourier Transform (FFT) operation, negative sequence decomposition, power calculation, and mathematical statistics on the time series. According to international regulations, statistical parameters include harmonic amplitude, average value of voltage imbalance, root mean square value, 95% probability value, and corresponding pass rate, etc. Calculate the power factor, average power and root mean square value, load factor, etc. under various reactive power metering methods (return without metering, return with metering, return with positive metering). [align=center]Figure 1. Diagram of analog quantity acquisition circuit[/align][align=left] Offline analysis is mainly used to analyze the load change pattern. The content includes: displaying and printing the historical curves of fundamental amplitude, harmonic amplitude, comprehensive distortion rate, voltage imbalance, and power; scatter plot of harmonic changes; calculation of the complex average value and probability distribution of harmonics; correlation analysis of fundamental, harmonic and negative sequence; power spectrum estimation of load process; identification of statistical model and load forecast; correlation analysis of system frequency with load active power and reactive power and identification of load model. There are two working modes for transient waveform recording: manual triggering and automatic triggering. Manual triggering is to pre-set the signal and recording time length of the waveform to be recorded and start it by pressing a button or a button on the user interface. Automatic triggering has various modes, such as timing, zero crossing, limit crossing, spike, etc., which are collectively referred to as event triggering. [b](2) Software implementation[/b] The software of the test system generally does not exceed 20,000 lines, involving low-level I/O operations, database, mathematical operations, graphical user interface and reports, etc. Developing with languages such as VB, C or C++, or Delphi is not conducive to improving speed. In developing the main control program and offline analysis, the author used LabWindows CVI configuration software from National Instruments (NI). Real-time processing was implemented using a dynamic link library (DLL) built with MSVC using an object-oriented approach. Database management and reporting were implemented separately using MSVB, which exchanges data with the main control program through data files on a RAM disk. The final software structure is shown in Figure 2. It integrates steady-state process data recording, automatic transient waveform capture, transient analysis, online load forecasting, data display, and reporting functions. The key technologies in the software design are the Windows 95 client/server strategy, DDE, and OOP technologies. The software consists of four programs: an automatic test program (BZCSEV), a user interface program (UI), a steady-state data analysis program (ANYSPD), and a transient data analysis program (ANYTPD). The programs communicate and exchange data using DDE, with BZCSEV acting as the server and UI, ANYSPD, and ANYTPD acting as clients. The functions of each program are described below. [align=left] Figure 2 Software Composition Block Diagram ①UI completes the display and reporting of real-time data, historical data and transient data, input of user (USER1) commands and input of substation information. UI is designed for non-professionals on site and its functions are relatively simple. ②BZCAVER completes the acquisition card driver (DACQDRV), automatic data recording (MONITER), statistical analysis (STAT), data management (DBM) and response to customer requests (ACQ). ③ANYSPD completes further analysis of steady-state process data. ④ANYTPD completes analysis of transient data. Users of ANYSPD and ANYTPD are generally professionals. [b]3 Algorithm Discussion (1) Data Acquisition[/b] The acquisition card (ADC) exchanges data with the PC through the I/O interface. The communication between the PC and the ADC can be done by polling or interrupt. In the Windows 95 environment, the interrupt method can be used to improve system performance, but hardware device drivers need to be developed. The device drivers in Windows 95 use the virtual device (VXD) mechanism. Developing VXD requires programmers to have a deep understanding of the Windows 95 operating mechanism, and the software is extremely expensive. Furthermore, there is very little information available about VXD in China, making it quite difficult for individuals to develop VXD in a short period. When using the polling method, the CPU spends time waiting, causing a performance degradation. Fortunately, Windows 95 supports multithreading, so continuous sampling can still be achieved using the polling method. The method involves using RAM as a buffer on the acquisition card, typically employing a first-in, first-out (FIFO) mechanism and auxiliary flags (empty, full, and half-full FIFO). A separate thread in the software handles the polling and reading of data from the ADC, with the acquisition thread exchanging data with the main thread through a double buffer. The double buffer consists of two arrays of equal size, BuffA and BuffB, and a flag, represented in C++ as struct { shortint *wptr; // Storage pointer shortint *rptr; // Data retrieval pointer BOOLAflag; // Buffer A full/empty BOOLABflag; // Buffer B full/empty intbuffsize; // Buffer size shortint *buffA; // Buffer A shortint *buffB; // Buffer B } The program works as follows: the data acquisition thread reads data from the acquisition card's FIFO, writes it sequentially to Buff A and BuffB through the storage pointer wptr, and sets Aflag and Bflag when they are full; the main thread continuously queries Aflag and Bflag, reads data through the data retrieval pointer rptr when they are set, and resets Aflag and Bflag after reading. To achieve synchronization, it is necessary to understand the speed of the machine's I/O operations, calculations, and disk operations, and to reasonably select the size of the buff-Size and set the priority of the two threads. [b] (2) Event Trigger[/b] To achieve automatic recording of transient processes, it is necessary to design a more comprehensive event triggering logic. Here, based on the characteristics of power system operation, several methods for automatic triggering through voltage and current waveform characteristics are proposed. Let the sampled signal be x(n) (n = 1, 2, ..., N; N = 2p), x(n) is a real number, and the selection of p depends on the sampling frequency and the length of the data window. After FFT transformation, it becomes X[k] (k = 1, 2, ..., N), X[k] is a complex number, let Am(X[k]) be the amplitude of X[k], and Arg(X[k]) be the angle of X[k]. There are three triggering methods. ① Energy discrimination method to determine whether the signal energy exceeds the given range. Let the energy of the signal be E, then Emin and Emax in the formula depend on the specific situation. This method is suitable for capturing transient processes such as overload, short-circuit faults, and overvoltage. ② Harmonic content discrimination method: Check the magnitude of the harmonic content rate HR or the comprehensive distortion rate THD. Triggering conditions are as follows: HR[k] > HRmax[k], THD > THDmax (3). The selection of HRmax[k] and THDmax can refer to the national standard. This method is particularly effective for capturing transient processes with very obvious waveform characteristics, such as the second harmonic of inrush current and the DC component in short-circuit faults. ③ Correlation coefficient discrimination method Considering the case of severe harmonics, when the system is working stably, the waveform shape of the signal is close to its characteristic waveform (equivalent to the statistical mean) and does not change much with time. However, after the system is disturbed, due to the effect of inertia, the signal energy will not change much. Judging from the change of energy and the content of a certain harmonic alone cannot make timely, accurate and comprehensive judgments. Of course, this problem can be solved by post-triggering, that is, recording the waveform for a longer period of time, but doing so increases the investment in the system and causes the complexity of programming. If the signal waveform is regarded as a point (or vector) in the state space, then the characteristic waveform is equivalent to the center position of the space. The correlation coefficient between the signal waveform and the characteristic waveform at a certain moment is the angle between the vectors. By examining the size of this angle, it can be determined whether the system is in a transient process. In order to save computation time, frequency domain data is used to calculate the correlation coefficient. [/align][align=left] In the formula, X[k] is the conjugate of X[k], X0[k] is the conjugate of X0[k], and φ = cos⁻¹(C) is the angle. The triggering condition is φ > φmax (5) Where φmax is no greater than 45°. 4. Conclusion Applying modern digital signal processing and computer technology is a practical and feasible method for comprehensive power quality testing. Satisfactory results can be obtained by using real-time synchronous sampling technology and Fourier analysis to extract steady-state harmonics, negative sequence, and power parameters. Hybrid programming in the Windows 95 environment is suitable for long-term data recording and analysis.