# Generalized algorithm for determining the control functions of an AC voltage compensator with a bipolar AC/AC converter

Pawel Szcześniak, Elżbieta Sztajmec

► To cite this version:

Pawel Szcześniak, Elżbieta Sztajmec. Generalized algorithm for determining the control functions of an AC voltage compensator with a bipolar AC/AC converter. The 26th European Conference on Power Electronics and Applications, GDR SEEDS France & EPE Association, Mar 2025, Paris, France. 10.34746/epe2025-0192. hal-05105858

HAL Id: hal-05105858

https://utc.hal.science/hal-05105858v1

Submitted on 10 Jun 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Generalized algorithm for determining the control functions of an AC voltage compensator with a bipolar AC/AC converter

Paweł Szcześniak

Institute of Automatic Control Electronics and Electrical Engineering, University of Zielona Góra,

Licealna 9, 65-417 Zielona Góra, Poland
Tel.: +48 661105320.

E-Mail: p.szczesniak@iee.uz.zgora.pl

URL: https://iaee.uz.zgora.pl/

Elżbieta Sztajmec

Faculty of Electrical and Computer Engineering, Rzeszow University of Technology, Al. Powstańców Warszawy
12, 35-959 Rzeszów, Poland

Tel.: +48 17 865 12 19.

E-Mail: e.sztajmec@prz.edu.pl

URL: https://keie.prz.edu.pl/

## Acknowledgements

This work was partially supported by a program of the Polish Ministry of Science under the title 'Regional Excellence Initiative', project no. RID/SP/0050/2024/1.

## Keywords

<<AC-AC converter>, <<Power quality>, <<Voltage sag compensators>, <<Control methods for electrical systems>>.

## Abstract

Power quality problems in the low voltage distribution grid are related to the development of prosumer electricity generators (especially PV) and the network's inadequacy to new distributed energy sources with significant nominal power. The main problem is related to the increase in voltage above the normative values and its asymmetry. In the scientific literature, one can find many articles describing this problem and methods of its solution based on the use of power electronics systems, energy storage, transformer tap changers or appropriate management of energy demand and production. The paper presents a generalized procedure for determining the control functions of transistors in an AC voltage compensator with a bipolar AC/AC converter. The obtained mathematical relations allow determining the control functions for the amplitude or phase asymmetry of input voltages. The correctness of the determined relations was verified in simulation studies.

## Introduction

Low voltage distribution networks in the modern power system are characterized by a high degree

of voltage value changes [1]. These changes are caused by various factors, the most important of which are frequent changes in line load, uneven load of individual lines in three-phase systems as well as excessive generation of energy from distributed prosumer sources. In addition, various line damages may occur, causing changes in voltage value and phase shifts between individual phases. An example of such disturbances are short circuits in the system. An example of voltage variation and asymmetry for a three-phase low-voltage network in the area of a small European city where prosumer sources occur is shown in Fig. 1.

<figure><img src="image_2.png" /><figcaption>Fig. 1: Low voltage variation in individual lines of the distribution network on the example of measurements in the distribution network of a small European town</figcaption></figure>

There are several methods of regulating low voltage in the distribution network. The greatest dynamics of regulation are achieved by using power electronic AC voltage regulation systems. Here, one can distinguish static compensator systems or those using energy storage [2]-[7]. One of the static AC voltage compensators is the system proposed in [8], [9], where the general description of the operation and basic properties have been defined. This compensator is based on the connection of two bipolar AC/AC controllers. Each of these controllers is powered from a
different line than the compensated line. Then, in [10], a method for calculating the control functions of the converter transistors was proposed and the range of compensating voltage generation was shown. The proposal for calculating the control functions was proposed based on the angular dependencies for the defined sectors in the complex reference frame. The control functions were generally defined for a symmetrical power supply system, which is insufficient, because the real system is characterized by voltage asymmetry (see Fig. 1) and there may also be asymmetries of the phase shift between individual voltages.

The main contribution of the paper is to present generalized dependencies for control functions of individual transistors of bipolar AC/AC controllers. Control functions are calculated for the presence of both amplitude asymmetry and phase asymmetry in three-phase grid voltages. The correctness of determining the control functions was verified in simulation studies.

