SIL Modelling of Shunt Harmonics Active Filter

The evolution in semi conducting devices has introduced flexible control on a system but it has also penetrated harmonics in the grid, which results in extra electrical stress and load. Limiting the presence of harmonics in the grid and low power factor maintained by consumers has become of utmost priority to the power system analyst. Hence, the need of Active Filter emerges. Here, a real time simulation, in dSPACETargetlink, of shunt harmonics active filter is propounded. The possible basic control strategy used in simulation is ”Instantaneous Power Theory”. Control logic of two features of Active Filter viz., Global Harmonics Elimination and Reactive Power Compensation are produced in the paper. The results obtained in ”Software In Loop Mode” of dSPACE are discussed and verified in detail. The richness of the code generated by the dSPACETargetlink can be reasoned by observing the results which are well aligned with the industrial standards regarding the harmonics.


I. INTRODUCTION
Constant proliferation of electronics has increased the harmonics pollution. This causes stress to the grid. Concentration of harmonics in power system has become of major concern to power system analyst as it increases losses in system. Interference caused by harmonics has adverse effect on sensitive loads which may result in malfunction of them. Also the demand of reactive power increases in presence of harmonics. Which means that power generated is not utilised completely.
Conventionally harmonics elimination and reactive power compensation was done using passive LC filter but drawback of tuning has made its use limited. Also if n number of harmonics are to be mitigated, n number of passive filters were required which made the system bulky. Whereas, concept of active harmonics filter has overcome the primitive passive filter as no rigorous tuning of filter is required also very flexible control is obtained in AHF. Just by a Shunt Harmonics Active Filter (SHAF) all the harmonics can be mitigated, pf correction can be done and there would be no issue of resonance caused by passive elements. As,such there are various topologies and technologies involved in active filter as shown in [1] and [2] but in this paper model is prepared using PQ Theory.
Here, an active filtering is proposed using PQ Theory in SIL Mode of dSPACE-Targetlink. dSPACE generates the code of control strategy modelled in Matlab Simulink using [3]. Once all the blocks used in Control Strategy are replaced with block set of Targetlink, the targetlink can be Software In Loop (SIL) or Model In Loop (MIL). dPACE can be used in Software In Loop (SIL) in which the model runs with the help of code generated by Targetlink and in Hardware In Loop (HIL) in which the dSpace acts as a hardware and the code generated by it is fed in the controller and actual operation is replicated. Hence with dSPACE SIL the control strategy is converted in code using [4] which helps to see richness of code in real time simulation. A three phase-three wire system is considered. The non linear load connected to the supply is a three phase uncontrolled rectifier. This load draws a non linear current, containing fundamental frequency component and also harmonics component. As the name suggests SHAF is connected in parallel to the load at the point of common coupling (PCC). So, the target of this SHAF is to mitigate the harmonics globally and to compensate the reactive power in real time simulation. Fig.2 shows the basic logic used in active harmonics filtering. Active Harmonics Filter is considered as dependent source because output of AHF is corresponding to the harmonics content of load current. Thus, constant calculation decides the switching of converter to derive the current through AHF.Here, by applying KCL at PCC of Fig.2 leads to, With this the harmonics demand of current is sufficed by the AHF and source current becomes sinusoidal. Hardware components are designed using [5] and [6] III. CONTROL STRATEGY Fig.3 depicts the control logic used to meet the end targets of AHF which is to mitigate global harmonics and also compensating the reactive power. As it can be seen from Fig.3 the whole control is divided in different levels. Also, the inputs to the control systems are V s , Voltage at PCC, I load , Load Current, I inv , Current through converter to the grid, V dc , Voltage level across the DC Capacitor. In this strategy instantaneous value of voltage and current are used in control strategy which makes this theory applicable in transient state and steady state as well. Also, three phase system is considered as a unit, it isn't assumed as the superposition of three single Fig. 3. Block diagram of control circuit phase. A three phase 120 • displaced is transformed in three orthogonal axes.

II. POWER CIRCUIT
The first and foremost step to execute PQ theory is to transform V s , I load of three phase system to power invariant three stationary orthogonal [7] frame using Clarke's Transformation as described in [8] Clark Transformation is power invariant. Hence power calculation is described as follow , Using (2), (3) and (5) following equation is obtained, where , Similarly, q, in αβ frame,is defined as sum of products of voltages and currents on different axes which is similar to abc frame. The imaginary power Q is proportional to the quantity of energy that is being exchanged between the phases of the system. It does not contribute to the energy transfer between the source and load at any time. So. as defined in [7] q is written as eq (6) and eq (7) can be written in matrix as follow, In this paper, three phase three wire system is considered which makes I 0 = 0 Thus, power P 0 will always be 0. So, eq (8) is reduced to Powers observed in αβ frame have peculiar tendency, They have some dc shifted power and pulsation superimposed on it as mentioned in [9]. Thus, p and q can be written as where,p andq corresponds to active power and reactive power because of fundamental frequency present in current, andp andq corresponds to active and reactive power because of harmonics in the current.
To separate the power corresponding to harmonics from total power, a low pass filter is used of cut off frequency Fig. 4. Control Logic of System of as low frequency as 10Hz. Here some active power is consumed by the converter to maintain the DC voltage across the capacitor, corresponding to switching loss. So to maintain a DC voltage, a PI controller is used and its output is accumulated with the active power of harmonics,P comp .
To obtain the selection between harmonics elimination and harmonics elimination with reactive power compensation is obtained as follow:

