1 Introduction

Traditional grid-connected systems usually require the placement of an isolation transformer between the inverter and the grid for isolation from the grid. This is purposed to meet the applicable safety standards and prevent the injection of DC component from the output current into the grid. However, the power frequency transformer is large in size, difficult to handle and costly. Besides, the efficiency of the entire system can be affected by power loss. Removing the isolation transformer can not only lower costs, but also reduce volume and weight, thus improving system efficiency. Therefore, increasing attention has been paid in recent years to the grid-connected system without isolation transformer [1,2,3,4].

However, there remain some outstanding problems to be solved for the non-isolated system [5,6,7,8], such as the existence of DC component in the output current, the leakage of current caused by common mode voltage and parasitic capacitance, and the mismatch of voltage levels between the grid and the inverter. Among them, the DC component in the output current can jeopardize the normal operation of the system and poses a safety risk. So far, there have been many countries and regions adopting the corresponding standards to limit the injection of DC components into the grid. For example, the IEEE standard 1547-2003 stipulates that the DC component injected into the grid side should be lower than 0.5% of the rated current. On this basis, the focus of this study is to find out how to suppress the DC components in grid-connected systems.

The main detrimental effects caused by DC component are as follows:

  1. (1)

    The DC component affects the operating point of the transformer in the system, which leads to one-way saturation of the transformer, thus increasing the excitation current. Meanwhile, there is an increase in the eddy current loss and noise, thus reducing the service life of the transformer.

  2. (2)

    The DC component flows between the inverter arms or parallel inverters, thus forming a loop, which affects the performance of parallel system in power sharing;

  3. (3)

    The DC component affects the normal operation of the load, such as triggering the fluctuation of torque in AC motor and causing additional losses;

  4. (4)

    The DC component causes corrosion of the grounding device.

There are two mainstream methods that can be used to suppress the DC component of the non-isolated grid-connected inverter. One is passive suppression. For example, the isolation transformer and the isolation capacitor are used to isolate the DC component. The main disadvantage of doing so is the increase in cost, volume weight and loss for the system. The other is active suppression, which usually relies on the use of sensors to detect the size of the DC component for control to be applied accordingly. Therefore, it is essential to accurately extract the DC component. Active suppression leads to a slight increase in system cost, small volume and weight, and low loss, which makes it a popular method to suppress the DC component. In References [9, 10], it is proposed to apply automatic sensor calibration techniques in two-level or three-level single-phase inverters, which is effective in reducing the injection of DC component caused by sensor drift. However, this method is only applicable to the DC component caused by sensor sampling drift, which requires the use of additional sensors. In References [11,12,13,14], different strategies are adopted to extract the DC component from the output current and perform feedback compensation. However, these methods are suitable only for single-phase systems to achieve DC component suppression. The three-phase system proposed in Reference [15] is capable to suppress the DC component by detecting the fluctuation in fundamental frequency of the DC voltage and feedback. However, this method as an indirect form of feedback is incapable to ensure the effective suppression of DC component [16,17,18,19,20,21,22,23].

Therefore, some scholars have proposed to use virtual capacitance to suppress the DC component in the grid current [24,25,26,27], and introduce a feedforward term based on the grid current integral operation into the controller to equivalently realize the DC component suppression effect of the AC side series capacitance. However, the virtual capacitance method has problems such as affecting the stability and dynamic response of the original current controller. Reference [28] compared the unit step response of the system under different virtual capacitance values, and qualitatively selected the virtual capacitance value, but did not specifically analyze the influence of the virtual capacitance value on the fundamental current response. In [29], with the help of frequency domain analysis tools such as root locus and Bode diagram, the interaction between virtual capacitor and proportional resonant (PR) controller is comprehensively analyzed. However, the final selected parameter values are empirical values obtained after simulation attempts, which cannot form a general guiding principle. In [30, 26], the concept of virtual capacitance is applied to three-phase grid-connected inverter system, and the parameter selection of proportional integral resonance (PIR) controller is analyzed by root locus method. However, in this paper, it is considered that the dynamic performance requirement of DC component suppression is not high in engineering, and the larger virtual capacitance value is directly selected, and the processing method is too simple.

