id-iq Control Strategy for Mitigation of Current Harmonics with Fuzzy Logic Controller Using Matlab / Simulation and RTDS Hardware

The main objective of this paper is to develop Fuzzy controller to analyse the performance of instantaneous real active and reactive current (id-iq) control strategy for extracting reference currents of shunt active filters under balanced, un-balanced and balanced non-sinusoidal conditions. When the supply voltages are balanced and sinusoidal, the all control strategies are converge to the same compensation characteristics; However, the supply voltages are distorted and/or un-balanced sinusoidal, these control strategies result in different degrees of compensation in harmonics. The p-q control strategy unable to yield an adequate solution when source voltages are not ideal. Extensive simulations are carried out with Fuzzy controller for id-iq control strategy under different main voltages. The 3-ph 4-wire shunt active filter (SHAF) system is also implemented on a Real Time Digital Simulator (RTDS Hardware) to further verify its effectiveness. The detailed simulation and RTDS Hardware results are included.


Introduction
As nonlinear currents flow through a facility's electrical system and the distribution-transmission lines, additional voltage distortions are produced due to the impedance associated with the electrical network.Thus, as electrical power is generated, distributed, and utilized, voltage and current waveform distortions are produced.It is noted that non-sinusoidal current [1] results in many problems for the utility power supply company, such as: low power factor, low energy efficiency, electromagnetic interference (EMI), distortion of line voltage etc.
The PI controller [2] requires precise linear mathematical models, which are difficult to obtain and may not give satisfactory performance under parameter variations, load disturbances, etc.Recently, fuzzy logic controllers [3] have received a great deal of interests in APF.The advantages of fuzzy controllers over conventional controllers are that they do not need an accurate mathematical model, can work with imprecise inputs, can handle non-linearity, and are more robust than conventional controllers.The Mamdani type of fuzzy controller used for the control of APF [4] gives better results compared with the PI controller, but it has the drawback of a larger number of fuzzy sets and 49 rules.
In our previous publication [5], we developed Fuzzy controller to analyse the performance of instantaneous real active and reactive power (p-q) control strategy [6 for extracting reference currents of shunt active filters under balanced, un-balanced and balanced non-sinusoidal conditions.Fuzzy controller based p-q theory shows dynamic performance than p-q method with PI controller.p-q theory needs additional PLL circuit for synchronization so p-q method is frequency variant.
In i d -i q method [7] angle "θ" is calculated directly from main voltages and thus enables the method to be frequency independent.Thus large numbers of synchronization problems with un-balanced and non-sinusoidal voltages are also avoided.
Present paper mainly focused on Fuzzy controller to analyse the performance of instantaneous real active and reactive current (i d -i q ) control strategy for extracting reference currents of shunt active filters under different voltage conditions.PWM pattern generation based on carrier less hysteresis based current control is used for quick response.Additionally, on contrast of different control strategies; i d -i q method is used for obtaining reference currents in the system, because in this strategy, angle "θ" is calculated directly from main voltages and enables operation to be frequency independent their by technique avoids large numbers of synchronization problems.It is also observed that DC voltage regulation system valid to be a stable and steady-state error free system was obtained.Thus with fuzzy logic and (i d -i q ) approaches a novel shunt active filter can be developed.
Even though two control strategies [8] with two controllers are capable to compensate current harmonics in the 3 phase 4-wire system, but it is observed that i d -i q method with Fuzzy Logic controller gives an outstanding performance over i d -i q method with PI controller and also than that of p-q with PI and Fuzzy controllers.

Shunt Active Filter Configuration
The active filter currents [9] are achieved from the instantaneous active and reactive powers p and q of the non-linear load.Figure 1 shows a three-leg structure with the neutral conductor being connected to midpoint of dc-link capacitor.
The three-leg six-switch split-capacitor [10] configuration of shunt APF suffers from several shortcomings viz.
1) Control circuit is somewhat complex; 2) Voltages of the two capacitors of split-capacitor need to be properly balanced; 3) Large dc-link capacitors are required.

Compensation Principle
The active power filter is controlled to draw/supply the a compensating current if from/to the load to cancel out the current harmonics on AC side and reactive power flow from/to the source there by making the source current in phase with source voltage.Figure 2 shows the basic compensation principle of the active power filter.

