Application of FFT algorithm based on DSP in reactive power compensation controller

Publisher:支持中文Latest update time:2010-10-23 Source: 现代电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

In the power system, reactive power is an important factor affecting voltage stability, and reactive power compensation is one of the effective measures to ensure efficient and reliable operation of the power system. To achieve the best effect of reactive compensation, active power and reactive power must be accurately measured. Based on the reactive power theory of non-sinusoidal periodic signals, this paper adopts the fast Fourier algorithm to measure active power and reactive power. Accurate calculation can effectively improve the switching accuracy and simplify the switching strategy, but its disadvantage is that the amount of calculation is large, and the calculation speed of the single-chip microcomputer system is far from meeting the requirements. However, the application of DSP solves the problem of large amount of calculation and slow calculation speed.

Fourier transform is based on synchronous sampling, which requires intercepting the signal in the entire cycle and sampling at strict equal intervals. Therefore, it is necessary to ensure that the sampled signal and the actual signal are strictly synchronized, that is, the sampling frequency is an integer multiple of the signal frequency. Otherwise, spectrum leakage will occur, causing errors in the Fourier transform results and affecting the measurement accuracy. Since the frequency of the power grid often fluctuates slightly, the above phenomenon is inevitable when a fixed sampling frequency is used. This paper adopts an improved method of software phase locking to reduce synchronization errors, that is, the number of sampling points is fixed, the DSP measures the power frequency period in a timely manner, and adaptively adjusts the sampling interval.

1 Synchronous sampling problem

Considering that the frequency of the system does not change very quickly, in order to adjust the sampling frequency in time with the change of the system power frequency, the count value corresponding to the previous cycle of the system frequency can be measured first (in units of DSP timer clock cycles), and then the count value TS of each sampling interval can be calculated in time according to the number of sampling points N per cycle. Sampling can be performed with TS as the cycle to achieve timely tracking of the sampling frequency. To achieve this process, the power frequency voltage is first shaped into a square wave and sent to the capture pin CAP1 of the TMS320F2812 capture unit. The capture unit captures the rising or falling edge of the square wave, measures the time difference between the two jumps in an interrupt mode, and obtains the timely power frequency cycle count value. The sampling interval is calculated, and TS is used as the time interval to adjust the period register value of the timer, modify the sampling interval of the next cycle, set the software timer interrupt, and preset the time to enter the interrupt next time. Data acquisition control is performed in the software timer interrupt to complete tracking sampling.

The improved method is simple to implement, highly timely, has an unlimited scope of application, and adds very little workload. The improved method is applied to the reactive power compensation control system to achieve software phase locking, which enables 64-point sampling to be completed within a full cycle regardless of the frequency fluctuation of the power grid, thereby reducing leakage errors, ensuring the accuracy of calculations, and effectively reducing
the impact of power system frequency changes on measurement accuracy.

This method of calculating the frequency by measuring the time length between successive zero crossings of the signal waveform can be easily implemented through the hardware function provided by TMS320F2812. The capture unit of the DSP automatically records the time of the jump without the intervention of the processor, which has high real-time performance and high recording accuracy. However, this method is easily affected by harmonics and random interference. Considering that most of the harmonics in the power system are integer harmonics, which have little effect on the zero crossing, the system adopts this frequency measurement method.

2 FFT algorithm for power measurement

Fast Fourier transform is used to detect and process electrical parameters in real time to achieve the best effect of reactive power compensation. The controller simultaneously samples three-phase voltage and three-phase current, and uses the fast Fourier transform (FFT) algorithm to measure the electrical parameters in the power grid in real time. Only three FFTs are needed to calculate the FFT results of three-phase voltage and three-phase current. The measurement algorithm of one phase voltage and current is as follows:

The voltage sequence {u(n)} and current sequence {i(n)} of the N points are sampled simultaneously, and the two constitute a complex discrete time series:


Where: X(K) and X*(NK) are the DFT transforms of x(n) and x*(n) respectively. When the system processes data, it first performs FFT transform on equation (2) to obtain X(K), then obtains X*(NK), and finally uses the transformation method of equation (4) to obtain the spectrum of voltage and current.

