Optimal Load Distribution in DG Sources UsingModel Predictive Control and the State Feedback Controller for Switching Control

,e distributed energy management of interconnected microgrids, which is based on model predictive control (MPC), relies on the cooperation of all the agents (i.e., microgrids). Model predictive control or MPC is widely used in industrial applications as an effective tool for dealing with multivariable limited control problems. MPC uses an explicit system model to predict the future horizon of the system and its outputs. ,is predictability allows calculating the optimal order of inputs to minimize output errors over a limited horizon, which is effected by the limitations of the system. ,is study presents a distributed economic model predictive control method using the new state feedback controller to control the switching of interface converters and compensate for the unbalanced and nonlinear loads. In this model, the islanding mode and the reconnection of the grid are considered to improve the transient behavior of the system to achieve steady-state power distribution. It has been proposed that it could obtain better results in predictive control, utilizing similarity transform in the state matrix and its modification. First, this model is simulated on distributed generation sources with power-sharing and local loads using the state feedback controller in MATLAB Simpower. ,en, the performance of the proposed method is evaluated, confirming that it is more reliable than the FS-MPC and DSVM-MPC methods.


Introduction
A microgrid is a small-scale power grid designed for supplying electricity to end users. Under certain conditions, microgrids have the ability to inject their excess energy into the main grid [1]. e most important challenge when using microgrids involves maintaining the system's security and stability. Most renewable energy-based distributed generation (DG) plants need voltage source inverters (VSIs) to connect to the microgrid [2]. Nowadays, choosing the appropriate method for controlling industrial processes is highly important. Moreover, control methods in the industry must have several characteristics, such as ease of use by the operator, simple configuration, and cost-effectiveness [3]. Although using proportional-integral-derivative (PID) controllers has become common in the industry, it should be noted that industrial processes involve a wide range of different operations, limiting the use of such controllers. e main reason behind the wide range of different dynamic operations probably relates to various factors, including the existence of zeroes outside the stable region, unstable poles, and long delays with indefinite and variable times.
Furthermore, it can overcome the uncertainties of the plant parameters because of load demand fluctuations and the errors of the implementation. e new method has been built based on new simple frequency domain conditions and the whale optimization algorithm (WOA). is method is utilized to design a robust proportional-integral-derivative (PID) controller based on the WOA in order to enhance the damping characteristics of the wind energy conversion system [4]. New two methods of artificial intelligence (AI) techniques are used to design the model predictive controllers (MPCs) with superconducting magnetic energy storage (SMES) and capacitive energy storage (CES) for load frequency control (LFC) [5]. e model predictive control (MPC) algorithm is a method for dealing with such complex industrial processes. Implementing the predictive control method for electric power converters can be difficult due to the large computational load required to instantly solve optimization equations. To mitigate this problem, a number of practical solutions have been considered, such as the outof-line calculation of optimization equations and solving these equations by evaluating finite state switching. e latter is known as the finite state model predictive control (FS-MPC) since it works using a finite set of possible states for the electric power converter switching. So far, the FS-MPC control method has been used in various applications, e.g., as rectifier, inverter, motor control, and uninterruptible power supply (UPS). Based on the results of the relevant studies, this control method has high performance ability for the optimal operation of the whole system, while there is no need to fine-tune the controller parameters. Despite these capabilities, this method has two major drawbacks that limit its use in industrial systems. e first drawback is that to achieve high performance, and a high sampling frequency is required, leading to costly hardware and the need for high computation power. Moreover, in this method, the switching frequency is variable, which increases the values of the converter's output filter and the volume, weight, and total cost of the converter. When FS-MPC control designs are implemented in laboratory experiments, a large volume of calculations needs to be performed during each sampling period, which causes a significant delay in the activation of the actuator signal. erefore, if the delay caused by the measurement, calculations, and the operation of the actuator is not considered in the design of the controller, it can cause poor controller performance. In this regard, [6] describes the reason for this delay and the method for compensating for it, which creates an interval between the moment the current is measured and the moment the new switching state is applied. During this interval, the previous switching state is present at the converter's output, which causes a difference between the load current and the reference current, increasing the current's ripple. To solve this problem, [6] uses the prediction of the next two samples instead of the prediction of the next sample. Moreover, [7] proposes a new predictive control method, called fast predictive control. In this method, the volume of the calculations will be significantly reduced, and it can be used in multilevel converters that have a large number of control vectors. Another disadvantage of the FS-MPC method is the variable switching frequency [8]. e variable switching frequency creates a wide range of harmonics at the output of the converter, which can cause resonance and make filter design more difficult. In [9], the average switching frequency is kept constant by adding corrective terms to the cost function. In addition, [9] modifies the current predictive control scheme in such a way that the switching frequency can become somewhat independent of the sampling frequency. Configuring and selecting the weighting coefficients in the FS-MPC method will be a major challenge, which has a significant impact on the system's performance. Configuring these coefficients is more time-consuming than adjusting the parameters of the PI controller in classical current control and adjusting the hysteresis bandwidth. Furthermore, [10] presents a number of important points for determining the optimal values of the weighting coefficients. In addition, [10] introduces a predictive control method without using weighting coefficients in the induction motor drive. On the other hand, [11] shows that using discrete space vector modulation in the FS-MPC control method enables employing virtual switching states in the control algorithm in addition to the real switching states. is new technique is called the discrete space vector modulation-model predictive control (DSVM-MPC), using which the required sampling frequency is reduced, while the switching frequency of the converter is stabilized [12]. In addition to the advantages of the FS-MPC method, this control method also provides other benefits, including fixed switching frequency and low sampling frequency [13]. However, due to the use of the same algorithm and its discrete nature, it includes a limited and discrete number of converter vector space points. erefore, to account for a wide and variable range of operating points for the converter, more points are needed, which may lead to slow dynamic performance, low accuracy, and distortion in the output of the converter. e economic costs for the MPC and the heuristic approach in the considered price scenarios are reported in the economic costs of prosumers equipped with production units, energy storage systems, and electric vehicles. To this purpose, the predictive control manages the available energy resources by exploiting future information about energy prices, absorption and production power profiles, and electric vehicle (EV) usage, such as times of departure and arrival and predicted energy consumption [14]. In the model predictive control and state feedback controller, the chosen states of the system are compared with their reference quantities to generate the converter switching. With the method proposed, in addition to the fact that we have maintained system dynamics, this similarity transform should be used to evaluate all systems. Hence, the following state transform matrix is considered for this system, and better results in terms of overshoot, rise time, settling time, and steady state have been obtained with this method, which are shown in the results of this study.
is study proposes a state feedback control method and discusses the optimal design using the iteration method to define all possible switching states along the predictor's horizon for the controller, thus mitigating the drawbacks of the previous methods. erefore, finding an economically applicable model with the best state-space model is very important. A comprehensive review of DC microgrids can be found in [15,16]. Figure 1 depicts the single-line diagram of a power system containing two DG sources. e microgrid is connected to the main grid at the PCC point. Two sources, i.e., DG1 and DG2, are directly connected to the microgrid using the CB-3 and CB-4 circuit breakers, respectively. Both DGs have local loads, which may be nonlinear and unbalanced. In addition, the microgrid may have a joint load as well, which is assumed to be balanced and located at a long distance from the DGs. One of the tasks of the DGs is to correct the imbalance 2

