Stand-Alone Hybrid Power Plant Based on SiC Solar PV and Wind Inverters with Smart Spinning Reserve Management

: Stand-alone hybrid power plants based on renewable energy sources are becoming a more and more interesting alternative. However, their management is a complex task because there are many variables, requirements and restrictions as well as a wide variety of possible scenarios. Though a proper sizing of the power plant is necessary to obtain a competitive cost of the energy, smart management is key to guarantee the power supply at a minimum cost. In this work, a novel hybrid power plant control strategy is designed, implemented and simulated under a wide variety of scenarios. Thereby, the proposed control algorithm aims to achieve maximum integration of renewable energy, reducing the usage of non-renewable generators as much as possible and guaranteeing the stability of the microgrid. Different scenarios and case studies have been analyzed by dynamic simulation to verify the proper operation of the power plant controller. The main novelties of this work are: (i) the stand-alone hybrid power plant management regarding a battery energy storage system as a part of the spinning reserve, (ii) the characterization of the largest loads as non-priority loads, (iii) the minimization of the needed spinning reserve and fuel consumption from diesel generators.


Introduction
Stand-alone hybrid power plants based on renewable energy are emerging as interesting solutions to produce electricity because they are a clean and inexhaustible source of energy and able to guarantee stable prices [1]. Furthermore, a hybrid power plant can harness the type of renewable energy available in the power plant location. Because of this, nowadays they are an attractive option to produce energy on a small scale, especially in locations situated far away from the utility power grid, such as isolated places, farms, telecommunication stations, etc. They can be considered as an attractive alternative for both traditional diesel-based off-grid systems and for unreliable grids [2]. Many examples have been proposed and developed in different locations, such as France [3], Nigeria [4], India [5] and Canada [6].
Nevertheless, the variability of renewable generation makes necessary the presence of back-up systems [7]. In this regard, battery energy storage systems (BESSs) are expensive, and synchronous generators (SGs) powered by diesel, gas, biomass or hydro need to be constantly running to compensate a sudden drop of solar photovoltaic (PV) or wind generation without causing an interruption in the load power supply. Consequently, the sizing of the installed power, the capacity of the back-up systems, as well as the operation strategy require a balance between the effective cost of the energy and the power supply reliability [8,9].
Microgrids can operate in two different modes: grid-connected mode and islanded mode. When connected to the grid, any power mismatch is compensated by the grid. However, during stand-alone operation, power plant generation must track the load demand The management of the power plant is centralized and hierarchical. At the top level, the secondary control determines the operation orders to be sent to each source, according to the state of all the sources and loads of the microgrid. While working in isolated mode, these signals (mainly the activation state and the load factor of each source) are calculated with the criteria of keeping a balance between generation and consumption, in order to maintain the grid frequency as stable as possible and to avoid blackout in the microgrid when a network change occurs. The power plant controller also manages the processes of disconnection and connection of the microgrid to the utility grid in order to allow the system to work either isolated from the network or grid-connected. On the other hand, the Electronics 2021, 10, 796 4 of 27 primary control is executed by each power source, in concordance with the orders of the secondary control.
The proposed power plant control can manage all the sources of the microgrid, as well as the connection of some specific loads. This control has prioritized versatility and scalability; it can be implemented in multiple power plant designs, it being possible to configure the quantity of each renewable source (solar PV and wind) and back-up systems (SGs and BESSs), as well as the capacity of each one. It also allows to specify the loads of the microgrid and classify them into three types (named priority, non-priority and renewable) on the basis of their connection preference.
The control algorithms were developed in MATLAB-Simulink, using function scripts programmed in MATLAB language. It has a modular scheme, based in seven levels or layers (without coupling effects between them), which can consist of one or several blocks that contain a specific functionality, as can be seen in Figure 1.
with the criteria of keeping a balance between generation and consumption, in order to maintain the grid frequency as stable as possible and to avoid blackout in the microgrid when a network change occurs. The power plant controller also manages the processes of disconnection and connection of the microgrid to the utility grid in order to allow the system to work either isolated from the network or grid-connected. On the other hand, the primary control is executed by each power source, in concordance with the orders of the secondary control.
The proposed power plant control can manage all the sources of the microgrid, as well as the connection of some specific loads. This control has prioritized versatility and scalability; it can be implemented in multiple power plant designs, it being possible to configure the quantity of each renewable source (solar PV and wind) and back-up systems (SGs and BESSs), as well as the capacity of each one. It also allows to specify the loads of the microgrid and classify them into three types (named priority, non-priority and renewable) on the basis of their connection preference.
The control algorithms were developed in MATLAB-Simulink, using function scripts programmed in MATLAB language. It has a modular scheme, based in seven levels or layers (without coupling effects between them), which can consist of one or several blocks that contain a specific functionality, as can be seen in Figure 1. The following nomenclature was used to designate an individual generic source of each type: i for PV sources, j for wind sources, k for SG sources, l for BESSs and m for loads.

Layer 1: Input Data Adaptation
The input data adaptation block simply converts the data from other devices of the power plant into a manageable format, including unit conversion. Most predominant inputs are fixed-point numbers (16 bits) and logical signals (1 bit). Some analog signals (for example, the active power of each solar PV source) are grouped into arrays to facilitate the calculations in the next layers. The following nomenclature was used to designate an individual generic source of each type: i for PV sources, j for wind sources, k for SG sources, l for BESSs and m for loads.

Layer 1: Input Data Adaptation
The input data adaptation block simply converts the data from other devices of the power plant into a manageable format, including unit conversion. Most predominant inputs are fixed-point numbers (16 bits) and logical signals (1 bit). Some analog signals (for example, the active power of each solar PV source) are grouped into arrays to facilitate the calculations in the next layers.