Assume UK is the vector representation of the Kth harmonic of u(t); IK is the vector representation of the Kth harmonic of i(t), then the voltage and current vectors have the following relationship with their spectrum:

When K=0, X(NK)=X(N)=X(O), which implies periodicity. The DC component is not considered here. In this way, the effective value (UK, IK) and active power (PK) of the harmonic voltage and current of each phase (1≤K≤N/2-1) can be derived as follows:

Where: XR(K) and XI(K) are the real and imaginary parts of X(K), respectively, and XR(NK) and XI(NK) are the real and imaginary parts of X(NK), respectively. Then the effective value of the voltage and current of this phase is:


In the formula: L = N/2-1, in this way, the system obtains the parameters of this phase. The processing method of the parameters of the other two phases is the same. The above is the calculation method for single-phase power. For three-phase power, there is:

Power Factor:

The calculation of voltage and current involves square, sum, division and square root. In the instruction system of TMS320F2812 , sum is easy to implement. For multiplication, TMS320F2812 has a dedicated hardware multiplier, and the effective execution time of the multiplication instruction is 1 CPU clock cycle. For division, there is no single-cycle division instruction. Division can be decomposed into a series of subtractions and shifts, which are implemented using subroutines. For square root, the DSP library function can be directly called in the assembly program.

Based on the above formula, the real-time voltage and reactive power can be calculated. This provides a basis for the comprehensive regulation of voltage and reactive power. From the above data processing process, it can be seen that after using the FFT algorithm to separate the DC component and the harmonics of the AC component, only the AC component is considered in the data processing process, thus eliminating the influence of DC drift in the test circuit on the measurement accuracy.

Using DSP for FFT calculation has the following advantages:

(1) Fast Fourier transform (FFT), used in signal analysis, processes complex time domain signals to obtain clearer frequency domain signals. In engineering applications, it has the characteristics of simplicity, accuracy, and speed. The control chip DSP has become the preferred processor for executing FFT with its own advantages such as pipeline operation and fast speed.
(2) Fast Fourier transform is a data processing method that is superior to ordinary Fourier transform. In this article, the voltage quantity is regarded as the real part and the current quantity is regarded as the imaginary part. Then, the two parts of the frequency quantity are separated by a formula, which doubles the operation speed and saves time.
(3) In Fourier transform, the quantity to be transformed is only an integer period, otherwise the accuracy of the transformed data will be reduced. Due to the algorithm, the fast Fourier transform has a false frequency phenomenon. After N groups of data are FFTed, N/2 frequency quantities are obtained. The other N/2 quantities are actually the repetition of the previous frequency quantities.

The relationship between the voltage and current vectors and their frequency spectrum can be used to obtain the initial voltage phase angle and current phase angle. The system uses the relationship between the fundamental wave (K=1) voltage and current initial phase angles a1 and b1 to determine the leading or lagging situation of the voltage and current, and assigns a "+" or "-" sign to the power factor cosφ, providing a basis for the judgment of switching capacitors.

3 Conclusion

Driven by the development of edge science such as power electronics and microelectronics, reactive power compensation technology has made great progress in the field of power systems. This paper uses DSP to perform FFT operations to achieve the tracking and measurement of the frequency of the input signal. The algorithm that calculates the sampling period according to the actual frequency solves the problem of synchronous sampling without increasing hardware investment. This improved method of software phase locking is simple to implement, has high real-time performance, and low computational workload. A three-phase power calculation method based on AC sampling and Fourier algorithm is introduced. This method can effectively eliminate the errors caused by harmonics in three-phase power measurement and improve measurement accuracy. In the design of reactive power compensation control system, software methods are used to achieve synchronous sampling, simplify hardware structure, and reduce costs.

Reference address:Application of FFT algorithm based on DSP in reactive power compensation controller

Previous article:Design of full attitude guidance instrument based on DSP and FPGA
Next article:PCB chip packaging welding method and process flow

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号