Seamless Transfer Algorithm of AC Microgrid Inverter Compensating Load Current for Weak Grid

In this paper, we propose a voltage control technique for the seamless transfer algorithm of a microgrid inverter. When the microgrid inverter is switched from grid-connected mode to standalone operation mode, an output voltage transient may occur, and adversely affect the load. To solve this, seamless transfer algorithms that complete mode switching within 4 ms have been studied. However, previous control techniques have very complex structures. In this study, we find the cause of the voltage transient occurring in the mode conversion, through state average modeling of the inverter. Subsequently, we propose a feed-forward compensator for seamless transfer. The cause of the voltage transient is removed by the compensation, and smooth mode switching is achieved. The proposed controller is verified by Powersim (PSIM) simulations.


Introduction
Recently, as global warming and environmental issues intensify, the demand for distributed power generation based on renewable energy is increasing.However, renewable energy (such as solar and wind power) has a disadvantage, in that the power generation is concentrated within a limited period of time, and the output changes according to the external environment.To address this, research has actively been conducted to link energy storage systems (ESSs) with new and renewable energy.An ESS is a system that stores electronic energy and supplies it.ESSs can be used with a bidirectional power transmission to replace the conventional unidirectional power supply for the efficient use of electric energy.In particular, studies on microgrid systems that can self-supply in the form of generating and consuming their own power, have been actively conducted [1][2][3][4][5][6][7].Generally, in the case of areas far from the grid, long-distance transmission lines must be installed in order to deliver electric power.These weak grids increase the economic burden as a result of power loss and installation costs.For this reason, diesel generators are often used in island areas to supply power to a load through their own power generation, but they come with initial installation and ongoing maintenance costs.Therefore, standalone microgrids are attracting attention as an alternative to the weak grid in remote areas, such as islands.
Figure 1 shows a block diagram of a microgrid system.When the microgrid operates in the standalone operation mode, it establishes a small-scale power grid by linking with various renewable energy sources (based on the energy storage system), and supplies stable electric energy to the demand load.A number of power conversion systems (PCSs) are needed in microgrid systems in order to link the renewable energy, grid, battery, and diesel generator.Typical PCS's include a device to convert renewable energy to DC, a bidirectional DC-DC converter to charge/discharge the battery, and a microgrid inverter to convert DC to AC.As the microgrid system has a plurality of power conversion devices, it is very important to define a communication method between them.Generally, for module design, each PCS is designed to have a separate controller, and the master controller-the energy management system (EMS)-communicates with all of the power converters to design the control.Figure 2 shows a block diagram of communication in a microgrid system [8][9][10].Figure 1 shows a block diagram of a microgrid system.When the microgrid operates in the standalone operation mode, it establishes a small-scale power grid by linking with various renewable energy sources (based on the energy storage system), and supplies stable electric energy to the demand load.A number of power conversion systems (PCSs) are needed in microgrid systems in order to link the renewable energy, grid, battery, and diesel generator.Typical PCS's include a device to convert renewable energy to DC, a bidirectional DC-DC converter to charge/discharge the battery, and a microgrid inverter to convert DC to AC.As the microgrid system has a plurality of power conversion devices, it is very important to define a communication method between them.Generally, for module design, each PCS is designed to have a separate controller, and the master controller-the energy management system (EMS)-communicates with all of the power converters to design the control.Figure 2 shows a block diagram of communication in a microgrid system [8][9][10].Microgrid inverters connect renewable energy and the grid via DC-to-AC conversion.The microgrid inverter operates in either grid-connected or standalone mode.Under normal grid conditions, the microgrid operates in grid-connected mode, and assists in sharing the load.However, when a system disturbance or fault occurs, a static switch opens and the microgrid changes to standalone operation.In this mode, the microgrid inverter operates as a single voltage source, and independently supplies stable electrical energy to the demand load through constant voltage constant frequency (CVCF) control.The microgrid inverter must always supply stable electrical energy in both grid-connected and standalone operation modes.In particular, while switching from grid-connected mode to stand-alone mode, the conversion should be performed  Figure 1 shows a block diagram of a microgrid system.When the microgrid operates in the standalone operation mode, it establishes a small-scale power grid by linking with various renewable energy sources (based on the energy storage system), and supplies stable electric energy to the demand load.A number of power conversion systems (PCSs) are needed in microgrid systems in order to link the renewable energy, grid, battery, and diesel generator.Typical PCS's include a device to convert renewable energy to DC, a bidirectional DC-DC converter to charge/discharge the battery, and a microgrid inverter to convert DC to AC.As the microgrid system has a plurality of power conversion devices, it is very important to define a communication method between them.Generally, for module design, each PCS is designed to have a separate controller, and the master controller-the energy management system (EMS)-communicates with all of the power converters to design the control.Figure 2 shows a block diagram of communication in a microgrid system [8][9][10].Microgrid inverters connect renewable energy and the grid via DC-to-AC conversion.The microgrid inverter operates in either grid-connected or standalone mode.Under normal grid conditions, the microgrid operates in grid-connected mode, and assists in sharing the load.However, when a system disturbance or fault occurs, a static switch opens and the microgrid changes to standalone operation.In this mode, the microgrid inverter operates as a single voltage source, and independently supplies stable electrical energy to the demand load through constant voltage constant frequency (CVCF) control.The microgrid inverter must always supply stable electrical energy in both grid-connected and standalone operation modes.In particular, while switching from grid-connected mode to stand-alone mode, the conversion should be performed stably without a transient state.This mode switching technique is defined as a seamless transfer, Microgrid inverters connect renewable energy and the grid via DC-to-AC conversion.The microgrid inverter operates in either grid-connected or standalone mode.Under normal grid conditions, the microgrid operates in grid-connected mode, and assists in sharing the load.However, when a system disturbance or fault occurs, a static switch opens and the microgrid changes to standalone operation.In this mode, the microgrid inverter operates as a single voltage source, and independently supplies stable electrical energy to the demand load through constant voltage constant frequency (CVCF) control.The microgrid inverter must always supply stable electrical energy in both grid-connected and standalone operation modes.In particular, while switching from grid-connected mode to stand-alone mode, the conversion should be performed stably without a transient state.This mode switching technique is defined as a seamless transfer, and should be completed within 4 ms [11][12][13][14][15].However, general inverter controllers often produce voltage transients when the mode is switched.To solve this, research into seamless transfer has been actively conducted.A seamless transfer algorithm through indirect current control has been studied [10][11][12][13][14][15].With it, the voltage can be controlled through an external current controller.A limit set at the time of mode conversion can be utilized in order to eliminate the voltage transient, thereby achieving a seamless transfer.However, as the indirect current control scheme has a structure in which the current controller is located outside, control is very complicated and bandwidth design is difficult-unlike the direct current control.In addition, research has also been conducted to achieve seamless transfer through Energies 2019, 12, 728 3 of 15 a droop control.Droop control is a method of controlling the frequency and magnitude using active power and reactive power in an inverter configured in parallel [16][17][18][19][20]. Using droop control, it is possible to reactive power sharing without communication between the distributed generation units.However, the power distribution technique using the droop control makes it difficult to control the low-level micro-grids under the assumption that the output impedance of the inverter is inductive, and the transient response characteristics are poor under the conditions of non-linear loads, because they operate on the basis of linear loads [13,14].Furthermore, if the effective reactive power of the system is not properly calculated, a reactive power error and voltage drop occur.When a microgrid system operates in standalone mode, it is necessary to further improve the accuracy of the reactive power sharing, because the inverter operates as a voltage source, and has characteristics that are sensitive to the system environment and parameters.A study was made to design a feed-forward controller through the modeling of a three-phase inverter and rectifier [21][22][23].However, the algorithm for seamless transfer in the grid-connected system was not considered, and the research was conducted under simple inverter load conditions.
In this paper, we propose a technique to accomplish seamless transfer by the feed-forward compensation of the load current, based on a direct current control technique.The controller of the inverter is designed, and the transient phenomenon is analyzed through a state average model.Subsequently, a feed-forward compensator is designed to remove the cause of the transient phenomenon, and produce a controller that can perform smooth conversions during mode switching.The proposed controller is verified using Powersim (PSIM) simulation software.