Layer 2: Sources and Loads Definition
The layer 2 blocks allow to specify the number of each type of generation sources to manage, as well as the number of loads and the maximum consumption and priority of each one. Each source can be individually defined through its characteristic parameters (nominal active and reactive power, generation curves or equations, etc.). These blocks also calculate the available power of each source.
In case of solar PV sources, the available active power of each solar PV source (P PV available,i ) is estimated through the nominal active power of the panels (P PV nom,i ). This value is given for standard conditions (an irradiance of G 0 = 1000 W/m 2 and a cell temperature of T c0 = 25°C). Solar PV generation is directly proportional to the irradiance G (W/m 2 ), which derives in the term G 1000 . The temperature dependence is determined by the temperature coefficient of the cells γ (%/ • C) and the estimated temperature of the panels T c ( • C). Additionally, the efficiency factor η PV is included, as shown in Equation (1).
The temperature of the panels, T c is estimated from the ambient temperature T ( • C), the Normal Operating Cell Temperature NOCT ( • C), and the irradiance G, as shown in Equation (2).
The efficiency factor, η PV , includes the DC electrical losses coefficient (C DC ), the dispersion coefficient (C disp ), the pollution coefficient (C pol ) and the inverter efficiency (η inv ), as shown in Equation (3).
In the case of wind sources, the estimation of the available active power of each wind source P wind available,j is made according to the wind speed measurement and the power curve of the wind turbine.
The available active power of synchronous generators (P SG available,k ) and battery energy storage systems (P BESS available,l ) are their nominal active power (P SG nom,k , P BESS nom,l respectively) unless their fuel tank is empty or their state of charge is below the minimum percentage, respectively.
If any source (whatever the type) is disabled by the user or it is unavailable (NOK as status signal), the algorithm control considers that its available active power is zero.
As previously mentioned, three different load topologies are defined: (i) priority, which represent loads that are always enabled; (ii) non-priority, which require sending a connection request in isolated mode; (iii) renewable, which represent loads that are enabled only when renewable energy production exceeds the total load consumption.

Layer 3: Spinning Reserve Management
The spinning reserve management block is responsible for maintaining the appropriate back-up power (SR) when working in isolated mode, in case the generation of some renewable sources decreases or ceases, and/or in case the demand load increases. Therefore, this block calculates the number of SGs to maintain running and determines the operation mode of the BESS (discharge or charge). The algorithm that calculates these parameters is based on the comparison between the required SR and the current SR.
The SR of each individual source of each type (SR PV i , SR wind j , SR SG k , SR BESS l ) is calculated as the load factor margin, i.e., the difference between the available active power and the measured instantaneous active power generated (P PV gen, i , P wind gen, j , P SG gen, k , P BESS gen, l ), as shown in Equation (4). For example, if a synchronous generator is working at 80% of its nominal power, it contributes to the spinning reserve with the remaining 20%.
The current spinning reserve of the power plant (SR current ) is determined as the sum of the remaining available power of the sources that are active at each present instant. The following expression considers the minimum SR between solar PV and wind power sources because they can back up each other, since a deep decrease in irradiance and wind at the same time is quite unlikely, but not themselves.
As observed in Equation (5), the contribution of each type of source to the SR can also be adjusted by a weighting factor (α PV , α wind , α SG , α BESS ), comprised between 0% (this source does not contribute at all) and 100% (all the remaining power of this source contributes to the SR). Currently, the weighting factor of solar PV and wind sources is set at 0% because of their variability, intermittency and unpredictability. Nevertheless, the control allows the possibility of receiving solar and wind power forecasting data. In that case, the remaining power of these sources can contribute to the spinning reserve, depending on the weather predictions.
Furthermore, the required SR of the power plant (SR required ) is determined according to the user configuration, in which the following four operation modes can be chosen: • Optimization methods can be applied to obtain the SR values of a scheduled program (mode 2), as was done in [36,37]. The operation of the microgrid in mode 1 and mode 2 can be complemented with the supervisory control given by modes 3 and 4 that compensates for any mismatch with the real-time microgrid operation.
In modes 3 and 4, the sources to back up can be selected among four possibilities: • Option 1: Back up only the instantaneous power generated by the wind sources of the power plant (P wind gen ): • Option 2: Back up only the power generated by the solar PV sources: • Option 3: Back up only the power of the maximum load that can be switched on (∆P load max ) at each present instant: • Option 4: Back up the maximum value between option 1, option 2 and option 3: SR required = max P wind gen , P PV gen , ∆P load max .
Electronics 2021, 10, 796 7 of 27 Options 1, 2 and 3 are considered in the case where renewable production can be predicted in the next seconds, which is the time required to connect a synchronous generator (24 s is an experimental value measured in diesel groups to synchronize with the grid). If not, option 4 should be applied. For wind speed lower than the cut-out wind speed (v cut ) and considering a slow decreasing rate of wind speed, the control does not need to back up the whole wind generation ( 5 6 × P wind gen is considered for speed lower than the 80% of v cut ). For wind speed higher than 0.8 × v cut , to prevent a possible shutdown, the control augments the needed SR up to 1 1 P wind gen . The value of required SR implies a compromise between the risk of a grid blackout and the cost of the energy produced by the hybrid power plant, considering that BESSs are quite expensive and running synchronous generators consumes a non-negligible amount of fuel. Consequently, it should be wisely defined. The power plant control has the possibility of limiting the required SR between minimum and maximum values, no matter the chosen operation mode.
The possibility of defining some loads as non-priority is advantageous, because these loads are normally disabled and consequently not backed up by the spinning reserve. If one of these loads sends a connection request, the power plant control has time to turn on one or several synchronous generators, if necessary, and enable that load when these generators are ready to inject energy to the microgrid (about 24 s later).
As previously mentioned, the output of the SR block is the number of SGs to start or to stop, according to the values of the current and the required SR at each present instant. The strategy is to minimize the number of running SGs to the strictly necessary, that is, the minimum number that makes positive the difference between the current SR and the required SR. Then, if SR required > SR current , the number of SGs to start (Num_SG_to_start) is calculated according to Equation (10), which takes into account the nominal power of the SG (P SG nom,k ) and the difference between SR required and SR current .
On the contrary, if SR current > SR required , Equation (11) determines the number of SGs to stop (Num_SG_to_stop) to maintain this difference positive but lower than the nominal power of one of the running SGs. These consigns are sent to the layer 4 blocks, in which the activation state of each individual SG present in the power plant is determined.
In addition, this block also orders to set the BESS in recharge mode when its state of charge is below the maximum and the power available by renewable generators is higher than the consumption of the loads.