Study of a Microgrid Containing a DG Source
International Transactions on Electrical Energy Systems and the nonlinearity of the local load. Several control schemes have been introduced in order to ensure the proper operation of the microgrid in the grid connection mode or the islanding mode [17]. Moreover, several control schemes have been introduced in order to ensure the proper operation of the microgrid in the grid connection mode or the stand-alone mode [18]. A comprehensive review of dc microgrids can be found in [19][20][21].
In the DG grid connection mode, the microgrid shares a percentage of its local load with the main power grid, while the joint load is fully supplied by the main grid. During the process of islanding, each DG source supplies its own local load, while the joint load is shared between the DG sources. e mix powers drawn by the local loads include P L1 + jQ L1 and P L2 + jQ L2 . Moreover, the joint load draws the i LC current from the grid and it consumes the mix power P LC + jQ LC .
Local loads at points PCC1 and PCC2 are connected to the DG sources with voltages of v p1 and v p2 , respectively. e real and reactive powers supplied by the DGs are denoted by P1, Q1, P2, and Q2, respectively. It is assumed that the microgrid is mainly resistive, and at the distribution level, the impedances of the lines are denoted by R D1 and R D2 . e main power supply is shown by V s , while the feeder inductance resistors are denoted by RS and LS, respectively. e main power grid injects PG and QG powers into the microgrid, and PS-PG and QS-QG powers supply the main load of the power grid.CB1 can disconnect the microgrid from the main power grid.
In the next sections, we will examine the performance of the system and the compensator in both grid connection and islanding modes. In all the modes mentioned in this section for the grid, a state feedback controller is used with a quadratic linear regulator to control the grid and correct the unbalanced loads. e general diagram block of this controller is shown in Figure 2. Here, in order to achieve the desired solutions, the value of h is set to 0.001. It should be noted that i1, i cf , and v cf signals are measurable.
In [22], the authors present an adaptive optimization method for NMPC, where an extended Kalman filter (EKF) is used for estimating the state variables. In [2], a system is investigated where the superheated steam temperature (SST) is the main variable that must be controlled. To do so, several categories of cascading PIDs have been used to control this variable. In [3], to adapt the model, neural networks are presented for controlling the model predictive control. In [23], a fuzzy method based on Lyapunov fragment functions is used in the model predictive control. In [24], in order to make the system smart, generalized predictive control (GPC) and a neural network model are used. In this method, a nonlinear neural network is used to extract the linear model of the system. In [25], horizon optimization is utilized for predictive control using a genetic algorithm. In [26], the prediction of the next two samples is used instead of predicting the next sample. Moreover, [27] proposes a new predictive control method, called fast predictive control. In this method, the volume of calculations will be significantly reduced, and it can be used in multilevel converters that have a large number of control vectors. In addition, [28] modifies the current predictive control scheme in such a way that the switching frequency can become somewhat independent from the sampling frequency. Increasing the sampling frequency improves the performance of FS-MPC, while reducing the ripple of the output current. However, increasing the sampling frequency also increases the switching frequency, which ultimately leads to increased losses [29]. is study presents a predictive control method using the state feedback controller to control the switching interface converters and compensate for the unbalanced and nonlinear loads.  Figure 1: e single-line diagram for the microgrid and the electricity grid, including two sources of distributed generation [31].
International Transactions on Electrical Energy Systems 3

