## 2 The Structure of the UPQC System
### Series Inverter Control Structure  
The traditional UPQC, as a multifunctional power quality management device that integrates both voltage and current compensation functions, has its voltage compensation unit primarily aimed at improving the quality of the grid voltage. This unit works by real-time detection of voltage fluctuations or distorted signals on the grid side and generates corresponding compensation signals to dynamically regulate the grid voltage, as shown in Figure 2.  
The control of the voltage compensation unit relies first on the precise detection of the grid voltage. Real-time three-phase grid-side voltage signals \(u_{s}\) are obtained via voltage transformers. To achieve accurate compensation of the grid voltage, fast fourier transform (FFT) or low-pass filters are commonly used to extract the fundamental sinusoidal components \(u_{sf}\). The detected voltage signals are then separated into harmonic components \(u_{sh}\), fundamental components \(u_{sf}\), and fluctuation components \(\Delta u_{s}\), satisfying the following relationship:  
\[u_{s}=u_{sf}+u_{sh}+\Delta u_{s} \tag{1}\]  
Figure 1: UPQC structure block diagram.  
Figure 2: UPQC series side structure block diagram.  
By detecting the deviation components of the grid voltage, a reference signal can be further provided to the control unit for voltage compensation. The core of the voltage control section lies in generating a compensation signal based on the detected grid voltage deviation to correct voltage distortion. Let \(u_{L}\) denote the load voltage and \(u_{s}\) represent the real-time detected voltage. The difference between the two is the output compensation voltage \(u_{c}\) of the series compensation unit, as given by:  
\[u_{c}=u_{s}-u_{L} \tag{2}\]  
By applying an appropriate control method, the compensation signal is transformed into a PWM signal to control the series compensator. This enables the DVR to inject a compensation voltage into the grid that is in inverse phase with the grid voltage distortion. That is, the UPQC injects a compensation quantity \(u_{c}\) through the series compensation unit to counteract the voltage distortion, ultimately ensuring that the output voltage of the distribution network and the load voltage are both sinusoidal and at the fundamental frequency. The PI controller is a crucial component of the voltage compensation unit, and the output of the PI controller provides the reference value for the compensation voltage, denoted as:  
\[u_{c}(t)=K_{p}\cdot e_{u}(t)+K_{i}\cdot\int e_{u}(t)dt \tag{3}\]  
where \(K_{p}\) is the proportional gain and \(K_{i}\) is the integral gain. The PI controller adjusts the compensation voltage \(u_{c}(t)\) in real time, gradually reducing the grid-side voltage deviation to zero, thereby achieving voltage stability and effective harmonic compensation.  
The voltage compensation unit generates control signals to drive the inverter through the PWM generator. The basic principle of PWM modulation is to compare the compensation voltage reference value \(u_{c}(t)\) with the carrier signal \(u_{\mathrm{carrier}}(t)\), thereby generating a switching signal.  
The series voltage compensation unit primarily achieves voltage compensation through an inverter installed between the load side and the grid. This inverter monitors and analyzes the grid voltage in real time, generating the corresponding compensation voltage signal to compensate for irregular waveforms such as harmonic components and instantaneous voltage sag in the grid voltage. The voltage waveform is precisely adjusted to maintain the load-side voltage in a stable and ideal state, thereby protecting sensitive loads and ensuring a high-quality supply of grid voltage.