Proportional–Resonant Controller Structure with Finite Gain for Three-Phase Grid-Tied Converters

The paper presents the study of a three-phase system coupling a DC power source to a power grid. This study, based on an FPGA, implements a real-time control system and digital models of the power circuit. The proposed proportional–resonant (P+R) controller with a modified structure was part of the system, which can be used as an alternative controller to traditional ones, e.g., in photovoltaic systems. Due to difficulties in implementing resonant controllers, a P+R with a new structure using a PI controller was elaborated. With an appropriate approach to the generation of phase current patterns, it is possible to set the reactive current and, thus, compensate for the reactive power. The operation of the system for typical operating conditions (e.g., system startup, change in preset load) was characterized and compared with a classical solution using a PI controller.


Introduction
Three-phase inverter control systems coupling energy sources to the power grid have traditionally used PI controllers and a natural system transformation to a rotating dq system [1]. To improve their performance, many variants have been proposed in the literature, including multistate feedback and increasing the proportional gain. The disadvantage of PI controllers is, among others, the distortion of the line current waveform caused by harmonics of the line voltage, inserted through feedback. For this reason, other solutions are sought, such as those based on fuzzy logic [2].
Another solution is to use the proportional-resonant (P+R) controller [3]. The P+R controller has the ability to track sinusoidal varying signals and has selective amplitudefrequency characteristics. The P+R controller can be used in systems operating with a constant frequency of output voltage, e.g., in devices coupling renewable energy sources to the power grid [4]. This controller is designed for single-phase systems, but can be applied to three-phase systems, after their transformation to a two-phase orthogonal αβ stationary system [5]. In this case, two identical controllers operating independently in both axes are used. This solution allows also to control the reactive current of the supply line.
Among the advantages of P+R controllers is that they can be tuned to the grid frequency for accurate tracking of the fundamental reference frequency and to some low-order harmonic frequencies for selective harmonic compensation. From an implementation point of view, a P+R controller requires less computational effort and does not require a grid voltage feedback loop, while achieving the same performance as a PI controller [2]. Due to the amplitude-frequency-selective characteristic, the power line current distortion is lower compared to control systems with PI structure [6][7][8].
In addition to the basic structure of the P+R controller, there are modifications described in the literature that improve its operation in grids with unstable voltage and frequency [9,10]. The differences in their structures, compared to typical P+R controllers, are due to the different variants of the feedback loop and the change in the controller transmittance. Other solutions consist of a combination of a traditional PI regulator and a P+R regulator, which operate in dq [11] and αβ [12] systems. The P+R controller can operate with different types of converters, e.g., matrix converters [13] and multilevel inverters [14,15].
In the literature focused on simulation studies, implementations of structures composed of basic functional blocks are encountered [16][17][18]. However, they mainly concern an ideal regulator with infinite gain for the reference frequency. The implementation of such a structure into a digital system is not indicated due to the natural limitation of signal ranges in such systems (such a limitation also applies to analog circuits). Due to the large slope of the characteristics in the resonant frequency range, even small changes in the line voltage frequency cause large and dangerous changes in the reference signals. This limits the functionality of the control system. To avoid these problems, the P+R controller in digital systems is made, for example, as a second-order generalized integrator (SOGI) [19]. A more common way is to implement the controller as a bandpass filter [4,8,20]. It has the same form as a gain-limited P+R regulator (called real [2]). Such an implementation consists of an appropriate equation in the discrete signal domain, whose coefficients depend on the controller settings (gains of the proportional and resonant parts), the damping factor, and the grid frequency. Changing one of these parameters entails changing most of the parameters of the equation, which provides difficulties in implementing such a controller in grids with unstable voltage and frequency.
As presented in the introduction, despite its advantages, the P+R controller is difficult to implement. Therefore, a new structure for the implementation of the controller is proposed using basic functional blocks and a PI regulator. The conducted tests confirmed the correct operation of the structure in single-phase systems [21,22]. Section 2 contains information on the P+R regulator, i.e., its structure and characteristics, as well as experimental studies comparing the continuous transmittance to the proposed one implemented in the FPGA. In Section 3, the assumptions for the performed tests in a three-phase system are presented. Section 4 contains the results of these studies, especially a comparison of the PI and P+R controllers. In Section 5, conclusions are presented, formulated on the basis of the conducted tests.

