Improved Model Predictive Direct Power Control of Grid Side Converter in Weak Grid Using Kalman Filter and DSOGI

: When grid side converter (GSC) is connected to weak grid, the small signal instability can happen due to terminal characteristics of the GSC that are incompatible with the grid impedance. This issue is not of wide concern in previous studies of direct power control (DPC) of GSC. By small signal analysis, it is shown that the impedance characteristic of the conventional direct power control GSC is not compatible with the inductive grid impedance in weak grid due to its constant power load behavior. To solve the problem, instead of feeding the DPC controller with direct measured voltage and current, a Kalman filter (KF) is used to obtain filtered output current and a double second-order generalized integrator (DSOGI) is used to obtain filtered voltage at the point of common coupling (PCC). These strategies change the impedance characteristic of the GSC dramatically and make it suitable to operate in weak grid where SCR is 2, while the rapid power response is preserved. The proposed strategy is verified through simulation and controller hardware in loop (CHIL) tests.


Introduction
One of the advantages of model predictive control (MPC) is its fast dynamic response and ease of control over nonlinear systems [1] . There are two MPC control methods. The dead-beat model predictive control (DB-MPC) with a modulator has fixed switching frequency, which tends to have lower harmonic distortion. The finite set model predictive control (FS-MPC) is more intuitive concerning online optimization by evaluating candidate switch states [2] . The switching frequency of FS-MPC is lower, which reduces the switching losses. Due to unfixed switching frequency, the spectrum of harmonics spread and the distortion is relatively large. For grid side converter (GSC) system, model predictive direct power control strategies are proposed which have faster power response than cascade control structures where as an outer loop, the speed of power response is limited. However, most of the works on direct power control focus on strong grid where the grid is regarded as a stiff voltage source [3][4][5][6] .
To achieve power quality improvement, firstly, the GSC connected to the grid must be stable, avoiding resonance with the grid impedance or any other dynamic systems in the grid. Secondly, some GSC systems can be designed to mitigate the harmonics existing in the grid (e.g., using multiple synchronous frame-based control strategy to increase controllability of 5th, 7th, 11th, and 13th harmonics, as demonstrated in Ref. [7]). Both of them contribute to better power quality of the grid, Nevertheless, in weak grid scenario, stability is a prerequisite for GSC, which is the main focus of this paper.
In weak grid, the small signal stability of interconnected system of GSC and grid impedance should be of concern. Impedance-based analysis is widely used to study this small signal instability problem [8] . The stable operation of GSC requires its impedance characteristic to be compatible with the grid impedance. The impedance model of GSC can be represented by a 2 2 × matrix. There are various domain choices, for example, DQ domain and sequence domain. Their relationship can be established using a set of linear coordinate transformations, making them equivalent in the stability analysis. Nevertheless, the sequence domain model, especially its single input single output (SISO) equivalence, is more intuitive to demonstrate the impedance stability of the interconnected system using a Bode diagram. The impedance model of GSC can either be modeled analytically or be measured using frequency sweeping test [9][10] .
Most of the existing impedance-based stability analyses of GSC concern vector control with cascade control structure, where the current controller is the inner loop and the power control is the outer loop.
There are a few cases of impedance-based stability of GSC using direct power control (DPC). In Ref. [11], the direct power control using a PI power controller is analyzed and it is shown that there is a potential stability problem when DPC controlled GSC is connected to inductive grid impedance. Reduced bandwidth of power controller benefits the stability. This result raises a question on the stability of GSC operating in weak grid using MPC direct power control (MPC-DPC), a more aggressive alternative DPC strategy with faster dynamic performance. Besides, in Ref. [12], an active front end application using an improved finite set MPC-DPC with grid impedance estimation function is proposed, which enables GSC to work stably in weak grid where SCR is larger than 2. However, its effectiveness no longer exists when the grid becomes even weaker as SCR approaches 2.
In this paper, by impedance-based analysis, it is found that the conventional MPC-DPC control strategy, neither DB-MPC nor FS-MPC is suitable to operate in weak grid with inductive grid impedance. To solve the problem, inspired by the output current observer proposed in Ref. [13], a Kalman filter (KF) is used to filter the measured current signal. The measured voltage at the point of common coupling (PCC) is also filtered by double second-order generalized integrator (DSOGI) before feeding it to the MPC-DPC controller. The proposed strategy is firstly verified by simulation. Then, the controller hardware in loop tests using Typhoon HIL602+ platform are carried out to further the effectiveness and fidelity of the proposed MPC-DPC strategy. First, the conventional MPC-DPC current control strategy is illustrated in Fig. 1. The GSC system has an LC filter. The power flow to the PCC is controlled by an MPC-DPC controller implemented in the stationary frame. For the benefit of reduced harmonic emission, a three-level converter is used in this paper. The model of output current using compact vector-based notation is expressed as where the dynamic of the capacitor filter is neglected.
Here, x αβ (x = i, e, v) are the output current, internal voltage, and PCC voltage respectively, expressed in vector form in the stationary αβ domain. Then, according to formula (1), the output power S can be expressed as where S is defined as Based on the above equations, the MPC strategy is implemented as follows. First, a step-ahead prediction is made to compensate delay of the digital control system as , , where k denotes step k; T s is the control period; ω 1 = 100π is the nominal angular frequency of the PCC voltage. Next, to achieve reference power deviation at step k, the control signal defined as The synthesis of m dq can be realized either by modulating the voltage reference e αβ by PWM as DB-MPC strategy or approximated by the closest switch state as FS-MPC strategy. For the DB-MPC strategy, the neutral point (NP) voltage balancing of 3L-NPC converter is realized in the modulation process [14] , while for the FS-MPC strategy, the NP voltage balancing can be included in the cost function together with power control [15] . The above steps of MPC-DPC are illustrated in the flow charts shown in Fig. 2 and Fig. 3.

