Electric energy quality analysis method and system
Technical Field
The invention relates to the field of power monitoring, in particular to a power quality analysis method and a power quality analysis system.
Background
Electric energy is one of the most widely used energy forms in the society today, and the development and utilization level of the electric energy is directly related to the development effectiveness of the country. In order to improve the use efficiency of electric energy, better serve public life and meet the requirements of social production, it is important to conduct deep analysis on the electric energy quality.
Along with the rapid development of renewable energy sources such as wind energy, water energy and solar energy, the new energy sources bring about diversification for energy supply, but have the characteristics of inherent randomness, intermittence, volatility, non-schedulability and the like, so that the quality of the electric energy obtained by conversion is affected to a certain extent. Therefore, it is critical to perform quality analysis on the electric energy converted from the new energy sources to ensure safe and controllable use of the electric energy.
In addition, the structure and load characteristics of the power grid have undergone significant changes in face of increasing electrical energy demands, as well as rapid developments in new energy generation and grid-tie technologies. The coexistence of alternating current and direct current in an electrical environment and the existence of special loads may cause problems such as harmonic interference, voltage fluctuation, imbalance of three-phase voltages, etc. These problems make accurate measurement of the power quality parameters in the grid difficult.
Disclosure of Invention
The invention aims to solve the problem of inaccurate measurement of power quality parameters in a power grid, and provides a power quality analysis method, which comprises the following steps of:
S1, receiving electric energy monitoring message data by using an SPI interface in a DMA mode, and temporarily storing the received message data into a RAM;
s2, carrying out wavelet transformation and FFT algorithm processing on voltage and current signals of the electric energy monitoring message data;
And S3, analyzing the electric energy quality parameters of the power grid, including voltage, frequency, voltage sag/dip, short interruption times, short and long-term flicker, harmonic waves and inter-harmonic waves, and displaying in a visual mode.
Further, S1 is specifically:
s11, initializing an SPI interface, and configuring the SPI interface as a data receiving mode;
S12, waiting for DMA interrupt triggering and finishing data receiving;
S13, verifying the received data;
s14, temporarily storing the verified message data into the RAM.
Further, every 16 frames of data are stored in the array, and the 16 frames of data are stored for 4096-point FFT.
Further, S2 is specifically:
S21, analyzing the message data to obtain a required voltage sampling value;
s22, performing wavelet transformation on the acquired voltage and current signals;
S23, performing FFT algorithm processing on the data after the wavelet transformation processing, and converting the time domain data into a frequency domain.
Further, the frequency domain resolution is improved by decomposing the sampled voltage or current signal into high frequency and low frequency components using wavelet transform, expressed as:
wherein, psi j,k (x) represents the wavelet function related to the parameters j, k, S j is a scale variable, j is a parameter of a frequency domain, k is a translation variable, j, k epsilon Z indicates that the wavelet transformed according to j, k belongs to a wavelet function set, Z indicates a parameter change set in the wavelet function set, j0 is an arbitrary starting point in the wavelet function set, c j0 (k) indicates an approximation coefficient, d j (k) indicates a fine coefficient,Representing a scale function, f (x) represents a sampled voltage or current signal, and x represents a time variable.
Further, S3 is specifically:
S31, extracting frequency domain amplitude information from FFT calculation results, wherein the integral multiple position of fundamental frequency is harmonic wave, and the rest is inter-harmonic wave, monitoring the harmonic voltage and harmonic current content rate for the harmonic wave, the harmonic current effective value for the harmonic wave, and calculating the voltage and current harmonic total harmonic distortion rate, wherein the inter-harmonic voltage and the harmonic current content rate for the inter-harmonic wave are 0.5-49.5 times, and the harmonic current effective value is 0.5-49.5 times;
S32, performing square root operation on the voltage value to obtain an effective value of the voltage, calculating an average value once for every 16 frame data received to obtain an effective average value of the voltage, and dividing the absolute value of the difference between the effective value of the voltage and 220V by 220V to obtain a deviation value of the voltage;
S33, acquiring signal frequency, and calculating data of 16 frames received each time as a frequency average value;
s34, monitoring voltage abnormality, if the abnormal condition is recovered within 10ms to 1min, recording the abnormal condition as one time, otherwise, not considering the abnormal condition as one time;
S35, flicker monitoring, namely calculating according to the requirements of IEC-61000-4-15 to obtain an instantaneous flicker value taking half cycle as a time interval, obtaining a short flicker value every 10 minutes and obtaining a flicker value every two hours, specifically calculating root mean square values of two half cycles of each frame of data, storing and then carrying out 512-point FFT (fast Fourier transform), calculating the instantaneous flicker value according to FFT results, accumulating 120 times of short flicker values, and accumulating 12 times of long flicker values;
And S36, after the data is processed and calculated, packaging the data, transmitting the data through a UART protocol, analyzing the packaged data, and displaying the data graphically.
Further, the calculation formula of the harmonic voltage content is as follows:
Wherein HRuh denotes a harmonic voltage content, v n denotes an n-order harmonic voltage value, and v 1 denotes a fundamental voltage value.
The invention also provides a power quality analysis system, which comprises:
The data receiving unit is used for receiving the electric energy monitoring message data by using an SPI interface in a DMA mode and temporarily storing the received message data into the RAM;
The signal processing unit is used for carrying out wavelet transformation and FFT algorithm processing on the voltage and current signals of the electric energy monitoring message data;
the parameter analysis unit is used for analyzing the electric energy quality parameters of the power grid, including voltage, frequency, voltage sag/dip, short interruption times, short and long flicker, harmonic waves and inter-harmonic waves, and displaying the parameters in a visual mode.
The technical scheme provided by the invention has the beneficial effects that:
The method analyzes the data of the power grid by adopting the algorithm combining wavelet transformation and FFT, can accurately capture transient characteristics and non-stationary characteristics of signals, ensures that the measured parameter error is smaller, and improves the accuracy of electric energy quality analysis.
Drawings
FIG. 1 is a flow chart of a power quality analysis method according to an embodiment of the present invention;
FIG. 2 is a wavelet transform and FFT computation flow chart of an embodiment of the invention;
FIG. 3 is a flowchart of a harmonic analysis calculation according to an embodiment of the present invention;
FIG. 4 is a flow chart of frequency deviation calculation according to an embodiment of the present invention;
FIG. 5 is a short-time flicker calculation flow chart of an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be further described with reference to the accompanying drawings.
The flow chart of the power quality analysis method according to the embodiment of the invention is shown in fig. 1, and specifically comprises the following steps:
s1, receiving electric energy monitoring message data in a DMA mode by utilizing an SPI interface, and temporarily storing the received message data into a RAM.
The method comprises the following steps:
s11, initializing an SPI interface, and configuring the SPI interface into a data receiving mode.
S12, waiting for DMA interrupt triggering, receiving 1546 data, namely triggering interrupt, and completing data receiving.
S13, verifying the frame header, check bit, frame tail and the like of the received data, and if the data packet information does not accord with the expectation, indicating that the data packet may be damaged or communication errors occur.
S14, temporarily storing the verified message data into the RAM.
Specifically, the device for data receiving and detecting in the embodiment of the invention is based on ARM Cortex-M4 kernel design and is used for efficiently monitoring the electric energy quality parameters in the power grid. The equipment is suitable for receiving the power grid cycle data provided by the single-phase intelligent Internet of things electric energy meter in an SPI communication mode, and realizes real-time monitoring of key parameters such as voltage deviation, frequency deviation, harmonic wave and the like.
S2, carrying out wavelet transformation and FFT algorithm processing on the voltage and current signals of the electric energy monitoring message data. The wavelet transform is used to accurately capture transient characteristics of the signal, while the FFT converts time domain data into the frequency domain for analysis of parameters such as harmonics and inter-harmonics. In the embodiment of the invention, every 16 frames of data are stored in an array, and the stored 16 frames of data are subjected to 4096-point FFT.
The method comprises the following steps:
S21, analyzing the message data to obtain a required voltage sampling value;
S22, performing wavelet transformation on the acquired voltage and current signals to extract detailed characteristics of the signals, including transient signals and non-stationary characteristics. And (3) designing a wavelet transformation algorithm by using MATLAB, converting an M file of the MATLAB into a C code form by adopting MATLAB Coder tools, importing the C code form into an engineering file, and calling a wavelet transformation function by a main program to process a sampling signal. The frequency domain resolution is increased stepwise by repeatedly decomposing the sampled voltage or current signal into high frequency and low frequency components using wavelet transform. Initially, the signal is split into detail (high frequency) and approximation (low frequency) by the orthogonal wavelet basis. The approximated portion is then decomposed again, resulting in a finer decomposition level. Finer details can be obtained in the frequency domain each time a one-level decomposition is added. Wavelet packet decomposition is further developed based on discrete wavelet transforms, which are nested for each layer. The wavelet function is as follows:
The original signal is recovered:
wherein, psi j,k (x) represents the wavelet function related to the parameters j, k, S j is a scale variable, j is a parameter e Z of a frequency domain, which indicates that the wavelet transformed according to j, k belongs to a wavelet function set, Z indicates a parameter change set in the wavelet function set,
S23, carrying out FFT algorithm processing on the data after the wavelet transformation processing, and converting the time domain data into a frequency domain so as to analyze parameters such as harmonic waves, inter-harmonic waves and the like.
Referring to fig. 2, fig. 2 is a flowchart of wavelet transform and FFT computation according to an embodiment of the present invention, during data processing, a wavelet packet transform method is performed to decompose an acquired signal, first, system initialization and selection of a wavelet packet transform basis function are performed, and then an analysis scale is determined and a sampled signal feature value is extracted. Then, the system checks whether the waveform changes, if so, records the changing time and extracts stable signals before and after the changing to carry out FFT processing, and finally, the whole processing flow is ended.
Referring to fig. 3, fig. 3 is a flowchart illustrating harmonic analysis calculation according to an embodiment of the present invention. The system stores every 16 frames of data in an array, and performs a 4096-point Fast Fourier Transform (FFT) on these data each time the array is full. Through the result of the FFT, the system can extract amplitude information in the frequency domain, where the amplitudes at integer multiples of the fundamental frequency are identified as harmonics, while the others are inter-harmonics.
And S3, analyzing the electric energy quality parameters of the power grid, including voltage, frequency, voltage sag/dip, short interruption times, short and long-term flicker, harmonic waves and inter-harmonic waves, and displaying in a visual mode.
The method comprises the following steps:
S31, extracting frequency domain amplitude information from FFT calculation results, wherein the integral multiple position of fundamental wave frequency is harmonic wave, the rest is inter-harmonic wave, monitoring the harmonic voltage and harmonic current content rate for the harmonic wave to be 2-50 times, the harmonic current effective value to be 2-50 times, calculating the voltage and current harmonic total harmonic distortion rate, and monitoring the inter-harmonic voltage and harmonic current content to be 0.5-49.5 times and the harmonic current effective value to be 0.5-49.5 times.
The calculation formula of the harmonic voltage content is as follows:
Wherein HRuh denotes a harmonic voltage content, v n denotes an n-order harmonic voltage value, and v 1 denotes a fundamental voltage value.
S32, calculating an effective value, an effective average value and deviation of the voltage, namely performing square root operation on the voltage value to obtain the effective value of the voltage, calculating the average value once every 16 frames of data are received to obtain the effective average value of the voltage, and calculating the absolute value of the difference between the effective value of the voltage and 220V to obtain the deviation value of the voltage by dividing 220V.
S33, acquiring signal frequency, and calculating data of 16 frames received each time as a frequency average value. Referring to fig. 4, fig. 4 is a flowchart of frequency and frequency deviation calculation according to an embodiment of the present invention. The system takes the signal frequency through input capture with falling edge disruption and calculates the average of the frequency after each 16 frames of data received to ensure accuracy of the measurement.
S34, monitoring voltage abnormality, if the abnormal condition is recovered within 10ms to 1min, recording the abnormal condition as one time, otherwise, not considering the abnormal condition as one time.
S35, flicker monitoring, namely calculating according to the requirements of IEC-61000-4-15 to obtain an instantaneous flicker value taking half cycle as a time interval, obtaining a short flicker value every 10 minutes and obtaining a flicker value every two hours, specifically calculating root mean square values of two half cycles of each frame of data, storing, then carrying out 512-point FFT, calculating the instantaneous flicker value according to FFT results, accumulating 120 times of short flicker values, and accumulating 12 times of long flicker values.
Referring to fig. 5, fig. 5 is a short-time flicker calculation flowchart according to an embodiment of the present invention. When the system processes each frame of data, root mean square values for two half cycles are first calculated and stored. These stored data are then used to perform 512-point FFTs. Based on the result of the FFT, the system further calculates an instantaneous flicker value. When 120 times of data are accumulated, the system calculates a short-time flicker value, and when 12 times of data are accumulated, a long-time flicker value is calculated.
And S36, after the data is processed and calculated, packaging the data, transmitting the data through a UART protocol, analyzing the packaged data, and displaying the data graphically.
The embodiment of the invention also comprises a power quality analysis system, which is characterized by comprising:
the data receiving unit is used for receiving the electric energy monitoring message data by using the SPI interface in a DMA mode and temporarily storing the received message data into the RAM.
And the signal processing unit is used for carrying out wavelet transformation and FFT algorithm processing on the voltage and current signals of the electric energy monitoring message data.
The parameter analysis unit is used for analyzing the electric energy quality parameters of the power grid, including voltage, frequency, voltage sag/dip, short interruption times, short and long flicker, harmonic waves and inter-harmonic waves, and displaying the parameters in a visual mode.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.