The Model Predictive Control (MPC) Method
e MPC method is an optimization problem where the cost function is minimized. Using the system model and the values of the variables until time K, the state values are predicted until time horizon K + N. Moreover, through the optimization of the cost function, the first component of the command sequence is applied at moment K+1. ese steps are repeated for the next time steps. e cost function includes the control objectives of the system, and its common terms include variables that need to follow a reference value [11].
According to equation (1), controlling these variables will be a function of the error between the predicted value and its reference value.
As can be seen in equation (1), this function can be the size, the square, or the integral over a sampling time interval.

e Finite State Model Predictive Control (FS-MPC).
is method uses the discrete nature of electronic power converters in such a way that all converter voltage vectors are tested in the cost function, and the vector that minimizes the cost function is selected [20]. Figure 2 shows the finite state model predictive control (FS-MPC). e algorithm for solving this method includes the following steps [26]: A : Load current measurement; B : Prediction of the load current in the next samples for all possible switching states according to the following equation: is equation is obtained by discretizing the voltage equation. C: e cost function is evaluated for each prediction. In this method, the cost function is expressed as the error between the reference current and the predicted current for each of the possible switching states ( (3)).
D: e switching state that minimizes the cost function is selected.
When FS-MPC control schemes are implemented in laboratory experiments, a large volume of calculations is performed in each sampling period, which causes a significant delay in the activation of the actuator signal. erefore, if the delay caused by the measurement, the calculations, and the activation of the actuator is not considered in the controller design, it can cause poor controller performance. In this regard, [26] describes the reason for this delay and how to compensate for it.

