# Optimal Energy Management in a Standalone Microgrid, with Photovoltaic Generation, Short-Term Storage, and Hydrogen Production

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. System Modeling

#### 2.1. Description of the Facilities

#### 2.1.1. Solar Photovoltaic System

#### 2.1.2. The Battery Storage System

#### 2.1.3. The Power Consumers

#### 2.2. Estimation of Solar Irradiance

#### 2.2.1. Solar Constant

#### 2.2.2. Geometric Considerations

**Latitude**($\phi $): Geographic coordinate that specifies the north-south position of the surface’s center;$$-90\xb0\le \phi \le 90\xb0$$**Declination**($\delta $): The angular position between the sun on the local meridian and the plane of the equator;$$-23.45\xb0\le \delta \le 23.45\xb0$$**Slope**($\beta $): The angle between the surface’s plane and the horizontal plane;**Surface azimuth angle**($\gamma $): Angle between the surface’s vector of the perpendicular projection on a horizontal plane and the south vector;$$-180\xb0\le \gamma \le 180\xb0$$**Hour angle**($\omega $): The angular variation of the local meridian due to rotation of the earth, at 15 per hour;$$-180\xb0\le \omega \le 180\xb0$$**Zenith angle**(${\theta}_{z}$): Angle between the solar radiation and the zenith of the panel;$$-90\xb0\le {\theta}_{z}\le 90\xb0$$**Angle of incidence**($\theta $): Angle between the direct radiation on a surface and the normal to that surface;

#### 2.2.3. Geometric Considerations for Tracking Surfaces

#### 2.2.4. Extraterrestrial Irradiance

#### 2.2.5. Atmospheric Attenuation and Clear-Sky Irradiance

**Scattering**as the radiation interacts with the atmospheric molecules;**Absorption**of the radiation by the molecules ${O}_{3}$, ${H}_{2}O$, and $C{O}_{2}$.

- Atmospheric turbidity values corresponding to solar zenith angles greater than 75° are removed;
- A minimum number of 60 clear-sky data is needed. Otherwise, the most recent historical clear-sky data is used.

#### 2.2.6. Solar Energy Conversion

**Solar panel efficiency**$\left({\eta}_{p}\right)$: Relation between the solar radiation perpendicular to the panel surface and the output of electric energy from the panel;**Inverter efficiency**$\left({\eta}_{inv}\right)$: Relation between the output AC electric energy and the input of DC electric energy.

#### 2.3. The Battery Storage Model

#### 2.3.1. Battery Model

#### 2.3.2. Battery Degradation

- ${C}_{rate}$: The ratio between the battery current and its nominal capacity;$${C}_{rate}={\displaystyle \frac{|{I}_{BAT}|}{{C}_{n}}}$$
- Depth of Discharge (DOD): The complementary of the SOC.$$DOD=100-SOC$$

#### 2.4. Hydrogen Generation Facility

## 3. Control Problem

#### 3.1. Introduction

- ${P}_{SOL}$: Real variable depicting the electrical energy introduced to the system through the inverters of the solar panels. Note that this variable will be bounded by the available solar energy;
- ${v}_{d}$: Binary signal that activates the time flexible load d. The loads that are time inflexible will not be governed by the controller of this work;
- $\alpha $: Binary signal that governs the activation of the hydrogen facility.

#### 3.2. Cost Function Definition

- To ensure that the demand of the system can be afforded;
- To maximize the production of ${H}_{2}$ from the hydrogen facility;
- To avoid actions that can damage the battery system.

- Large discharge rate of the battery is one of the main factors that contributes to its degradation, due to this, the following term will be included:$${J}_{1}\left(k\right)={\left({P}_{BAT}^{dch}\left(k\right)\right)}^{2};$$
- Maintaining the batteries around a reasonable SOC is crucial to ensure the uninterrupted supply of the power to the scheduled energy consumption. To accomplish this the following term is included:$${J}_{2}\left(k\right)={(SOC\left(k\right)-\overline{SOC})}^{2},$$In cases where the microgrid is not self-sufficient, the reference value $\overline{SOC}$ may not be trackable by just the RES generation and it may be necessary to exchange energy with the grid. In such cases, the viability of the control scheme can be studied through indicators such as energy-independence and self-supply [39,42], which could be optimized by adding an additional term in the cost function that penalizes the exchange with the grid [39];
- To maximize the production of hydrogen, the following term is considered:$${J}_{3}\left(k\right)=-{\left(\alpha \left(k\right)\right)}^{2}.$$

#### 3.3. Characterization of Time Flexible Loads