## Topology description

The proposed AC voltage change compensator system of a three-phase AC network consists of three independent modules for each line. The power supply of a given compensator module is provided from two other lines than the line in which the compensator operates. For example, the module compensating voltage changes in line 1 is supplied from line 2 and line 3. An example of connecting compensator modules is shown in Fig. 2. This method of connection even allows for compensation of voltage drops in one of the lines.

<figure><img src="image_3.png" /><figcaption>Fig. 2: The method of connecting independent compensator modules for each line of a three-phase system</figcaption></figure>

Each of the compensator modules is built from two bipolar matrix controllers (MC) – Fig. 3. Each of the matrix converters MC1 and MC2 enables the generation of a voltage with adjustable amplitude and variable phase. The idealized phase shift of the output voltage in relation to the supply voltage is equal $180°$ ($π$ rad) for pulse duty factor of the control signal $0[D≤0.5$ and $0°$ for $0.5[D≤1]$. The idealized voltage amplitude and output voltage phase shift characteristics for a single bipolar AC/AC controller are shown in Fig. 4 [8]–[10].

<figure><img src="image_4.png" /><figcaption>Fig. 3: Topologies of two bipolar AC/AC controllers combined in one compensator module for the selected line (example for line 1)</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Fig. 4: Idealized characteristics of voltage amplitude regulation and output voltage phase shift with respect to supply voltage as a function of pulse duty cycle $D$ for a single bipolar AC/AC controller</figcaption></figure>

The full compensator module for a given line of a three-phase system is supplied from the other two lines. Then, at the module output, we get the sum of two voltages VMC1 and VMC2 (Fig. 3). The
summation is performed using separating transformers $T_3, T_4$. Also, the supply voltage of the individual AC/AC module for safety purposes is made using separating transformers $T_1$ and $T_2$ (Fig. 3).

The article considers the operation of the compensation module for line 1 supplied from line 2 and line 3 (Fig. 3). The operation will be identical for the subsequent modules. For the connection of the compensator system of line 1 as shown in Fig. 2 and Fig. 3 and the control characteristics shown in Fig. 4, it is possible to obtain voltages with adjustable amplitude on individual modules MC1 and MC2 as shown in the phasor diagrams from Fig. 5. At the output of the MC1 module, we can obtain a voltage with a phase shift of the voltage of line 2 ($v_2$) and a phase shift opposite to it ($-v_2$). At the output of the MC2 module, we can obtain a voltage with a phase shift of the voltage of line 3 ($v_3$) and a phase shift opposite to it ($-v_3$). By adding both voltages $v_{MC1}$ and $v_{MC2}$, we can obtain any compensation voltage, the regulation range of which depends on the phase shift of the compensation voltage $v_{C1}$, which was discussed in [10].

<figure><img src="image_6.png" /><figcaption>Fig. 5: Phasors of the output voltages obtained at the output of individual MC1 and MC2 modules for the compensator module for line 1</figcaption></figure>

## Description of proposed algorithm for determining the control functions

In order to determine the algorithm for calculating the control functions of individual AC/AC controllers for a given module, the parameters of the supply voltages must first be determined. For the voltage compensator in line 1, the following parameters must be determined (Fig. 6): 1) the amplitudes of the voltages $V_2$ and $V_3$, whose instantaneous values are constantly changing (see Fig. 1), 2) the phase shift angles $\phi_2$ and $\phi_3$ of these voltages, which can also be subject to continuous

change. Then we calculate the vector $v_{ref}$ of the compensating voltage with the amplitude $V_{ref}$ and the phase shift $\phi_{ref}$, based on the knowledge of the instantaneous values of the amplitudes and phase shifts of the supply voltages $v_2$ and $v_3$.

<figure><img src="image_7.png" /><figcaption>Fig. 6: Definition of signal parameters necessary to determine the compensation voltage reference vector</figcaption></figure>