Grid-Connected Inverter Modeling of Microgrid
Figure 3 shows the circuit of a bidirectional grid-connected inverter that is part of a microgrid system.This microgrid inverter consists of six insulated-gate bipolar transistor (IGBT) switches and an inductor-capacitor filter (LC filter).In grid-connected mode, the inverter operates as a current source, and the current flows to the load and grid through the current control.In standalone mode, the inverter operates as a voltage source, and supplies power independently to the demand load.
Energies 2019, 12, x FOR PEER REVIEW 3 of 15 and should be completed within 4 ms [11][12][13][14][15].However, general inverter controllers often produce voltage transients when the mode is switched.To solve this, research into seamless transfer has been actively conducted.A seamless transfer algorithm through indirect current control has been studied [10][11][12][13][14][15].With it, the voltage can be controlled through an external current controller.A limit set at the time of mode conversion can be utilized in order to eliminate the voltage transient, thereby achieving a seamless transfer.However, as the indirect current control scheme has a structure in which the current controller is located outside, control is very complicated and bandwidth design is difficult-unlike the direct current control.In addition, research has also been conducted to achieve seamless transfer through a droop control.Droop control is a method of controlling the frequency and magnitude using active power and reactive power in an inverter configured in parallel [16][17][18][19][20].
Using droop control, it is possible to reactive power sharing without communication between the distributed generation units.However, the power distribution technique using the droop control makes it difficult to control the low-level micro-grids under the assumption that the output impedance of the inverter is inductive, and the transient response characteristics are poor under the conditions of non-linear loads, because they operate on the basis of linear loads [13,14].Furthermore, if the effective reactive power of the system is not properly calculated, a reactive power error and voltage drop occur.When a microgrid system operates in standalone mode, it is necessary to further improve the accuracy of the reactive power sharing, because the inverter operates as a voltage source, and has characteristics that are sensitive to the system environment and parameters.A study was made to design a feed-forward controller through the modeling of a three-phase inverter and rectifier [21][22][23].However, the algorithm for seamless transfer in the grid-connected system was not considered, and the research was conducted under simple inverter load conditions.In this paper, we propose a technique to accomplish seamless transfer by the feed-forward compensation of the load current, based on a direct current control technique.The controller of the inverter is designed, and the transient phenomenon is analyzed through a state average model.Subsequently, a feed-forward compensator is designed to remove the cause of the transient phenomenon, and produce a controller that can perform smooth conversions during mode switching.The proposed controller is verified using Powersim (PSIM) simulation software.Figure 3 shows the circuit of a bidirectional grid-connected inverter that is part of a microgrid system.This microgrid inverter consists of six insulated-gate bipolar transistor (IGBT) switches and To design the controller, the state average models for the inductor and capacitor of the inverter should be calculated.