Layer 4: Activation of Sources and Loads
In the layer 4 blocks, the activation state of each source and load is determined. In isolated mode, solar PV sources are connected if the irradiance is enough, and also wind sources if the wind speed is between cut-in and cut-out. The state of each SG and BESS depends on the setpoint calculated in the SR block. Priority loads are always connected, whereas non-priority loads are connected if a connection request is sent and there is enough SR to feed them. Renewable loads are fed only if renewable generation exceeds the demand charge.
In grid-connected mode, solar PV and wind sources are activated in order to inject energy to the grid, unless there is not enough irradiance or the wind speed is out of range, respectively. SGs are disconnected, whereas BESSs can be disconnected or connected if the SR block sets them in recharge mode (when its state of charge is below the maximum). This layer also manages the closing and opening of the global breaker of each source, being able to set up the timing of these maneuvers.

Layer 5: Calculation of the Load Factor of the Sources
The layer 5 block calculates the power setpoint of each connected source at each present instant (P PV setpoint,i , P wind setpoint,j , P SG setpoint,k , P BESS setpoint,l ). The algorithm was designed to maximize renewable generation. In grid-connected mode the objective is to generate as much renewable power as possible to inject it to the grid.
However, in isolated mode, calculations are more complex because the power plant control has to maintain the balance between the power generated by the sources and the consumption of the loads (P load consumption = ∑ m P load consumption,m ): There are multiple factors that have to be considered by the control, according to the scenario at every present instant. For example, if solar PV and/or wind sources can produce all the demand charge (∑ i P PV available,i + ∑ j P wind available,j > P load consumption ), the control will order to share the generation between them, in a directly proportional way with respect to the available active power of each one, as shown in Equation (13).
That means that if at one present instant a source can generate double the power of the other one, it will contribute twice to the global power generation. It should be noted that if SR maintains active one or several synchronous generators, their load factor must be at least 20% of the nominal active power (the exact value depends on the minimum continuous load given by the data sheet of the SGs selected, and it is commonly close to 20%). This issue can make it necessary to reduce the renewable generation in some specific circumstances where demand charge is low and there are not more loads to feed or BESSs to recharge. In these scenarios where renewable power availability surpasses the load demand (including the potential recharge of BESSs), some loads defined as renewable could be fed if their nominal power is lower than the available power surplus. On the other hand, if renewable generation is lower than the load demand, BESSs will be set in discharge mode to contribute to the power generation. If BESSs are not able to compensate for the power deficit (for example, because they are discharged, their nominal power is not enough or simply because the microgrid does not have BESSs installed), SGs will have to generate the required power to ensure the balance between generation and consumption in the microgrid.
The load factor setpoint to send to each source (LF PV setpoint,i , LF wind setpoint,j , LF SG setpoint,k , LF BESS setpoint,l ) is calculated as the ratio between the setpoint power and the nominal power, as described in Equation (14): In the next block, which constitutes layer 6 of the power plant control, safety measures are programmed. These include the monitoring of the generated energy by each synchronous generator, to stop it in case of motorization (i.e., P SG gen,k < 0). The grid voltage is also monitored to disconnect the whole hybrid power plant in case of inadmissible overvoltage or undervoltage, as well as voltage imbalance. Another safety measure implemented in this block limits the rate variation of the load factor for each source, according to the given maximum rise and fall slope values that can be individually set up. This block also executes the disconnection of the power plant if the emergency stop button is pressed.

Layer 7: Output Data Adaptation
Finally, the layer 7 block adapts the format of the output data to be understandable to the rest of the devices of the power plant that receive them.

Developing and Implementation of the Control Algorithm
The power plant control was programmed in MATLAB-Simulink because of the advantages of this software. On one hand, it is possible to incorporate, in conjunction with the control algorithm, a model of the physical power plant based on the SimScape Power Systems library of Simulink. This model makes possible to simulate the behavior of the control under several scenarios, helping to evaluate it and to develop and evaluate improvements. In addition, it is quite easy to export the code to the language of some electronic devices, such as microprocessors, PLCs or FPGAs [38,39]. In this work, it wasdecided to run the power plant control in a PLC (specifically, Siemens 1200) because of its robustness and its long-term stability. This device is able to execute each cycle of the control program in less than 20 ms, providing a quick response. Then, the programming of the control was done in compliance with the PLC Coder toolbox of MATLAB, which allowed us to directly export it to these devices.
In the same way as the power plant control, the inverter control was developed in MATLAB-Simulink, in conjunction with a model of the physical power electronics elements based on SimScape Power Systems library. This control is executed by a FPGA (specifically Altera Cyclone V), because of its speed and its adaptability. MATLAB allows exporting the algorithm coded in MATLAB language to VHDL language, with the HDL Coder toolbox.
An advanced feature of this hybrid power plant is the communication that constantly takes place between its different elements. The head of this communication is the power plant controller, executed by a PLC. This device shares information in both directions with the source controllers of the power plant (i.e., the inverters). The power plant controller continuously needs information about the instantaneous active and reactive power generated by each source, their available power, their status (ON/OFF, OK/NOK), etc. In the same way, the power plant controller constantly sends to every PV, wind and BESS unit their active and reactive power set-points, as well as manages the connection and disconnection orders to each source (including the closing and opening of its associated breaker). The chosen PLC model can communicate with external devices via Ethernet commands. The selected FPGA lacks a network port (such as RJ45), so it can only communicate via its digital I/O pins. In addition, this device has not natively implemented any communication protocol, so one was specifically developed. A half-duplex RS485 protocol was chosen, one of the simplest possibilities that only requires two pins of the FPGA for the A+ and Bsignals. Then, a commercial RS485-to-ethernet device was attached between the PLC and the FPGA.

