Real Time Energy Management and Control of Renewable Energy based Microgrid in Grid Connected and Island Modes

An efficient power management control for microgrids with energy storage is presented in this paper. The proposed control scheme increases the reliability and resiliency of the microgrid based on three distributed energy resources (DERs), namely Photovoltaic (PV), battery, and diesel generator with local active loads. Coordination among the DERs with energy storage is essential for microgrid management. The system model and the control strategy were developed in Real Time Digital Simulator (RTDS). Decoupled d-q current control strategy is proposed and implemented for voltage source converters (VSCs) used to interface the PV and battery sources to the AC grid. A dc-dc buck converter with a maximum power point tracking function is implemented to maximize the intermittent energy generation from the PV array. A controller is proposed and employed for both grid connected and island modes of operation. In grid connected mode, the system frequency and voltage are regulated by the grid. During a fault in island mode, the diesel generator controls the system frequency and voltage in isochronous mode. Results based on the real time digital simulator are provided to verify the superiority and effectiveness of the proposed control scheme.


Introduction
A microgrid is a small scale power grid composed of distributed generation (DG), energy storage and loads accumulated together in the vicinity of each other [1,2].Microgrids increase the grid resiliency and reliability during severe weather conditions and emergency events.They offer several advantages and benefits including energy efficiency improvement, reduced power transmission losses as the distributed energy resources (DERs) are located nearby to the load, CO 2 emission reduction, integration of renewable and alternative energy sources, energy access to remote and developing communities, grid support functions, such as voltage regulation in low and medium voltage distribution networks, and other environmental benefits [3][4][5][6][7].
A microgrid can be operated in parallel with the main utility (grid connected mode) or independently as a power island (island mode) and it can be AC, DC, or a combination of both DC and AC (hybrid) [8,9].In grid connected mode, microgrids support the main grid with voltage control, frequency control, and can provide more flexibility and reliability by exchanging power based on supply and demand.In this mode, DERs operate in a maximum power point tracking (MPPT) mode and deliver maximum power to the grid.In islanded mode, the microgrid disconnects itself from the main grid and supplies the load from the DERs [10,11].In both operation modes, the balance between power demand and supply is one of the most important criteria in managing the microgrid.In grid-connected mode, the main grid is required to meet the balance.However, in the island mode the microgrid needs to do the balancing via increases in generation or load sharing [12][13][14][15].
A hybrid microgrid power supply system based on wind, photovoltaic (PV), fuel cell (FC) along with the dynamic operation and control strategies is presented in [16][17][18].The authors used a static var compensator for reactive power control and to regulate the system voltage.A distributed model predictive control (MPC) for the power dispatching optimization of a microgrid consisting of DGs, storage and shiftable loads is proposed in [19].Power management control for microgrid with distributed generation is discussed in [20][21][22][23].To control the real power, the authors proposed a frequency-droop characteristic, and for reactive power control they proposed voltage-droop characteristic, voltage regulation and load reactive power compensation.However, the fluctuation in the output of DERs with renewable energy resources (photovoltaic or wind) and varying load demand pose challenges in the successful operation of microgrids.Energy storage devices such as flywheels, batteries and supercapacitors could be used to minimize the fluctuation in renewable sources and assist the DERs match generation with demand [24][25][26][27][28].A supervisory power management system with reduced number of sensors for a grid interactive microgrid with a hybrid energy storage system is proposed in [29,30].Energy management and effective control techniques for a photovoltaic-based DC microgrid is proposed in [31].
A control technique based on inherent characteristics of synchronous generators (SG) for control of interfaced converters with high penetration of renewable energy resources (RERs) into the power grid is presented in [32].A multi-stage stochastic programming for smart transactive energy (TE) framework in which home microgrids (H-MGs) collaborate with each other in a multiple H-MG system by forming coalitions for gaining competitiveness in the market is discussed in [33].Authors in [34] propose an optimization-based algorithm in the regulation of electricity market within the context of economic planning and control for grid reliability enhancement.An optimal management system of battery energy storage to enhance the resilience of the photovoltaic-based microgrid supplying a typical commercial building while maintaining its operational cost at a minimum level is proposed in [35].The optimization is achieved by solving a linear optimization programming problem while the Conditional Value at Risk (CVaR) is incorporated in the objective function.The CVaR is used to account for the uncertainty in the intermittent PV system generated power and that in the electricity price.A power management strategy for an islanded microgrid with multiple decentralized batteries, PV, and droop units, is employed in [36,37].Energy storage can help the system ride-through the fault, provide generation deficiencies, reduce load surges, reduce network losses and improve the protection system by contributing to fault currents.Hence, it is essential to coordinate between DGs and energy storage devices.The fault ride-through enhancement with energy storage, coordination between DGs and energy storage devices during grid connected and island modes, and the transient response of the microgrid during islanding have not been extensively studied in previous research.Those shortcomings are addressed in this paper.
This work presents an efficient power management control technique for microgrids with energy storage.The microgrid is based on PV, battery and diesel generator with local active loads.The PV and battery controls are based on the decoupled d-q current control strategy.A controller is proposed and implemented for both grid connected and island modes of operation.During grid connected mode, the load is supplied by the DERs and the grid.The PV array generates the maximum available power using a maximum power point tracking tool to supply the load, and the excess power is transferred to the grid.In island mode; the load is supplied by the DERs and if the power generated from the PV array decreases, the diesel generator provides the power balance.During normal operation and fault, the diesel generator controls the frequency and voltage in isochronous mode.The battery storage minimizes the fluctuation and helps the microgrid ride-through the fault.The rest of the paper is organized as follows.Sections 2 and 3 describe the proposed system configuration and the proposed controller respectively.Section 4 presents results and discussions, while Section 5 concludes the paper.