A. For only Harmonic Elimination
If the target is to eliminate the harmonics globally, reactive power used in finding reference current named as Q comp is Q har as shown in Fig.3. So to eliminate the harmonics the reactive power compensation selection key is kept at position (i). In this total Q f unda+har is passed through a low pass filter of 10 Hz frequency. Output of the low pass filter is reactive power corresponding to the power frequency. To obtain reactive power corresponding to harmonic output of the low pass filter is subtracted power from Q f unda+har . Thus, obtained reactive power viz., Q har , P comp , and V s together will be used to draw the reference current corresponding to harmonic elimination.

B. For Harmonic Elimination and Reactive Power Compensation
Assuming that reactive power is also to be compensated along with harmonics elimination, the key selection point is Q comp . At this point Q comp will be Q f unda+har . From which Q har will compensate for the harmonics elimination and component of Q f unda will help to compensate for the demand of reactive power by the load. Thus, by keeping the switch at position (ii) as shown in Fig.3, the reactive compensation and harmonics mitigation is obtained. Now, after obtaining active power corresponding to harmonics, P comp , and by selecting reactive power as per the feature one has to execute, Q comp , compensating current is found with the help of V s . These compensating currents in α β frame are compared with actual current through inverter, I inv in α β frame.
Errors between both the currents are maintained nearly to zero by the PI controller of the current loop. This depicts that actual current is tracking the reference current. There are two PI controllers for currents, one for α and other for β. The outputs of these two controllers are converted back to abc frame by using inverse Clark Transform. Finally, obtained signals are compared with the triangular pulse of switching frequency to get the gate pulses of AHF. Fig.4 gives the basic control logic of control system,similar to the one in [10] for SRF strategy, where each block is replaced by its transfer function.

IV. RESULTS OF SIMULATION
The control system of Shunt Active Harmonics Filter is implemented using dSPACE targetlink which enables real time simulation in MATLAB itself. The control logic of the system is converted in C code by using dSPACE system. This C code file becomes the base for real time control of system. This same C code file is dumped in DSP controller for the hardware implementation. Real time simulation proposed in this paper is for 30A capacity of Active Filter, having parameters as shown in Table I,  Here, non linear load considered in the real time simulation is three phase rectifier having an RL load of R = 10Ω and L = 50mH A. Result of uncompensated source current As it is clear from Fig.5 harmonic components are visible and also source current %thd without any compensation is 25.73%

B. Results After Global Harmonics Elimination
In this section results are produced by just eliminating all harmonics.  Fig.6 it can be observed that %thd of source current after mitigating global harmonics gets reduced to 1.89% also the magnitude of harmonics visible in Fig.5 is reduced to a negligible value.  Fig.7 waveform of currents are analysed from which it can be inferred that though load current is non sinusoidal, current drawn from the grid is three phase balanced sinusoidal and rest demand of harmonics current is fulfilled by SHAF.  Fig.8 infers that the source current %thd after mitigating harmonics and reactive power compensation is reduced from 25.73% to 2.37% . On comparing Fig.6 and Fig.8 there is slight increase in %thd which can be surmise as in reactive power compensation some part of 50Hz frequency is delivered which increase the source current %thd.  Fig.9 displays that load current is non sinusoidal but the current claimed from the source is three phase balanced sinusoidal. The above description depicts that, load is non linear but it behaves as simple resistive load, which consumes sinusoidal current and unity power factor. Focusing on the magnified portion of Fig.10 and Fig.11, it can be judged that in Fig.10 the zero crossing of voltage and current is not same. Though, the current is sinusoidal, there is some phase shift between two. This means that some reactive power is consumed by the load. Hence, this waveform of source current and voltage is obtained after global harmonics elimination. Similarly, in Fig.11 the zero crossing of voltage and source current coincide. From this it can be concluded that there is zero phase shift between voltage and source current. This ceases to a point that there is harmonics elimination by seeing the waveform of current and also the reactive power is compensated by observing zero crossing of voltage and source current. Similar to the observation made from the waveforms, it can be noticed from the II. The reduction in %thd of I s and reactive power compensation and increase in power factor line up to the conclusions drawn by observing waveforms in Fig.10 and Fig.11.  Fig.12 shows the bar graph of magnitude of each harmonics v/s order of the harmonics. The aforesaid results are obtained in three conditions viz., when the harmonics are uncompensated, when global harmonics are mitigated and when harmonics mitigation and power factor correction is done simultaneously. With this results, it is observed that magnitude of harmonics are reduced drastically.

V. CONCLUSIONS
An active filtering of harmonics and reactive power compensation based on instantaneous power theory are produced. As the hindrances of harmonics current in source current is ceased the source current has become sinusoidal and the system acts as a harmonics and reactive power compensator. The active filter compensation currents are generated by three phase VSC with SPWM current control. A control system modelled using Clark Transform, permits the tracking of reference current by using PI controller. Also the DC voltage maintained across the DC bus is maintained to the reference voltage using PI controller, which draws a conclusion that current loop and voltage loop are properly implemented.
Based on the results obtained in real time simulation, it can be concluded that the strategy used in harmonics elimination and reactive power compensation gives systematical results, having coherence with the standards adopted by IEEE.