Grid-Connected Inverter Modeling of Microgrid
Energies 2019, 12, 728 where, V abc is the phase voltage of the inverter side, V C.abc is the filter capacitor voltage, L di abc dt is the inductor voltage, i abc is the inductor current, C V C.abc dt is the capacitor current, and V C.abc R is the load current.For an easy analysis, the turn ratio of the transformer is assumed as the ideal transformer with a 1: 1 turn ratio, and the load is assumed to be the only resistor load.Equations ( 1) and ( 2) are the state average models for the inductors and capacitors of the typical three-phase inverters.The AC three-phase system cannot use proportional-integral (PI) controllers.Therefore, to design the controller, the voltage and current of the abc axis are converted to the dq axis.
where, T(θ) is the transformation matrix of the abc frame to dq frame.Equation ( 3) is a transformation matrix for transforming the abc axis into the dq axis.By applying this transformation matrix in Equations ( 4) and ( 5), the state average models for the dq axis of the inverter can be calculated.
Where ω is the grid frequency in radians, and V A d q is the phase voltage in the dq frame, V C dq is the capacitor voltage in the dq frame, and i dq is the inductor current in the dq frame.
Equations ( 6) and ( 7) are the state average model for the dq axis of the voltage and current, respectively, of the inverter.There is a cross-coupling term in the dq axis of the voltage and current.As this cross-coupling term complicates the controller design, it is removed by the feed-forward compensation, as shown in Figure 4.
where, D dq, f b is the feed-forward component in the inverter controller.Finally, the three-phase inverter model can be expressed as Equation ( 8).The three-phase inverter is a buck-based topology, which is identical to the voltage and current controller models in a buck converter.When the inverter operates in grid-connected mode, the voltage is synchronized with the grid voltage, and the controller is configured-as shown in Figure 4-to perform only the current control without the voltage control.
When the inverter operates in standalone mode, both the voltage and current must be controlled, because the system is disconnected from the grid, and the voltage needs to be supplied to the demand load.Figure 5 shows the inverter controller in standalone mode.An external voltage controller controls the load voltage, and an internal current controller controls the current.
where,  , is the feed-forward component in the inverter controller.Finally, the three-phase inverter model can be expressed as Equation ( 8).The three-phase inverter is a buck-based topology, which is identical to the voltage and current controller models in a buck converter.When the inverter operates in grid-connected mode, the voltage is synchronized with the grid voltage, and the controller is configured-as shown in Figure 4-to perform only the current control without the voltage control.When the inverter operates in standalone mode, both the voltage and current must be controlled, because the system is disconnected from the grid, and the voltage needs to be supplied to the demand load.Figure 5 shows the inverter controller in standalone mode.An external voltage controller controls the load voltage, and an internal current controller controls the current.
Figure 5. Two-loop controller of a microgrid inverter.

Problems with the Mode Conversion of Previous Controllers
If the controller is designed by modeling the system using Equation ( 8), the voltage and current can be controlled easily without any problems in both grid-connected and standalone mode.
where,  , is the feed-forward component in the inverter controller.Finally, the three-phase inverter model can be expressed as Equation ( 8).The three-phase inverter is a buck-based topology, which is identical to the voltage and current controller models in a buck converter.When the inverter operates in grid-connected mode, the voltage is synchronized with the grid voltage, and the controller is configured-as shown in Figure 4-to perform only the current control without the voltage control.When the inverter operates in standalone mode, both the voltage and current must be controlled, because the system is disconnected from the grid, and the voltage needs to be supplied to the demand load.Figure 5 shows the inverter controller in standalone mode.An external voltage controller controls the load voltage, and an internal current controller controls the current.
Figure 5. Two-loop controller of a microgrid inverter.