System Configuration
The proposed PV, battery, diesel generator and active load based microgrid system is shown in Figure 1.An inverter is employed to connect the PV array generated power to the grid.The PV and battery controls are based on the decoupled d-q current control strategy.The DERs and the grid are connected at the point of common coupling (PCC) using a circuit breaker (CB).Dynamic models of the main components are developed using RSCAD (Interfacing software with RTDS).During normal operation the microgrid is connected to the grid and load is supplied by both the DERs and the grid.The voltage and frequency are maintained at the rated values by the grid.In island mode, the load is supplied by the DERs.The voltage and frequency during island mode are controlled by the diesel generator in isochronous mode.In the isochronous speed control mode, the speed will return to the original speed set-point after a load has been applied or rejected.This mode is used when a generator is operating on its own and is used to maintain the frequency at rated 60 Hz.
From Figure 1: P PV represents PV array generated power, P BAT is the charging and discharging power of the battery storage system, P GEN is the power generated from the diesel generator, P LOAD is the power drawn by the load, P GRID is the power exchanged between the main grid and the microgrid,

System Configuration
The proposed PV, battery, diesel generator and active load based microgrid system is shown in Figure 1.An inverter is employed to connect the PV array generated power to the grid.The PV and battery controls are based on the decoupled d-q current control strategy.The DERs and the grid are connected at the point of common coupling (PCC) using a circuit breaker (CB).Dynamic models of the main components are developed using RSCAD (Interfacing software with RTDS).During normal operation the microgrid is connected to the grid and load is supplied by both the DERs and the grid.The voltage and frequency are maintained at the rated values by the grid.In island mode, the load is supplied by the DERs.The voltage and frequency during island mode are controlled by the diesel generator in isochronous mode.In the isochronous speed control mode, the speed will return to the original speed set-point after a load has been applied or rejected.This mode is used when a generator is operating on its own and is used to maintain the frequency at rated 60 Hz.
From Figure 1: PPV represents PV array generated power, PBAT is the charging and discharging power of the battery storage system, PGEN is the power generated from the diesel generator, PLOAD is the power drawn by the load, PGRID is the power exchanged between the main grid and the microgrid, Duty is the buck converter control signal, mD and mQ are the PV voltage source converter (VSC)control signals, mBD and mBQ are the battery VSC control signals, PCC is the point of common coupling, CB is circuit breaker.

Proposed Controller
An independent controller is proposed and implemented for each DER.For the PV array, a multistage topology of buck converter and VSC are used to transfer the generated power PPV to the

Proposed Controller
An independent controller is proposed and implemented for each DER.For the PV array, a multistage topology of buck converter and VSC are used to transfer the generated power P PV to the PCC.An incremental conductance control method is implemented for the buck converter and a d-q controller is employed for the VSC to transfer the DC link power to the PCC.A similar d-q controller is proposed for the battery for charging and discharging to meet its objectives.The diesel generator supplies a constant active and reactive power during grid connected mode and maintains the voltage and frequency in the island mode, whereas the grid takes care of the voltage and frequency in grid connected mode.