SISO sequence domain impedance model of GSC
Assuming there is a voltage perturbation at PCC that is expressed as and corresponding output current response is expressed as then the sequence domain impedance of GSC can be expressed by a 2 2 × matrix as . Similar impedance matrix can also be used to model grid impedance, and it is diagonal.
For DPC, the amplitude of off-diagonal elements in impedance matrix are large and cannot be neglected [11] . To evaluate the stability of the coupled system, multiple inputs multiple outputs (MIMO) stability criteria such as generalized Nyquist stability criteria is required, which is less intuitive than those ones of SISO systems which use a single bode diagram or a single Nyquist diagram of eigenloci for stability assessment [8] .
Nevertheless, by including the grid impedance model, the SISO equivalence of MIMO GSC impedance model can be derived as The SISO GSC impedance model (9) can be used to analyze the impedance stability of GSC connected to a specific weak grid characterized by grid impedance [16] . Besides, apart from building formulas (8) and (9) analytically, they can be obtained using frequency sweeping tests, which are explained in detail in Ref. [10].

Impedance model of conventional MPC-DPC
The impedance characteristic of a 1 MW GSC controlled by MPC-DPC is presented in this section. The GSC parameter is shown in Tab. 1.

Parameter Value
Filter inductance L f /mH 0.4 Filter capacitor C f /mF 500 Rated active power P r /MW 1 Control frequency f s /kHz 10 Bandwidth of sampling filter G s /(rad/s) 10 000 Weight factor λ NP 5×10 -7 The analytical GSC impedance model can be obtained by linearizing the GSC system, including its control system and its power stage model. Those linearization techniques are thoroughly explained in Refs. [9][10][16][17][18], and will not be discussed in detail in this paper. Because the dead-beat MPC-DPC strategy is developed in the discrete time domain, during the development of impedance model, it is transformed to continuous time domain. The analytical impedance model of finite set MPC-DPC is also represented by its dead-beat counterpart.
Nevertheless, the GSC impedance model can be approximated in a much easier way by exploiting the high power control bandwidth of MPC-DPC, shown as According to harmonic linearization method [9] , the approximated GSC impedance model Y ap can be obtained by linearizing formula (10) as where V 1 is the Fourier coefficient of the fundamental PCC voltage and I 1 is the Fourier coefficient of the fundamental output current. It is found that the impedance matrix of GSC is approximated to a constant non-diagonal matrix determined by its operation point. Then, the approximated SISO GSC impedance model Y eap is calculated according to formula (9). In Fig. 4, the bode diagram of the approximated impedance model Y eap , the detailed analytical impedance model Y ep , and the impedance model measured by frequency sweeping test is illustrated. It is shown that the analytical GSC impedance model is fitted well by the simulation results.
It can be observed in Fig. 4 that the GSC impedance characteristic of conventional MPC-DPC strategy is not affected by the choice of FS-MPC or DB-MPC. Both of them are unstable when connecting to weak grid with inductive grid impedance because of the insufficient phase margin. This instability can be checked more clearly using Nyquist diagram shown in Fig. 5 where the eigenloci encircle (-1, 0). Moreover, when it comes to the simplified GSC model Y ap in formula (11), as shown in Fig. 4, although its phase is not accurate in the frequency range above 100 Hz, its amplitude is fitted well by the measured impedance model around the intersection between GSC impedance amplitude and grid impedance amplitude. This reflects the severely insufficient phase margin when using the conventional MPC-DPC strategy. Time domain simulations are carried out to verify the above stability analysis. As shown in Fig. 6, at the beginning, the GSC controlled by dead-beat MPC-DPC strategy is connected to an ideal grid without grid impedance and it is stable. Then, at 0.1 s, 1/16 p.u. grid impedance is added and high frequency resonance happens. Then, at 0.2 s, another 3/16 p.u. grid impedance is added, which makes the GSC system crash as both active power reference and reactive power reference cannot be tracked.  The above analysis demonstrates that the large bandwidth of power control makes GSC act as constant power load (CPL) and makes GSC terminal characteristic similar to the approximated impedance model (11), which is not compatible with the inductive grid impedance.