- (1)
- To guarantee that ${P}_{c}^{fl}\left(k\right)$ is active in the interval $\{{T}_{0}-{S}_{l},{T}_{0}+{S}_{l}\}$ it is necessary to fulfill that :$$\mathbf{Constraint}\mathbf{1}:\phantom{\rule{1.em}{0ex}}\sum _{k\in \{{T}_{0}-{S}_{l},{T}_{0}+{S}_{l}\}}^{}{P}_{c}^{fl}\left(k\right)\ge {E}_{d}$$
- (2)
- To force that ${P}_{c}^{fl}\left(k\right)$ starts in some time $k\in \{{T}_{0}-{S}_{l},{T}_{0}+{S}_{l}\}$ the following condition is also considered:$$\mathbf{Constraint}\mathbf{2}:\phantom{\rule{1.em}{0ex}}{P}_{c}^{fl}\left(k\right)-{P}_{c}^{fl}(k-1)\le {T}_{sl}\left(k\right)D\phantom{\rule{1.em}{0ex}}\forall k$$
- (3)
- Finally, to ensure that ${P}_{c}^{fl}\left(k\right)$ remains active at least L consecutive time intervals the following constrain is required:$$\mathbf{Constraint}\mathbf{3}:\phantom{\rule{1.em}{0ex}}\sum _{k-L}^{k}{v}_{d}\left(k\right)\le {z}_{d}\left(k\right)\phantom{\rule{1.em}{0ex}}\forall k,$$$$\mathbf{Constraint}\mathbf{4}:\phantom{\rule{1.em}{0ex}}{v}_{d}\left(k\right)\ge {z}_{d}\left(k\right)-{z}_{d}(k-1)\phantom{\rule{1.em}{0ex}}\forall k.$$

#### 3.4. Controller Formulation

#### 3.5. Prediction Horizon

#### 3.6. Parameter Uncertainty and Robustness

## 4. Results and Discussion

## 5. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## Abbreviations

MPC | Model Predictive Control |

RES | Renewable Energy Sources |

DER | Distributed Energy Resource |

DSM | Demand Side Management |

DNI | Direct Normal Irradiance |

SOC | State of charge |

DOD | Depth of Discharge |

EOL | End of Life |

AC | Alternating Current |

DC | Direct Current |

PV | Photovoltaic |

RAM | Random Access Memory |

RMSE | Root Mean Square Error |

## References