Problems with the Mode Conversion of Previous Controllers
If the controller is designed by modeling the system using Equation ( 8), the voltage and current can be controlled easily without any problems in both grid-connected and standalone mode.

Problems with the Mode Conversion of Previous Controllers
If the controller is designed by modeling the system using Equation ( 8), the voltage and current can be controlled easily without any problems in both grid-connected and standalone mode.A typical grid-connected inverter controller is designed as shown in Figure 6, to operate in both modes.
Energies 2019, 12, x FOR PEER REVIEW 6 of 15 A typical grid-connected inverter controller is designed as shown in Figure 6, to operate in both modes.When the microgrid inverter is operating in grid-connected mode, the current command is received via the EMS master controller.In grid-connected mode, the IGBT switches are controlled by the current controller, without any voltage control.However, as the load voltage must be controlled in standalone mode, the microgrid inverter is designed for this role as a two-loop controller that performs both voltage and current control.The inverter performs in either the  When the microgrid inverter is operating in grid-connected mode, the current command is received via the EMS master controller.In grid-connected mode, the IGBT switches are controlled by the current controller, without any voltage control.However, as the load voltage must be controlled in standalone mode, the microgrid inverter is designed for this role as a two-loop controller that performs both voltage and current control.The inverter performs in either the standalone or grid-connected mode, according to the EMS command.
Fault detection or so-called islanding detection is a very critical issue in this application.In this paper, two major faults are described.First, there is a fault in the grid.Grid faults generally can be classified as short-circuit faults and ground faults [24][25][26][27].A short-circuit fault is an accident that occurs when a certain phase is connected to another phase, and a ground fault is an accident where one or more phases are connected to the ground.
Figure 7 shows the mode-switching sequence of the microgrid inverter in the event of a grid fault.Microgrid inverters should switch quickly from grid-connected to stand-alone mode when a fault occurs in the grid.For stable mode switching, it is necessary to detect the fault quickly and to switch smoothly.Generally, performing a mode switching within 4 ms-from the occurrence of a fault, to the completion of switching-is defined as a seamless transfer.However, if the voltage control begins in stand-alone mode without any additional control after the detection of a fault, a voltage transient may occur, and the load may be severely affected.When the microgrid inverter is operating in grid-connected mode, the current command is received via the EMS master controller.In grid-connected mode, the IGBT switches are controlled by the current controller, without any voltage control.However, as the load voltage must be controlled in standalone mode, the microgrid inverter is designed for this role as a two-loop controller that performs both voltage and current control.The inverter performs in either the standalone or grid-connected mode, according to the EMS command.
Fault detection or so-called islanding detection is a very critical issue in this application.In this paper, two major faults are described.First, there is a fault in the grid.Grid faults generally can be classified as short-circuit faults and ground faults [24][25][26][27].A short-circuit fault is an accident that occurs when a certain phase is connected to another phase, and a ground fault is an accident where one or more phases are connected to the ground.Figure 7 shows the mode-switching sequence of the microgrid inverter in the event of a grid fault.Microgrid inverters should switch quickly from grid-connected to stand-alone mode when a fault occurs in the grid.For stable mode switching, it is necessary to detect the fault quickly and to switch smoothly.Generally, performing a mode switching within 4 ms-from the occurrence of a fault, to the completion of switching-is defined as a seamless transfer.However, if the voltage Figure 8 shows the simulation result of a mode conversion as a result of the occurrence of a system fault.Here, it is assumed that the switch connected to the system turned off because of a fault-this change was detected within 1 ms, to trigger mode conversion.At this time, the inverter proceeded to control the voltage in standalone mode.However, a transient occurred in the output voltage after the mode change.Secondly, there is a weak-grid fault.A weak-grid fault occurs when the grid voltage is lower or higher than the rated voltage because of grid disturbances.The inverter senses a fault when the grid voltage is unstable below or above the rated-voltage (weak-grid fault), and switches modes from the grid-connected mode to stand-alone mode.
To solve this problem, indirect current control and droop control techniques have been studied.However, as the indirect current control scheme has a structure in which the current controller is located outside, control is very complicated and bandwidth design is difficult-unlike direct current control.In this paper, we propose a load current compensation technique that can be easily controlled.Figure 8 shows the simulation result of a mode conversion as a result of the occurrence of a system fault.Here, it is assumed that the switch connected to the system turned off because of a fault-this change was detected within 1 ms, to trigger mode conversion.At this time, the inverter proceeded to control the voltage in standalone mode.However, a transient occurred in the output voltage after the mode change.Secondly, there is a weak-grid fault.A weak-grid fault occurs when the grid voltage is lower or higher than the rated voltage because of grid disturbances.The inverter senses a fault when the grid voltage is unstable below or above the rated-voltage (weak-grid fault), and switches modes from the grid-connected mode to stand-alone mode.
To solve this problem, indirect current control and droop control techniques have been studied.However, as the indirect current control scheme has a structure in which the current controller is located outside, control is very complicated and bandwidth design is difficult-unlike direct current control.In this paper, we propose a load current compensation technique that can be easily controlled.