Instantaneous Active and Reactive Power (i d -i q ) Method
In Figure 3, the entire reference current generation scheme has been illustrated.The load currents i La , i Lb and i Lc are tracked upon which Park's transformation is performed to obtain corresponding d-q axes currents i Ld and i Lq as given in (1), where  is rotational speed of syn- The currents i Ldnh and i Lqnh along with i d1h are utilized to generate reference filter currents i cd * and i cq * in d-q coordinates, followed by inverse Park transformation giving away the compensation currents i ca *, i cb *, i cc * and i cn * in the four wires as described in ( 2) and (3).
Reference currents are extracted with i d -i q method using Fuzzy controller which is shown in Figure 4.The reference signals thus obtained are compared with the actual compensating filter currents in a hysteresis comparator, where the actual current is forced to follow the reference and provides instantaneous compensation by the APF [11] on account of its easy implementation and quick prevail over fast current transitions.This consequently provides switching signals to trigger the IGBTs inside the inverter.Ultimately, the filter provides necessary compensation for harmonics in the source current and reactive power unbalance in the system.Figure 6 shows voltage and current vectors in stationary and ro-tating reference frames.The transformation angle "θ" is sensible to all voltage harmonics and unbalanced voltages; as a result dθ/dt may not be constant.
One of the advantages of this method is that angle θ is calculated directly from main voltages and thus makes this method frequency independent by avoiding the PLL in the control circuit.Consequently synchronizing problems with unbalanced and distorted conditions of main voltages are also evaded.Thus i d -i q achieves large frequency operating limit essentially by the cut-off frequency of voltage source inverter (VSI) [12].
Figures 4 and 5 show the control diagram for shunt active filter and harmonic injection circuit.On owing load currents i d and i q are obtained from park transformation then they are allowed to pass through the high pass filter to eliminate dc components in the nonlinear load currents.Filters used in the circuit are Butterworth type and to reduce the influence of high pass filter an alternative high pass filter (AHPF) can be used in the circuit.It  can be obtained through the low pass filter (LPF) of same order and cut-off frequency simply difference between the input signal and the filtered one, which is clearly shown in Figure 4. Butterworth filters used in harmonic injecting circuit have cut-off frequency equal to one half of the main frequency (f c = f/2), with this a small phase shift in harmonics and sufficiently high transient response can be obtained.

Construction of Fuzzy Controller
The concept of Fuzzy Logic (FL) was proposed by Professor Lotfi Zadeh in 1965, at first as a way of processing data by allowing partial set membership rather than crisp membership.Soon after, it was proven to be an excellent choice for many control system applications since it mimics human control logic.
The bock diagram of Fuzzy logic controller is shown in  A fuzzy controller converts a linguistic control strategy into an automatic control strategy, and fuzzy rules are constructed by expert experience or knowledge database [14].Firstly, input voltage V dc and the input reference voltage V dc-ref have been placed of the angular velocity to be the input variables of the fuzzy logic controller.Then the output variable of the fuzzy logic controller is presented by the control Current I max .To convert these numerical variables into linguistic variables, the following seven fuzzy levels or sets are chosen as: NB (negative big), NM (negative medium), NS (negative small), ZE (zero), PS (positive small), PM (positive medium), and PB (positive big) as shown in Figure 8.
Rule Base: The elements of this rule base table are determined based on the theory that in the transient state, large errors need coarse control, which requires coarse input/output variables; in the steady state, small errors need fine control, which requires fine input/output variables.Based on this the elements of the rule table are obtained as shown in Table 1, with "V dc " and "V dc-ref " as inputs.
The fuzzy controller is characterized as follows: 1) Seven fuzzy sets for each input and output.

RTDS Hardware
This simulator was developed with the aim of meeting the transient simulation needs of electromechanical drives and electric systems while solving the limitations of traditional real-time simulators which is shown in Figure 9.It is based on a central principle: the use of widely available, user-friendly, highly competitive commercial products (PC platform, Simulink™).The realtime simulator [15] consists of two main tools: a real-time distributed simulation package (RT-LAB) for the execution of Simulink block diagrams on a PC-cluster, and algorithmic toolboxes designed for the fixed-time-step simulation of stiff electric circuits and their controllers.Real-time simulation and Hardware-Inthe-Loop (HIL) applications are increasingly recognized  as essential tools for engineering design and especially in power electronics and electrical systems.

Simulator Architecture 1) Block Diagram and Schematic Interface
The present real-time electric simulator is based on RT LAB real-time, distributed simulation platform; it is optimized to run Simulink in real-time, with efficient fixed-step solvers, on PC Cluster.Based on COTS non-proprietary PC components, RT LAB is a modular real-time simulation platform, for the automatic implementation of system-level, block diagram models, on standard PC's.It uses the popular MATLAB/Simulink as a front-end for editing and viewing graphic models in block-diagram format.The block diagram models be-come the source from which code can be automatically generated, manipulated and downloaded onto target processors (Pentium and Pentium-compatible) for realtime or distributed simulation.

2) Inputs and Outputs (I/O)
A requirement for real-time HIL applications is interfacing with real world hardware devices, controller or physical plant alike.In the RT-LAB real-time simulator, I/O interfaces are configured through custom blocks, supplied as a Simulink toolbox.The engineer merely needs to drag and drop the blocks to the graphic model and connect the inputs and outputs to these blocks, without worrying about low-level driver programming.RT-LAB manages the automatic generation of I/O drivers and models code so to direct the model's data flow onto the physical I/O cards.

