## 3 Results  
The compensator control scheme was tested extensively in simulation and laboratory experiments. The model built in the SIMULINK environment included a three-level converter rated at 15 kVA with a switching frequency set at 5 kHz, connected to the 3 \(\times\) 400V, 50 Hz grid. Selected results comparing the conventional control method and the proposed algorithm are presented below. Figure 7 illustrates the response of the current controllers for the unbalanced grid voltage conditions (between 0.1 and 0.14 s) and unbalanced reference current (between 0.18 s and 0.22 s). A simple PI controller exhibits excellent performance in balanced conditions (Figure 7b). The step response is characterized by a single overshoot and by fast error elimination. However, during the unbalanced voltage or reference current, a double grid frequency component appears in the SRF. The PI controller dynamic is not sufficient to follow this component, and errors are relatively high. Figure 7: Simulation results of the current controller operating under unbalanced voltage conditions: (**a**) test voltage waveform, (**b**) PI controller and (**c**) proposed PI and resonant controller. An additional resonant path in the current controller allows for the elimination of steady-state errors in unbalanced conditions. As shown in Figure 6(c), the resonant part extends controller performance to negative sequence signals, allowing for the elimination of errors during unbalanced voltage and precisely tracked negative sequence current references. The disadvantage of such a controller is its oscillatory step response. Figure 8 compares voltage-control strategies. A test voltage waveform includes a 10% symmetrical voltage dip between 0.4 and 0.48 s (Figure 7(a)). Figure 7(b) illustrates voltage control with a classical reactive power compensator, and Figure 7(c) illustrates the proposed method, which calculates active and reactive power components according to complex values of short-circuit impedance. In both cases, the presented control algorithm assures high dynamics, eliminating voltage errors during one cycle. The proposed apparent power-compensation strategy presents some advantages over the reactive power strategy. Firstly, the amplitude of the conditioner current is reduced. In such a case, the conditioner rating could be reduced, and the loading of the feeder related to voltage control is lower. Secondly, in the apparent power strategy, the conditioner action does not introduce phase distortion. In the reactive power strategy, a high variation in \(u_{q}\) is observed, which is minimized by the PLL algorithm. Figure 8: _Cont_. The power-conditioning functions of the designed system are verified experimentally. The scheme of the test setup is shown in Figure 9. The compensator is composed of a three-leg, three-level 15 kVA DC-AC grid converter and energy storage system. To provide dynamic voltage support, a power-source-type storage should be considered. In the experiment, this is a 75 V 94 F supercapacitor bank. Due to the high voltage ratio, it is interfaced to the DC-link by a dual active bridge (DAB) bi-directional DC-DC converter. The converter controls are implemented using C++ code in a dSPACE 1006 controller. The grid is simulated by a programmable voltage source with a programmable impedance module. A local resistive load bank is connected to avoid reverse power flow. A Fluke 434 power analyzer assures the measurement of the PCC voltage parameters according to the EN50160 standard. The experiments are conducted with 3 \(\times\) 120 V nominal phase voltage (208 V line-to-line voltage). The fundamental value of the grid impedance in the experiment is: \(X=0.4\)\(\Omega\), \(R=0.7\)\(\Omega\) and \(|Z|=0.8\)\(\Omega\). To verify the effectiveness of the PCC voltage control, a steady-state voltage regulation test was conducted. The conditioner regulates voltage to the nominal value using two control strategies: reactive power injection and apparent power injection with minimum current.