## 5 A Case Study--Application as a Grid Voltage Compensator  
As already remarked, the basic requirement of the proposed converter is to obtain the bipolar voltage gain outputs with voltage step-down characteristics. The converter with these capabilities can be employed in many applications, for example, grid voltage compensation during the voltage sag or swell problem that requires the non-inverted and inverted outputs for their compensation, respectively. The primary roots of these problems are line faults, especially line-to-ground faults. Voltage sag with a depth level of less than 50% is one of the most occurring problems reported in [25]. Here, a voltage sag compensation approach-based interphase mechanism was developed. This approach was based on the series connection of dynamic voltage compensators in each phase of the three-phase system. Each dynamic voltage compensator consists of two bipolar voltage controllers, and their inputs are connected to the non-faulty phases. Two-line frequency transformers were used to interconnect the outputs of the two AC voltage controllers. The output windings of these two transformers were connected in series to obtain the compensating voltage. The phase alignment of this voltage with the voltage of the faulty phase is one of the big issues with this approach. There is no such problem in the second voltage compensating approach, where the dynamic voltage restorer is connected in the same phase in which voltage correction is required. This arrangement is shown in Figure 9.  
Figure 8: Recording of output waveforms (blue) with respect to input voltage (red) with a voltage gain of 0.6: (**a**) voltage in-phase form; (**b**) voltage out-of-phase form; (**c**) frequency regulation form. In this system, the switch (\(S\)) connected to the output of the AC voltage controller normally remains closed, and in this case, no voltage is injected into the line. It only opens once the voltage correction in the line is required, and this process is initiated upon the detection of the problem. Here, the line frequency transformer (\(T\)) facilities the injection of the compensating voltage. The detailed process of Figure 9 is outlined in the form of the block diagram presented in Figure 10.  
The detection of the problem with the depth level was carried out by comparing the line peak voltage (\(V_{p(line)}\)) with the peak value of the reference voltage (\(V_{p(up)}\)). The peak line voltage was obtained with the help of the peak voltage detector. If the line voltage is less than the reference voltage, it indicates a voltage sag problem in the line, and the AC voltage controller has to produce the non-inverted output (\(NIO\)) to compensate for the problem. On the other hand, if the line voltage is greater than the reference voltage, then there is a problem of voltage swell, and the AC voltage controller has to produce the inverted output (\(IO\)) to tackle this issue. The magnitude adjustment of the compensating voltage that is available at the input of the series connected transformer is somehow critical as the change in the load voltage is also reflected in the input voltage of the AC voltage  
Figure 10: Block diagram of the voltage compensation process. Figure 9: Test circuit for the voltage compensation process. controller, which means if load voltage is reduced, then input voltage of the converter is also reduced and vice versa. In order to address this problem, the required voltage gain was computed with the information of line and reference voltage as. \[k_{v}=\frac{\left|V_{p(ref)}-V_{p(line)}\right|}{V_{p(line)}} \tag{22}\]  
The simulated outputs of the voltage compensating system in Figure 10 are shown in Figure 11a,b for the correction of the line voltage during the voltage sag and swell issues, respectively, with a depth level of 20%. Here, as an example, the required load voltage was 100 V peak.