e DSVM-MPC Controller.
e main idea behind the DSVM-MPC control method involves using other points in the vector space. In the SVM modulation method, in addition to the eight main switching states for the three-phase converter, other states can also be applied in the form of a linear combination of these base states. ese new states are called virtual states. However, because the cost function is calculated per each vector, it will only be possible to use a limited number of points in the vector space. In Figure 3, the real points (circles) and virtual points (squares) are shown for the switching of a three-phase converter [21] ( Figure 3).
is control method also offers benefits such as a fixed switching frequency and a low sampling frequency. However, due to using a similar algorithm and its discrete nature, it covers a limited and discrete number of points in the converter's vector space [19].

e Proposed DE-MPC Controller.
e microgrid shown in Figure 1 is considered. It can be observed that when entering the is landing mode and reconnecting the grid, the system's response is not highly satisfactory since it takes a long time for the power distribution to reach a steady state. To solve this problem, we first used a PSO algorithm and PID control, and the issue was largely mitigated. In this section, we try to design a distributed economic model predictive controller (DEMPC) to improve the transient state of the system. e model predictive controller method is designed and implemented based on the following three steps: (1) A model is used to predict the behavior of the control variables for the next time step. (2) A cost function is determined, including control objectives and the expected behavior of the system. (3) e appropriate command is extracted by minimizing the value of the cost function. e model used for the prediction is a discrete-time model that can be represented in the form of state equations according to equations (4) and (5): In these equations, the vector x(k) denotes the current values of the state variables, x(k + 1) is the future prediction value for the state variables, u(k) denotes the current values of the input variables, and y(k) is the vector of the current output values. In the next step, the cost function must be determined. According to equation (6), in this function, the reference values, values of the future states, and the future control commands are considered.
It is noted that the constraints of the state equations are considered as follows.
. ., N p e quantities of the prediction horizon are usually considered to be twofold the control horizon. at is in the simulation, N p � 10 and N u � 5 should be considered in this regard.
e DE-MPC control method is an optimization problem in which the cost function is minimized. In this optimization, the system model and control objectives are considered for K+1 to K + N time steps. e result of this optimization is N consecutive commands. e first component of this command sequence is applied at moment K + 1. Similarly, during this time, using the new measurement values, the optimization is performed for the next moment, and the appropriate command is selected for the moment K + 2.
ese types of calculations are called receding horizon strategies. Figure 4 shows the performance of the DE-MPC method. Using the system model and the values of the variables until time K, the state values until time horizon K + N are predicted. In addition, by optimizing the cost function, the first component of the command sequence is applied at moment K + 1. ese steps are repeated for the next time steps.
In this method, the number of switching states is defined to control the microgrid, and based on this number and the proposed cost function, the switching operation is performed. Furthermore, Figure 5 shows the state feedback controller diagram. Moreover, the proposed controller equations are explained in Section 3.4.
Among constraints that exist in this system, we could mention constraints in switching control S, which is considered in the equation below. e control signal, which is defined by predictive control, is continuous. e variable S is denoted that to u signal. As it is mentioned, this signal takes one of values +1 or −1. e principle of switching is presented below: in which h is a very small number. Choosing the h value determines switching frequency, in a way that reference values are tracked. After several sequences, when we achieved a more accurate model, we could choose this h value even smaller. e single-phase equivalent circuit of converted is shown in Figure 6. Using this figure and in the presence of the LCL filter, the state vector in conventional methods is considered as below: International Transactions on Electrical Energy Systems Figure 6 shows the block diagram of the implemented control method. Using Figure 6 and considering selected state variables, it will be obtained the following descriptions for system state space: PI Microgrid MPC Algorithm Figure 4: Principles of the operation of the predictive method. uV dc  International Transactions on Electrical Energy Systems Hence, the following state vectors are given that by equation (13).
In the following, it has been proposed that it could be obtained better results in predictive control, utilizing similarity transform in the state matrix and its modification. With this method, in addition to the fact that it has maintained system dynamics, we can use this similarity transform to evaluate all systems. Figure 6 depicts a block diagram of the implemented control method. In the model predictive control and state feedback controller, the chosen states of the system are compared with their reference quantities to generate the converter switching. It is easy to generate a reference for the output voltage v cf and current i c from power flow conditions. However, the same cannot be said about the reference for the i f . To facilitate this, we define the new state vectors as follows:

e Proposed Method.
erefore, we will have the following conversion matrix: e transformed state equations are obtained by combining equations (11) and (12) as follows: e control rule is defined as follows: In the above equation, K is a gain matrix, and x ref is the reference vector. e gain matrix can be obtained using the DE-MPC control method and the proposed switching method.
e control rule of equation (13) includes switching control, which is discussed in detail below.
Assuming complete control over u, a quadratic optimal linear steady state can be designed for this problem. As noted earlier, the control rule is as follows: e control law discussed so far is for the system in which the DGs have an output inductor. Alternatively, when the DGs do not have an output inductance, the inductance L1 is removed and the output filter is a simple LC filter. e system state is then modified follows: With respect to Figure 6, the reference for v cf v * and given V * and Ø * , the current phasor through the capacitor C f is given by equation (14).
e reference i * cf is obtained from the instantaneous value of I * cf . As we have seen, it is much easier to predict the reference values from the capacitor voltage (v cf ) and then to predict its current (i c ) than to predict the current i f and δ * 1 is angle of V * , respectively. It is evident in equation (11) that reference for all elements of the states is required for state feedback. Since V and δ are obtained from the droop equation, the references for the capacitor voltage and current are given by v cref � V sin(wt + δ) and i cref � V ѡ C f sin(ѡt + δ +90).
In the above equation, x ref (k) denotes reference vectors. e DE-MPC controller minimizes the following performance index: e index given in equation (18) must be minimized to obtain the optimal control rule, u, by solving the steady-state equation.
In equation (18), the weighting matrix, Q, is a definite or semidefinite positive matrix, which is real and symmetric, while the penalty control matrix, R, is a definite positive matrix, which is real and symmetric. Moreover, ρ is a constant positive number. According to Bryson's rule, the initial choice for R and Q matrices is possible in the form of diagonal matrices as follows: In the above equation, l is the number of control outputs and m is the number of inputs. Moreover, z i is called the controlled output, which is related to the signal we want to minimize in the shortest possible time. In this method, the output voltage is indirectly regulated by controlling the inductor's current. e reason behind selecting the current instead of the voltage involves the presence of more ripples in the current, which increases the predictions in the proposed controller. In this way, more accurate data about the future can be predicted, increasing the robustness of the proposed controller.
To do so, an optimal objective function is specified that determines the order of switching. e order of switching along the prediction horizon will be according to equation (20): In this equation, U is the optimal switching state whose first element, i.e., u(k), which is applied to the circuit, while its other elements are applied in subsequent time steps.
In this method, one of the control goals of the objective function involves reducing the difference between the current and its reference value according to equation (21): In this way, the cost function can be expressed as equation (22): e optimal switching state is achieved by minimizing the cost function as follows: e reason for using these arguments in the proposed equation is that it can better minimize the cost function. Optimal switching in equation (23) is performed using the iteration method. All possible switching states are defined for the controller along the N horizon, which is shown by U(k).
erefore, there will be 2 N switching states. Matrices (20) and (21) are calculated for all the switching states, while the cost function equation (22) is also calculated.
Finally, the switching state with the lowest j value is selected and applied to the switch. e existing differential approximation, i.e., di/dt, can be considered as follows as a simple step-forward Euler equation: In addition, by substituting equation (24) into (21), the future value of the load current vector is obtained as follows: Equation (25) is used in the controller block for predicting the future current values based on the measured voltage vector. To select the voltage vector and control the current, the predicted current is evaluated using the following cost function: In this equation, i * α, β[k+1] is the estimate of the reference current vector in the next horizon. For grids with a sufficiently small sampling time, it can be assumed that this current is equal to its previous value, i.e., i * α, β[k+1] i * α, β [k]. However, for large sampling times, the future value of the reference current needs to be extrapolated. To make the values of the three-phase current vectors independent from each other, the voltage vectors can be first obtained from the values of the switching signals and the voltage of the DC link capacitors.
e shared-mode voltage is obtained as follows: e cost function in the proposed algorithm is to minimize the voltage drop. e objective function that should be minimized is defined as follows: In the above equation, P 1ss , PL 1ss , PG 1ss , P 2ss , Pl 2ss , and PG 2ss are the final (stable) values obtained for the active powers in Table 1. Moreover, Q 1ss , QL 1ss , QG 1ss , Q 2ss , QL 2ss , and QG 2ss are the final (stable) values of the reactive powers.
In fact, this objective function is defined in such a way that the values of the powers have the least deviation from the final values or the values of their steady states, while reaching this steady state in the shortest possible time. e model-based predictive control process algorithm for controlling the current in the selected system is as follows: (iii) Measuring currents ic, ia, and ib;