Impedance model of conventional MPC-DPC
One way to avoid the CPL behavior of an MPC-DPC controlled GSC is to reduce the controller bandwidth of the power controller. Originally, the power controller was intended to compensate the power tracking error in one step. To reduce the control bandwidth, a proportional factor k p is used, and now the controller is scheduled to compensate the power tracking error (S k+1 -S k ) to k p (S k+1 -S k ). However, the modification can also be regarded as setting an inaccurate predictive model on purpose, which can cause tracking error in steady state. Therefore, another integral factor k i is used to eliminate the steady tracking error. The control law (5) Fig. 8 shows the impedance characteristic of GSC controlled by modified MPC-DPC strategies where k p = 0.06 and k i = 10/f s . It is observed that the phase of GSC impedance increases above 90 − around the intersection of GSC impedance amplitude and grid impedance amplitude at the right side of the fundamental frequency. Now the interconnected Fig. 8 Bode diagram of SISO impedance of GSC controlled by MPC-DPC strategies of reduced control bandwidth system is stable due to its sufficient phase margin. The simulation result is shown in Fig. 9. At 0.1 s, the grid impedance increases from 0.125 p.u. to 0.25 p.u., and the GSC keeps stable when the modified control law (12) is applied. It loses stability as soon as the modified control law is replaced by the conventional one at 0.2 s. However, it is noticed that the controller law (12) is exactly the same direct power controller of PI type presented in Ref. [19]. Moreover, the original dead-beat MPC-DPC can also be regarded as a PI type controller where very large proportional gain reduces the tracking error to almost zero and integral gain can be discarded. Thus, it reveals that the trade-off between dynamic performance of conventional MPC-DPC controller and its stability margin in weak grid makes it incapable of achieving very fast power regulation, as was intended.
One more shortcoming of the modified control law (12) is that it is not applicable to finite-set MPC-DPC. The time domain simulation in Fig. 10 shows that the current waveform is severely distorted, Fig. 10 Simulation of a modified finite set MPC-DPC controlled GSC in weak grid becoming worse when 0.125 p.u. grid impedance is added at 0.1 s and finally losing its stability when another 0.25 p.u. grid impedance is added at 0.2 s.

Improved FS-MPC current controller in weak grid using a Kalman filter
In order to improve the stability performance of the MPC-DPC strategy in weak grid, apart from modifying the cost function to slow down the power reference tracking, another method is to filter the measurement PCC voltage and output current instead of feeding them to the MPC-DPC controller directly.

Output current estimated by KF
Instead of directly measuring output current, a KF can be applied to filter the distorted current signal [13] .
where superscript ∧ denotes that the variables in formula (14) are estimated states, and the system output is estimated current. These can be used to construct a current observer with actual output current. In formula (15), w(k) is the measurement noise and η(k) is process noise, and they satisfy Here, R and Q are tunable parameters and an optimal observer gain L of the KF can be calculated. The detailed KF implementation according to model (14) can be found in Ref. [20]. Here large R is preferred because the direct measurement of output current is noisy and tends to make the GSC system satisfy formula (10) over a wider frequency range, which is not desired for stability concerns. In this paper, Q is set as 0.1 and R is set as 100.

PCC voltage filtering by DSOGI
Unlike Ref. [13], the voltage signal sent to the MPC controller is not the one estimated by the KF because of the steady state error of voltage estimation, which is illustrated by the time domain simulation shown in Fig. 11. Fig. 11 Steady error of voltage estimation by KF Instead, the DSOGI block is applied here, which can extract positive sequence component. The detailed implementation of the DSOGI block is shown in Fig.12 [21] .
where v p and v n are the positive sequence small signal perturbation and negative sequence small signal perturbation, respectively, of the input signal of the DSOGI block and p v , n v are the small signal positive sequence response and the small signal negative sequence response, respectively, of the DSOGI output.
The frequency domain characteristic of the DSOGI in Fig. 13 is verified by sweeping test.
Behaving as a band-pass filter, the DSOGI is helpful to avoid the GSC behaving as CPL. Besides, the Fig. 13 Bode diagram of T pp and T nn frequency signal ω 1 in the DSOGI is set as a constant value 100π rad/s, considering that in the common applications the grid frequency will not drift much from its nominal value of 50 Hz [22] . The integration of the frequency locked loop to deal with severe grid frequency deviation will be considered in the future work.

