**2. Voltage sag generator**

112 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

*a*

*V*

*b*

*c*

*a*

*V V*

*V Vj*

*V Vj*

1

*a*

*V*

*b*

*c*

*a*

*V V*

*b*

*c*

*a*

*b*

*c*

*b*

*c*

1

31 3 32 6 31 3 32 6

11 3 36 2 11 3 36 2

*V Vj V*

*V Vj V*

*V j Vj V*

*V j Vj V*

*V V*

*V Vj V*

*V Vj V*

(3)

(4)

(5)

(6)

(7)

 

 

*V jV*

*V jV*

Type C

Type D

Type E

Type F

Type G

Previous works (Takahashi *et al*., 2008; Rylander *et al.*, 2007; Bhavar *et al.*, 2008; Teke *et al.*, 2008; Ma and Karady, 2008), have developed voltage sag generator which can be simply classified into 4 types. These four types of voltage sag generator are transformer, switchingimpedance, generator and amplifier. The transformer type uses a switch to adjust both presag voltage and sag magnitudes. The switching-impedance type creates voltage sags by switching impedance into a power system by using a thyristor-controlled reactor (TCR). The generator type uses a synchronous generator to give controlled 3-phase voltage sags. The amplifier type uses a waveform generator to create controlled 3-phase voltage sags.

An autotransformer is used as the 1-phase voltage sag generator as demonstrated (Rylander *et al.*, 2007, Bhavar *et al.*, 2008); Rylander, *et al* .used MOSFET to turn-on/turn-off for changing between the primary source and the secondary source. Bhavsar, *et al*. used motorized variac with multi tapping transformer, the position of the variac is changed using a signal generated by the PIC. The main disadvantage of this method is that the nonconducting pairs connected to the unselected taps dissipate power due to the taps. It has a

complex structure and requires control of signal processors. The TCR type creates a difference in voltage by firing the TCR at different angles. The disadvantages of TCR are the generation of low frequency harmonic current components and higher losses when working in the inductive region (Teke *et al.,* 2008). The generator type uses a synchronous generator that provides voltage sag by changing the exciting current of the generator. The control of sag generator's operation and monitoring of the system under test in performed by the Visual Basic programming (Collins and Morgan, 1996). The software of this paper had not displayed the waveform of voltage sag and disadvantages of this type are that it needs more space to install and is more expensive (Ma & Karady, 2008). The amplifier type can provide voltage sags with varying magnitude, duration, frequency and harmonics. After defining the desired waveform data is passed to power amplifier, at which outputs of adequate voltage levels of voltage sag are produced. This type is more convenient than others types, because it enables more precise control of all voltage sag characteristics and also allows testing of equipment in context of frequency variations and harmonic distortions. Therefore, a power amplifier type of voltage sag generator is selected for designing the voltage sag generator in this study. This chapter presents a 3-phase 4-wire voltage sag generator based on an *abc* algorithm((Oranpiroj *et al.,* 2009). Voltage sag generator has been created waveform by SagWave software. The actual voltage sag is created by the 3-phase 4-wire inverter which is controlled by low-cost dsPIC.