Proposed Controller Design
As shown in Equation ( 8), the state average model for the capacitor voltage is expressed by the equation of load resistance and output voltage.When the microgrid inverter mode is switched, it is necessary to control the component of the load that was not previously considered.Additionally, the voltage controller is designed with a low bandwidth so as to reduce disturbance of the grid frequency, so that the steady-state is reached with very slow response characteristics.As a result of these factors, the output voltage of the microgrid inverter changes when the mode is switched.However, if the load current feed-forward compensator is designed to measure the load current through a sensor, it will be possible to eliminate the transient state that occurs during mode switching.

Proposed Controller Design
As shown in Equation ( 8), the state average model for the capacitor voltage is expressed by the equation of load resistance and output voltage.When the microgrid inverter mode is switched, it is necessary to control the component of the load that was not previously considered.Additionally, the voltage controller is designed with a low bandwidth so as to reduce disturbance of the grid frequency, so that the steady-state is reached with very slow response characteristics.As a result of these factors, the output voltage of the microgrid inverter changes when the mode is switched.However, if the load current feed-forward compensator is designed to measure the load current through a sensor, it will be possible to eliminate the transient state that occurs during mode switching.
Figure 9 shows a block diagram of the proposed seamless transfer controller.A separate load current feed-forward compensator was added to the existing voltage controller output.Therefore, the voltage controller controls the capacitor current of the inverter, and the current flowing to the load is managed by the feed-forward compensator.
Equation ( 9) represents the state average modeling equation of the inverter with the load current feed-forward compensator.The disturbance term relating to the previously problematic load current is removed by the feed-forward compensator.Therefore, if feed-forward compensation is applied to Equation (8) by measuring the load current through the sensor-as shown in Equation ( 9)-the compensator directly removes the disturbance due to the load.As such, the controller will always be able to output a stable voltage.
When the microgrid inverter operates in standalone mode, the voltage of the inverter can be expressed as a function of the load, as shown in Equation (8).Therefore, when the load fluctuates in standalone mode, the output voltage fluctuates.However, if the proposed controller is used, a stable voltage can always be supplied through load current compensation-even if the load fluctuates.Figure 9 shows a block diagram of the proposed seamless transfer controller.A separate load current feed-forward compensator was added to the existing voltage controller output.Therefore, the voltage controller controls the capacitor current of the inverter, and the current flowing to the load is managed by the feed-forward compensator.
Equation ( 9) represents the state average modeling equation of the inverter with the load current feed-forward compensator.The disturbance term relating to the previously problematic load current is removed by the feed-forward compensator.Therefore, if feed-forward compensation is applied to Equation ( 8) by measuring the load current through the sensor-as shown in Equation ( 9)-the compensator directly removes the disturbance due to the load.As such, the controller will always be able to output a stable voltage.
When the microgrid inverter operates in standalone mode, the voltage of the inverter can be expressed as a function of the load, as shown in Equation (8).Therefore, when the load fluctuates in standalone mode, the output voltage fluctuates.However, if the proposed controller is used, a stable voltage can always be supplied through load current compensation-even if the load fluctuates.Figure 10 shows the simulation circuit constructed with PSIM.The DC input voltage is connected to the grid and load via the inverter.The parameters of the inverter are shown in Table 1.

Simulation
Figure 10 shows the simulation circuit constructed with PSIM.The DC input voltage is connected to the grid and load via the inverter.The parameters of the inverter are shown in Table 1.
Figure 9 shows a block diagram of the proposed seamless transfer controller.A separate load current feed-forward compensator was added to the existing voltage controller output.Therefore, the voltage controller controls the capacitor current of the inverter, and the current flowing to the load is managed by the feed-forward compensator.
Equation ( 9) represents the state average modeling equation of the inverter with the load current feed-forward compensator.The disturbance term relating to the previously problematic load current is removed by the feed-forward compensator.Therefore, if feed-forward compensation is applied to Equation ( 8) by measuring the load current through the sensor-as shown in Equation ( 9)-the compensator directly removes the disturbance due to the load.As such, the controller will always be able to output a stable voltage.
When the microgrid inverter operates in standalone mode, the voltage of the inverter can be expressed as a function of the load, as shown in Equation ( 8).Therefore, when the load fluctuates in standalone mode, the output voltage fluctuates.However, if the proposed controller is used, a stable voltage can always be supplied through load current compensation-even if the load fluctuates.Figure 10 shows the simulation circuit constructed with PSIM.The DC input voltage is connected to the grid and load via the inverter.The parameters of the inverter are shown in Table 1.The simulations were performed for the occurrence of accidents in both normal-grid and weak-grid system conditions (low-and high-grid voltage).Additionally, the microgrid inverter is capable of bi-directional power transfer.When renewable energy is generated, the current flows from the inverter to the grid.When the state of charge (SOC) of the battery becomes insufficient, the current enters and charges the battery.In this case, the inverter's current flows from the grid to the inverter.Therefore, as the proposed control method has to support the bidirectional operation, a simulation analysis was performed in both positive and negative current conditions.Figures 11-13 show the simulation results for mode switching during renewable energy generation, and Figures 14-16 show the same during battery charging.