- Van den Bergh, J.; Botzen, W. Monetary valuation of the social cost of CO
_{2}emissions: A critical survey. Ecol. Econ.**2015**, 114, 3–46. [Google Scholar] [CrossRef] - Barreto, R.A. Fossil fuels, alternative energy and economic growth. Econ. Model.
**2018**, 1–25. [Google Scholar] [CrossRef] [Green Version] - Mahmud, N.; Zahedi, A. Review of control strategies for voltage regulation of the smart distribution network with high penetration of renewable distributed generation. Renew. Sustain. Energy Rev.
**2016**, 64, 582–595. [Google Scholar] [CrossRef] - Lund, P.D.; Lindgren, J.; Mikkola, J.; Salpakari, J. Review of energy system flexibility measures to enable high levels of variable renewable electricity. Renew. Sustain. Energy Rev.
**2015**, 45, 785–807. [Google Scholar] [CrossRef] [Green Version] - Fahad Zia, M.; Elbouchikhi, E.; Benbouzid, M. Microgrids energy management systems: A critical review on methods, solutions, and prospects. Appl. Energy
**2018**, 222, 1033–1055. [Google Scholar] [CrossRef] - Chauhan, A.; Saini, R.P. A review on Integrated Renewable Energy System based power generation for stand-alone applications: Configurations, storage options, sizing methodologies and control. Renew. Sustain. Energy Rev.
**2014**, 38, 99–120. [Google Scholar] [CrossRef] - Al-falahi, M.D.A.; Jayasinghe, S.D.G.; Enshaei, H. A review on recent size optimization methodologies for standalone solar and wind hybrid renewable energy system. Energy Convers. Manag.
**2017**, 143, 252–274. [Google Scholar] [CrossRef] - Ghasemi, A.; Enayatzare, M. Optimal energy management of a renewable-based isolated microgrid with pumped-storage unit and demand response. Renew. Energy
**2018**, 123, 460–474. [Google Scholar] [CrossRef] - Carroquino, J.; Dufo-López, R.; Bernal-Agustín, J.L. Sizing of off-grid renewable energy systems for drip irrigation in Mediterranean crops. Renew. Energy
**2015**, 76, 566–574. [Google Scholar] [CrossRef] - Spanos, C.; Turney, D.E.; Fthenakis, V. Life-cycle analysis of flow-assisted nickel zinc-, manganese dioxide-, and valve-regulated lead-acid batteries designed for demand-charge reduction. Renew. Sustain. Energy Rev.
**2015**, 43, 478–494. [Google Scholar] [CrossRef] - Yang, Y.; Bremner, S.; Menictas, C.; Kay, M. Battery energy storage system size determination in renewable energy. Renew. Sustain. Energy Rev.
**2018**, 91, 109–125. [Google Scholar] [CrossRef] - Carli, R.; Dotoli, M. Energy scheduling of a smart home under nonlinear pricing. In Proceedings of the 53rd IEEE Conference on Decision and Control, Los Angeles, CA, USA, 15–17 December 2014. [Google Scholar] [CrossRef]
- Wang, T.; Kamath, H.; Willard, S. Control and Optimization of Grid-Tied Photovoltaic Storage Systems Using Model Predictive Control. IEEE Trans. Smart Grids
**2014**, 5, 1010–1017. [Google Scholar] [CrossRef] - Hu, J.; Xu, Y.; Cheng, K.W.; Guerrero, J.M. A model predictive control strategy of PV-Battery microgrid under variable power generations and load conditions. Appl. Energy
**2018**, 221, 195–203. [Google Scholar] [CrossRef] - Wang, X.; Li, L.; Palazoglu, A.; El-Farra, N.H.; Shah, N. Optimization and control of offshore wind systems with energy storage. Energy Convers. Manag.
**2018**, 173, 426–437. [Google Scholar] [CrossRef] - Al-Ammar, E.A.; Habib, H.U.R.; Kotb, K.M.; Wang, S.; Ko, W.; Elmorshedy, M.F.; Waqar, A. Residential Community Load Management based on Optimal Design of Standalone HRES with Model Predictive Control. IEEE Access
**2020**, 8. [Google Scholar] [CrossRef] - Pereira, M.; Limon, D.; Muñoz de la Peña, D.; Valverde, L.; Alamo, T. Periodic Economic Control of a Nonisolated Microgrid. IEEE Trans. Ind. Electron.
**2015**, 62, 5247–5254. [Google Scholar] [CrossRef] - Carroquino, J.; Roda, V.; Mustata, R.; Yago, J.; Valiño, L.; Lozano, A.; Barreras, F. Combined production of electricity and hydrogen from solar energy and its use in the wine sector. Renew. Energy
**2018**, 122, 251–263. [Google Scholar] [CrossRef] [Green Version] - Carroquino, J.; Bernal-Agustín, J.-L.; Dufo-López, R. Standalone Renewable Energy and Hydrogen in an Agricultural Context: A Demonstrative Case. Sustainability
**2019**, 11, 951. [Google Scholar] [CrossRef] [Green Version] - Roda, V.; Carroquino, J.; Valiño, L.; Lozano, A.; Barreras, F. Remodeling of a commercial plug-in battery electric vehicle to a hybrid configuration with a PEM fuel cell. Int. J. Hydrogen Energy
**2018**, 43. [Google Scholar] [CrossRef] - Chauvin, R.; Nou, J.; Eynard, J.; Thil, S.; Grieu, S. A new approach to the real-time assessment and intraday forecasting of clear-sky direct normal irradiance. Sol. Energy
**2018**, 167, 35–51. [Google Scholar] [CrossRef] - Gueymard, C.A.; Ruiz-Arias, J.A. Validation of direct normal irradiance predictions under arid conditions: A review of radiative models and their turbidity-dependent performance. Renew. Sustain. Energy Rev.
**2015**, 45, 379–396. [Google Scholar] [CrossRef] - Gueymard, C.A. REST2: High-performance solar radiation model for cloudless-sky irradiance, illuminance, and photosynthetically active radiation—Validation with a benchmark dataset. Sol. Energy
**2008**, 82, 272–285. [Google Scholar] [CrossRef] - Ineichen, P.; Perez, R. A New Airmass Independent Formulation for the Linke Turbidity Coefficient. Sol. Energy
**2002**, 73, 151–157. [Google Scholar] [CrossRef] [Green Version] - Kopp, G. An assessment of the solar irradiance record for climate studies. J. Space Weather Space Clim.
**2014**, 4. [Google Scholar] [CrossRef] [Green Version] - Spencer, J. Fourier Series Representation of the Position of the Sun. Search
**1972**, 2, 162–172. [Google Scholar] - Cooper, P. The Absorption of Solar Radiation in Solar Stills. Sol. Energy
**1969**, 12, 333–346. [Google Scholar] [CrossRef] - Duffie, J.A.; Beckman, W.A. Solar Engineering of Thermal Processes; John Wiley and Sons Inc.: Hoboken, NJ, USA, 2013. [Google Scholar]
- Kasten, F. A simple parameterization of two pyrheliometric formulae for determining the Linke turbidity factor. Meteorol. Rdsch.
**1996**, 33, 124–127. [Google Scholar] - Gueymard, C. Critical analysis and performance assessment of clear sky solar irradiance models using theoretical and measured data. Sol. Energy
**1993**, 51, 121–138. [Google Scholar] [CrossRef] - Inman, R.H.; Edson, G.J.; Coimbra, C.F.M. Impact of local broadband turbidity estimation on forecasting of clear sky direct normal irradiance. Sol. Energy
**2015**, 117, 125–138. [Google Scholar] [CrossRef] [Green Version] - Hu, X.; Li, S.; Huei, P. A comparative study of equivalent circuit models for Li-ion batteries. J. Power Sources
**2012**, 359–367. [Google Scholar] [CrossRef] - Huria, T.; Ceraolo, M.; Gazzarri, J.; Jackey, R. High Fidelity Electrical Model with Thermal dependence for characterization and simulation of high power lithium battery cells. In Proceedings of the Electric Vehicle Conference (IEVC), Greenville, SC, USA, 4–8 March 2012. [Google Scholar] [CrossRef]
- He, Y.; Liu, X.; Zhang, C.; Chen, Z. A new model for State-of-Charge (SOC) estimation for high-power Li-ion batteries. Appl. Energy
**2013**, 101, 808–814. [Google Scholar] [CrossRef] - Jin, X.; Vora, A.; Hoshing, V.; Saha, T.; Shaver, G.; Wasynczuk, O.; Varigonda, S. Applicability of available Li-ion battery degradation models for system and control algorithm design. Control Eng. Pract.
**2018**, 1–9. [Google Scholar] [CrossRef] - Wang, J.; Liu, P.; Hicks-Garner, J.; Sherman, E.; Soukiazian, S.; Verbrugge, M.; Finamore, P. Cycle-life model for graphite-LiFePO4 cells. J. Power Sources
**2011**, 3942–3948. [Google Scholar] [CrossRef] - Serrao, L.; Simona, O.; Rizzoni, G.; Guezennec, Y. A Novel Model-Based Algorithm for Battery Prognosis. IFAC Proc. Vol.
**2009**, 42, 923–928. [Google Scholar] [CrossRef] - Serrao, L.; Onori, S.; Sciarretta, A.; Guezennec, Y.; Rizzoni, G. Optimal energy management of hybrid electric vehicles including battery aging. In Proceedings of the American Control Conference, San Francisco, CA, USA, 29 June–1 July 2011. [Google Scholar] [CrossRef]
- Carli, R.; Dotoli, M.; Jantzen, J.; Kristensen, M.; Ben Othman, S. Energy schedulin gof a smart microgrid with shared photovoltaic panels and storage: The case of the Ballen marina in Samsø. Energy
**2020**. [Google Scholar] [CrossRef] - Joe Qin, S.; Badgwell, T.A. A survey of industrial model predictive control technology. Control Eng. Pract.
**2003**, 11, 733–764. [Google Scholar] [CrossRef] - Camacho, E.; Bordons, C. Model Predictive Control; Springer: London, UK, 2004. [Google Scholar]
- Kim, M.; Parkt, S.; Choi, J.; Lee, J. Energy independence of energy trading system in microgrid. In Proceedings of the 2017 IEEE ISGT-Asia, Auckland, New Zealand, 4–7 December 2017. [Google Scholar]
- Hosseini, S.M.; Carli, R.; Dotoli, M. A Residential Demand-Side Management Strategy under Nonlinear Pricing Based on Robust Model Predictive Control. In Proceedings of the 2019 IEEE International Conference on Systems, Man and Cybernetics (SMC), Bari, Italy, 6–9 October 2019; pp. 3243–3248. [Google Scholar] [CrossRef]
- Giraldo, J.S.; Castrillon, J.A.; López, J.C.; Rider, M.J.; Castro, C.A. Microgrids Energy Management Using Robust Convex Programming. IEEE Trans. Smart Grid
**2019**, 10, 4520–4530. [Google Scholar] [CrossRef]