In addition, the above literature does not constrain the time domain index of the system when selecting the virtual capacitance value and the current controller parameters. Although Reference [27] put forward specific requirements for controller parameter design from the aspects of steady-state error, open-loop system fundamental amplitude gain, amplitude margin and phase margin angle, and obtained the allowable domain of parameter selection by fitting the constraint condition curve, the steps are too cumbersome.

In this paper, a new idea is proposed for the suppression of DC component. Firstly, in the extraction of DC components, this paper proposes a moving average filtering extraction method. The amplitude-frequency characteristics of the filter are basically the same as those of the low-pass filter in the low-frequency domain. As the frequency increases, the gain of the moving average shows a change with the power frequency as the cycle and the gain is 0 at the integer multiple of the power frequency. This feature can well filter out the integer multiple power frequency components caused by harmonics, and obtain the DC component more accurately. This feature is not available in low-pass filters, and does not require additional hardware circuits. It only needs software programming to achieve, and has a high cost performance. Secondly, in the whole control strategy, because the existing grid-connected control strategy is designed based on PI control in the synchronous rotating coordinate system, the DC component in the output current becomes the fundamental frequency component in the synchronous rotating coordinate system, and the PI controller can not realize the AC signal without static error control, and can not better suppress the DC component [31,32,33,34,35,36]. In this paper, the proportional integral resonant controller is used to control the DC component and the fundamental component to realize the suppression of the DC component and the effective tracking of the fundamental component. Finally, a three-phase grid-connected inverter experimental platform is built. It is proved that the method in this paper reduces the DC component to less than 0.5% of the rated current, and effectively controls the total harmonic distortion rate, second-order harmonic and DC voltage ripple of the output current, which meets the requirements of IEEE standard 1547-2003.

2 Main Causes of DC Component

The three-phase control system usually converts the voltage and current into the two-phase rotating dq coordinate system for analysis. This is because the control variable becomes a DC component in the dq coordinate system, which facilitates the classical PI control design. Figure 1 shows the topology of the three-phase grid-connected inverter, and its mathematical equations in the two-phase rotating dq coordinate system are as follows:

$$\left\{ \begin{gathered} \frac{{{\text{d}}i_{{\text{d}}} }}{{{\text{d}}t}} = - \frac{R}{L}i_{{\text{d}}} + \omega i_{{\text{q}}} + \frac{{u_{{{\text{dc}}}} }}{L}s_{{\text{d}}} - \frac{1}{L}u_{{{\text{gd}}}} \hfill \\ \frac{{{\text{d}}i_{{\text{q}}} }}{{{\text{d}}t}} = - \omega i_{{\text{d}}} - \frac{R}{L}i_{{\text{q}}} + \frac{{u_{{{\text{dc}}}} }}{L}s_{{\text{q}}} - \frac{1}{L}u_{{{\text{gq}}}} \hfill \\ \end{gathered} \right.$$
(1)
Fig. 1
figure 1

Main circuit of three phase grid-connected inverter

In Eq. (1), sd and sq represent components d and q of the switching function. The conventional PI control block diagram is shown in Fig. 2.

Fig. 2
figure 2

The control block diagram of three phase grid-connected inverter

The time domain expression of the PI regulator is shown in Eq. (2)

$$u(t) = K_{{\text{p}}} e(t) + K_{{\text{i}}} \int {e(t){\text{d}}t}$$
(2)

The design of current controllers is based on digital control, so that Eq. (2) is discretized into a difference equation, the first beat output of which is expressed as

$$\begin{gathered} u(k) = K_{{\text{p}}} e(k) + K_{{\text{i}}} T_{{\text{s}}} \sum\limits_{i = 1}^{k} {e(i)} = K_{{\text{p}}} e(k) + u_{{\text{i}}} (k) \\ = K_{{\text{p}}} e(k) + K_{{\text{i}}} T_{{\text{s}}} e(k) + u_{{\text{i}}} (k - 1) \\ \end{gathered}$$
(3)

In Eq. (3), Kp represents the proportional coefficient, Ki indicates the integral coefficient, Ts denotes the sampling time, u(k) means the kth output value of the regulator, and e(k) stands for the deviation between the kth reference value and the feedback value. At present, the grid-connected inverter usually adopts the Hall current transformer to sample the output current for involvement in the closed-loop control. However, the Hall current transformer is susceptible to drift as the operating temperature varies. This drift can occur even though the actual output current is a strict sine wave. Besides, the asymmetry of sampling results can arise between the positive half-axis and the negative half-axis. Such an error can spread to the closed-loop control system. According to the digital control algorithm of Eq. (3), even though the actual output current effectively tracks the current command, the error e(k) is not equal to zero due to the zero drift of the sampling circuit, and the regulator output u(k) outputs an offset for correction. Consequently, the output current has a DC component. Therefore, the closed-loop control inverter is incapable to suppress the DC component caused by the sampling circuit error as an output of the inverter. Therefore, it must be corrected in another way.

3 Extraction Method of DC Component

In theory, the average value of any phase AC in a cycle of the stationary coordinate system is zero. Therefore, the output voltage/current of the three-phase inverter has only the DC component when the average value algorithm is adopted. Among various average value algorithms, the moving average filter is proved to perform better in the accuracy of extraction and dynamic response. Herein, the sliding window with the output current cycle of the time length, which is the number of points is N, is constructed to slide along the discrete time series. At each sliding sampling interval, a new piece of data is entered into the front of the window, while an old piece of data is removed from behind the window. Therefore, there are N ‘latest’ data in the window at all times[12,13,14]. In summary, the moving average filter is accumulated from the k + N − 1 point of the instantaneous current sequence to the k point. Then, it is divided by N, so as to determine the DC component sequence at the point k, as shown in Fig. 3.

Fig. 3
figure 3

The moving average filter diagram of sinusoidal sequence

The algorithm of moving average filter in discrete domain is expressed as:

$$y[n] = \frac{1}{N}\sum\limits_{k = 0}^{N - 1} {x[n - k]}$$
(4)

Figure 4 shows the principle of moving average filter in digital control system. The first point data of a cycle covers the first point data of the previous cycle, and so on. At each time when the ‘newest’ piece of data is sampled, the ‘oldest’ piece of data is covered, thus constituting a process of sliding recursive calculation. Each of the ‘newest’ piece of data is subtracted by the ‘oldest’ piece of data, divided by the number of arrays, and then added with the average of one calculation, to obtain the latest average.

Fig. 4
figure 4

Sampling data window of moving average filter

With \(x(n) = e^{{{\text{j}}\omega n}}\) as the input, the output caused by \(x(n) = e^{{{\text{j}}\omega n}}\) is expressed as:

$$\begin{gathered} y[n] = \frac{1}{N}\sum\limits_{k = 0}^{N - 1} {e^{{{\text{j}}(n - k)\omega }} } = e^{{{\text{j}}n\omega }} \frac{1}{N}\sum\limits_{k = 0}^{N - 1} {e^{{ - {\text{j}}k\omega }} } \\ = e^{{{\text{j}}n\omega }} H(e^{{{\text{j}}\omega }} ) \\ \end{gathered}$$
(5)

\(H(e^{{{\text{j}}\omega }} )\) is defined as the frequency response of the system, which is an equal ratio series, according to the equation of equal ratio series summation.

$$\begin{gathered} H(e^{{{\text{j}}\omega }} ) = \frac{1}{N}\sum\limits_{k = 0}^{N - 1} {e^{{ - {\text{j}}k\omega }} } = \frac{1}{N}\left( {\frac{{1 - e^{{ - {\text{j}}N\omega }} }}{{1 - e^{{ - {\text{j}}\omega }} }}} \right) \\ = \frac{1}{N}\frac{{e^{{\frac{{ - {\text{j}}N\omega }}{2}}} }}{{e^{{\frac{{ - {\text{j}}\omega }}{2}}} }}\left( {\frac{{e^{{\frac{{{\text{j}}N\omega }}{2}}} - e^{{\frac{{ - {\text{j}}N\omega }}{2}}} }}{{e^{{\frac{{{\text{j}}N\omega }}{2}}} - e^{{\frac{{ - {\text{j}}N\omega }}{2}}} }}} \right) \\ = \frac{{\sin \left( {\frac{N\omega }{2}} \right)}}{{N\sin \left( {\frac{\omega }{2}} \right)}}e^{{\frac{{ - {\text{j}}(N - 1)\omega }}{2}}} \\ \end{gathered}$$
(6)

where \(\omega = 2\pi fT_{{\text{s}}} = 2\pi f/f_{{\text{s}}}\),\(f_{{\text{s}}} = 1/T_{{\text{s}}}\),\(f_{{\text{s}}}\) represents the sampling frequency, and \(T_{{\text{s}}}\) denotes the sampling period.

Define

$$D_{N} (e^{j\omega } ) = \frac{{\sin \left( {\frac{N\omega }{2}} \right)}}{{N\sin \left( {\frac{\omega }{2}} \right)}} = \frac{{\sin \left( {\frac{2N\pi f}{{2f_{{\text{s}}} }}} \right)}}{{N\sin \left( {\frac{2\pi f}{{2f_{{\text{s}}} }}} \right)}}$$

The amplitude function shown in Fig. 5 can be obtained. It can be seen from the figure that the moving average filter is a low-pass filter in essence, which causes the attenuation of the signal with a higher frequency and captures the low-frequency signal.

Fig. 5
figure 5

Amplitude of moving average filter

With the attenuation 3 dB commonly used in engineering works as the critical condition, the cut-off frequency of the moving average filter is calculated as follows.

$$\frac{{\sin \left( {\frac{2\pi fN}{{2f_{s} }}} \right)}}{{N\sin \left( {\frac{2\pi f}{{2f_{s} }}} \right)}} = \frac{1}{\sqrt 2 }$$

So we can get

$$f = \frac{{f_{{\text{s}}} }}{0.32 + 2.21N}$$

When \(f_{{\text{s}}} = 5{\text{kHz}}\), \(N = 100\), and the cut-off frequency of the moving average filter is \(f = 22.59{\text{Hz}}\). Figure 6 shows the relationship between the frequency, the cut-off frequency and the number of data points.

Fig. 6
figure 6

The relation between sampling frequency, the cut-off frequency and the numbers of sampling data

A second-order IIR Butterworth low-pass filter is designed and compared with the proposed moving average filter. The transfer function in the discrete domain is obtained given a sampling frequency of 5 kHz and a cutoff frequency of 22.59 Hz.

$$H(z) = \frac{{0.0001975 + 0.0003950z^{ - 1} + 0.0001975z^{ - 2} }}{{1 - 1.9598z^{ - 1} + 0.9606z^{ - 2} }}$$
(7)

The amplitude-frequency characteristics of the low-pass filter with a cutoff frequency of 22.59 Hz are shown in Fig. 7.

Fig. 7
figure 7

Amplitude of low pass filter

By comparing Figs. 5 and 7, it can be found out that the amplitude-frequency characteristics of the low-pass filter are basically consistent with that of the moving average filter in the low-frequency domain. As the frequency increases, the gain of the moving average varies with the power frequency as the cycle. Besides, the gain at the integer multiple of the power frequency is 0. Due to this feature, the integer multiple power frequency components caused by harmonics can be filtered out effectively and the DC component can be obtained more accurately, which is impossible for low-pass filters. Moreover, it removes the need for transformation between the stationary coordinate system and the rotating coordinate system in line with the instantaneous reactive power theory, and that for the complex design of low-pass filter. It is thus easier to program in engineering practice, which not only improves the dynamic response of the system, but also enhances the real-time performance of harmonic compensation.

4 Closed-Loop Control System Design

Since the output voltage or current contains a DC component, the fundamental component becomes a DC component after Park transformation to the dq rotating coordinate system, while the DC component becomes an AC component with the same frequency as the fundamental component. If the use of PI controller continues, it would lead to the unsatisfactory outcome of suppressing the DC component. Therefore, it is proposed in this paper to build a PIR controller by connecting a resonant controller in parallel on the current loop. The PI controller is used to apply control on the DC component, while the resonant controller with the resonant frequency as the fundamental frequency is used to impose control on the AC component. In this way, the grid-connected current can be accurately tracked and the DC component can be suppressed. This method is easy to implement, and effective in tracking the current command accurately and rapidly.

The discretized PIR control transfer function is expressed as follows.

$$G_{{{\text{PIR}}}} (z) = K_{{\text{p}}} + \frac{{K_{{\text{i}}} T_{{\text{s}}} z}}{z - 1} + \frac{{K_{{\text{r}}} T_{{\text{s}}} (z^{2} - z)}}{{(z - 1)^{2} + (\omega_{{\text{o}}} T_{s} z)^{2} }}$$
(8)

As shown in Fig. 8, the PIR controller combines the advantages of both PI control and PR control. Besides, the open-loop gain is relatively significant at the low frequency band and the resonance point of 50 Hz. Thus, the regulator performs well in tracking control for the fundamental component and the DC component.

Fig. 8
figure 8

Bode diagram of PI control, PR control and PIR control

However, there is no limit imposed on the gain of the resonant controller at the selected frequency. In order to avoid the loss of stability caused by the control frequency offset on the output gain, a quasi-resonant controller can be introduced. Figure 9 shows the DC component suppression scheme based on PIR control for the three-phase grid-connected inverter.

Fig. 9
figure 9

Prevention of DC current component in three-phase grid connected inverters based on PIR control

5 Experimental Result

In order to verify the strategy proposed in the present study, a 50 kW three-phase grid-connected inverter experimental platform is built. The control chip adopts TMS320F28335 DSP and Spartan-3 XC3S400 FPGA. DSP is intended mainly for mathematical operations and algorithm implementation. FPGA is intended mainly for PWM generation, inverter protection and peripheral equipment control. Figure 10 shows the experimental platform of grid-connected inverter and Table 1 shows the working parameters of inverter experimental platform.

Fig. 10
figure 10

Experimental platform of grid-connected inverter

Table 1 Working parameters of inverter experimental platform

Figure 11 shows the experimental waveforms obtained by using two different methods of DC component extraction. It can be seen from the figure that moving average filtering outperforms the low-pass filter method in extracting the output DC component of the grid-connected inverter. Firstly, the moving average filter performs well in filtering out the integer power frequency components caused by harmonics, and it allows the DC component to be obtained more accurately. Secondly, the DC component of each moment as obtained by the moving average filter is the average value of N sampling points in a power frequency cycle, which means it is not significantly affected by noise. While the low-pass filter is used to filter a single sampling set. The presence of noise can lead to the abrupt change to control quantity, thus affecting the consistency in the outcome of DC component suppression.

Fig. 11
figure 11

Comparison of suppression effects produced by two methods for the extraction of DC component

Figure 12 shows the comparison in DC component of output current between PI control, PR control and quasi-PIR control. It can be seen from the figure that when the DC component is extracted via moving average filtering, the scheme of using quasi-PIR control to suppress the DC component through closed-loop control is more effective than the scheme using PI or PR control. Besides, the DC component is reduced to less than 0.5% of the rated current.

Fig. 12
figure 12

Comparison of suppression effects of three methods for closed loop control

Figure 13 illustrates the ultimate grid-connected current and power waveforms. Figure 11a shows the grid-connected current waveform as obtained when the grid line voltage is 380 V. As shown in Fig. 11b, the harmonic analysis of grid-connected current is conducted. According to this figure, THD is less than 5%, and the waveform is approximately sinusoidal, which meets the standard of grid connection. Figure 11c shows the active and reactive power waveforms of the inverter, which are 50 kW and 0var, respectively. It can be found out that the effective suppression of the DC component leads to the limited fluctuation in the fundamental frequency of power.

Fig. 13
figure 13

Waveform of grid-connected current and power

6 Conclusion

In the present study, a closed-loop control strategy based on moving average filter to detect DC component and quasi-PIR control is proposed for the output DC component of three-phase non-isolated grid-connected inverter. First of all, the gain of moving average filter is zero at the fundamental integer multiples, which contributes to a significant attenuation of the fundamental integer multiples harmonics and ensures the accurate extraction of the DC component. Secondly, the quasi-PIR controller has sufficient bandwidth to avoid the lack of stability caused by frequency offset. In addition, the system performs well in robustness. Meanwhile, it produces a satisfactory outcome of adjustment for DC signal and AC signal. Finally, the experimental results show that the proposed method has good DC component suppression ability; through data analysis, the design method of this paper has significant advantages in the evaluation index of DC component suppression effect. The feasibility of the method proposed in this paper is confirmed from the qualitative and quantitative point of view.

It is worth noting that the current research conclusions are based on the comparison with traditional PI and PR control strategies. The dynamic performance and stability performance are better than the traditional PI control strategy. The next step should be compared with other existing control strategies to further prove the superiority of the proposed control strategy.