The solution of the problem of voltage regulation with a given amplitude $V_{ref}$ and phase shift $\phi_{ref}$ by switching on two voltages with a given amplitude ($v_2, v_3$) and phase ($\phi_2, \phi_3$) consists in determining the relative switching times of these voltages defined as $d_1$ and $d_2$. Then, we need to solve the system of equations described by the relation (1). This system of equations is the complex notation of the output reference voltage based on the complex notation of supply voltages.

$$ 
\begin{aligned}
V_{ref} \cos(\phi_{ref}) &= d_1 V_2 \cos(\phi_2) + d_2 V_3 \cos(\phi_3) \\
V_{ref} \sin(\phi_{ref}) &= d_1 V_2 \sin(\phi_2) + d_2 V_3 \sin(\phi_3)
\end{aligned}
\quad (1) $$

The solutions of the system equations (1) are the values of the coefficients $d_1$ and $d_2$, and $-1 \le d_1 \le 1$, $-1 \le d_2 \le 1$. When the $d_1$ coefficient is negative, it means that the voltage of $-v_2$ is switched on, whereas when $d_1$ is positive, the voltage $v_2$ is switched on. Similarly in the second case, when the coefficient $d_2$ is negative it means that the voltage of $-v_3$ is switched on, whereas when $d_2$ is positive the voltage $v_2$ is switched on.

$$ d_1 = - \frac{V_{ref} \sin(\phi_3 - \phi_{ref})}{V_2 \sin(\phi_2 - \phi_3)} \quad (2) $$

$$ d_2 = \frac{V_{ref} \sin(\phi_2 - \phi_{ref})}{V_3 \sin(\phi_2 - \phi_3)} \quad (3) $$

In order for the coefficients $d_1$ and $d_2$ to be used for PWM control of the control functions of individual transistors, the transformation
described by the relationship (4) must be performed. Then we obtain the pulse duty coefficients $D_1$ and $D_2$, which correspond to the control range in accordance with the control characteristic of the bipolar controller shown in Fig. 3. The coefficients $D_1$ and $D_2$ are defined in the following ranges $0 \le D_1 \le 1$, $0 \le D_2 \le 1$, where $D_1=t_1/T_s$, $D_2=t_2/T_s$, $t_1$, and $t_2$ – duration of the control pulse for the first and second bipolar matrix controllers, respectively, $T_s$ – period of the PWM switching sequence.

$$D_1 = \left| \frac{d_1 - 1}{2} \right|, \quad D_2 = \left| \frac{d_2 - 1}{2} \right| \quad (4)$$

In order to automate the control system, the control function determination system should be implemented in a closed feedback loop. For this purpose, the single phase PLL (phase locked loop) algorithm was used, shown in Fig. 7 [11]. The proposed method of creating an orthogonal system is based on the discrete structure of the second order generalized integrator (SOGI) and is shown in Fig. 8. The implementation of the discrete SOGI algorithm is taken from the article [11] for the trapezoidal method of transforming a continuous system into a discrete system. All coefficients $a_1, a_2, b_0$ and $w$ are defined as described in the article [11]. Using the PLL algorithm, the amplitude values of the individual phase voltages ($V_1, V_2, V_3, V_{ref}$) and the phase shift angles ($\phi_2, \phi_3, \phi_{ref}$) were calculated.

<figure><img src="image_8.png" /><figcaption>Fig. 7: General structure of a single-phase PLL</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Fig. 8: Trapezoidal method implementation of SOGI algorithm</figcaption></figure>

## Simulation verification

In order to verify the correctness of the theoretical calculations, a simulation model for voltage compensation in line 1 was built in the Altair PSIM program, which the main circuit is shown in Fig. 9. The algorithm for determining the control functions, the converter and the digital implementation of the PLL algorithm was implemented using the built-in PSIM compiler and the C block.

<figure><img src="image_10.png" /><figcaption>Fig. 9: Simulation diagram of the proposed AC voltage compensator for line 1</figcaption></figure>

## Results of simulation studies