**Figure 3.**Comparison of computed extraterrestrial irradiance (yellow), irradiance data measured with the panels pyranometer (blue), and clear sky direct normal irradiance (DNI) estimation (orange). Date: 27/06/2016.

**Figure 5.**Evolution of the battery open circuit voltage as function of SOC (state of charge). The set of data points have been fitted with a linear regression.

**Figure 10.**Simulation profiles. Prediction of photovoltaic (PV) power (blue), estimation of PV power with perturbation (orange), and original system power demand (yellow).

**Figure 11.**Batteries’ SOC evolution. SOC’s evolution case 1 (blue), SOC’s evolution case 2 (orange), and experimental data of the batteries’ SOC (yellow).

**Figure 14.**Batteries’ SOC evolution. SOC’s evolution without aerator 1 reschedule (blue), SOC’s evolution with aerator 1 reschedule (orange).

Variable Name | Description | Variable Name | Description |
---|---|---|---|

${G}_{sc}$ | Solar constant | n | number of the day |

${G}_{on}$ | Corrected solar constant | ${\eta}_{p}$ | Solar panel’s efficiency |

$\varphi $ | Latitude | ${\eta}_{inv}$ | Inverter’s efficiency |

$\delta $ | Declination | ${P}_{out}$ | Potential panel’s power output |

