Abstract : This paper first introduces the topology of an active power filter (APF), selecting a three-phase three-wire parallel structure as the research object, constructing a mathematical model and explaining its working principle. Accurate reactive power and harmonic current detection is a prerequisite for realizing the active power filter function. This paper introduces relevant current detection methods, providing a detailed derivation of the detection method based on reactive power theory and synchronous coordinate transformation theory, and deriving a new detection method using mathematical transformation. Digital control is one of the future trends in active power filter technology. Therefore, this paper designs the entire active power filter system in both hardware and software, using the MC56F8346 as the core. Hardware test circuits were built for the main components, and experimental studies were conducted. Combined with the control system software flow, major interrupt programs such as harmonic current detection and SVPWM were developed. Finally, simulation models of each part of the active power filter were built in the MATLAB/Simulink environment. Simulations were performed on the load current detection module and the compensation current control module, and the simulation results show that the built model meets the requirements of system reactive power compensation and harmonic suppression, and can achieve good compensation function.
Keywords : harmonic suppression, parallel voltage-type active power filter, instantaneous reactive power, digital processing chip (MC56F8346)
1 Introduction
Whether in industrial production or daily life, electricity has become the most widely used energy source in human society, and its application level is a major indicator of a country's development level. With scientific advancements, especially the development of power electronics technology, nonlinear loads such as power electronic devices are widely used in industrial control, thus enabling more efficient utilization of electrical energy. However, due to the nonlinearity, impulsiveness, and unbalanced power consumption of these loads, serious harmonic pollution has been caused to the power grid. Power electronic devices have replaced transformers as the main source of harmonics in the power grid. Overall, the injection of reactive current and harmonic current threatens the safe operation of the power grid and the normal use of electrical equipment. At the same time, modern industrial production and residential users' electrical equipment are highly sensitive to power quality, requiring high-quality power supply. Furthermore, the significance of reactive power compensation and harmonic suppression can be viewed from the perspective of controlling environmental pollution and protecting the green environment. It can be said that the compensation and suppression of reactive power and harmonic currents are receiving increasing attention, and research on the impact of power conversion devices on power grid harmonics and power factor is of great importance, thus becoming a hot topic in power electronics technology, power systems, and other fields. To address this issue, scholars both domestically and internationally have proposed various methods. However, based on current research and application, using active power filters (APFs) to compensate for and suppress reactive current and harmonic current is a feasible approach and an important future development trend.
Basic structure of 2APF
An APF mainly consists of two parts: the main circuit and the control circuit. The block diagram of an APF is shown in Figure 1.
When the grid charges the DC-side energy storage element, the APF main circuit operates as a rectifier; when generating compensation current, the main circuit operates as an inverter. The control circuit primarily calculates reactive and harmonic command currents, generates pulse control signals, and generates compensation currents. The command current calculation circuit detects the load current, mainly separating the reactive and harmonic current components to be compensated from the current of the object to be compensated based on relevant detection theories. The compensation current generating circuit uses the compensation current obtained from the command current calculation circuit as a reference signal and, through a certain control method, generates pulse signals to drive the power electronic devices.
This allows the device to be turned on or off, thereby controlling the main circuit to generate the actual compensation current.
Figure 1. APF structural block diagram
3. Voltage-type active filter principle
There are two types of main circuits for active power filters: current-source PWM inverter circuits and voltage-source PWM inverter circuits. Their function is to generate non-sinusoidal current to compensate for harmonic currents generated by nonlinear loads. While current-source active power filters have high reliability, they also have high losses and require a large inductor in parallel on the AC side, thus they are less commonly used in general applications. Voltage-source PWM converters have a large capacitor on their DC side; due to their portability and good characteristics, they are more widely used. The voltage-source structure used in this paper is illustrated in Figure 2.
Figure 2 Schematic diagram of parallel APF system
The presence of a nonlinear load in the circuit causes distortion of the power supply current waveform, resulting in reactive current and harmonic current components in the load current. The reactive and harmonic current detection section of the APF detects the load current iL, detecting the reactive current component iLfq and the harmonic current component Lhi. These two components are used as a command signal ic* to control the generation of a compensation current. After appropriate control, the APF compensation generation circuit generates a compensation current ic that is equal in magnitude and opposite in direction to the command current signal. This compensation current ic is injected into the circuit to cancel out the reactive and harmonic current components, thus ensuring that the power supply current is contains only the fundamental component iLf.
4. Mathematical Model of Parallel APF
For each bridge arm, the upper and lower switching devices cannot be turned on simultaneously; therefore, there are only two states: the upper bridge arm is on and the lower bridge arm is off; or the upper bridge arm is off and the lower bridge arm is on. Based on the APF structure shown in Figure 3, the mathematical model is established as follows:
Figure 3. Three-phase three-wire parallel type APF structure diagram
The mathematical model for the parallel APF is as follows:
4. Harmonic Detection Algorithm Based on Instantaneous Reactive Power Theory
The detection method based on Akaggi's three-phase instantaneous reactive power theory has played a significant role in the development of active power filters (APFs) and is currently the most widely used detection method in APFs. This method transforms the three-phase electrical vectors to α-β coordinates, redefines instantaneous active and reactive power, and then inverses these powers into three-phase compensation currents. When both the power supply voltage and load current are distorted, the ip/iq calculation method can still accurately detect harmonic currents, while the p/q calculation method has errors. When the three-phase voltage or three-phase current is unbalanced, directly applying either the ip/iq or p/q calculation methods will result in detection errors. The voltage and current vectors in the α-β coordinate system are shown in Figure 4.
Figure 4. Voltage and current vectors in the α-β coordinate system
5 Current Detection Method Based on Synchronous Coordinate Transformation Theory
Synchronous coordinate transformation is often used to simplify the mathematical model of a motor, transforming a rotating quantity in a stationary coordinate system into a stationary quantity in a rotating coordinate system, thus facilitating model analysis and control. Similarly, this method can be applied to load current detection in an APF (Automatic Power Filter), and it is also suitable for cases of three-phase voltage distortion or asymmetry. After dq transformation, we obtain:
The forms of the positive and negative sequence components of the current on the d-axis and q-axis after transformation show that the nth positive sequence component of the original current becomes the (n-1)th positive sequence component, and the nth negative sequence component becomes the (n+1)th negative sequence component. The fundamental positive sequence component of the original current becomes a DC component, and the frequency of the lowest harmonic positive sequence component is twice the power frequency. The fundamental positive sequence component can be obtained after passing through a low-pass filter, and the reactive and harmonic current components can then be separated. The principle of this detection method is shown in Figure 5.
Figure 5 shows the principle diagram of d-q operation.
For the control of the compensation current, this paper adopts the voltage tracking control method.
Voltage space vector control (VVC) is a method of voltage tracking control. Initially applied only to motor control, VVC is a control strategy based on motor magnetic field theory. The basic idea is to consider the three-phase circuit as a whole, converting the three-phase voltage states into two-phase voltage vectors, allowing the spatial rotating vector to be synthesized and tracked by a finite number of stationary vectors. Extending this method beyond motor control, disregarding the physical concepts in motor control, has led to its development into a widely used PWM (Pulse Width Modulation) technique. Similarly, VVC is also applicable to APF (Automatic Voltage Filter) control. For parallel APFs, the advantages of this method include: a fixed switching frequency; reduced switching losses through a reasonable vector control sequence; improved DC voltage utilization; good real-time performance; and ease of digital control implementation.
6 System Hardware Circuit
The parallel-type APF consists of two main parts: the main circuit and the control circuit. The main circuit is connected in parallel with the nonlinear load to the power supply to provide compensation current. The control circuit mainly includes signal acquisition and conditioning circuits, DSP control circuits, and drive control circuits. Its function is to generate PWM pulse signals to drive the power devices in the main circuit through a series of controls. The calculation of the command current and the tracking control of the compensation current are both implemented in the DSP. This paper adopts a three-phase three-wire voltage source main circuit structure.
When designing a three-phase three-wire APF, appropriate switching devices and suitable converter output voltage levels should be selected based on the device's capacity, voltage, and current ratings. Since the APF is connected in parallel with the nonlinear load, the AC voltage connected to the load is approximately the same. If only harmonic compensation is required, the filter's compensation current must be equal in magnitude and opposite in direction to the harmonic components of the load current. In this case, the filter's capacity can be considered to depend on the magnitude of the harmonic current in the load current.
This design utilizes an Intelligent Power Module (IPM). It integrates power switching devices, drive circuits, fault detection and protection circuits, and can send detection signals to a DSP for interrupt processing. The APF has a capacity of 8KVA, an AC line voltage of 400V, and a compensation current of 12A.
6.1 Control of DC-side voltage in the main circuit
Controlling the DC-side capacitor voltage can be achieved simply by controlling the instantaneous active current of the main circuit. For an APF (Advanced Persistent Filter), the DC-side voltage is crucial because its magnitude directly affects the filter's ability to track the compensation current. A higher voltage results in a greater and faster rate of change of the compensation current, leading to better tracking performance. From this perspective, the voltage should be as high as possible. However, considering the capacitor's capacitance and voltage withstand requirements, the voltage needs to be as low as possible. Therefore, the design considers using a larger DC-side voltage while meeting the capacitance and voltage withstand requirements.
6.2 Selection of Inductors and Capacitors in the Main Circuit
The selection of an inductor requires a trade-off. Two factors need to be considered: First, the rate of change of the compensation current should be greater than the maximum possible rate of change of the command current to ensure tracking performance and meet the requirements of different nonlinear loads. Second, a lower limit range should be set for the inductor to meet the requirements for compensation current ripple. The calculation formula used for inductor selection is:
Where i*cmax is the maximum value of the reactive power and harmonic command current, which is usually 70% of the load current;
tc is the sampling interval within one cycle; λ is a coefficient ranging from 0.3 to 0.4. When compensating for reactive power and harmonic current, if the maximum firing angle of the three-phase rectifier bridge is taken as 30°, based on the obtained Ic=12A, the load current is IL=43.2A, i*cmax=30.2A. When the sampling frequency is 12.8kHz, the sampling period is tc=78.1μs, Udc≥3Um=1000V, thus L=3mL.
The function of the DC-side capacitor in the main circuit is as follows: when the converter operates in rectification mode, the capacitor acts as an energy storage element; when the converter operates as an inverter, the capacitor can provide a stable DC voltage and buffer energy fluctuations caused by energy storage in the AC-side inductor and high-order harmonics. To prevent DC voltage fluctuations, the capacitor should be as large as possible, and voltage fluctuations caused by harmonics must also be considered. The following formula is used for calculation:
Where Im is the peak value of the negative sequence current component in the compensation current, typically taken as 60% of the compensation current value; ε is the ripple rate of the DC side voltage, usually taken as 0.01; and ω is the fundamental angular frequency of the power grid. Substituting the data into the above formula, we get C = 1000μF.
7 Control Circuit Design
The control system is the core component for achieving reactive power compensation and harmonic suppression. The block diagram of the control system is shown in Figure 6.
Figure 6 Block diagram of APF control section
The control circuit needs to calculate the reactive and harmonic command current and generate the control signal required for SVPWM. It calculates the command operation current by detecting the nonlinear load current, generates the SVPWM control signal through control operations, and drives the switching devices to control the on/off operation of the filter, thereby generating the corresponding compensation current to eliminate reactive and harmonic components in the line. The control section mainly includes: a DSP control chip, an input signal detection and conditioning circuit, and a voltage synchronization zero-crossing signal generation circuit.
The MC56F8346 is used for control data acquisition to separate harmonic components from the grid-side current and load-side voltage in real time. The PWM converter is then controlled to inject a current equal in magnitude and opposite in direction to the harmonic current into the system, thus canceling the system's harmonic current and achieving harmonic elimination. To improve the compensation effect, the control cycle should be as short as possible, hence the use of the high-speed MC56F8346 MCU.
7.1 Phase-Locked Loop and Frequency Multiplier Circuit
Phase-locked loops (PLLs) and frequency multipliers can solve the problem of accurately controlling the sampling period, allowing for real-time dynamic adjustment of the sampling time for grid frequencies. The A-phase voltage signal can be multiplied by 128, and the multiplied signal is then connected to the DSP's external interrupt pin XINT1. A lookup table is performed within the interrupt routine, thus achieving accurate positioning of the sine table.
Phase-locked loops (PLLs) are automatic control systems that synchronize the phases of two electrical signals. A PLL is a closed-loop system capable of synchronizing the phases of two electrical signals. It is widely used in broadcasting, frequency synthesis, automatic control, and clock synchronization. A PLL mainly consists of three parts: a phase comparator (PC), a voltage-controlled oscillator (VCO), and a low-pass filter, as shown in Figure 7.
Figure 7 Block diagram of phase-locked loop principle
This paper uses the typical MC4046 as a phase-locked loop chip and a 12-bit binary counter MC4040 to realize the frequency multiplication of the power frequency square wave. The circuit is shown in Figure 8. C1, R1, C2, and R2 together form an external oscillation circuit. The output of MC4046 is used as the input of MC4040. The frequency is fed back to MC4046 through the 7-division function of MC4040. After the phase-locking is completed, the frequency of the 4th output signal of MC4046 is 128 times the frequency of the input signal at pin 14, thus realizing the frequency multiplication function.
Figure 8 Phase-locked loop and frequency multiplier circuit diagram
7.2 Voltage Zero-Crossing Comparator Circuit
The zero-crossing signal generation circuit is shown in Figure 9. The A-phase grid voltage is too high for the chip and cannot be used directly; it needs processing. First, a step-down transformer is used to reduce the voltage to a smaller value. This signal is then passed through a zero-crossing comparator circuit composed of an operational amplifier and resistors to obtain a square wave signal. Finally, an AND gate and a diode are used to obtain a more ideal square wave signal that synchronously crosses zero, meeting the requirements of the MC56F8346. The AND gate converts the non-ideal square wave signal into an ideal signal; the diode ensures that the high-level value of the square wave signal meets the requirements of the MC56F8346.
Figure 9 Voltage zero-crossing comparator circuit
7.3 Signal Acquisition and Conditioning Circuit
This paper uses Hall effect sensors to acquire current and voltage signals. The MC56F8346 itself has an ADC module that converts external analog signals into digital signals, simplifying the design of external hardware circuitry. Since the ADC module within the MC56F8346 has a reference voltage of 3.3V and can only process positive analog signals, while the signals acquired by the Hall effect sensors can be both positive and negative, the analog signals must be processed before being fed into the MC56F8346 to meet its requirements. This signal processing is accomplished through a signal conditioning circuit. The signal conditioning circuit is primarily responsible for the conversion and processing of analog signals such as current and voltage.
The conditioning circuit for AC current and voltage signals is shown in Figure 10. The voltage or current signal acquired by the Hall sensor is sampled by a resistor and converted into a voltage signal proportional to the original signal. Then, it is sent to a low-pass filter to filter out high-frequency components. After passing through a level offset circuit, the bipolar signal is converted into a unipolar signal. The limiting effect of the diode ensures that the signal voltage meets the requirements of the MC56F8346. Finally, it is sent to the ADC module of the DSP.
Figure 10 Signal conditioning circuit
8DSP control
This paper uses the Freescale MC56F8346 DSP chip, a 16-bit hybrid controller based on the 56800E core. It has the functions of a microcontroller (MCU) and a digital signal processor (DSP), with abundant on-chip resources, low cost, fast processing speed, powerful functions, and simplifies the design of peripheral hardware circuits.
The DSP control section mainly performs the following tasks: A/D conversion of the acquired current and voltage signals through the ADC module; detection of reactive and harmonic components in the load current based on the dq method of synchronous coordinate transformation, and using them as the command operation current; control of the DC-side capacitor voltage of the main circuit to maintain it at a relatively constant value using the PI control method; and generation of PWM signals using the space vector control method to drive the power devices of the main circuit to generate compensation current.
9APF System Simulation and Analysis
To verify the feasibility of the control strategy for the filtering effect of the active power filter, a mathematical model of the active power filter was established using MATLAB simulation software. The control strategy algorithm and system parameters of the active power filter were then simulated. Since the actual experimental system uses fully digital control, the simulation model was also discretized.
Generally, time-domain detection methods have fast response speeds and can also implement selective harmonic detection methods (though these methods consume significant computation time for dq0 transformations, such as 5th and 7th orders, making them unsuitable). Currently, most harmonic detection methods utilize instantaneous reactive power theory. Frequency-domain detection, on the other hand, is applicable to both single-phase and three-phase systems. While it has a larger time delay, it offers significant advantages for detecting harmonics in periodic loads and can effectively detect specific harmonics, offering greater flexibility. In this simulation, we use the Discrete Fourier Transform (DFT) for harmonic detection, as shown in Figure 11.
Figure 11 Simulation waveform of three-phase nonlinear balanced load
Figure 12 shows the full compensation after detecting the total harmonic current using an arbitrary harmonic detection algorithm. The first image shows the current waveform before compensation, the second shows the total harmonic current waveform, and the third shows the waveform after compensation tracked using SVPWM. As can be seen from the figure, the current waveform after compensation is basically a sine wave and stabilizes after one and a half cycles, indicating that the compensation effect meets the requirements.
Figure 12 shows the results of total harmonic current tracking compensation.
Simulation results show that the filtered phase voltage tracks the original reference voltage waveform well in both amplitude and phase. The results demonstrate that the algorithm can accurately track the input signal, generate signals with the same waveform, and exhibits high tracking accuracy and good dynamic performance.
10. Conclusion
The large-scale application of power electronic converters increases harmonic pollution in the power grid while consuming a significant amount of reactive power. These devices reduce grid utilization efficiency and power quality, necessitating mitigation measures. APF (Automatic Power Generation) has conducted comprehensive research on reactive power compensation and harmonic suppression in response to this need.
This paper selects a parallel-type APF as the research platform, as real-time and accurate detection of load current is one of the keys to realizing the active power filter function. Based on an introduction to various methods of reactive power and harmonic current detection, this paper analyzes the design based on instantaneous reactive power theory and synchronous coordinate transformation theory, employing a dq-based computational method for simulation. The simulation results verify its feasibility. The control section is designed using Freescale's MC56f8346DSP as the core, including the generation of voltage zero-crossing signals and sampling signals, and the acquisition and conditioning design of voltage and current signals. Finally, the entire system is simulated in the MATLAB/Simulink environment.
About the Author
Wang Lei (1984-) is a female master's degree holder who currently works at Harbin Jiuzhou Electric Co., Ltd. as an intermediate engineer. She is mainly engaged in the design of DC systems for power plants, intelligent power grid systems, and integrated power supply design and development.
Zhou Jiaqi (1983-) is a male with a master's degree. He currently works at Harbin Jiuzhou Electric Co., Ltd. as an intermediate engineer. He is mainly engaged in the research and development of new energy power generation technology and reactive power compensation technology.