The simulation test results were presented for the voltage compensator only for line 1. The operation of the compensator for line 2 and line 3 will be identical to that for line 1. For the line 1 compensator, the individual modules of the bipolar AC/AC converter are supplied from the voltage of phase 2 and the voltage of phase 3. This method of compensation allows not only for the compensation of voltage increases and decreases in the line but also for the reconstruction of the voltage of the compensated line in the event of a complete voltage loss. All simulation test results shown in Figures 10 to 14 were obtained for various types of supply voltage unbalance.

Figure 10 shows the results of simulation studies of voltage compensation in phase 1 for voltage values higher than the nominal value of 230 VRMS, and a step change of this increase in order to illustrate the dynamics of the system operation. The following voltage changes occurred in the individual lines of the system: for line 1 from 240 VRMS to 260 VRMS, for line 2 from 220 VRMS to 240 VRMS, for line 3 from 220 VRMS to 235 VRMS.
<figure><img src="image_11.png" /><figcaption>Fig. 10: Simulation results for the following voltage changes occurred in the individual lines: for line 1 from 240 to 260 VRMS, for line 2 from 220 to 240 VRMS, for line 3 from 220 to 235 VRMS</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>Fig. 11: Simulation results for the following voltage changes occurred in the individual lines: for line 1 from 200 to 180 VRMS, line 2 from 220 to 200 VRMS, line 3 from 230 to 215 VRMS</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>Fig. 12: Simulation results for the following voltage changes occurred in the individual lines: for line 1 and line 2 from 250 VRMS to 180 VRMS with a 20-degree phase shift, line 3 from 230 to 215 VRMS</figcaption></figure>
<figure><img src="image_14.png" /><figcaption>Fig. 13: Simulation results for the following voltage changes occurred in the individual lines: for line 1 from 200 to 0 VRMS - voltage loss, line 2 and line 3 220 VRMS</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>Fig. 14: Simulation results for the following voltage changes occurred in the individual lines: for line 1 200 VRMS, line 2 220 VRMS, line 3 from 220 VRMS to 50 VRMS.</figcaption></figure>

Despite the asymmetric power supply and the dynamic change of voltage parameters in each phase, the compensator maintained the set value of the output voltage $v_{L1}$, in accordance with the set function $v_{L1 ref}$. The output voltage of the compensator $v_c$ follows the designated reference compensating voltage $v_c ref$. The obtained results show a transient state lasting about a quarter of a period for the grid voltage frequency.

Figure 11 shows the results for network voltages lower than the nominal value of 230 VRMS and the dynamic voltage change in individual lines as follows: line 1 from 200 VRMS to 180 VRMS, line 2 from 220 VRMS to 200 VRMS, line 3 from 230 VRMS to 215 VRMS. Similar results were also obtained as for the simulation presented in Fig. 10.

Figure 12 shows the compensator test results for typical network voltages occurring during a two-

phase short circuit of line 1 and line 2. The voltages for lines 1 and 2 dropped from 250 VRMS to 180 VRMS with a 20-degree phase shift of these voltages, with the line 3 voltage equal to 250 VRMS. As can be seen from the results, the output voltage of line 1 remains at the set level of 230 VRMS and the compensated phase shift. The obtained results show a transient state lasting about five periods of the network voltage frequency. The improvement of the dynamics of operation will be related to the selection of the parameters of the PI controllers used in the PLL algorithms.

Figure 13 shows the reconstruction of the line 1 voltage for a complete voltage loss in this line. The obtained results show that it is possible to rebuild the line voltage from the two remaining supply lines. The obtained results also show a transient state in the compensated line voltage,
which does not last longer than half a period of
the network voltage frequency.

The latest simulation test results shown in Fig. 14
illustrate the situation when a deep voltage dip
occurs in one of the lines from which the
compensator is supplied (in this case for line 3).
The simulation results show voltage
compensation in line 1 with the following
transient state of the individual voltages: line 1
200 VRMS, line 2 220 VRMS, line 3 from 220
VRMS to 50 VRMS. The voltage of phase 1 is
compensated to the set value of 230 VRMS
(v<sub>L1 ref</sub>). In the obtained results, the time of settling
the transient state in the voltage of the
compensated line v<sub>L1</sub> is about one period of the
grid voltage frequency.

