## 1. Introduction

One of the serious problems in electrical power systems is the increase of electronic devices which are used by the industry. These devices, which need high-quality energy to work properly, at the same time, are the most responsible ones for decreasing of power quality by themselves.

Custom power devices (CP) used in distribution systems can control power quality. One of the most efficient CPs is Unified Power Quality Conditioner (UPQC). It consists of a Parallel-Active Filter (PAF) and a Series-Active Filter (SAF) together with a common dc link [1-3]. This combination allows a simultaneous compensation for source side currents and delivered voltage to the load. In this way, operation of the UPQC isolates the utility from current quality problems of the load and at the same time isolates the load from the voltage quality problems of utility.

Reference generation of UPQC is an important problem. One of the scopes of this research is extending of Fourier transform for increasing of its responsibility speed twelve times as the main control part of reference generation of the UPQC. Proposed approach named Very Fast Fourier Transform (VFFT) can be used in balanced three phase systems for extraction of reference voltage and current signals. Proposed approach has fast responsibility as well as good steady state response. As it is known, Fourier transform response needs at least one cycle data for the settling down which results in slow responsibility and week capability in dynamic condition. In the proposed approach there are two different data window lengths. In the sag or swell condition, control system switches to T/12 data window length but, in the steady state condition it is switched to T/2 data window length. It causes fast responsibility as well as good steady state response. This approach will be used for the UPQC control circuit for extraction of the reference signals.

Second scope of this research is to use Multy Output ADAptive LINEar (MOADALINE) approach for the reference generation of UPQC. Simplicity and flexibility in extraction of different reference signals can be advantage of the proposed algorithm. Third scope of this research is reference generation of UPQC with the scope of power flow control as well as power quality compensation. In this stage, SAF is controlled by dqo approach for voltage sag, swell, unbalance, interruption, harmonic compensation and power flow control. Also, PAF is controlled by composition of dqo and Fourier theories for current harmonic and reactive power compensation.

Also for the validity of the proposed approaches, power quality compensation has been done in a test circuit via simulation. Voltage sag, swell and harmonics will be compensated by SAF of UPQC. Also, current harmonics and reactive power will be compensated by PAF of UPQC. Section 2 generally introduces UPQC and its equivalent circuit. Section 3 explains the proposed VFFT and related equations. Section 4 introduces UPQC reference generation system based on the proposed VFFT approach. Section 5 explains proposed MOADALINE algorithm for reference generation. Section 6 explains reference generation based on power flow control. Section 7 simulates the research. Finally, section 8 concludes the results.

## 2. Unified Power Quality Conditioner (UPQC)

UPQC is composed of two inverters that are connected back to back [3-10]. One of them is connected to the grid via a parallel transformer and can compensate the current problems (PAF). Another one is connected to the grid via a series transformer and can compensate the voltage problems (SAF). These inverters are controlled for the compensation of the power quality problems instantaneously. Figure 1 shows the general schematic of a UPQC.

A simple circuit model of the UPQC is shown in Figure 2. Series active filter has been modeled as the voltage source and parallel active filter has been modeled as the current source.

## 3. VFFT problem statement

Fourier transform has the capability of different order components extraction of distorted periodic voltage and current. It is possible to use voltage and current first order components for determining the compensator signals. Based on the related equations of Fourier transform, there is a need for at least one cycle data for settling down the response. This problem can cause week responsibility in dynamic condition. Proposed extended Fourier transform will be responsible for improving this problem. First order Fourier coefficients of a sinusoidal signal can be written as equations (1) and (2).

Based on equations (1) and (2) it is possible to reduce settling time of the Fourier transform responsibility to T/2; where, T is the main period of the signal. In this condition the responsibility speed will be increased twice but, it is not reasonable speed in dynamic condition yet. Equation (5) can be resulted from equations (3) and (4), for a sinusoidal signal with phase angle *Φ*. Equation (6) can be resulted similarly.

(5) |

(6) |

Equations (7) and (8) can be rewritten from equations (5) and (6) respectively.

(7) |

(8) |