Simulation
from the inverter to the grid.When the state of charge (SOC) of the battery becomes insufficient, the current enters and charges the battery.In this case, the inverter's current flows from the grid to the inverter.Therefore, as the proposed control method has to support the bidirectional operation, a simulation analysis was performed in both positive and negative current conditions.Figures 11-13 show the simulation results for mode switching during renewable energy generation, and Figures 14-16 show the same during battery charging.Figure 11 shows the waveforms detected and mode-shifted after 1 ms as a result of a fault in the normal system during renewable energy generation.If a general controller is used-as shown in Figure 11a-the output voltage is transient because of the influence of the load when the mode is changed.The simulation results showed that the voltage fluctuation was about 50 V.However, if the proposed controller is used-as shown in Figure 11b-the load current can be feed-forward compensated to remove this fluctuation.Therefore, even when the mode is switched, a stable voltage can always be supplied.In the simulation results for the proposed controller, the smooth mode switching was completed without a voltage transient.Figure 11 shows the waveforms detected and mode-shifted after 1 ms as a result of a fault in the normal system during renewable energy generation.If a general controller is used-as shown in Figure 11a-the output voltage is transient because of the influence of the load when the mode is changed.The simulation results showed that the voltage fluctuation was about 50 V.However, if the proposed controller is used-as shown in Figure 11b-the load current can be feed-forward compensated to remove this fluctuation.Therefore, even when the mode is switched, a stable voltage can always be supplied.In the simulation results for the proposed controller, the smooth mode switching was completed without a voltage transient.Figure 12 shows the simulation results for a transition from a weak grid condition (low system voltage) to standalone mode.Figure 12a depicts the case in which the general controller is used.After the mode switching command, the output voltage took approximately 5 ms to reach the steady state, and voltage fluctuation occurred.Figure 12b depicts the case in which the proposed controller is used.Even under the low-grid voltage condition, the proposed controller compensated the load current and output stable voltage within 1 ms. Figure 12 shows the simulation results for a transition from a weak grid condition (low system voltage) to standalone mode.Figure 12a depicts the case in which the general controller is used.Figure 12 shows the simulation results for a transition from a weak grid condition (low system voltage) to standalone mode.Figure 12a depicts the case in which the general controller is used.After the mode switching command, the output voltage took approximately 5 ms to reach the steady state, and voltage fluctuation occurred.Figure 12b  Figure 13 shows the simulation results for a transition from a weak grid condition (high-grid voltage) to standalone mode.Figure 13a shows a transient in the output voltage when the mode was changed and a general controller was used.However, when the proposed controller was used, the mode was switched as shown in Figure 13b.As shown in Figures 11-13, when the mode was switched during renewable energy generation, the transient phenomenon was eliminated by the load current feed-forward compensator.Figure 13 shows the simulation results for a transition from a weak grid condition (high-grid voltage) to standalone mode.Figure 13a shows a transient in the output voltage when the mode was changed and a general controller was used.However, when the proposed controller was used, the mode was switched as shown in Figure 13b.As shown in Figures 11-13, when the mode was switched during renewable energy generation, the transient phenomenon was eliminated by the load current feed-forward compensator.Figure 14 shows the simulation results of switching from a grid-connected mode to standalone mode, as a result of a fault in the normal system during battery charging.Figure 14a shows the case in which a general inverter controller is used, and Figure 14b shows the case in which the proposed load current compensation controller is used.Both controllers were able to switch to standalone operation, but in the case of the general controller, the output voltage was transient.Comparatively, Figure 14 shows the simulation results of switching from a grid-connected mode to standalone mode, as a result of a fault in the normal system during battery charging.Figure 14a shows the case in which a general inverter controller is used, and Figure 14b shows the case in which the proposed load current compensation controller is used.Both controllers were able to switch to standalone operation, but in the case of the general controller, the output voltage was transient.Comparatively, the proposed controller was able to achieve seamless transfer-even if the inverter current was in the (-) direction-by feed-forward compensation of the load current.Figure 14 shows the simulation results of switching from a grid-connected mode to standalone mode, as a result of a fault in the normal system during battery charging.Figure 14a shows the case in which a general inverter controller is used, and Figure 14b shows the case in which the proposed load current compensation controller is used.Both controllers were able to switch to standalone operation, but in the case of the general controller, the output voltage was transient.Comparatively, the proposed controller was able to achieve seamless transfer-even if the inverter current was in the (-) direction-by feed-forward compensation of the load current.Figure 15 shows the simulation results of switching from a weak grid condition (low system voltage) to standalone mode during battery charging.When the mode switching was performed, the general controller had a slow transition to the steady state, as a result of the influence of the load current, as shown in Figure 15a.However, with the proposed load current compensation controller, a stable output voltage was achieved without a voltage transient.Figure 15b shows the Figure 15 shows the simulation results of switching from a weak grid condition (low system voltage) to standalone mode during battery charging.When the mode switching was performed, the general controller had a slow transition to the steady state, as a result of the influence of the load current, as shown in Figure 15a.However, with the proposed load current compensation controller, a stable output voltage was achieved without a voltage transient.Figure 15b shows the simulation result using the proposed controller.Even during mode switching, the output voltage remained stable.Figure 16 shows the simulation results of switching from a weak-grid condition (high system voltage) to standalone mode during battery charging.When mode switching was performed, the normal controller had a slow transition to the steady state, because of the influence of the load current.However, the proposed load current compensation controller achieved a stable output Figure 16 shows the simulation results of switching from a weak-grid condition (high system voltage) to standalone mode during battery charging.When mode switching was performed, the normal controller had a slow transition to the steady state, because of the influence of the load current.However, the proposed load current compensation controller achieved a stable output voltage without a voltage transient.
Figure 17 shows the simulation results when the load varies in the weak-grid system.When the load changes in the weak-grid, the output voltage fluctuates as a result of the influence of the line impedance.This variation applies a large voltage stress to the load, as overvoltage is observed.It should be disconnected from the grid and operated in stand-alone mode.However, if a general controller is used, there is a problem that a transient occurs in the output voltage when the mode is switched.Figure 17a shows the simulation result of the mode switching due to the load variation in the weak-grid.When the mode is switched using a general controller, a voltage transient of about 100 V occurs.This voltage transient affects the load adversely.However, if the proposed seamless algorithm is applied, like Figure 17b, it is possible to switch the stand-alone mode and supply stable electrical power to the load.Figure 16 shows the simulation results of switching from a weak-grid condition (high system voltage) to standalone mode during battery charging.When mode switching was performed, the normal controller had a slow transition to the steady state, because of the influence of the load current.However, the proposed load current compensation controller achieved a stable output voltage without a voltage transient.Figure 17 shows the simulation results when the load varies in the weak-grid system.When the load changes in the weak-grid, the output voltage fluctuates as a result of the influence of the line impedance.This variation applies a large voltage stress to the load, as overvoltage is observed.It should be disconnected from the grid and operated in stand-alone mode.However, if a general controller is used, there is a problem that a transient occurs in the output voltage when the mode is switched.Figure 17a shows the simulation result of the mode switching due to the load variation in the weak-grid.When the mode is switched using a general controller, a voltage transient of about 100 V occurs.This voltage transient affects the load adversely.However, if the proposed seamless Figure 18 shows the simulation results of the output voltage and current according to load variations, when the inverters operate in standalone mode.Figure 18a shows the case in which the general controller was used.When the load fluctuated, the output voltage fluctuated.The results showed that the output voltage fluctuated by approximately 60 V.However, when the controller that compensates the load current was used, as shown in Figure 18b, a stable voltage was always output-even if the load fluctuated.When the microgrid inverter is in standalone mode, it acts as a voltage source and is responsible for supplying power to the demand load.Therefore, if the proposed controller is used, it will have robust characteristics against demand load fluctuations.
algorithm is applied, like Figure 17b, it is possible to switch the stand-alone mode and supply stable electrical power to the load.Figure 18 shows the simulation results of the output voltage and current according to load variations, when the inverters operate in standalone mode.Figure 18a shows the case in which the general controller was used.When the load fluctuated, the output voltage fluctuated.The results showed that the output voltage fluctuated by approximately 60 V.However, when the controller that compensates the load current was used, as shown in Figure 18b, a stable voltage was always output-even if the load fluctuated.When the microgrid inverter is in standalone mode, it acts as a voltage source and is responsible for supplying power to the demand load.Therefore, if the proposed controller is used, it will have robust characteristics against demand load fluctuations.