PV MPPT Controller
Different maximum power point tracking (MPPT) methods are archived in the literature to generate the maximum power from the PV system under varying irradiation and temperature.This paper employs incremental conductance to track the maximum power from the PV array.In this method, the PV array voltage V PV is continuously adjusted under time varying temperature and irradiation until it reaches the Maximum Power Point (MPP).A PI controller is used for the buck converter to force the PV array work at the MPP.The error between the MPPT output voltage V ref is compared with the actual PV array voltage V PV to generate the duty control signal for the buck converter as depicted in Figure 2.
The parameters of the buck converter, the PV array and the specifications of the battery are provided in Table 1.
where, from Equation (1) and Figure 2: PCC.An incremental conductance control method is implemented for the buck converter and a d-q controller is employed for the VSC to transfer the DC link power to the PCC.A similar d-q controller is proposed for the battery for charging and discharging to meet its objectives.The diesel generator supplies a constant active and reactive power during grid connected mode and maintains the voltage and frequency in the island mode, whereas the grid takes care of the voltage and frequency in grid connected mode.

PV MPPT Controller
Different maximum power point tracking (MPPT) methods are archived in the literature to generate the maximum power from the PV system under varying irradiation and temperature.This paper employs incremental conductance to track the maximum power from the PV array.In this method, the PV array voltage VPV is continuously adjusted under time varying temperature and irradiation until it reaches the Maximum Power Point (MPP).A PI controller is used for the buck converter to force the PV array work at the MPP.The error between the MPPT output voltage Vref is compared with the actual PV array voltage VPV to generate the duty control signal for the buck converter as depicted in Figure 2.
The parameters of the buck converter, the PV array and the specifications of the battery are provided in Table 1.

Decoupled d-q Controller for the PV VSC
The VSC shown in Figure 3 is used to integrate the PV DC link power to the PCC to supply AC loads and for grid integration.

Decoupled d-q Controller for the PV VSC
The VSC shown in Figure 3 is used to integrate the PV DC link power to the PCC to supply AC loads and for grid integration.The three phase voltage equations can be written as:  The three phase voltage equations can be written as: where, I a , I b and I c are the grid side line currents, V a , V b , V c are the VSC output voltages, V ag , V bg , V cg are the grid voltages, R g and L g are resistance and inductance of the line.
Energies 2019, 12, 276 6 of 18 Synchronous rotating reference frame (D-Q axis) based current control technique is implemented where the D current component I LD controls the active power flow and the Q current component I LQ the reactive power.
where, P G and Q G are the grid side active and reactive power respectively, P DC is the DC link capacitor power, V LD and V LQ are the D and Q axes voltage components (shown in Figure 4), I LD and I LQ are the D and Q axes current components (shown in Figure 4).

Battery Control
The battery controls are based on the decoupled d-q current control strategy.The battery is connected to the PCC using a VSC.During grid connected mode, the battery is controlled as a constant P-Q control to inject a constant active and reactive power to the PCC whereas during island mode, it is controlled in a voltage control mode to support the voltage and frequency.The battery controller for grid connected mode is provided in Figure 5.During island mode, the outer control loop is replaced by a voltage control loop with the reference voltage equal to the PCC voltage.The parameters of the battery are provided in Table 1.
To improve the performance of the PI current controllers, feed forward voltage and cross-coupling terms are used as shown in Figure 4.
The outer voltage control loop in the Laplace frame is: The D and Q-axes control signals in the Laplace domain are: from Equations ( 5)-( 7); Pulse width modulation (PWM) is used to generate the firing pulses after converting m D and m Q back to ABC frame (DQ/ABC).

Battery Control
The battery controls are based on the decoupled d-q current control strategy.The battery is connected to the PCC using a VSC.During grid connected mode, the battery is controlled as a constant P-Q control to inject a constant active and reactive power to the PCC whereas during island mode, it is controlled in a voltage control mode to support the voltage and frequency.The battery controller for grid connected mode is provided in Figure 5.During island mode, the outer control loop is replaced by a voltage control loop with the reference voltage equal to the PCC voltage.The parameters of the battery are provided in Table 1.

Battery Control
The battery controls are based on the decoupled d-q current control strategy.The battery is connected to the PCC using a VSC.During grid connected mode, the battery is controlled as a constant P-Q control to inject a constant active and reactive power to the PCC whereas during island mode, it is controlled in a voltage control mode to support the voltage and frequency.The battery controller for grid connected mode is provided in Figure 5.During island mode, the outer control loop is replaced by a voltage control loop with the reference voltage equal to the PCC voltage.The parameters of the battery are provided in Table 1.