This solution has advantage of reducing the data window length to T/12. In this condition, settling time of the Fourier transform responsibility will be decreased to T/12. In other words, the responsibility speed will be increased twelve times. It should be noticed that this approach can be used only in balanced three phase systems. In this condition reach to the same accuracy in response is possible as compared to that of one cycle but very faster than one cycle. When data window length is chosen T sec, all of even components of distorted voltage and current in the related integral of Fourier transform can be filtered completely. But this is not possible in T/12 data window length condition. So, the problem of this approach is the unfiltered steady state oscillations in the response. This is because of small data window length. Thus, to complete the proposed approach for accessing the fast response, as well as good steady state response, proper composition of T/12 and T/2 data window lengths have been used. Completed proposed approach uses T/12 data window length in signal magnitude change instances, for accessing the fast response, and T/2 data window length in other times, for accessing the good response without oscillation [10].

## 4. UPQC Reference Generation Based on the VFFT

Based on the previous indications, the detection of sag, swell, and load change conditions are essential problem for proper control of the UPQC. In this research, for the detection of sag or swell condition in the source voltage and changes in the load current, derivative of the first order component magnitude of the voltage and current signals has been compared with a constant value. This is based on the facts that in these conditions, the derivative of the signal magnitude can change rapidly with an almost increasing slope amount. Figure 3, shows the block diagram of the proposed VFFT based control approach [10].

### 4.1. Series active filter reference generation

Proposed approach can be used for the extraction of direct and indirect first order components of the source voltage. In this control approach, series active filter can compensate harmonics as well as voltage sag and swells. In this approach the reference voltage magnitude can be setup to the nominal value as equation (9). Figure 4, shows the block diagram of the SAF control circuit.

### 4.2. Parallel active filter reference generation

In this research parallel active filter have the duty of the reactive power compensation, as well as, current harmonics. For this purpose as equation (10), active first order component of load current which is tangent component of the load current to the load voltage can be used as the reference current. This problem has been shown in Figure 5.

Where, *I*_{l1} and *Φ*_{il1} are the first order component magnitude and phase angle of the load current, respectively and *Φ*_{vl1} is the first order component phase angle of the load voltage. Figure 6, shows the block diagram of the PAF control circuit.

## 5. Reference Generation based on MOADALINE approach

Based on MOADLINE approach each

Where, e(t) is the error between desired and actual signal of y, and K is the convergence factor. It is possible to extract the reference voltage and current from uncompensated source voltage and load current. Fourier coefficients can be determined as vector of y. Reference signal can be determined as W. Matrix of S is constant. After determination of uncompensated signal Fourier coefficients, they can be compared with the desired values. Error signal can be used in adaptation rule for updating the vector of W. Therefore reference voltage and current can be determined. Figure 7, shows block diagram of the proposed MOADALINE approach [11].

## 6. Reference generation based on power flow control

Park transform which is used for the conversion of abc to dqo frame, is useful in the steady state and dynamic analysis of electrical systems [3]. Conversion matrix and related equations have been shown in Equations (16) and (17).

(16) |

Instantaneous active and reactive powers in dqo axis can be written as Equations (18) and (19).

Equations (20) and (21) show direct and quadratic axis voltages based on P and Q that have been determined from equations (18) and (19). It should be noticed that the active and reactive powers in equations (20) and (21) are transmitted powers after series active filter toward the load. These equations show that in constant impedance loads there is a relation between voltage and transmitted power. In other words, a particular load voltage is needed for a particular load power and vice versa. In equations (20) and (21) it have been assumed that the voltages are balanced and

Therefore, setup transmission active and reactive powers in equations (20) and (21) in considered amounts will result the related load voltage magnitude and phase angle. In reactive power compensated condition, Q=0 and the amount of active power will be extracted from the above equations as equation (22).

Generally, in this approach nominal active and reactive powers of load will be substituted in equation (20) and (21) for reference voltage extraction. But, there is a problem. If we don’t have load nominal power data, extracted reference voltage will not have nominal magnitude. For correct arrangement of the voltage magnitude, a PI controller is used for minimum error between magnitudes of extracted reference voltage and the nominal voltage.

Where,

Figure 8, shows the block diagram of the proposed control circuit.

## 7. Results

### 7.1. Results of VFFT approach