The Simulation Results
is section presents the optimal distribution of the joint load using the distributed generation source, which is separately simulated using the LQR and PID methods. is simulation was performed in MATLAB Simpower environment in the presence of two distributed generation sources. In addition, by optimally adjusting the parameters of each controller using the PSO algorithm, the reliability of the microgrid substation has increased. In the following, the proposed predictive control method, i.e., DE-MPC, is compared with PID controllers using PSO. Moreover, FS-MPC and DSVM-MPC are simulated using a single distributed generation source, and the results are compared with each other. Figure 7 shows the simulated model of the system in MATLAB Simpower. Suppose that at time t � 0.5s, the impedance of the joint load is reduced by half of the initial value.
In this section, the active power and voltage DGs are obtained in Figures 8(a) and 8(b). In Figure 9 as can be seen from these figures and Table 1, in this case, after reconnecting the microgrid to the main grid, the power values rapidly reach their steady state; according to Figure 9, the fluctuation of power in PCC1 and PCC2 point voltage is reduced. In addition, to compare the performance of two methods, in Table 2, the numerical results of the PID controller using the PSO algorithm for two DGs are obtained, and in Figures 10 and 11 it that the active power dedication in DG-1 and DG-2.
It can be illustrated the active power distribution with the PID controller and three-phase voltage waveform at the PCC1 point by PSO algorithm for one DG in Figures 12 and 13 respectively. Furthermore, Table 3 presents the PID controller simulation results for one DG. In order to better compare the proposed method (DEMPC) by PID controller using PSO algorithm, the numerical results for one DG are evaluated. Figure 14 shows the convergence diagram of the objective function. In this case, in order to compare the proposed method with DSVM-MPC, the convergence diagram of DE-MPC is first simulated using 100 iterations. It shows the convergence diagram of the objective function. According to the convergence diagram, it can be concluded that the diagram of the proposed controller cost function is lower than the DSVM method. In terms of economy, the better performance can be seen than the other controllers studied. e reasons for choosing PSO include simplicity in implementation and a successful track record in these works. It should be noted that the effectiveness of an algorithm largely depends on the type and structure of the problem, but the fact that PSO has been successfully used in a wide range of scientific fields shows its good potential for solving optimization problems. Hence, one of the main weaknesses of previous methods is convergence to local optimums and the lack of a robust global search. As the formulations of classic PSO indicate, the best approach to increase the efficiency of this algorithm is to adjust the coefficients so as to improve its local and global searches. In the improved algorithm, the inertia weight (w min � 0.4, w max � 0.9) and the acceleration coefficients and population number (c1 � 0.2 and c2 � 2.3, population � 50) are obtained by the parameters mentioned [16,30]. e simulations results demonstrated the good performance of best so far quantities' optimization with the proposed algorithm in solving the model predictive control cost function. e notable features of the developed algorithm include fast convergence and the progress of search based on the rotational motion of the system during optimization.
In Figure 15, the active power distribution is calculated for one DG in the presence of the proposed controller. Furthermore, this method can be a suitable alternative for the mentioned controllers. Figure 15 shows the actual power allocation, and Figure 16 shows the PCCI voltage point with the DE-MPC controller. Table 3 presents the numerical results obtained from these diagrams.
According to Figures 15 and 16, the information presented in Table 3, it can be observed that in the presence of the DE-MPC controller, the transient response of the system is significantly improved, and after connecting the grid, the International Transactions on Electrical Energy Systems power distribution returns to its original state even in less time compared to PID and PSO. In addition, for noncomplex model predictive control to define optimization functions and solve them, the constrained linear functions such as fminprog and nonlinear constrained functions such as fmincon can be used in the MATLAB software. Also, if the problem is unconstrained by linear functions, the fminsearch function is used.
Comparing the results in Table 3 and Table 4 with the results of the power allocation in the islanding mode using the proposed DE-MPC controller, it can be seen that when using the DE-MPC controller, the transient response of the system is greatly improved, and after reconnecting the microgrid to the main power grid (in less than 1 second), the power distribution rapidly reaches its steady state, and there will be no power fluctuations.