Diesel Generator Model and Control
In grid connected mode, the diesel generator provides real and reactive power and in islanded mode it regulates the microgrid frequency as shown in Figure 6.A synchronous machine with excitation system and a speed governor is used to model the diesel generator.The machine frequency is regulated by the speed governor driven by a diesel engine.Figure 7 shows the diesel engine and speed governor control where the inputs are diesel generator per unit speed ω and per unit speed reference ωref.The governor output is the per unit mechanical torque Tpu which drives the shaft of the synchronous generator.The diesel generator supplies specified reference power at grid frequency in speed-droop mode in grid connected operation, however, to control and maintain a

Diesel Generator Model and Control
In grid connected mode, the diesel generator provides real and reactive power and in islanded mode it regulates the microgrid frequency as shown in Figure 6.A synchronous machine with excitation system and a speed governor is used to model the diesel generator.The machine frequency is regulated by the speed governor driven by a diesel engine.Figure 7 shows the diesel engine and speed governor control where the inputs are diesel generator per unit speed ω and per unit speed reference ω ref .The governor output is the per unit mechanical torque T pu which drives the shaft of the synchronous generator.The diesel generator supplies specified reference power at grid frequency in speed-droop mode in grid connected operation, however, to control and maintain a constant frequency under varying load conditions in islanded operation; it is operated in isochronous mode.The parameters of the diesel generator are provided in Table 2.

Results and Discussion
The microgrid system developed in RTDS is presented in Figure 8.The specification of the PV array and the diesel generator are provided in Tables 1 and 2 respectively.As given in Table 1, 1000 W/m 2 and 25 • C were used as a reference solar intensity and temperature respectively.The operating voltage VMP and current IMP at the MPP are 2001 V (=115 × 17.4 V), and 201.3A (=66 × 3.05 A), respectively.

Results and Discussion
The microgrid system developed in RTDS is presented in Figure 8.The specification of the PV array and the diesel generator are provided in Table 1 and Table 2 respectively.As given in Table 1, 1000 W/m 2 and 25 °C were used as a reference solar intensity and temperature respectively.The operating voltage VMP and current IMP at the MPP are 2001 V (=115 × 17.4 V), and 201.3A (=66 × 3.05 A), respectively.At this operating point, 402.8 kW (2001 V × 201.3 A) is the expected maximum output power from this PV array.The buck dc-dc converter converts the PV array terminal voltage (2 kV) to 1.62 kV as a common DC link voltage which is input to the PV array VSC to be converted to AC.

Grid Connected Mode (Normal Operation)
In this scenario, both the grid and the micrigrid operate in parallel.Initially the load is supplied by the grid and the DERs were off.When the switches of the DERs are on, the load will be supplied by both the grid and the DERs.The reference load power is set to 0.5 MW and the irradiation of the PV array is set at 1000 W/m 2 meaning that the PV array generates around 0.4 MW.The battery is being charged with a reference power set point of 0.3 MW.For this particular case, the PV array power charges the battery and the remaining power supplies the load.The difference load power is provided by the grid.The diesel generator generates no output power as the difference comes from the grid.Figure 9 shows the corresponding grid power PGRID, the PV power PPV, the battery power PBAT, the diesel generator power PGEN and the load power PLOAD.As observed, the PV array generates the maximum available power to charge the battery.The controller manages the power balance with Island mode: The controller was tested by varying the PV array irradiation, battery and load set points.c.
Fault ride-through: The diesel generator capability in maintaining the frequency after a three phase fault was tested.