$\beta $ | Slope | ${P}_{SOL}$ | Solar panel’s power output |

$\gamma $ | Surface azimuth angle | $SOC$ | State of Charge |

$\omega $ | Hour angle | ${I}_{BAT}$ | Battery’s current |

${\theta}_{z}$ | Zenith angle | ${U}_{BAT}$ | Battery’s open circuit voltage |

$\theta $ | Angle of incidence | ${R}_{BAT}$ | Battery’s internal resistance |

${G}_{b,\tau}$ | Extraterrestrial irradiance | ${U}_{BAT}$ | Battery’s terminal voltage |

${T}_{L}$ | Turbidity coefficient | ${P}_{c}$ | Power consumption |

${I}_{cs}$ | Clear-sky DNI | ${C}_{rate}$ | C rate |

b | Correction coefficient | $DOD$ | Depth of Discharge |

m | Relative optical air mass | $Ah$ | Effective Ah-throughput |

h | Solar panel’s height | $\sigma $ | Severity factor |

I | Measured normal irradiance | $Bl$ | Battery charge/discharge efficiency |

N | Number of solar panels | $A{h}_{n}$ | Nominal Ah-throughput |

${P}_{BAT}$ | Battery’s power | ${C}_{n}$ | Nominal capacity |

${I}_{BAT}$ | Battery’s current | ${\alpha}_{ch/dch}$ | Battery’s charge/discharge efficiency |

Continuous decision variables | |

${P}_{SOL}$ | Electrical output of the solar panels controlled by the inverters |

Binary decision variables | |

${v}_{d}$ | Variable denoting the activation of load d |

$\alpha $ | Variable denoting the activation of the hydrogen facility |

${z}_{d}$ | Variable denoting that the flexible load d is active |

b | Variable denoting the charging of the battery |

Parameters | |

D | Power demand of the flexible load |

L | Minimum consecutive active time intervals of the flexible load |

${T}_{0}$ | Scheduled activation time of the load |

$Sl$ | Maximum time intervals that the flexible load can be advanced/delayed |

${\overline{P}}_{BAT}$ | Maximum battery charge/discharge power |

$\underline{SOC}/\overline{SOC}$ | Maximum/minimum allowed state of charge |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Cecilia, A.; Carroquino, J.; Roda, V.; Costa-Castelló, R.; Barreras, F.
Optimal Energy Management in a Standalone Microgrid, with Photovoltaic Generation, Short-Term Storage, and Hydrogen Production. *Energies* **2020**, *13*, 1454.
https://doi.org/10.3390/en13061454

**AMA Style**

Cecilia A, Carroquino J, Roda V, Costa-Castelló R, Barreras F.
Optimal Energy Management in a Standalone Microgrid, with Photovoltaic Generation, Short-Term Storage, and Hydrogen Production. *Energies*. 2020; 13(6):1454.
https://doi.org/10.3390/en13061454

**Chicago/Turabian Style**

Cecilia, Andreu, Javier Carroquino, Vicente Roda, Ramon Costa-Castelló, and Félix Barreras.
2020. "Optimal Energy Management in a Standalone Microgrid, with Photovoltaic Generation, Short-Term Storage, and Hydrogen Production" *Energies* 13, no. 6: 1454.
https://doi.org/10.3390/en13061454