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.
Previous article:Design of full attitude guidance instrument based on DSP and FPGA
Next article:PCB chip packaging welding method and process flow
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Friends in Xi'an, please get out of this pit as soon as possible.
- Xianyu low-cost wireless digital microphone disassembly (Jerry solution)
- [Perf-V Review] + Solidification of Hummingbird Soft Core
- Read the good book "Electronic Engineer Self-study Handbook" + my impression
- Three-port network
- RSL10 drives ink screen
- GoKit Case Study: Gizwits IoT Development Platform’s Pet House Transformed into an Air Quality Detector
- Embedded licensing: why not and why not?
- I found a 1963 "Electron Tube Handbook"
- How to extract the effective value of fundamental wave and each harmonic in MATLAB?