Grid Connected Mode (Normal Operation)
In this scenario, both the grid and the micrigrid operate in parallel.Initially the load is supplied by the grid and the DERs were off.When the switches of the DERs are on, the load will be supplied by both the grid and the DERs.The reference load power is set to 0.5 MW and the irradiation of the PV array is set at 1000 W/m 2 meaning that the PV array generates around 0.4 MW.The battery is being charged with a reference power set point of 0.3 MW.For this particular case, the PV array power charges the battery and the remaining power supplies the load.The difference load power is provided by the grid.The diesel generator generates no output power as the difference comes from the grid.Figure 9 shows the corresponding grid power P GRID , the PV power P PV , the battery power P BAT , the diesel generator power P GEN and the load power P LOAD .As observed, the PV array generates the maximum available power to charge the battery.The controller manages the power balance with the grid matching the load power demand.The corresponding PCC voltage provided in Figure 10 is kept at its rated value.The state of charge (SOC) of the battery is presented in Figure 11.If the battery gets discharged (with 0.3 MW reference power), the grid power decreases by the same amount as presented in Figure 12.If the load is increased (from 0.5 to 1 MW), the grid power increases to accommodate the difference as depicted in Figure 13.If the irradiation increases from 1000 to 1200 W/m 2 , the grid power decreases accordingly, as shown in Figure 14.
The simulation results show that the DGs supply approximately the maximum active power and zero reactive power since they are designed to operate at unity power factor during normal operation.
Energies 2019, 12, x FOR PEER REVIEW 10 of 18 the grid matching the load power demand.The corresponding PCC voltage provided in Figure 10 is kept at its rated value.The state of charge (SOC) of the battery is presented in Figure 11.If the battery gets discharged (with 0.3 MW reference power), the grid power decreases by the same amount as presented in Figure 12.If the load is increased (from 0.5 to 1 MW), the grid power increases to accommodate the difference as depicted in Figure 13.If the irradiation increases from 1000 to 1200 W/m 2 , the grid power decreases accordingly, as shown in Figure 14.
The simulation results show that the DGs supply approximately the maximum active power and zero reactive power since they are designed to operate at unity power factor during normal operation.the grid matching the load power demand.The corresponding PCC voltage provided in Figure 10 is kept at its rated value.The state of charge (SOC) of the battery is presented in Figure 11.If the battery gets discharged (with 0.3 MW reference power), the grid power decreases by the same amount as presented in Figure 12.If the load is increased (from 0.5 to 1 MW), the grid power increases to accommodate the difference as depicted in Figure 13.If the irradiation increases from 1000 to 1200 W/m 2 , the grid power decreases accordingly, as shown in Figure 14.
The simulation results show that the DGs supply approximately the maximum active power and zero reactive power since they are designed to operate at unity power factor during normal operation.

Island Mode
The controller's capability was further tested in island mode.The system was working in grid connected mode with irradiation of 1000 W/m 2 and the battery getting charged with PREF = -0.3MW.Turning the grid side circuit breaker from Figure 1 off makes the system work in island mode.The

Island Mode
The controller's capability was further tested in island mode.The system was working in grid connected mode with irradiation of 1000 W/m 2 and the battery getting charged with PREF = -0.3MW.Turning the grid side circuit breaker from Figure 1 off makes the system work in island mode.The

Island Mode
The controller's capability was further tested in island mode.The system was working in grid connected mode with irradiation of 1000 W/m 2 and the battery getting charged with P REF = −0.3MW.
Turning the grid side circuit breaker from Figure 1 off makes the system work in island mode.The diesel generator emulates the function of the grid and balances the load demand in island mode as depicted in Figure 15.As shown in the figure, the load is completely supplied by the DERs as the grid power is reduced to zero.The corresponding PCC voltage provided in Figure 16 is maintained at the rated value.Another scenario is applied by varying the PV array irradiation.When the PV irradiation decreases from 1000 to 500 W/m 2 , the diesel generator power increases to accommodate the difference as shown in Figure 17.With the same scenario, if the battery discharges (from −0.3 to 0.3), the diesel generator power decreases as shown in Figure 18.
Energies 2019, 12, x FOR PEER REVIEW 13 of 18 diesel generator emulates the function of the grid and balances the load demand in island mode as depicted in Figure 15.As shown in the figure, the load is completely supplied by the DERs as the grid power is reduced to zero.The corresponding PCC voltage provided in Figure 16 is maintained at the rated value.Another scenario is applied by varying the PV array irradiation.When the PV irradiation decreases from 1000 to 500 W/m 2 , the diesel generator power increases to accommodate the difference as shown in Figure 17.With the same scenario, if the battery discharges (from −0.3 to 0.3), the diesel generator power decreases as shown in Figure 18.diesel generator emulates the function of the grid and balances the load demand in island mode as depicted in Figure 15.As shown in the figure, the load is completely supplied by the DERs as the grid power is reduced to zero.The corresponding PCC voltage provided in Figure 16 is maintained at the rated value.Another scenario is applied by varying the PV array irradiation.When the PV irradiation decreases from 1000 to 500 W/m 2 , the diesel generator power increases to accommodate the difference as shown in Figure 17.With the same scenario, if the battery discharges (from −0.3 to 0.3), the diesel generator power decreases as shown in Figure 18.