Microgrid Use Case
The microgrid considered as the use case was modeled using MATLAB-Simulink, as depicted in Figure 2. The installed capacity of the power plant was 21 kW (26 kW with the BESS), which consisted of renewable sources (5 kW solar PV and 6 kW wind generators) and synchronous back-up generators (two units with a total capacity of 10 kW), as indicated in Table 1. In order to estimate the suitability of adding a 5 kW BESS, each scenario was simulated twice, with the absence or the presence of this back-up generator source.  Solar PV and wind sources were connected to the hybrid power plant through two level and three-wire SiC inverters, which used sinusoidal pulse width modulation (PWM These devices operated at a switching frequency of 25 kHz. By way of example, th schematic of the solar PV SiC inverter used for this work is shown in Figure 3, where som details about the filter, the SiC devices and the gate driver are indicated.  Solar PV and wind sources were connected to the hybrid power plant through twolevel and three-wire SiC inverters, which used sinusoidal pulse width modulation (PWM). These devices operated at a switching frequency of 25 kHz. By way of example, the schematic of the solar PV SiC inverter used for this work is shown in Figure 3, where some details about the filter, the SiC devices and the gate driver are indicated. Electronics 2021, 10, x FOR PEER REVIEW 11 of 28 Each inverter can also adjust the active and reactive power generated by the source to the value required by the power plant controller, performing the primary control of the hybrid power plant.
For large power systems, the generation mix required to meet the demand is determined based on the actual demand and the forecasted demand, as well as the maximum and minimum values of the daily demand. However, for stand-alone systems, demand forecasting is not always an available tool. Likewise, average load demand curves are not useful even considering a more precise characterization as seasonal curves, which may be consulted via the Spanish Transmission System Operator [40].
Therefore, in order to meet a diverse range of customer needs, the load demand characterization was based on the following criteria: • The maximum peak demand (10 kW in this use case).
• The maximum instantaneous variation of demand, given by the maximum single load (∆ ) that can be connected, which is considered to be equal to 2 kW.
Moreover, each active synchronous generator has to run at a minimum continuous load factor of 20% of its nominal power that results in 1 kW, which is considered by the SR management. Hence, once a synchronous generator is started, the power plant controller calculates and sends the set-points to the renewables sources and BESS, taking into account this minimum continuous load of the started synchronous generators.

Results of the Power Plant without the BESS
To test the power plant control algorithm, the hybrid power plant was simulated and evaluated under several scenarios. These scenarios were designed for different levels of load and renewable generation. Furthermore, in these scenarios, the BESS was not considered. Simulations in MATLAB-Simulink were performed using auto fixed-step size, auto solver configuration and a time simulation of 100 s.
The curve demand was defined for several levels of load, between the minimum (0 kW) and the maximum (10 kW). Changes in the demand curve were applied as steps of 2 kW in order to understand the behavior when this previously defined maximum single load (∆ ) was connected or disconnected. The reason to apply 2 kW steps in all load variations was because that was the worst-case situation. The performance of the control algorithm during different operation conditions is described below. In all cases, the spinning reserve was determined according to the mode 3 (Optimal) and option 4, which back up the maximum value between the generation of wind sources, the generation of solar PV sources and the maximum connectable load.
As mentioned before, the time required to connect a new synchronous group is approximately 24 s, however the time considered for simulation was lower only for saving computation time. Each inverter can also adjust the active and reactive power generated by the source to the value required by the power plant controller, performing the primary control of the hybrid power plant.

Scenario 1: Variable Demand Curve and Maximum Solar PV and Wind Generation
For large power systems, the generation mix required to meet the demand is determined based on the actual demand and the forecasted demand, as well as the maximum and minimum values of the daily demand. However, for stand-alone systems, demand forecasting is not always an available tool. Likewise, average load demand curves are not useful even considering a more precise characterization as seasonal curves, which may be consulted via the Spanish Transmission System Operator [40].
Therefore, in order to meet a diverse range of customer needs, the load demand characterization was based on the following criteria:

•
The maximum peak demand (10 kW in this use case).

•
The maximum instantaneous variation of demand, given by the maximum single load (∆P load max ) that can be connected, which is considered to be equal to 2 kW. Moreover, each active synchronous generator has to run at a minimum continuous load factor of 20% of its nominal power that results in 1 kW, which is considered by the SR management. Hence, once a synchronous generator is started, the power plant controller calculates and sends the set-points to the renewables sources and BESS, taking into account this minimum continuous load of the started synchronous generators.

Results of the Power Plant without the BESS
To test the power plant control algorithm, the hybrid power plant was simulated and evaluated under several scenarios. These scenarios were designed for different levels of load and renewable generation. Furthermore, in these scenarios, the BESS was not considered. Simulations in MATLAB-Simulink were performed using auto fixed-step size, auto solver configuration and a time simulation of 100 s.
The curve demand was defined for several levels of load, between the minimum (0 kW) and the maximum (10 kW). Changes in the demand curve were applied as steps of 2 kW in order to understand the behavior when this previously defined maximum single load (∆P load max ) was connected or disconnected. The reason to apply 2 kW steps in all load variations was because that was the worst-case situation. The performance of the control algorithm during different operation conditions is described below. In all cases, the spinning reserve was determined according to the mode 3 (Optimal) and option 4, which back up the maximum value between the generation of wind sources, the generation of solar PV sources and the maximum connectable load.
As mentioned before, the time required to connect a new synchronous group is approximately 24 s, however the time considered for simulation was lower only for saving computation time.

Scenario 1: Variable Demand Curve and Maximum Solar PV and Wind Generation
This scenario considered that solar PV and wind generators could produce at the maximum of their capacity. Figure 4 shows the curve demand versus the power generated by SGs, solar PV and wind generators. As the renewable resource was enough to supply the load demand, the set-points to solar PV and wind generators given by the controller were such that the SGs were working at the minimum load (1 kW). The rest of energy was supplied and shared by the solar PV and wind sources. This scenario considered that solar PV and wind generators could produce at the maximum of their capacity. Figure 4 shows the curve demand versus the power generated by SGs, solar PV and wind generators. As the renewable resource was enough to supply the load demand, the set-points to solar PV and wind generators given by the controller were such that the SGs were working at the minimum load (1 kW). The rest of energy was supplied and shared by the solar PV and wind sources.
When the load reached its maximum value (10 kW), to achieve the SR requirement two back-up SGs were needed. Conversely, in the other states only one SG was operating to back up the system. It could be seen that the fast response of the generation was provided by the active SG. When there was a load step, the renewable sources progressively adjusted their power generation, while the power generation of the SG compensated the power balance.

Scenario 2: Variable Demand Curve, Maximum Solar PV Generation and Zero Wind Generation
In this scenario, solar PV generation was available at its maximum capacity while wind generation was not available. The curve demand and the power generated by synchronous and solar PV generators are given in Figure 5. While solar PV power generated was lower than 4 kW, only one SG was operating to back up the hybrid power plant. However, when the solar PV generation surpassed the amount of 4 kW, the SR from SG1 was not enough and the controller connected a second synchronous generator (SG2) to guarantee enough operating SR.
When the load demand was lower than 5 kW, to provide the necessary back-up power, SG1 was working at its minimum continuous load. For higher demands, SG2 was connected. As the priority of the power plant control was to maximize the renewable energy generation, the active power generated by SG1 and SG2 was kept at their minimum values except when the solar PV source could not generate enough power to feed the load. In this case, the additional power was shared between the two SGs.  When the load reached its maximum value (10 kW), to achieve the SR requirement two back-up SGs were needed. Conversely, in the other states only one SG was operating to back up the system. It could be seen that the fast response of the generation was provided by the active SG. When there was a load step, the renewable sources progressively adjusted their power generation, while the power generation of the SG compensated the power balance.

Scenario 2: Variable Demand Curve, Maximum Solar PV Generation and Zero Wind Generation
In this scenario, solar PV generation was available at its maximum capacity while wind generation was not available. The curve demand and the power generated by synchronous and solar PV generators are given in Figure 5. While solar PV power generated was lower than 4 kW, only one SG was operating to back up the hybrid power plant. However, when the solar PV generation surpassed the amount of 4 kW, the SR from SG1 was not enough and the controller connected a second synchronous generator (SG2) to guarantee enough operating SR.
x FOR PEER REVIEW 13 of 28

Scenario 3: Cloud Transient Analysis for Maximum Solar PV and Wind Generation
One of the main sources of abrupt attenuation of solar PV output power is the cloud cover. In an interconnected power system, the variability of the solar irradiance due to cloud passing creates fluctuation in the solar PV output, which is just a power quality issue and several solutions have been proposed to cope with it [41]. However, a standalone power plant is a very weak network and cloud transients can affect to the grid stability and should be considered in order to guarantee the power supply continuity. Clouds both scatter and absorb incident radiation in different ways, depending on the wavelength of the light; that is, there is a dependency between cloud types and solar irradiance. That being said, the maximum amount of decreasing solar irradiance for a given time duration must be considered from the grid stability point of view. As the time required to connect a new synchronous group is 24 s (this time is lower in simulation), the maximum solar PV power loss in a lower duration was applied. Values of decreasing solar irradiance are given in Table 2, which have been deduced from [42]. Therefore, to determine how the stand-alone power plant managed the solar PV power transient for a maximum change in solar irradiance, the irradiance profile shown in Figure 6 was applied to the solar PV source. When the load demand was lower than 5 kW, to provide the necessary back-up power, SG1 was working at its minimum continuous load. For higher demands, SG2 was connected. As the priority of the power plant control was to maximize the renewable energy generation, the active power generated by SG1 and SG2 was kept at their minimum values except when the solar PV source could not generate enough power to feed the load. In this case, the additional power was shared between the two SGs.

Scenario 3: Cloud Transient Analysis for Maximum Solar PV and Wind Generation
One of the main sources of abrupt attenuation of solar PV output power is the cloud cover. In an interconnected power system, the variability of the solar irradiance due to cloud passing creates fluctuation in the solar PV output, which is just a power quality issue and several solutions have been proposed to cope with it [41]. However, a stand-alone power plant is a very weak network and cloud transients can affect to the grid stability and should be considered in order to guarantee the power supply continuity. Clouds both scatter and absorb incident radiation in different ways, depending on the wavelength of the light; that is, there is a dependency between cloud types and solar irradiance. That being said, the maximum amount of decreasing solar irradiance for a given time duration must be considered from the grid stability point of view. As the time required to connect a new synchronous group is 24 s (this time is lower in simulation), the maximum solar PV power loss in a lower duration was applied. Values of decreasing solar irradiance are given in Table 2, which have been deduced from [42]. Therefore, to determine how the stand-alone power plant managed the solar PV power transient for a maximum change in solar irradiance, the irradiance profile shown in Figure 6 was applied to the solar PV source. Considering that solar PV and wind generators can produce at the maximum of their capacity, as in scenario 1, the power plant behavior for a 4 kW load demand in response to a cloud transient is shown in Figure 7. As it can be noticed, in this case, wind generation was able to cover the loss of solar PV power. Considering that solar PV and wind generators can produce at the maximum of their capacity, as in scenario 1, the power plant behavior for a 4 kW load demand in response to a cloud transient is shown in Figure 7. As it can be noticed, in this case, wind generation was able to cover the loss of solar PV power. Considering that solar PV and wind generators can produce at the maximum of their capacity, as in scenario 1, the power plant behavior for a 4 kW load demand in response to a cloud transient is shown in Figure 7. As it can be noticed, in this case, wind generation was able to cover the loss of solar PV power. When the load demand reached 10 kW under the same conditions given in the previous case, the power plant response to a cloud transient is illustrated in Figure 8. At When the load demand reached 10 kW under the same conditions given in the previous case, the power plant response to a cloud transient is illustrated in Figure 8. At a 10 kW demand level, to fulfill the SR requirement, the controller commanded the connection of a second back-up synchronous generator. During the cloud transient, wind generation was not able to cover the loss of solar PV power, which was supplied by the back-up SGs.
R PEER REVIEW 15 of 28 a 10 kW demand level, to fulfill the SR requirement, the controller commanded the connection of a second back-up synchronous generator. During the cloud transient, wind generation was not able to cover the loss of solar PV power, which was supplied by the back-up SGs.

Scenario 4: Cloud Transient Analysis for Maximum Solar PV Generation and Zero Wind Generation
In this case, there was no wind generation. Nevertheless, solar PV generation could produce at its maximum capacity, as in scenario 2. A maximum change in solar irradiance ( Figure 6) was applied to the stand-alone power plant. For a 4 kW load demand, the power plant response to this cloud transient is shown in Figure 9. In the absence of wind generation, the loss of solar PV power was covered by the back-up SGs. It can be seen from Figure 9 that SG1 increased its production to cover the solar PV power loss, however, for low values of PPV, according to Equation (9), the required SR was now equal to ΔPmax_load (2 kW). Therefore, when the current SR was lower than 2 kW, a second back-up generator (SG2) was connected by the controller (the time of connection was lower than 24 s in the simulation only for saving computation time).

Scenario 4: Cloud Transient Analysis for Maximum Solar PV Generation and Zero Wind Generation
In this case, there was no wind generation. Nevertheless, solar PV generation could produce at its maximum capacity, as in scenario 2. A maximum change in solar irradiance ( Figure 6) was applied to the stand-alone power plant. For a 4 kW load demand, the power plant response to this cloud transient is shown in Figure 9. In the absence of wind generation, the loss of solar PV power was covered by the back-up SGs. It can be seen from Figure 9 that SG1 increased its production to cover the solar PV power loss, however, for low values of P PV , according to Equation (9), the required SR was now equal to ∆P max_load (2 kW). Therefore, when the current SR was lower than 2 kW, a second back-up generator (SG2) was connected by the controller (the time of connection was lower than 24 s in the simulation only for saving computation time). Under the same conditions, if the load demand increased up to 10 kW, the needed power was supplied by the two back-up SGs, as shown in Figure 10. Under the same conditions, if the load demand increased up to 10 kW, the needed power was supplied by the two back-up SGs, as shown in Figure 10. Under the same conditions, if the load demand increased up to 10 kW, the needed power was supplied by the two back-up SGs, as shown in Figure 10.

Results of the Power Plant with BESS Performing as SR
Renewable production cannot contribute to the spinning reserve (SR) due to its intermittent character. As it can be noticed from the previous results, in all the simulation scenarios, one or two back-up SGs were needed to guarantee the SR. However, this way to support the SR is excessively expensive, mainly due to the minimum continuous load (1 kW) of SGs.
In the conventional methods, the SR is assigned to the synchronous generators, and the interest in and popularity of the battery energy storage system (BESS) is because it can store energy at off-peak hours and supply energy at peak hours. Conversely, in the proposed method, a BESS was used to perform as SR in order to minimize the consumption of SGs when they gave support as SR.
The four previous scenarios were simulated again, but with the presence of a BESS in the microgrid and, as in the prior study cases, SR was determined according to the mode 3 (Optimal) and option 4. In all cases, the power plant response was quite similar to the responses shown in Figures 4, 5 and 7-10, with the advantage that the BESS allowed to reduce the SGs working time and, therefore, to save fuel consumption.

Scenario 1: Variable Demand Curve and Maximum Solar PV and Wind Generation
In scenario 1 the renewable production was enough to feed the load demand. If the BESS was used as SR, no SGs were needed, as shown in Figure 11, even for high values of load demand. The BESS is was sized to be able to back up the renewable production. Considering that the renewable production was for most of the time (>94%) lower or equal to 5 kW, then this was the back-up capacity required and the nominal power selected for the BESS.
to support the SR is excessively expensive, mainly due to the minimum continuous load (1 kW) of SGs.
In the conventional methods, the SR is assigned to the synchronous generators, and the interest in and popularity of the battery energy storage system (BESS) is because it can store energy at off-peak hours and supply energy at peak hours. Conversely, in the proposed method, a BESS was used to perform as SR in order to minimize the consumption of SGs when they gave support as SR.
The four previous scenarios were simulated again, but with the presence of a BESS in the microgrid and, as in the prior study cases, SR was determined according to the mode 3 (Optimal) and option 4. In all cases, the power plant response was quite similar to the responses shown in Figures 4-5 and 7-10, with the advantage that the BESS allowed to reduce the SGs working time and, therefore, to save fuel consumption.

Scenario 1: Variable Demand Curve and Maximum Solar PV and Wind Generation
In scenario 1 the renewable production was enough to feed the load demand. If the BESS was used as SR, no SGs were needed, as shown in Figure 11, even for high values of load demand. The BESS is was sized to be able to back up the renewable production. Considering that the renewable production was for most of the time (>94%) lower or equal to 5 kW, then this was the back-up capacity required and the nominal power selected for the BESS.
If a wind production of 6 kW is considered, the needed SR would also be 5 kW (except for very high wind speed values) because the decrease rate of wind speed is considered to be much lower, therefore less critical, than cloud transient is in solar PV. However, a shutdown can happen when wind speeds above the maximum operational limit (about 25 m/s) occur, which was considered in the control. Thus, for wind speeds close to the cutout wind speed, SR was increased up to 6 kW.  If a wind production of 6 kW is considered, the needed SR would also be 5 kW (except for very high wind speed values) because the decrease rate of wind speed is considered to be much lower, therefore less critical, than cloud transient is in solar PV. However, a shutdown can happen when wind speeds above the maximum operational limit (about 25 m/s) occur, which was considered in the control. Thus, for wind speeds close to the cut-out wind speed, SR was increased up to 6 kW.

Scenario 2: Variable Demand Curve, Maximum Solar PV Generation and Zero Wind Generation
In scenario 2 (maximum solar PV generation and zero wind generation), when the BESS was working as a back-up generator, the behavior of which is shown in Figure 12. While the load was below 5 kW, the SR provided by the BESS was enough to avoid the SG connection. For load values higher than 5 kW, renewable production was not enough to feed the load demand, therefore it was necessary to connect an SG.

PEER REVIEW
18 of 28

Scenario 2: Variable Demand Curve, Maximum Solar PV Generation and Zero Wind Generation
In scenario 2 (maximum solar PV generation and zero wind generation), when the BESS was working as a back-up generator, the behavior of which is shown in Figure 12. While the load was below 5 kW, the SR provided by the BESS was enough to avoid the SG connection. For load values higher than 5 kW, renewable production was not enough to feed the load demand, therefore it was necessary to connect an SG.  Figure 13 illustrates the power plant response to a cloud transient for a 4 kW demand (scenario 3a) when the BESS was used as SR. It can be noticed that the wind generation was covering the loss of the solar PV power, and neither of the SGs was connected, thanks to the BESS back up  Figure 13 illustrates the power plant response to a cloud transient for a 4 kW demand (scenario 3a) when the BESS was used as SR. It can be noticed that the wind generation was covering the loss of the solar PV power, and neither of the SGs was connected, thanks to the BESS back up cs 2021, 10, x FOR PEER REVIEW 19 of 28 However, an SG should be connected in scenario 3b (with a load of 10 kW) to guarantee the SR, as can be seen from Figure 14. During the cloud transient, wind generation was not enough to cover the loss of solar PV power, which was supplied by an SG while the BESS remained as back up. Thereby, the BESS and SG1 were providing the needed SR to insure against wind production loss.  However, an SG should be connected in scenario 3b (with a load of 10 kW) to guarantee the SR, as can be seen from Figure 14. During the cloud transient, wind generation was not enough to cover the loss of solar PV power, which was supplied by an SG while the BESS remained as back up. Thereby, the BESS and SG1 were providing the needed SR to insure against wind production loss. However, an SG should be connected in scenario 3b (with a load of 10 kW) to guarantee the SR, as can be seen from Figure 14. During the cloud transient, wind generation was not enough to cover the loss of solar PV power, which was supplied by an SG while the BESS remained as back up. Thereby, the BESS and SG1 were providing the needed SR to insure against wind production loss.

Scenario 4: Cloud Transient Analysis for Maximum Solar PV Generation and Zero Wind Generation
In scenario 4, the power plant responded to a cloud transient with maximum solar PV and without wind generation. In this context, for a 4 kW load demand, the cloud transient effect on the solar PV generation was supplied by the BESS (Figure 15) until SG1 was connected.

Scenario 4: Cloud Transient Analysis for Maximum Solar PV Generation and Zero Wind Generation
In scenario 4, the power plant responded to a cloud transient with maximum solar PV and without wind generation. In this context, for a 4 kW load demand, the cloud transient effect on the solar PV generation was supplied by the BESS (Figure 15) until SG1 was connected. For a load demand of 10 kW, in addition to the solar PV generation, an SG was needed to feed the 10 kW load. When the cloud transient occurred, the loss of solar PV power was provided by the BESS and the SG2 (Figure 16). For a load demand of 10 kW, in addition to the solar PV generation, an SG was needed to feed the 10 kW load. When the cloud transient occurred, the loss of solar PV power was provided by the BESS and the SG2 (Figure 16).

Smart Spinning Reserve Management Discussion
Simulation results showed that the presence of a BESS working as SR can significantly reduce the time that synchronous generators are running only to maintain the necessary SR. This allows to reduce the fuel consumption of the power plant,

Smart Spinning Reserve Management Discussion
Simulation results showed that the presence of a BESS working as SR can significantly reduce the time that synchronous generators are running only to maintain the necessary SR. This allows to reduce the fuel consumption of the power plant, decreasing the energy costs and improving the environmental impact.
Nevertheless, generally BESSs are not adequate to cover the power demand for long periods of time, because of their cost per kilowatt hour. For example, in the location of Zaragoza (Spain) with 2745 peak sun hours and around 2200 of wind equivalent full load hours, renewable sources are not available for more than the 50% of the time on an annual basis, because the amount of wind and solar PV hours are frequently coincident. In practice, periods of about a week with very low or almost zero renewable generation are likely. In those cases, the capacity of the BESS would have to be oversized to entirely feed the loads of the microgrid during these periods, which is not usually economically suitable. Obviously, the duration of these time periods without renewable generation depends mainly on the energy resource of the site. When the BESS is used to perform only as SR the required size is smaller and therefore more affordable.
In order to compare the conventional method with the proposed one, the fuel energy consumption was estimated in kWh. The diesel consumption is 0.7 L/h when an SG is running at the minimum load charge of 20% and its energy content is 10 kWh/L. Therefore, the fuel energy consumption estimated is 30,800 kWh per year, which is considered as the reference value to calculate the renewable energy production in % and their values when the BESS is performing as SR, as shown in Figure 17. Likewise, the renewable energy production is slightly lower in the conventional method because, as it can be noticed from the previous analysis, if an SG is connected the renewable production must be reduced. In this power plant, long periods of renewable scarcity are thought to be covered by SGs, because it is the best option in economic terms. Then, the role of the BESS is to be a short-term back-up device, that is, to provide immediately the required power that prevents the power plant from suffering a blackout in cases of a sudden drop in solar In this power plant, long periods of renewable scarcity are thought to be covered by SGs, because it is the best option in economic terms. Then, the role of the BESS is to be a short-term back-up device, that is, to provide immediately the required power that prevents the power plant from suffering a blackout in cases of a sudden drop in solar irradiation or wind or the connection of a big load. The spinning reserve management is able to identify that under these circumstances a new SG has to be started to maintain the power balance, but there is a duration of about 24 s from the SG activation order until it is ready to inject energy, and this lapse has to be covered.
Even if the stand-alone power plant is not equipped with a BESS or a BESS is not available, the consumption of synchronous generators should be minimized to reduce costs. To this end, it is possible to optimize the SR strategy if the largest loads are characterized as non-priority loads. That means that a non-priority load should request permission to the power plant controller before connection. Then, if at each present instant the available SR is not enough, the connection of this load is delayed by the time required to start and synchronize an SG. Thus, for low solar PV (P PV gen ,) and wind (P wind gen ) productions, the lower the ∆P load max , the lower the SR needed. Hence, for example, in a scenario of no renewable contribution in which all power of the microgrid is provided by an SG, the available SR is the remaining power of this SG. In the case of all loads being considered as priority loads, the required SR is ∆P load max = 2 kW, and when the demand is higher than 3 kW a second SG (SG2) is started, as shown in Figure 18. However, if all loads larger than a determined size (for example, 0.5 kW) are characterized as non-priority loads, ∆P load max can be defined equal to this value. Then, in the same scenario, the connection of the second group SG2 working as SR is avoided, as shown in Figure 19. Obviously, any load can be connected at any time and only for the non-priority loads will there be a need to obtain permission for the connection. Therefore, if SR is enough, the permission for the load connection is immediate and the decision lasts a cycle of PLC (20 ms). On the contrary, if SR is not sufficient, then SG2 should be connected before the

Conclusions
A hybrid power plant control was designed and evaluated in MATLAB-Simulink, the main purpose being to ensure the system stability. Likewise, the control strategy was designed to maximize renewable energy generation and minimize the use of nonrenewable generators. The application was aimed to be in the range of a few kW up to several hundred kW, and the results focused on stand-alone operation and its short-term stability (between microseconds and seconds). Therefore, only the worst operating conditions were included in the analyzed scenarios to test the energy management.
The case studies carried out showed the comparison between the absence of a BESS (conventional method) and the presence of a BESS performing as SR (proposed method). Results manifested that the use of a BESS contributes to reduce significantly the SGs working time, reducing fuel consumption and, consequently, the cost of the energy. Figure 17 shows how a BESS working as SR can reduce the fuel consumption, in the analyzed case the saved energy (approximately 90%) was comparable to the renewable energy production.
Finally, it is also remarkable that non-priority loads allow to minimize the needed SR when solar PV and wind production are low. Non-priority loads require permission from the power plant controller before being connected, hence they introduce a delay to the connection of a few seconds.
We have successfully exported both power plant control and inverter control to physical devices (a PLC and an FPGA, respectively) and executed them under elementary conditions. The next stage will be their assembling in a real pilot hybrid power plant, to evaluate them in real conditions. Obviously, any load can be connected at any time and only for the non-priority loads will there be a need to obtain permission for the connection. Therefore, if SR is enough, the permission for the load connection is immediate and the decision lasts a cycle of PLC (20 ms). On the contrary, if SR is not sufficient, then SG2 should be connected before the non-priority load does it, the needed time to connect SG2 being the starting time plus the synchronization time (about 24 s in total). The drawback of having to wait 24 s for a non-priority load connection is largely justified by the fuel savings, which arise from avoiding the connection of an SG as SR for long periods of time.

Conclusions
A hybrid power plant control was designed and evaluated in MATLAB-Simulink, the main purpose being to ensure the system stability. Likewise, the control strategy was designed to maximize renewable energy generation and minimize the use of non-renewable generators. The application was aimed to be in the range of a few kW up to several hundred kW, and the results focused on stand-alone operation and its short-term stability (between microseconds and seconds). Therefore, only the worst operating conditions were included in the analyzed scenarios to test the energy management.
The case studies carried out showed the comparison between the absence of a BESS (conventional method) and the presence of a BESS performing as SR (proposed method). Results manifested that the use of a BESS contributes to reduce significantly the SGs working time, reducing fuel consumption and, consequently, the cost of the energy. Figure 17 shows how a BESS working as SR can reduce the fuel consumption, in the analyzed case the saved energy (approximately 90%) was comparable to the renewable energy production.
Finally, it is also remarkable that non-priority loads allow to minimize the needed SR when solar PV and wind production are low. Non-priority loads require permission from the power plant controller before being connected, hence they introduce a delay to the connection of a few seconds.
We have successfully exported both power plant control and inverter control to physical devices (a PLC and an FPGA, respectively) and executed them under elementary conditions. The next stage will be their assembling in a real pilot hybrid power plant, to evaluate them in real conditions. Funding: This project has received funding from the ECSEL Joint Undertaking (JU) under grant agreement No 783158. The JU receives support from the European Union's Horizon 2020 research and innovation programme and Italy, Germany, Belgium, Sweden, Austria, Romania, Slovakia, France, Poland, Spain, Ireland, Switzerland, Israel [43].

Acknowledgments:
The authors wish to thank the technical support from the Research Group on Renewable Energy Integration (GENER) of the University of Zaragoza (funded by the Government of Aragon).

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

Appendix B
This appendix contains the main parameters used in the power plant model.