Conclusions
In this study, we examined the seamless transfer algorithm of a microgrid inverter.Microgrid inverters should always supply stable electrical energy to the demand load in both grid-connected and the standalone modes.Our controller was designed based on state average modeling and on the analysis of the voltage transients occurring during mode switching.When a microgrid inverter operates in standalone mode, the output voltage is affected by the load current.Therefore, when the inverter switches from the grid-connected mode to standalone mode, the output voltage is transient.To solve this, we proposed a method of removing the disturbance by compensating the load current.Using the proposed method, it was possible both to perform smooth mode switching without voltage transients, and to remove the output voltage fluctuations caused by the load fluctuations in standalone mode.Additionally, the proposed control structure feed-forward compensates the load current based on the direct current control technique, so that it can be implemented more easily than the other seamless transfer control methods.
Author Contributions: J-U.L. implemented the system and performed the experiments.H-W.K. provided the idea and managed the paper.K-Y.C. and I-S.K. assisted in idea development and paper writing.

Conflicts of Interest:
The authors declare no conflict of interest.

Conclusions
In this study, we examined the seamless transfer algorithm of a microgrid inverter.Microgrid inverters should always supply stable electrical energy to the demand load in both grid-connected and the standalone modes.Our controller was designed based on state average modeling and on the analysis of the voltage transients occurring during mode switching.When a microgrid inverter operates in standalone mode, the output voltage is affected by the load current.Therefore, when the inverter switches from the grid-connected mode to standalone mode, the output voltage is transient.To solve this, we proposed a method of removing the disturbance by compensating the load current.Using the proposed method, it was possible both to perform smooth mode switching without voltage transients, and to remove the output voltage fluctuations caused by the load fluctuations in standalone mode.Additionally, the proposed control structure feed-forward compensates the load current based on the direct current control technique, so that it can be implemented more easily than the other seamless transfer control methods.