Fault Ride-Through
In order to further test the robustness of the controller, a three phase fault of six cycles was applied during grid connected and island modes of operation.The PCC voltage depicted in Figure 19 shows that the system has ridden through the fault.Figure 20 presents the corresponding grid, PV, battery, diesel generator and load powers during the grid fault.The response of the system during a six cycle fault in the island mode is presented in Figures 21 and 22.In both grid connected

Fault Ride-Through
In order to further test the robustness of the controller, a three phase fault of six cycles was applied during grid connected and island modes of operation.The PCC voltage depicted in Figure 19 shows that the system has ridden through the fault.Figure 20 presents the corresponding grid, PV, battery, diesel generator and load powers during the grid fault.The response of the system during a six cycle fault in the island mode is presented in Figures 21 and 22.In both grid connected

Fault Ride-Through
In order to further test the robustness of the controller, a three phase fault of six cycles was applied during grid connected and island modes of operation.The PCC voltage depicted in Figure 19 shows that the system has ridden through the fault.Figure 20 presents the corresponding grid, PV, battery, diesel generator and load powers during the grid fault.The response of the system during a six cycle fault in the island mode is presented in Figures 21 and 22.In both grid connected and island modes, the system has recovered from the faults.The battery energy storage system helps the microgrid ride-through the fault.
Energies 2019, 12, x FOR PEER REVIEW 15 of 18 and island modes, the system has recovered from the faults.The battery energy storage system helps the microgrid ride-through the fault.and island modes, the system has recovered from the faults.The battery energy storage system helps the microgrid ride-through the fault.

Conclusions
An efficient power management control scheme of a microgrid based on PV, battery, diesel generator and load was presented in this paper.An independent P-Q controller is implemented to transfer the PV array and the battery powers to both the PCC and to the load.The incremental conductance based MPPT implemented forces the PV array to work at the maximum power.The system voltage and frequency are maintained at the rated value by the grid during grid connected mode and by the diesel generator in the island mode.The transient and steady state response of the microgrid for both grid-connected and islanded modes of operation have shown to give satisfactory performance.With energy storage, the fault ride-through capability of the system was improved.The results show that the proposed control scheme manages the load power during island and grid connected modes and improves the system reliability.

Figure 1 .
Figure 1.The studied distributed energy resources (DER)based microgrid system.

Figure 1 .
Figure 1.The studied distributed energy resources (DER)based microgrid system.
k P and k I are the proportional and integral constants of the PI controller, I PV and V PV are the PV cell output current and voltage respectively, V DC is the DC link voltage, V ref is the MPPT output voltage.Energies 2019, 12, x FOR PEER REVIEW 4 of 18

Figure 3 .
Figure 3. Voltage source converter (VSC) for the PV source.
Ia, Ib and Ic are the grid side line currents, Va, Vb, Vc are the VSC output voltages, Vag, Vbg, Vcg are the grid voltages, Rg and Lg are resistance and inductance of the line.Synchronous rotating reference frame (D-Q axis) based current control technique is implemented where the D current component ILD controls the active power flow and the Q current component ILQ the reactive power.

Figure 3 .
Figure 3. Voltage source converter (VSC) for the PV source.

Figure 4 .
Figure 4. Decoupled P-Q inverter control.Equation (3) can be further reduced to Equation (4) by aligning the D-axis reference frame to the phase voltage of the grid (V LQ = 0).
k P 's are the proportional constants, k I 's are the integral constants, m D , and m Q are the PV array D and Q axes control signals respectively.

Figure 7 .Table 2 .
Figure 7. Diesel generator speed governor controller.Figure 7. Diesel generator speed governor controller.Table 2. Diesel generator parameters.Parameter Value Rated rms line to line voltage 0.48 kV Rated MVA of the machine 1.25 MVA Inertia constant 1.7 Stator resistance 0.002 pu Leakage reactance, Stator 0.13 pu Unsaturated reactance, d-axis 1.7 pu Unsaturated transient reactance, d-axis 0.16 pu Unsaturated sub-trans reactance, d-axis 0.135 pu Unsaturated transient open T constant, d-axis 4.3 s Unsaturated sub-transient open T constant, d-axis 0.032 s Unsaturated reactance, q-axis 1.71 pu Unsaturated transient reactance, q-axis 0.228 pu Unsaturated sub-trans reactance, q-axis 0.2 pu Unsaturated transient open T constant, q-axis 0.85 s Unsaturated sub-transient open T constant, q-axis 0.05 s Grid voltage 0.48 kV point, 402.8 kW (2001 V × 201.3 A) is the expected maximum output power from this PV array.The buck dc-dc converter converts the PV array terminal voltage (2 kV) to 1.62 kV as a common DC link voltage which is input to the PV array VSC to be converted to AC.