For the investigation of the validity of the proposed VFFT reference generation strategy in power quality compensation of a distribution system, simulation of the test circuit of Figure 9, has been done in MATLAB/SIMULINK software. Source voltage and load current, have been measured and analyzed in the proposed control system for the determination of the compensator signals of SAF and PAF.

This power system consists of a three phase 380V (RMS, L-L), 50 Hz utility, two three phase linear R-L load and a three phase rectifier as a nonlinear load which can be connected to the circuit at different times. This is for the investigation of the proposed control system capability in dynamic conditions. For the investigation of the voltage sag and swell conditions, utility voltages have 0.25 percent sag between 0.04 sec and 0.08 sec and 0.25 percent swell between 0.08 sec and 0.12 sec. Also, for the investigation of the proposed control strategy in the harmonic conditions, source voltage has been harmonized between 0.17 sec and 0.4 sec. Table 1, shows the utility voltage data and Table 2, shows the load powers and related switching times. In this study series active filter has been connected to the circuit at time zero. But parallel active filter has been connected to the circuit at time 0.25 sec. A number of selected simulation results will be shown later.

Voltage Order | Magnitude (pu) | Phase Angle (deg) | Time (sec) |

1 | 1 | 0 | 0-0.04, 0.12-0.4 |

1 | 0.75 | 0 | 0.04-0.08 |

1 | 1.25 | 0 | 0.08-0.12 |

5 | 0.1 | -45 | 0.17-0.4 |

3 | 0.1 | 0 | 0.17-0.4 |

Load | Nominal Power (kVA) | Nominal Voltage (RMS, L-L) | Switching Time (Sec) |

Linear | 10 | 380V | 0 |

Linear | 10 | 380V | 0.29 |

Non linear | 5 | 380V | 0.33 |

Figure 10, shows the source side voltage of phase 1. Figure 11 shows the compensated load side voltage of phase 1. Figure 12 shows SAF voltage of phase 1. Figure 13 and 14 shows first order component magnitude of the source voltage extracted by T and T/2 data windows respectively. Figure 15 shows first order component magnitude of the source voltage extracted by T/12 data window. Figure 16 shows the first order component magnitude of the source voltage extracted by the proposed composition of T/2 and T/12 data windows. Figure 17 shows the load side current of phase 1. Figure 18 shows the source side current of phase

1. Figure 19 shows the PAF current of phase 1. Figure 20 and 21 show first order component magnitude of the load current extracted by T and T/2 data windows respectively. Figure 22 shows the first order component magnitude of the load current extracted by T/12 data window. Figure 23 shows the first order component magnitude of the load current extracted by the proposed composition of T/2 and T/12 data windows. Figure 24 and 25 show the source side and load side voltages frequency spectrum, respectively. Finally Figures 26 and 27 show the load side and source side currents frequency spectrum, respectively. Table 3 shows THDs of the source and load voltages and currents. Load voltage and source current harmonics have been compensated satisfactory.

### 7.2. Results of MOADALINE approach

For the investigation of the validity of the mentioned control strategy of MOADALINE for power quality compensation of a distribution system, simulation of the test circuit has been done in MATLAB software. Source current and load voltage have been measured and analyzed in the proposed control system for the determination of the compensator signals of SAF and PAF. Related equations of the controlled system have been compiled in MATLAB software via M-file. Desired values of

The power system consists of a harmonized and unbalanced three phase 380V (RMS, L-L), 50 Hz utility, a three phase rectifier as a nonlinear load, a three phase balanced R-L load which is connected to the circuit at 0.04 sec and a one phase load which is connected to the circuit at 0.07 sec.

For the investigation of the voltage harmonic condition, utility voltages have harmonic and negative sequence components between 0.03 sec and 0.1 sec. Also, for the investigation of the proposed control strategy in unbalance condition, magnitude of the first phase voltage is increased to the 1.25 pu between 0.02 sec and 0.04 sec and decreased to the 0.75 pu between 0.06 sec to 0.08 sec. Figure 28 shows the source side voltage of phase 1. Figure 29, shows the compensator voltage of phase 1. Figure 30, shows load side voltage of phase 1. Figure 31, shows the load side current of phase 1. Figure 32, shows the reactive current of phase 1. Figure 33, shows the harmonic current of phase 1. Finally Figure 34, shows the source side current of phase 1. Load voltage and source current harmonics have been compensated satisfactory.