Proportional-Resonant Controller
An ideal regulator has infinite gain for the frequency to which it is tuned. In practice, a controller with limited gain is used with transmittance (Equation (1)) [2].
G P+R (s) = K P + 2K I ξω r s s 2 + 2ξω r s + ω r 2 . (1) In Figure 1, the amplitude-frequency characteristics are shown for the following parameters of the controller in Equation (1): K P = 1, K I = 100, ω r = 100π, and ξ = 0.05. For signals with resonant frequency of the controller, gain is equal to K P + K I . It is much bigger than for other frequencies. The resonant part of the controller can expressed as shown in Equation (2) [19].
where Y R is the resonant controller output signal, X is the resonant controller input signal, T 1 , T 2 are integration time constants, and k is the gain.   (1)).
Using Equation (2), a structure consisting of simple blocks (P or I) was obtained. The integral part with integration time T2 and the proportional part with gain k form the parallel structure of the PI controller. The proposed structure of the P+R controller is shown in Figure 2, where the resonant part of the regulator is highlighted by a dashed line [22]. If it is assumed that T1 = T2 = T, the relationship of the coefficients in Equations (1) and (2) can be expressed as In order to verify the discretization of the P+R controller, the digital structure of this controller was tested for amplitude-frequency characteristics. A schematic diagram of the system that was implemented in the FPGA device is shown in Figure 3.  (1)).
Using Equation (2), a structure consisting of simple blocks (P or I) was obtained. The integral part with integration time T 2 and the proportional part with gain k form the parallel structure of the PI controller. The proposed structure of the P+R controller is shown in Figure 2, where the resonant part of the regulator is highlighted by a dashed line [22].  (1)).
Using Equation (2), a structure consisting of simple blocks (P or I) was obtained. The integral part with integration time T2 and the proportional part with gain k form the parallel structure of the PI controller. The proposed structure of the P+R controller is shown in Figure 2, where the resonant part of the regulator is highlighted by a dashed line [22]. If it is assumed that T1 = T2 = T, the relationship of the coefficients in Equations (1) and (2) can be expressed as In order to verify the discretization of the P+R controller, the digital structure of this controller was tested for amplitude-frequency characteristics. A schematic diagram of the system that was implemented in the FPGA device is shown in Figure 3. If it is assumed that T 1 = T 2 = T, the relationship of the coefficients in Equations (1) and (2) can be expressed as In order to verify the discretization of the P+R controller, the digital structure of this controller was tested for amplitude-frequency characteristics. A schematic diagram of the system that was implemented in the FPGA device is shown in Figure 3.  Tests of amplitude-frequency characteristics were performed for the input signal frequency range from 40 to 60 Hz, while the regulator resonance frequency was 50 Hz. The results of these tests are shown in Figure 4. Comparing the characteristics of the continuous form of the regulator with those of the digitally implemented regulator, the digital P+R controller has significantly less signal gain at the resonant frequency (ideal-40 dB, implemented-25 dB). Furthermore, its phase shift is smaller for signals with frequencies other than resonant (ideal-around 80°, Tests of amplitude-frequency characteristics were performed for the input signal frequency range from 40 to 60 Hz, while the regulator resonance frequency was 50 Hz. The results of these tests are shown in Figure 4.  Tests of amplitude-frequency characteristics were performed for the input signal frequency range from 40 to 60 Hz, while the regulator resonance frequency was 50 Hz. The results of these tests are shown in Figure 4. Comparing the characteristics of the continuous form of the regulator with those of the digitally implemented regulator, the digital P+R controller has significantly less signal gain at the resonant frequency (ideal-40 dB, implemented-25 dB). Furthermore, its phase shift is smaller for signals with frequencies other than resonant (ideal-around 80°, Comparing the characteristics of the continuous form of the regulator with those of the digitally implemented regulator, the digital P+R controller has significantly less signal gain at the resonant frequency (ideal-40 dB, implemented-25 dB). Furthermore, its phase shift is smaller for signals with frequencies other than resonant (ideal-around Energies 2021, 14, 6726 5 of 17 80 • , implemented-70 • ). This is due to the accuracy of the calculations and the rounding involved. These features allow for more stable operation following small changes in line voltage frequency.

P+R Operation in Three-Phase System
The P+R controller can be used in three-phase systems. The control system operates in the αβ coordinate system, and patterns of the current waveform are obtained similarly to the single-phase system from the phase voltage waveforms as described in [21,22]. The transformation from the natural coordinate system to αβ follows the relationship in Equation (4). This is the version of the αβ transformation in which the natural and αβ system waveforms have equal amplitudes.
In this system, it is possible to independently set the active and reactive components of the supply line currents. In Figure 5, the alpha-beta frame is presented with the current space vector Im and the voltage space vector Um. Both the voltage and the current space vectors were calculated using Equation (4). Assuming that the voltage vector is rotating with angular velocity wt, the current vector rotates with the same angular velocity but is delayed by an angle ϕ for inductive load. In this case, the component of the current vector lying in the direction of the voltage vector corresponds to the active component I P , and that in the orthogonal direction corresponds to the reactive component I Q .

P+R Operation in Three-Phase System
The P+R controller can be used in three-phase systems. The con in the αβ coordinate system, and patterns of the current waveform ar to the single-phase system from the phase voltage waveforms as desc transformation from the natural coordinate system to αβ follows the r tion (4). This is the version of the αβ transformation in which the na waveforms have equal amplitudes.
In this system, it is possible to independently set the active and r of the supply line currents. In Figure 5, the alpha-beta frame is presen space vector Im and the voltage space vector Um. Both the voltage a vectors were calculated using Equation (4). Assuming that the volta with angular velocity wt, the current vector rotates with the same an delayed by an angle φ for inductive load. In this case, the component lying in the direction of the voltage vector corresponds to the active that in the orthogonal direction corresponds to the reactive compone    The equations presented are the control rules implemented in the control system. From these, the orthogonal reference currents are determined as follows: where k P and k Q are arbitrarily preset components corresponding to the active and reactive component of the current, respectively. Therefore, it is possible to use an inverter in which the reference currents are also obtained as in Equation (6) as a reactive power compensator. This could compensate for both inductive and capacitive reactive power, thereby implementing voltage control at the point of connection to the line. The primary role of the system is to transfer energy from the renewable energy source to the grid. Therefore, the level of compensated reactive power depends on the current load of the device with active power. The reactive power that can be generated is limited by the following equation: where S Max is the maximum apparent power, and P is the actual active power value. Power S Max in this case is equal to the nominal active power of the converter.

Laboratory Model
The laboratory model tests of a three-phase, three-wire, three-leg, two-level inverter with a P+R controller were performed in real time (RT) using the Quartus II software package. The P+R controller was part of an inverter control system coupling a three-phase power line to a renewable energy source. In practice, controllers are commonly tested using real-time models implemented in the same structure as the control system. This is possible due to the high computational capabilities of programmable systems, e.g., FPGAs. Using previously verified models allows testing controllers in similar conditions as in cases with a real power system. This method of controller testing is illustrated in Figure 6. The basic currents and the voltage waveform during hardware startup registered when the active current component changed from 21 A to 16 A are shown in Figure 7. This case refers to a reactive current component equal to zero.
Energies 2021, 14, 6726 6 of 17 where kP and kQ are arbitrarily preset components corresponding to the active and reactive component of the current, respectively. Therefore, it is possible to use an inverter in which the reference currents are also obtained as in Equation (6) as a reactive power compensator. This could compensate for both inductive and capacitive reactive power, thereby implementing voltage control at the point of connection to the line. The primary role of the system is to transfer energy from the renewable energy source to the grid. Therefore, the level of compensated reactive power depends on the current load of the device with active power. The reactive power that can be generated is limited by the following equation: where SMax is the maximum apparent power, and P is the actual active power value.
Power SMax in this case is equal to the nominal active power of the converter.

Laboratory Model
The laboratory model tests of a three-phase, three-wire, three-leg, two-level inverter with a P+R controller were performed in real time (RT) using the Quartus II software package. The P+R controller was part of an inverter control system coupling a three-phase power line to a renewable energy source. In practice, controllers are commonly tested using real-time models implemented in the same structure as the control system. This is possible due to the high computational capabilities of programmable systems, e.g., FPGAs. Using previously verified models allows testing controllers in similar conditions as in cases with a real power system. This method of controller testing is illustrated in Figure 6. The basic currents and the voltage waveform during hardware startup registered when the active current component changed from 21 A to 16 A are shown in Figure 7. This case refers to a reactive current component equal to zero.   In the next level of research, the waveforms of currents and voltages, active and reactive power for a constant reference value iαref equal to 10 A, and zero, positive, and negative reactive components of current iβref were registered. Figure 8 shows the case when the active component of the reference current was equal to 20 A with zero reactive component.  In the next level of research, the waveforms of currents and voltages, active and reactive power for a constant reference value i αref equal to 10 A, and zero, positive, and negative reactive components of current i βref were registered. Figure 8 shows the case when the active component of the reference current was equal to 20 A with zero reactive component. In the next level of research, the waveforms of currents and voltages, active and reactive power for a constant reference value iαref equal to 10 A, and zero, positive, and negative reactive components of current iβref were registered. Figure 8 shows the case when the active component of the reference current was equal to 20 A with zero reactive component.   It can be seen from Figure 8 that the reactive power value is close to zero within the limits resulting from the accuracy of the measuring systems and parasitic reactance.
As shown in Figures 9 and 10, the inverter can generate both types of reactive power, at the same active power, transferring it from the energy source to the grid. It can be seen from Figure 8 that the reactive power value is close to zero within the limits resulting from the accuracy of the measuring systems and parasitic reactance.
As shown in Figures 9 and 10, the inverter can generate both types of reactive power, at the same active power, transferring it from the energy source to the grid.   The blocks implemented in the software were divided into two parts: the simulator of the power circuit (energy source, inverter, and power line) and the control system (controller, modulation system, and current pattern signal generation). In Table 1, the assumptions made during the experimental verification of the system with a digital P+R controller are given. The reference waveform of the line current was obtained according to Equation (5). The coefficients k P and k Q were limited by software such that the maximum current value was not exceeded. An appropriately scaled (by k v coefficient) αβ reference voltage signal was added to the controller output signal. The amplitude of these signals was chosen in    The line current is the result of the voltage difference between the inverter and the grid. Its waveform in one line is described by the following equation: where v c is the inverter voltage, v f is the phase voltage in the supply line, R is the line resistance, and L is the total inductance of the system. Using Equation (8), the line current values at discrete time intervals were determined (calculations for T p = 4 µs and T RL = 0.021).
where i(n) is the current value at the n-th sample time, i(n − 1) is the current value at the previous sample time, and v s (n − 1) is the value of the voltage difference between inverter and line voltages. The blocks that make up the control system are a P+R controller, a modulator consisting of a triangular waveform generator (24 kHz), and three numerical comparators. The numerical comparators compare the output signal of the controller with the triangular waveform and, on this basis, generate control signals for the switches of the inverter legs. In Figure 11, the block diagram of the individual modules implemented in the FPGA for the study is shown.

Results and Analysis
The conducted studies investigated the following issues:

•
Startup of the device with a preset active power, • The change in the preset active load, • Startup of the device with a preset active and reactive power, • The change in the preset reactive load, • Phase modulation of grid voltages, • Step phase shift of grid voltages, • Grid voltage drop.
Example waveforms of these operating states are presented in Figures 12simplicity, the waveforms illustrate voltages and currents in the αβ axes after tr mation from the natural reference system. The values marked on the graphs are am values of currents and voltages. Inverter operation and associated phase current tions were performed in the RT system and implemented for a three-phase line. Th forms were observed with the Quartus II environment tool using the JTAG pro transfer samples of selected signals to a computer.

Results and Analysis
The conducted studies investigated the following issues: • Startup of the device with a preset active power, • The change in the preset active load, • Startup of the device with a preset active and reactive power, • The change in the preset reactive load, • Phase modulation of grid voltages, • Step phase shift of grid voltages, • Grid voltage drop.
Example waveforms of these operating states are presented in Figures 12-18. For simplicity, the waveforms illustrate voltages and currents in the αβ axes after transformation from the natural reference system. The values marked on the graphs are amplitude values of currents and voltages. Inverter operation and associated phase current calculations were performed in the RT system and implemented for a three-phase line. The waveforms were observed with the Quartus II environment tool using the JTAG protocol to transfer samples of selected signals to a computer.
For all operating conditions, the controller operation was stable. In Figures 12-15, the set points of active and reactive components changed, and, in all cases, active and reactive components of the current reached set values. In Figures 16-18, a grid operation with unstable parameters was shown. As in previous cases, the response to these changes in the control system was correct and quickly reached the reference waveforms. In the case of phase modulation (Figure 16), no significant phase shift was observed. During step phase change (Figure 17), the time needed to achieve the reference waveform was about 10 ms. In the case study with voltage drop, the current change was not significant.
Example waveforms of these operating states are presented in Figures 12-18. For simplicity, the waveforms illustrate voltages and currents in the αβ axes after transformation from the natural reference system. The values marked on the graphs are amplitude values of currents and voltages. Inverter operation and associated phase current calculations were performed in the RT system and implemented for a three-phase line. The waveforms were observed with the Quartus II environment tool using the JTAG protocol to transfer samples of selected signals to a computer.                For all operating conditions, the controller operation was stable. In Figures 12-15, the set points of active and reactive components changed, and, in all cases, active and reactive components of the current reached set values. In Figures 16-18, a grid operation with unstable parameters was shown. As in previous cases, the response to these changes in the control system was correct and quickly reached the reference waveforms. In the case of phase modulation (Figure 16), no significant phase shift was observed. During step phase change (Figure 17), the time needed to achieve the reference waveform was about 10 ms. In the case study with voltage drop, the current change was not significant.
In the next step of the study, control systems with the proposed P+R controller and the classical PI controller were compared. In Table 2, the parameters of these controllers are compared. In traditional solutions, a large gain is used in the proportional path of the PI controller; however, for the purpose of this study, it was set equal to the proportional part of the P+R controller. This allowed comparing the operation of the controllers under similar conditions.   For all operating conditions, the controller operation was stable. In Figures 12-15, the set points of active and reactive components changed, and, in all cases, active and reactive components of the current reached set values. In Figures 16-18, a grid operation with unstable parameters was shown. As in previous cases, the response to these changes in the control system was correct and quickly reached the reference waveforms. In the case of phase modulation (Figure 16), no significant phase shift was observed. During step phase change (Figure 17), the time needed to achieve the reference waveform was about 10 ms. In the case study with voltage drop, the current change was not significant.
In the next step of the study, control systems with the proposed P+R controller and the classical PI controller were compared. In Table 2, the parameters of these controllers are compared. In traditional solutions, a large gain is used in the proportional path of the PI controller; however, for the purpose of this study, it was set equal to the proportional part of the P+R controller. This allowed comparing the operation of the controllers under similar conditions.  In the next step of the study, control systems with the proposed P+R controller and the classical PI controller were compared. In Table 2, the parameters of these controllers are compared. In traditional solutions, a large gain is used in the proportional path of the PI controller; however, for the purpose of this study, it was set equal to the proportional part of the P+R controller. This allowed comparing the operation of the controllers under similar conditions. Both types of controllers were operated in the αβ reference system. Characteristics were plotted for the following operating states:

•
Startup of the device with the preset active power (from 0 to the preset power), • Change in the preset active load (from 0.5P N to the preset power, where P N is the nominal power of the inverter), • Change in the character of active power, • Change in the preset reactive load with constant active power load (constant 0.5P N , reactive power from 0 to the preset power).
For the last point, it is important to keep in mind the limitation resulting from Equation (7). When the active power load is 0.5P N , the maximum reactive component is limited to 0.8P N . The changes in the set quantities were triggered at random moments of the supply voltage period. For this reason, the presented results are an average of 10 measurements for each set point of operation. As a criterion for a properly operating controller, a moment at which the deviation of the regulation was no more than 10% of the instantaneous value of the set waveform was assumed. Figures 19-22 illustrate the characteristics of control systems with the P+R or PI controller for various operating conditions. They show how the regulation time (t r in ms) changes depending on the set value of active or reactive component. The value of the set component (as well as for other cases) expressed as a function of the characteristics as a percentage refers to the rated power of the device. In Figure 19, the dependence of the adjustment time on the set active component during the startup of the device is shown. With the increase in the set point value, the regulation time in both variants increased. For the P+R controller, for 0.5P N and higher values, the regulation time oscillated around 30 ms. In the case of the PI regulator, on the other hand, the adjustment time was significantly longer and was characterized by an increase across the entire range of parameter changes. The largest difference was observed for the rated power, and it was about 20 ms. The smallest was observed for 0.6P N , and it was about 8 ms.
The graph in Figure 20 shows the dependence of the adjustment time on the set value of the active component for a step change of the set load. The study assumes that the power changes from 0.5P N to the set point. As in the previous case, the adjustment time of the system with the PI controller was significantly longer. The smallest difference was observed for the change to maximum power, and it was 27 ms. The smallest difference was 15 ms for 0.3P N . Both types of controllers were operated in the αβ reference system. Characteristics were plotted for the following operating states: For the last point, it is important to keep in mind the limitation resulting from Equation (7). When the active power load is 0.5PN, the maximum reactive component is limited to 0.8PN. The changes in the set quantities were triggered at random moments of the supply voltage period. For this reason, the presented results are an average of 10 measurements for each set point of operation. As a criterion for a properly operating controller, a moment at which the deviation of the regulation was no more than 10% of the instantaneous value of the set waveform was assumed. Figures 19-22 illustrate the characteristics of control systems with the P+R or PI controller for various operating conditions. They show how the regulation time (tr in ms) changes depending on the set value of active or reactive component. The value of the set component (as well as for other cases) expressed as a function of the characteristics as a percentage refers to the rated power of the device. In Figure 19, the dependence of the adjustment time on the set active component during the startup of the device is shown. With the increase in the set point value, the regulation time in both variants increased. For the P+R controller, for 0.5PN and higher values, the regulation time oscillated around 30 ms. In the case of the PI regulator, on the other hand, the adjustment time was significantly longer and was characterized by an increase across the entire range of parameter changes. The largest difference was observed for the rated power, and it was about 20 ms. The smallest was observed for 0.6PN, and it was about 8 ms. The graph in Figure 20 shows the dependence of the adjustment time on the set value of the active component for a step change of the set load. The study assumes that the power changes from 0.5PN to the set point. As in the previous case, the adjustment time of the system with the PI controller was significantly longer. The smallest difference was The largest difference was about 15 ms for a reactive component equal to 10% of the rated power. The adjustment time of both systems stabilized at about Q = 0.4PN, achieving values of about 36 ms for P+R and 43 ms for PI. The dependence of the adjustment time while the set reactive component was changed in the case of a constant active component is presented in Figure 22. In this case, the adjustment time increased with the increase in the set reactive component for both controllers. The differences in this case were the smallest and did not exceed 10 ms. power. In both cases, this time increased with the initial value of the reactive component.
The largest difference was about 15 ms for a reactive component equal to 10% of the rated power. The adjustment time of both systems stabilized at about Q = 0.4PN, achieving values of about 36 ms for P+R and 43 ms for PI. The dependence of the adjustment time while the set reactive component was changed in the case of a constant active component is presented in Figure 22. In this case, the adjustment time increased with the increase in the set reactive component for both controllers. The differences in this case were the smallest and did not exceed 10 ms.  The remaining characteristics, illustrated in Figures 21 and 22, concern the operation of the system when the reactive component of the line currents was also set. Figure 21 illustrates the changes in the adjustment time upon changing the character of the reactive power. In both cases, this time increased with the initial value of the reactive component.  In each of the cases studied, the PI controller had a steady-state error, which was not observed for the P+R controller. For this reason, the PI controller in such systems is used after transformation to a dq system, where it operates on constant signals.

Conclusions
The presented experimental results of the studies prove the functionality of the P+R controller in systems of three-phase inverters coupling energy sources to the power grid. For all the tests carried out, the P+R controller was characterized by better dynamics of operation than the PI regulator. The differences were even more than one period of supply voltage in favor of the P+R controller. In the case of reactive power control, when the system played an additional role in compensating for reactive power, the differences were not so significant, but the P+R controller was still characterized by better dynamics of operation. Since both controllers had the same proportional gain, it can be concluded that the resonant part of the proposed P+R controller provides better dynamic performance. The possibility of using a lower gain in the feedback will also reduce the harmonic transfer when the voltage is distorted.
Real-time testing was performed using an FPGA-based platform. This allowed the control system to be tested as it might be used in a real device. During such tests, the control system cooperated with the blocks, in which the parameters were artificially generated for the power grid, inverter, and energy source. The high frequency of operation and, thus, the calculations allow assuming that the control system will work properly in cooperation with a real device and grid, without requiring many improvements.  In each of the cases studied, the PI controller had a steady-state error, which was not observed for the P+R controller. For this reason, the PI controller in such systems is used after transformation to a dq system, where it operates on constant signals.

Conclusions
The presented experimental results of the studies prove the functionality of the P+R controller in systems of three-phase inverters coupling energy sources to the power grid. For all the tests carried out, the P+R controller was characterized by better dynamics of operation than the PI regulator. The differences were even more than one period of supply voltage in favor of the P+R controller. In the case of reactive power control, when the system played an additional role in compensating for reactive power, the differences were not so significant, but the P+R controller was still characterized by better dynamics of operation. Since both controllers had the same proportional gain, it can be concluded that the resonant part of the proposed P+R controller provides better dynamic performance. The possibility of using a lower gain in the feedback will also reduce the harmonic transfer when the voltage is distorted.
Real-time testing was performed using an FPGA-based platform. This allowed the control system to be tested as it might be used in a real device. During such tests, the control system cooperated with the blocks, in which the parameters were artificially generated for the power grid, inverter, and energy source. The high frequency of operation and, thus, the calculations allow assuming that the control system will work properly in cooperation with a real device and grid, without requiring many improvements.