3) Simulator Configuration
In a typical configuration (Figure 10), the RT-LAB simulator consists of • One or more target PC's (computation nodes); one of the PCs (Master) manages the communication between the hosts and the targets and the communication between all other target PC's.The targets use the REDHAT real-time operating system.
• One or more host PC's allowing multiple users to access the targets; one of the hosts has the full control of the simulator, while other hosts, in read-only mode, can receive and display signals from the real-time simulator.
• I/O's of various types (analog in and out, digital in and out, PWM in and out, timers, encoders, etc).I/O's can be managed by dedicated processors distributed over several nodes.

Simulation and RTDS Results
Figures 11, 12 and 13 illustrates the performance of shunt active power filter under different main voltages, as load is highly inductive, current draw by load is integrated with rich harmonics.
Figure 11 illustrates the performance of Shunt active power filter under balanced sinusoidal voltage condition, THD for i d -i q method with Fuzzy Controller using matlab simulation is 0.97% and using RT DS Hard ware is 1.26%.
Figure 12 illustrates the performance of Shunt active power filter under un-balanced sinusoidal voltage condition, THD for i d -i q method with Fuzzy Controller using matlab simulation is 1.64% and using RT DS Hard ware is 1.94%.
Figure 13 illustrates the performance of Shunt active power filter under balanced non-sinusoidal voltage condition, THD for i d -i q method with Fuzzy Controller using matlab simulation is 3.01% and using RT DS Hard ware is 3.54%.
Figure 14 gives the Total Harmonic Distortion (THD) comparison of i d -i q control strategy with Fuzzy Controller Using Matlab/Simulink and RTDS Hardware.In the present paper instantaneous active and Reactive current control strategy with Fuzzy controller is developed to mitigate the current harmonics in three phase four wire system using Matlab/simulink environment and it verified with Real Time Digital Simulator.This control strategy is capable to suppress the harmonics in the system during balanced sinusoidal, un-balanced sinusoidal and balanced non-sinusoidal conditions.The p-q control strategy is unable to yield an adequate solution when source voltages are not ideal.p-q theory needs additional PLL circuit for synchronization so p-q method is frequency variant, where as in i d -i q method angle "θ" is calculated directly from main voltages and thus enables the method to be frequency independent.Thus large numbers of synchronization problems with un-balanced and non-sinusoidal voltages are also avoided.Addition to that DC voltage regulation system valid to be a stable and steady-state error free system was obtained.

Figure 2 .Figure 3 .
Figure 2. Compensation characteristics of a shunt active ower filter.p

Figure 4 .
Figure 4. Reference current extraction with i d -i q method with Fuzzy controller.

Figure 7
Figure7shows the internal structure of the control circuit.The control scheme consists of Fuzzy controller[13], limiter, and three phase sine wave generator for reference current generation and generation of switching signals.The peak value of reference currents is estimated by regulating the DC link voltage.The actual capacitor voltage is compared with a set reference value.The error signal is then processed through a Fuzzy controller, which contributes to zero steady error in tracking the reference current signal.A fuzzy controller converts a linguistic control strategy into an automatic control strategy, and fuzzy rules are constructed by expert experience or knowledge database[14].Firstly, input voltage V dc and the input reference voltage V dc-ref have been placed of the angular velocity to be the input variables of the fuzzy logic controller.Then the output variable of the fuzzy logic controller is presented by the control Current I max .To convert these numerical variables into linguistic variables, the following seven fuzzy levels or sets are chosen as: NB (negative big), NM (negative medium), NS (negative small), ZE (zero), PS (positive small), PM (positive medium), and PB (positive big) as shown in Figure8.Rule Base: The elements of this rule base table are determined based on the theory that in the transient state, large errors need coarse control, which requires coarse input/output variables; in the steady state, small errors need fine control, which requires fine input/output variables.Based on this the elements of the rule table are obtained as shown in Table1, with "V dc " and "V dc-ref " as inputs.The fuzzy controller is characterized as follows: 1) Seven fuzzy sets for each input and output.2) Fuzzification using continuous universe of discoure.s

Figure 11 .
Figure 11.i d -i q with fuzzy controller under balanced sinusoidal (a) matlab simulation; (b) RT DS hardware.

Figure 12 .
Figure 12. i d -i q with fuzzy controller under un-bal sin, (a) matlab simulation; (b) RT DS hardware.

Figure 13 .
Figure 13.i d -i q with fuzzy controller under non-sin (a) Matlab simulation; (b) RT DS hardware.

Figure 14 .
Figure 14.THD for i d -i q method with fuzzy controller using Matlab and RTDS hardware.7.Conclusions