Figure 8 .
Figure 8.The studied DERs system model built in RSCAD (Interfacing software with RTDS).

Figure 8 .
Figure 8.The studied DERs system model built in RSCAD (Interfacing software with RTDS).The following tests were applied to demonstrate the effectiveness of the proposed controllers.a. Grid connected mode (normal operation): The performance of the controller was tested by varying the load, irradiation and charging and discharging set points of the battery.b.Island mode: The controller was tested by varying the PV array irradiation, battery and load set points.c.Fault ride-through: The diesel generator capability in maintaining the frequency after a three phase fault was tested.

Figure 10 .
Figure 10.The corresponding grid voltage and breaker currents.

Figure 9 .
Figure 9. Grid power P GRID , PV array output power P PV , battery power P BAT , generator power P GEN and load power P LOAD .

Figure 10 .
Figure 10.The corresponding grid voltage and breaker currents.Figure 10.The corresponding grid voltage and breaker currents.

Figure 10 .
Figure 10.The corresponding grid voltage and breaker currents.Figure 10.The corresponding grid voltage and breaker currents.

Figure 11 .
Figure 11.State of charge (SOC) of the battery.

Figure 12 .
Figure 12.Grid power P GRID , PV array output power P PV , battery power P BAT , generator power P GEN and load power P LOAD .

Figure 14 .
Figure 14.Grid power PGRID, PV array output power PPV and load power PLOAD.

Figure 13 . 18 Figure 13 .
Figure 13.Grid power P GRID , PV array output power P PV , battery power P BAT , generator power P GEN and load power P LOAD .

Figure 14 .
Figure 14.Grid power PGRID, PV array output power PPV and load power PLOAD.

Figure 14 .
Figure 14.Grid power P GRID , PV array output power P PV and load power P LOAD .

Figure 16 .
Figure 16.The corresponding point of common coupling (PCC) voltage.

Figure 15 .
Figure 15.Grid power P GRID , PV array output power P PV , battery power P BAT , generator power P GEN and load power P LOAD .

Figure 16 .
Figure 16.The corresponding point of common coupling (PCC) voltage.

Figure 16 .
Figure 16.The corresponding point of common coupling (PCC) voltage.

Figure 17 . 18 Figure 17 .
Figure 17.Grid power P GRID , PV array output power P PV , battery power P BAT , generator power P GEN and load power P LOAD .

Figure 18 .
Figure 18.Grid power P GRID , PV array output power P PV , battery power P BAT , generator power P GEN and load power P LOAD .

Figure 20 .
Figure 20.Grid power PGRID, PV array output power PPV, battery power PBAT, generator power PGEN and load power PLOAD during grid fault.

Figure 20 .
Figure 20.Grid power PGRID, PV array output power PPV, battery power PBAT, generator power PGEN and load power PLOAD during grid fault.

Figure 20 . 18 Figure 21 .
Figure 20.Grid power P GRID , PV array output power P PV , battery power P BAT , generator power P GEN and load power P LOAD during grid fault.Energies 2019, 12, x FOR PEER REVIEW 16 of 18

Figure 22 .
Figure 22.Grid power PGRID, PV array output power PPV, battery power PBAT, generator power PGEN and load power PLOAD during island fault.
is the buck converter control signal, m D and m Q are the PV voltage source converter (VSC)control signals, m BD and m BQ are the battery VSC control signals, PCC is the point of common coupling, CB is circuit breaker.

Table 1 .
Photovoltaic (PV) panel, battery and other component parameters.Parameter Value PV Array and Buck converter Reference Temperature 25 °C Reference solar intensity 1000 W/m 2 Series connected modules 115 Parallel connected Modules 66 Open circuit voltage 21.7 VFigure 2. Maximum power point tracking (MPPT) and buck converter controller.

Table 1 .
Photovoltaic (PV) panel, battery and other component parameters.