Conclusions
In this study, a distributed model predictive controller was proposed. A comparison of the results obtained in Tables 3  and 4 revealed that the proposed distributed economic model predictive controller significantly improves the transient response of the system and the power quality of the grid compared to the LQR, PID, FS-MPC, and DVSM-MPC methods. It is noteworthy that the proposed DE-MPC controller has a better performance than other controllers in terms of balancing and stabilizing the microgrid when it is connected to the main grid. By changing the predictive control rule and replacing the current with the voltage, more data are provided than in the previous case. erefore, in this way, a large volume of data becomes available for the proposed predictive horizon. In addition, this study proposes a novel PCC voltage compensation method for islanded microgrids by improving the power-sharing control schemes among the DGs to compensate for the PCC voltage deviation caused by the droop control and the state feedback controller. A smooth transfer between the islanding mode and grid connection mode assure a stable operation of the system. e model predictive control efficacy is checked in the case of the LCL filter. e application is mainly aimed at the rural area where the unbalanced load is common and wireless communication is always desirable due to large network size. However, load sharing can be made more accurate by incorporating the line impedance values in the power reference calculation. By switching the control action of the DGs from state feedback control in grid connection mode to voltage control in islanding modes, a seamless transfer is achieved. A step-by-step matrix transformation control method is proposed for a smooth transition during islanding and resynchronization. It must be mentioned that the proposed distributed economic model predictive controller has more successfully performed in creating balance and stability in the microgrid in the grid connection mode. In addition, this study proposes a novel PCC voltage compensation method for islanded microgrids by improving the power-sharing control schemes among the DGs to compensate for the PCC voltage deviation caused by the state feedback controller. It has changed the inductor and capacitor in Figure 6 section for 2%, its results are evaluated, and it is noticed that this system has good robustness against potential changes. Hence, the following state transform matrix is considered for this system, and better results in terms of overshoot, rise time, settling time, and steady state have been obtained with this method. As a result, the recovery time for reswitching from the island mode to the connection mode of the distributed generation sources is reduced. Some areas for future work are the state feedback control strategy scheme that can be modified to share power in microgrid with inertial and noninertial DG. Improvement in supplementary droop control for enhanced system damping under weak operating conditions and protection of back-to-back converters in case of a fault in utility or microgrid faults can be investigated.

FS-MPC:
Finite set model predictive control DE-MPC: Distributed economic model predictive control DSVM-MPC: Discrete space vector modulation-model predictive control GPC: Generalized predictive control VSI: Voltage source inverters DG: Distributed generation PI: Proportional integral.

Data Availability
e data used to support the finding of this study are available from the corresponding author upon request. Meanwhile, readers can contact us via e-mail: mh_fatehi@ kau.ac.ir.
Ethical Approval e author's approval of the manuscript should not be submitted to more than one journal for simultaneous consideration.