#### 7.3.. Results of power flow control

For the investigation of the validity of the power flow control strategy in a distribution system, simulation of the test circuit of Figure 35 has been done.

This power system consists of a harmonized and unbalanced three phase 20 kV (RMS, L-L), 50 Hz utility, a three phase balanced R-L load and a nonlinear three phase load. For the investigation of the voltage harmonic condition, utility voltages have harmonic and negative sequence components between 0.15 s and 0.35 s. Also, for the investigation of the proposed control strategy in unbalance condition, magnitude of the first phase voltage is increased to the 1.25 pu between 0.10 s and 0.20 s and decreased to the 0.75 pu between 0.3 s to 0.4 s. Investigation of the control circuit performance in fault condition is done by a three phase fault in output terminal of the main source between 0.4 s to 0.5 s. Table 4 shows the utility voltage harmonic and sequence parameters data and Table 5 shows the load power and voltage parameters. Table 6 show states of switches of

Voltage order | Sequence | Magnitude (pu) | Phase angle (degree) | Time duration (sec) |

5 | + | 0.12 | -45 | 0.15-0.35 |

3 | - | 0.1 | 0 | 0.15-0.35 |

switch | 0<t<0.4 sec | 0.4<t<0.5 sec | ||

First strategy | Second strategy | First strategy | Second strategy | |

close | close | open | open | |

open | open | close | close |

Figure 36, shows the source side voltage of phase 1. Figure 37, shows the compensator voltage of phase 1. Figure 38, shows the load side voltage of phase 1. Figure 39, shows the load side current of phase 1. Figure 40, shows the compensator current of phase 1. Figure 41, shows the source side current of phase 1. Figure 42, shows the load active and reactive powers. Figure 43, shows generation PAF active and reactive powers. Figure 44, shows the consumption active and reactive powers of the series active filter. Figure 45, shows generation active and reactive powers of the source. Figure 46, shows the difference between load voltage magnitude and nominal value and finally Figure 47, shows the difference between load voltage and source voltage phases.

## 8. Conclusions

In this research different approaches for reference generation of UPQC have been proposed. Based on the general equations of Fourier transform, its response settling time is one cycle. In this research for increasing the response speed and improving the control system capabilities in dynamic conditions, very fast Fourier transform approach has been proposed for balanced three phase systems. In the proposed approach, settling time of the response could be reduced to one twelfth of a cycle. In the proposed approach, there were two data window lengths, T/12 and T/2. In the sag, swell, and load change conditions, control system was switched to T/12 for obtaining fast response. Then for improving the proposed approach responsibility in filtering of unwanted steady state oscillation, control system was switched to T/2 for obtaining no oscillated response. In these states, fast response in dynamic conditions as well as good response in the steady state conditions would be possible. In this research for the detection of the source voltage sag, swell, and load change conditions, derivative of the first order magnitude of the voltage and current signal, were compared to a constant value. This was based on the fact that in these conditions voltage or current magnitude generally changes rapidly. Proposed control approach was simulated in MATLAB/SIMULINK software. Voltage sag, swell, and harmonics were compensated by SAF. But, reactive power and current harmonics were compensated by PAF. THD of load voltage before compensation was 14.14 percent which was reduced to almost zero after the compensation. But, THD of the source current before compensation was 9 percent which was reduced to almost zero after the compensation.

Also the proposed reference generation algorithm based on MOADALINE has been compiled in MATLAB software via M-File. Voltage harmonics have been compensated by SAF of the UPQC and current harmonics have been compensated by PAF of the UPQC. Based on the results proposed strategy not only could generate pure sinusoidal source current and load voltage but also could compensate source reactive power satisfactory. Total harmonic distortion of load voltage and current before compensation was 0.17 and 0.12 respectively which was reduced to almost zero after the compensation.

Another scope of this research was reference generation based on power flow control. This approach was based on relation between active and reactive powers and load voltage. In this approach amount of reactive power arranged to zero but amount of active power arranged to load nominal power. Also a PI controller used for arranging the load voltage magnitude to the nominal amount.