Figure 2 .
Figure 2. Communication method of microgrid system.PCS-power conversion system.

Figure 2 .
Figure 2. Communication method of microgrid system.PCS-power conversion system.

Figure 2 .
Figure 2. Communication method of microgrid system.PCS-power conversion system.

Figure 6 .
Figure 6.Microgrid inverter controller block diagram of grid-connected and standalone mode.

Figure 6 .
Figure 6.Microgrid inverter controller block diagram of grid-connected and standalone mode.

Figure 6 .
Figure 6.Microgrid inverter controller block diagram of grid-connected and standalone mode.
12,  x FOR PEER REVIEW 7 of 15 control begins in stand-alone mode without any additional control after the detection of a fault, a voltage transient may occur, and the load may be severely affected.

Figure 8 .
Figure 8. Simulation result of mode switching using a conventional proportional-integral (PI) controller.

Figure 8 .
Figure 8. Simulation result of mode switching using a conventional proportional-integral (PI) controller.

Figure 11 .
Figure 11.Simulation results of mode switching in the case of a grid fault during renewable energy generation: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 11 .
Figure 11.Simulation results of mode switching in the case of a grid fault during renewable energy generation: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 12 .
Figure 12.Simulation results of mode switching in the case of low-grid voltage during renewable energy generation: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 12 .
Figure 12.Simulation results of mode switching in the case of low-grid voltage during renewable energy generation: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 12 .
Figure 12.Simulation results of mode switching in the case of low-grid voltage during renewable energy generation: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 13 .
Figure12shows the simulation results for a transition from a weak grid condition (low system voltage) to standalone mode.Figure12adepicts the case in which the general controller is used.After the mode switching command, the output voltage took approximately 5 ms to reach the steady state, and voltage fluctuation occurred.Figure12bdepicts the case in which the proposed controller is used.Even under the low-grid voltage condition, the proposed controller compensated the load current and output stable voltage within 1 ms.

Figure 13 .
Figure 13.Simulation results of mode switching in the case of high-grid voltage during renewable energy generation: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 14 .
Figure 14.Simulation results of mode switching in the case of a grid fault during battery charging: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 14 .
Figure 14.Simulation results of mode switching in the case of a grid fault during battery charging: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 14 .
Figure 14.Simulation results of mode switching in the case of a grid fault during battery charging: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 15 .
Figure 15.Simulation results of mode switching in the case of low-grid voltage during battery charging: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 15 .
Figure 15.Simulation results of mode switching in the case of low-grid voltage during battery charging: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Energies 2019 ,Figure 16 .
Figure 16.Simulation results of mode switching in the case of low grid voltage during battery charging: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 16 .
Figure 16.Simulation results of mode switching in the case of low grid voltage during battery charging: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 16 .
Figure 16.Simulation results of mode switching in the case of low grid voltage during battery charging: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 17 .
Figure 17.Simulation results of mode switching in case of a load change in a weak-grid condition: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 17 .
Figure 17.Simulation results of mode switching in case of a load change in a weak-grid condition: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Figure 18 .
Figure 18.Simulation results in standalone mode with load variation: (a) using the general inverter controller; (b) using the proposed load current compensation controller.

Funding:
The research was supported by a grant from the Academic Research Program of Korea National University of Transportation in 2018.This work was supported by the "Human Resources Program in Energy Technology" of the Korea Institute of Energy Technology Evaluation and Planning (KETEP), and granted financial resources from the Ministry of Trade, Industry, and Energy, Republic of Korea (no.20164030201100).

Figure 18 .
Figure 18.Simulation results in standalone mode with load variation: (a) using the general inverter controller; (b) using the proposed load current compensation controller.