Impedance characteristic of GSC controlled by proposed MPC-DPC strategy
The impedance characteristic of GSC controlled by the proposed MPC-DPC strategy is illustrated in Fig. 14. It can be observed that the analytical model is fitted well by the simulation result and the impedance characteristics are almost identical for finite set strategy and dead-beat strategy. It is found in Fig. 14a that the introduce of KF and DSOGI does not decrease the GSC impedance amplitude. After having a small dip at the right side of the fundamental frequency in a narrow band, the GSC impedance amplitude keeps increasing at the rate of about 20 dB/dec up to about 300 Hz, reducing the possibility of intersecting with inductive grid impedance. Moreover, compared to conventional MPC-DPC strategy, the phase of GSC impedance increases greatly and the phase margin is larger than 25 even when the grid impedance increases to 0.5 p.u. This demonstrates that, by using the proposed MPC-DPC strategy, the GSC can operate stably in weak grid where SCR is about 2, as shown in Fig. 14b.    Finally, the dynamic performance of the proposed MPC-DPC is illustrated by the test results shown in Fig. 17 where the grid impedance is set as 1/3 p.u. For comparison, the conventional MPC-DPC with modified control law (12) is simulated with the same grid impedance and its result is shown in Fig. 18. In the tests, the references of active power and reactive power are superposed using a 100 Hz sinusoidal waveform. It can be observed in Fig. 17 that when using the proposed MPC-DPC strategy, the step response of the active power is fast and both active power and reactive power can follow their high frequency oscillated references. This indicates that the proposed MPC-DPC inherits the advantage of fast power dynamic. On the other hand, when using the conventional MPC-DPC with reduced control bandwidth, the active power cannot follow the high frequency component of its reference, as shown in Fig. 18. Thus, in weak grid, the dynamic performance of the proposed KF-based MPC-DPC strategy is superior to that of the conventional one.  To validate further the effectiveness of the proposed MPC-DPC strategy, hardware-in-loop (HIL) experiments are carried out. The HIL platform H602+ is produced by Typhoon Inc. The control strategy is implemented in TI F28379D. Most of the parameters are the same as those listed in Tab. 1, except that the filter inductance is increased to 0.8 mH because the control frequency f s reduced to 7 kHz.

Simulation of proposed MPC-DPC strategy in weak grid
First, the finite set MPC strategy is tested. The active power step response of the proposed KF-based MPC-DPC strategy is shown in Fig. 19 where SCR = 2. The active power reference steps from 0.6 p.u. to 1.0 p.u. at about 0.6 ms. It is found that the active power quickly rises without oscillation.  The robustness of the proposed MPC-DPC strategy against filter parameter variation is shown in Fig. 21 and Fig. 22. In Fig. 21, the actual inductance of the filter is 0.6 mH, which is less than that in the predictive model (0.8 mH). As shown in Fig. 21, the waveform of the active power step response when filter inductance is 0.6 mH is very similar to the one for the nominal parameter, where active power reaches its reference in about 2 ms. In Fig. 22, the waveform of the active power step response when the filter inductance is 1 mH is demonstrated. It can be observed that the active power follows its reference at about 3.5 ms. The dynamic response becomes slower as the actual filter inductance becomes larger. The GSC impedance model using the proposed MPC-DPC strategy was verified using a sweeping test on the HIL platform. The result is shown in Fig. 23. It can be observed that the analytical model is fitted well by the sweeping results, which proves the effectiveness of the proposed MPC-DPC strategy in shaping the GSC impedance characteristic to avoid instability in weak grid.
The stability improvement of the GSC in weak grid using the proposed MPC-DPC strategy is further illustrated in Fig. 24. At 0.25 s, the proposed MPC-DPC strategy is replaced by the conventional MPC-DPC strategy, at which time the system begins to oscillate badly due to the insufficient stability margin of the conventional MPC-DPC strategy in weak grid. A similar phenomenon is also observed when predictive control works in the dead-beat way, as shown in Fig. 25. This illustrates that the proposed MPC-DPC strategy can be used in either finite-set predictive method or dead-beat predictive method.

Conclusions
In this paper, the small signal impedance model of the conventional MPC-DPC control strategy is built. On the basis of this, it is found that when using the conventional strategy, neither finite set MPC-DPC nor dead-beat MPC-DPC is suitable for weak grid scenario as their impedance characteristics are not compatible with inductive grid impedance. To avoid the stability problem, instead of sending measured output current and measured PCC voltage directly to the DPC controller, an output current estimator using a Kalman filter and a DSOGI block for filtering PCC voltage are applied. The proposed MPC-DPC strategy changes the GSC impedance characteristic, making it less resemble a CPL, which enables it to operate stably in weak grid where the SCR is about 2. Moreover, simulations also show that the fast dynamic of power control is preserved when using the proposed MPC-DPC strategy.