The presented research results show the
enormous compensation potential of the proposed
system for various types of disturbances in the
grid voltages. In order to determine the full
compensation ranges, e.g. for a voltage drop of
one of the lines, the exact static characteristics of
the compensator should be determined using one
of the converter system modelling methods [12].
Additionally, the optimization of the selection of
PI controller settings should be considered.

Conclusion

The paper presents a concept of general
determination of control functions in an AC
voltage compensator based on bipolar matrix
controllers. Solving the system of equations
describing the complex notation of the
compensation voltage using the complex notation
of supply voltages yielded the dependencies for
the control coefficients *d*₁ and *d*₂. These
coefficients were then transformed to a form
useful in the PWM modulator. A preliminary
verification of the theoretical calculations was
carried out using simulation studies with single
phase PLL algorithm. The presented simulation
test results confirm the correctness of determining
the control signals for various asymmetries of the
power supply system. Using the proposed
compensator, it is possible to compensate for AC
voltage fluctuations in a wide range of supply
voltage changes, even in the event of a complete
loss of voltage as well as a deep voltage dip.

Further work will concern the correct
determination of the compensation range for
various grid voltage distortions as well as the
optimization of the selection of PI controller
parameters.

References

[1]. Razmi D, Lu T., Papari B., Akbari E., Fathi G., Ghadamyari M.: An Overview on Power Quality Issues and Control Strategies for Distribution Networks With the Presence of Distributed Generation Resources, IEEE Access, Vol. 11, pp 10308-10325, 2023.

[2]. Benysek G., Kaźmierkowski M.P., Popczyk J., Strzelecki R.: Power electronic systems as a crucial part of Smart Grid infrastructure – a survey, Bulletin of the Polish Academy of Sciences: Technical Sciences, Vol. 59, No. 4, pp 455-473, 2011.

[3]. Hashemi S., Østergaard J.: Methods and strategies for overvoltage prevention in low voltage distribution systems with PV, IET Renewable Power Generation, Vol. 11, pp 205-214, 2017.

[4]. Aziz T., Ketjoy N.: Enhancing PV penetration in LV networks using reactive power control and on load tap changer with existing transformers, IEEE Access, Vol. 6, pp 2683-2691, 2018.

[5]. Majumder R.: Aspect of voltage stability and reactive power support in active distribution, IET Generation, Transmission & Distribution, Vol. 8, pp. 442-450, 2014.

[6]. Zimann J.F., Batschauer A.L., Mezaroba M., Neves F.A.S.: Energy storage system control algorithm for voltage regulation with active and reactive power injection in low-voltage distribution network, Electric Power Systems Research, Vol. 174, pp. 105825, 2019.

[7]. Szcześniak P., Powroźnik P., Sztajmec E.: Selected voltage control methods in LV local distribution grids with high penetration of PV, Przegląd Elektrotechniczny, Vol. 99, No. 11/2023, pp. 62–65, 2023.

[8]. Kaniewski J.: Power flow controller based on bipolar direct PWM AC/AC converter operation with active load, Archives of Electrical Engineering, Vol. 68, No. 2, pp 341-356, 2019.

[9]. Kaniewski, J.: Three-Phase Power Flow Controller Based on Bipolar AC/AC Converter with Matrix Choppers. In Proceedings of the International Symposium on Power Electronics, Electrical Drives, Automation and Motion (SPEEDAM), Amalfi, Italy, 20–22 June 2018; pp. 709–715.

[10]. Sztajmec E., Szcześniak P.: Voltage Control in LV Distribution Grid Using AC Voltage Compensator with Bipolar AC/AC Matrix Choppers, Applied Sciences, Vol. 13, No. 15, pp 8736, 2023.
[11]. Ciobotaru M., Teodorescu R. and F. Blaabjerg F.: A new single-phase PLL structure based on second order generalized integrator, 2006 37th IEEE Power Electronics Specialists Conference, Jeju, Korea (South), 2006, pp. 1-6.

[12]. Szcześniak P.: A static and dynamic model of a space vector modulated matrix-reactance frequency converter, Electric Power Systems Research, Vol. 108, pp 82-92, 2014.