# Autonomous Electrical System Monitoring and Control Strategies to Avoid Oversized Storage Capacity

Hong T. T. Vu, Benoit Delinchant, Jerome Ferrari, Quang D. Nguyen

<figure><img src="image_1.png" /></figure>

## To cite this version:

Hong T. T. Vu, Benoit Delinchant, Jerome Ferrari, Quang D. Nguyen. Autonomous Electrical System Monitoring and Control Strategies to Avoid Oversized Storage Capacity. IOP Conference Series: Earth and Environmental Science, 2020, 505, pp.012045. 10.1088/1755-1315/505/1/012045. [hal-03259954](https://hal.science/hal-03259954)

HAL Id: hal-03259954

https://hal.science/hal-03259954

Submitted on 21 Mar 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>
PAPER • OPEN ACCESS

# Autonomous Electrical System Monitoring and Control Strategies to Avoid Oversized Storage Capacity

To cite this article: T T Vu Hong et al 2020 IOP Conf. Ser.: Earth Environ. Sci. 505 012045

View the [article online](#) for updates and enhancements.

You may also like

- Modeling and analysis of the solar photovoltaic levelized cost of electricity (LCoE) - case study in Kupang
Rusman Sinaga, Nonce F. Tuati, Marthen D.E. Beily et al.

- An Investigation of the Recovery of Silicon Photovoltaic Cells By Application of an Organic Solvent Method
Vaidyanathan Subramanian, Prichard Tembo and Milan Heninger

- Performance of Artificial Neural Network and Particle Swarm Optimization: Technique based Maximum Power Point Tracking for Photovoltaic System Under Different Environmental Conditions
Said Zakaria Said and Lamine Thiw

PRIME
PACIFIC RIM MEETING
ON ELECTROCHEMICAL AND SOLID STATE SCIENCE

HONOLULU, HI
Oct 6-11, 2024

Abstract submission deadline:
April 12, 2024

Learn more and submit!

<figure><img src="image_3.png" /></figure>

Joint Meeting of

The Electrochemical Society

The Electrochemical Society of Japan

Korea Electrochemical Society

<figure><img src="image_4.png" /></figure>
# Autonomous Electrical System Monitoring and Control Strategies to Avoid Oversized Storage Capacity

Hong T T Vu<sup>1,2</sup>, Benoit Delinchant<sup>1*</sup>, Jérôme Ferrari<sup>1</sup>, and Quang D Nguyen<sup>2,3</sup>

1 Univ. Grenoble Alpes, CNRS, Grenoble INP, G2Elab, 38000 Grenoble, France

2 Energy Department, University of Science and Technology of Hanoi, VAST, Vietnam

3 Institute of energy and sciences, VAST, Vietnam

*E-mail: benoit.delinchant@G2Elab.grenoble-inp.fr

**Abstract.** A significant solution to achieve energy efficiencies and stability of the electrical network is upgrading auto-consumption in a single PV system. In this paper, we presented a methodology to implement low-cost sensors and actuators to have better monitoring and control for a feasibility solution. This approach has been conducted through a case study on Greenhouse's PV system in Grenoble, France. We proposed a minimal set of sensors to reduce system complexity while giving us enough information to make decisions. Some technical issues were analyzed as accuracy, sampling rate, response-ability of our system. The influences of inverter operation mode to system losses were considered. After that, we figured out energy problematics in our system based on available design data and simulation data from PVSyst. A PV production prediction model was investigated with input as forecast cloudiness data collected from web service, updated every 3 hours. This model, combined with real-time monitoring data and setting mode on an off-grid inverter, was used to identify control strategies with objectives of avoiding oversize storage capacity and maximizing the autonomous duration of the PV system.

## NOMENLATURE

<table><thead><tr><th>Symbol</th><th>Parameters (unit)</th></tr></thead><tbody><tr><td>V<sub>ac in</sub></td><td>Grid AC voltage (V)</td></tr><tr><td>I<sub>ac in</sub></td><td>Grid AC current (A)</td></tr><tr><td>P<sub>ac in</sub></td><td>Grid Power (W)</td></tr><tr><td>V<sub>ac out</sub></td><td>Inverter AC output voltage (V)</td></tr><tr><td>I<sub>ac out</sub></td><td>Inverter AC output current (A)</td></tr><tr><td>P<sub>ac out</sub></td><td>Inverter AC output power (W)</td></tr><tr><td>V<sub>pv</sub></td><td>PV panels output voltage (V)</td></tr><tr><td>I<sub>pv</sub></td><td>PV panels output current (A)</td></tr><tr><td>P<sub>pv</sub></td><td>PV panels output power (W)</td></tr><tr><td>V<sub>bat</sub></td><td>Battery DC voltage (V)</td></tr><tr><td>I<sub>bat</sub></td><td>Battery DC current (A)</td></tr><tr><td>P<sub>bat</sub></td><td>Battery DC power (W)</td></tr><tr><td>V<sub>pump</sub></td><td>DC Pump voltage (V)</td></tr></tbody></table>

<table><thead><tr><th>Symbol</th><th>Parameters (unit)</th></tr></thead><tbody><tr><td>I<sub>pump</sub></td><td>DC pump current (A)</td></tr><tr><td>P<sub>pump</sub></td><td>DC pump power (W)</td></tr><tr><td>P<sub>loss-discharge</sub></td><td>Power losses through inverter in discharging mode (W)</td></tr><tr><td>P<sub>discharge</sub></td><td>Power battery discharging (W)</td></tr><tr><td>P<sub>loss-charge</sub></td><td>Power losses through inverter in charging mode (W)</td></tr><tr><td>P<sub>charge</sub></td><td>Power battery charging (W)</td></tr><tr><td>E<sub>loss-discharge</sub></td><td>Energy losses through inverter in discharging mode (Wh)</td></tr><tr><td>E<sub>loss-charge</sub></td><td>Energy losses through inverter in charging mode (Wh)</td></tr><tr><td>E<sub>pv</sub></td><td>Energy produce by PV panels (Wh)</td></tr><tr><td>E<sub>loss</sub></td><td>Total energy losses through inverter (Wh)</td></tr><tr><td>E<sub>loads</sub></td><td>Energy consumption of loads (Pump + others) (Wh)</td></tr><tr><td>E<sub>Grid</sub></td><td>Total energy from grid (Wh)</td></tr><tr><td>E<sub>pv predict</sub></td><td>PV Energy forecast (Wh)</td></tr></tbody></table>

<figure><img src="image_5.png" /></figure>

Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
# 1. Introduction

Among renewable energy sources, solar energy is more attended because it is high power potential and more eco-friendly [1][2]. The investment costs of photovoltaic systems have been gone down to $1.5/Wp for the non-tracking solar system [3]. Recently, solar energy projects are accelerating quickly, accounting for 55% of the total new installed generator capacity [4]. However, the intermittent characteristic of solar energy is the cause of instability of power flows into the grid, rising system losses, and power quality issues, as noted by [5]. The deploying energy autonomy in PV systems can help us pass through these challenges and feasibility of solar energy applications in practical. The meaning of energy autonomy was defined by authors in [6], that is “*the ability of the energy system to function (or have the ability to function) fully, without the need of external support in the form of energy imports through its local energy generation, storage and distribution systems.*”

An autonomous PV system with a sizing approach was reported in the review [7]. An autonomous off-grid photovoltaic (PV) model was proposed by [8], that is a combination of solar panels, battery storage, loads, and inverter/charger device connected to the grid and/or generator when energy from solar and storage is not enough supply to loads. Probabilistic methods in [9]–[11] determined LLP/LPSP (Loss of Load Probability / Loss of Power Supply Probability) values that reflected shortage/surplus of power supply, consumer demand, and mismatch electricity time. Others used predictive methods power generation, reducing loads power to avoid out of the power supply capacity of the system and extend time autonomy of the system [12].

The significant influences of the inverter's operating mode on losses and energy balance issues on the PV system were presented in several studies [13], [14]. Nevertheless, in many proposed solutions, they were usually neglected. As a fact, in the real-time control phase, we can achieve a better algorithm if the changing losses by system operation modes are considered.

Most of the researches on energy system required measured data [15], [16]. That can be completely obtained by setting up an energy management system (EMS). A structure of the EMS [17] comprises a sensor network integrated control algorithms and database connection for tasks as monitoring, controlling, optimizing, and reporting. In previous works, the benefits of EMS system in the designs and operations of low-energy building [18], performance analysis of the PV system [19]. The role of sensing and actuation to improve energy efficiency was also discussed in [20].

However, technical issues (such as accuracy, sampling rate, response-ability of system, and losses) are factors that affect much the quality of monitoring and controlling systems [13], [14], [19]. Although low-cost technologies now have promised multiple applications in monitoring platforms and big data [21], [22], we still have to deal with drawbacks of these sensors as low data quality, sensor degradation, and many unpredictable variables during sensor lifecycle [23]. Thus, general questions are how to obtain a quality system, where we can easily collect the right data, and what control strategies can be exploited with realistic operations on it.

Our aim in this paper is described below:

**Energy monitoring hardware implementation:** we share a feasibility way to implement a quality low-cost monitoring and control system for energy autonomy studies. Some highlights of this part are the proposals of a minimal set of sensors and considering losses of the inverter. In this work, a case study in France was presented.

**Energy-saving strategies:** An autonomous energy system (islanded or connected to the grid) with a system sizing approach was studied. We exploited monitoring data as load consumption, PV production, and losses to analyze energy balance. Then we evaluated the best control strategy to reach autonomy for typical weather conditions days. Those analyses will help us develop smart control algorithms to manage loads operation depending on PV power in a short-term period of several days in further work.
## 2. Creating energy monitoring and control

### 2.1. Case study: Autonomous greenhouse

Filling our shopping cart with expensive toxic food that travels miles and miles does not seem like a good idea nowadays with all this technological advance. The necessity to produce our own food sustainably and autonomously pave the way toward a new agriculture process where three organisms (fishes, bacteria and plants) collaborate in a greenhouse using self-produced energy to power an advanced monitoring system, resulting in a 90% savings in water consumption.

The aquaponics greenhouse is installed on the roof of an engineering school in Grenoble city as shown in Figure 1. We used this platform to test and apply our studies in energy modeling and optimal control strategies.

Electrical parts on Greenhouse for our study consist of solar panels, batteries, inverter, and controllable load (water pump). Parameters of each part are the following:

* Solar panels (x6) by Francewatts: $V_{mpp}$ (V)=8.03; $I_{mpp}$(A)=7.97; $P_{max}$ (Wp)=64; title=27⁰; azimuth with 2 orients are equal 18⁰ and -162⁰ respectively;

* Battery (x2) : 22Ah-12 V

* Inverter/charger : 3000VA/2400W; AC Output=13A; AC Input =17.7A

* Pump DCS-4000 by Jacod : DC 24V – 30W

<figure><img src="image_6.png" /><figcaption>**Figure 2.** Schematic of energy monitoring and control system</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>**Figure 1.** Greenhouse in roof building in Grenoble City</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>**Figure 3.** Electrical board</figcaption></figure>

The energy monitoring and control system needs five sensors (PV Panels, Battery, 2 for AC input/output of the inverter, Pump) for measuring Voltage/Current/Power/Energy and a speed driver for the pump. The measured data from sensors will be stored in time series on the local Raspberry Pi server as in the database and displayed on a web-based dashboard. Therefore, users will be able to access and see data. Our schematic of monitoring and control system and electrical board were shown in Figure 2, 3.

### 2.2. Material choice

<table><caption>**Table 1.** Nominal voltage/current of each component and proposal sensors</caption><thead><tr><td>Name</td><td>Vmax (V)</td><td>Imax (A)</td><td>Proposal sensors</td></tr></thead><tbody><tr><td>PV panels</td><td>8.03 x 6</td><td>7.97</td><td>DC sensor with measured range (V<sub>pvMax</sub>>48.18V and I<sub>pvMax</sub>>7.97A)</td></tr><tr><td>Battery</td><td>28.2</td><td>30</td><td>DC sensor with measured range (V<sub>batMax</sub>>28.2V, I<sub>batMax</sub>>30A)</td></tr><tr><td>Pump</td><td>24</td><td>30W/24V</td><td>DC sensor with measured range (V<sub>pumpMax</sub>>240V, I<sub>pumpMax</sub>>1.25A)</td></tr><tr><td>AC input</td><td>240</td><td>13</td><td>AC sensor with measured range (V<sub>AcMax</sub>>240V, I<sub>AcMax</sub>>13A)</td></tr></tbody></table>
<table><tr><td>AC output</td><td>240</td><td>17.7</td><td>AC sensor with measured range (V<sub>AcMax</sub>>240V, I<sub>AcMax</sub>>17.7A)</td></tr></table>

We have designed the sensors according to characteristics of electrical components that were detailed in table 1. The application noted in [24] commented on some advantages and obstacles of various sensors technologies. The Rogowski Coil and Hall Effect sensors have high accuracy, but they still are more expensive than other technologies. In order to reduce complicated testing procedures and investment costs, the digital sensors that have been calibrated by the manufacturer are preferred choice. For current measurement in this work, we looked on shunt (DC Pzem-xxx and INA219) and the current transformer sensor (AC Pzem-004T). The required precision of sensors depends on different applications and can be improved by users with calibration. A measure accuracy of 1% is targeted, as advised on page 60 of [19]. We have reduced the set of sensors to a minimal number in order to reduce cost investment and maintenance. It has been done by neglecting energy sensor for battery charging mode. Figure 4 demonstrated the wiring of components in our developing system. In which, we chose cheap energy sensors for DC/AC measuring:

* DC Pzem-003 sensor<fnref n="1" /> was for PV panels with built-in Shunt, an accuracy of 1% and a measured range of 0.01-10A. DC Pzem-017 sensor<fnref n="2" /> was for Battery in discharging mode with an external shunt, an accuracy of 1%, and a range 0-100A. Both of these sensors have a physical layer from UART to RS485 communication interface, the application layer of Modbus RTU protocol. Two DC Pzem were wired to Raspberry Pi through USB port by converter cable.

* AC Pzem-004T sensors<fnref n="3" /> were for input and output of inverter with measured range (80 - 260 VAC) / (0 - 100A). These sensors were connected with an Arduino Atmega2560 module by UART protocol, which transmits data to Raspberry Pi through USB protocol.

* Adafruit DC INA219 sensor<fnref n="4" /> for Pump has a Shunt of 0.1 ohm-2W-1%, measuring up to +26VDC/±3.2A and support I2C communication protocol because the starting current of the motor is about 5-7 times higher than the nominal current. Our pump has a 1.25A of rated current. Therefore, we replaced by other Shunt with 0.01 ohm-1W-1% to extend the current range to ± 10A.

* Actuator<fnref n="5" /> was developed an actuator based on a two channels relay module to control the up/down motor speed of pump.

* Raspberry pi is our system data center, developed with open source solutions: InfluxdB<fnref n="6" />, Grafana<fnref n="7" />, Python<fnref n="8" />.

<figure><img src="image_9.png" /><figcaption>Figure 4. Wiring diagram of monitoring and control system</figcaption></figure>

<footnote n="1">¹ https://www.ebay.com/itm/PEACEFAIR-PZEM-003-DC-Voltage-Current-Power-Consumption-Meter-Communication-173504669451</footnote>

<footnote n="2">² https://peacefair.en.made-in-china.com/product/FCsEdQqvwkVl/China-Pzem-017-DC-0-300V-Electric-Solar-Power-Meter-with-RS485-Modbus-with-300A-Shunt.html</footnote>

<footnote n="3">³ https://innovatorsguru.com/ac-digital-multi-function-smart-meter-using-Arduino-and-pzem-004t/</footnote>

<footnote n="4">⁴ https://pypi.org/project/pi-ina219/</footnote>

<footnote n="5">⁵ https://www.amazon.com/SainSmart-101-70-100-2-Channel-Relay-Module/dp/B0057OC6D8</footnote>

<footnote n="6">⁶ https://docs.influxdata.com/influxdb/v1.7/</footnote>

<footnote n="7">⁷ https://grafana.com/docs/</footnote>

<footnote n="8">⁸ https://docs.python.org/3/</footnote>
## 2.3. *Data acquisition, storage and display*

In Figure 5, the dashboard displays measured data from the energy monitoring and control system. Users can access Raspberry through the internet to exploit and study. This information helps to track energy behaviors as (production, consumption, and storage) in the PV system.

## 2.4. *Quality of the monitoring and control*

In this section, we are presenting some solutions for testing and calibration to improve the quality of our energy monitoring and control system, to have better data quality and higher reliability operation.

<figure><img src="image_10.png" /><figcaption>**Figure 5.** Real-time monitoring on Grafana dashboard</figcaption></figure>

**The sensor's accuracy relates to data quality.** All most sensors are calibrated in factories. These devices evaluation information are provided by the manufacturer to support user finding the suitable sensors for their applications. Nevertheless, sensor errors come from users, the sensor's working environment, and degradation quality. Testing and calibration are therefore mandatory requirements before using them, which allow us an evaluation of measurement quality, determining the time to re-calibrate sensors or replacing them to a new one.

Some studies on the calibration of low-cost energy sensors are listed by [25]. However, it is not easy to proceed due to certain conditions such as high accuracy of reference tools, complex calculations, and testing time. The challenges of maintaining the quality of low-cost sensors still need to be addressed.

Experiences of calibrating low-cost sensors from laboratory to real systems were shown in [23]. We should select the right reference instrument accuracy (depend on the application, but it must be higher than testing devices) and measurement scale (as noted in table 2 [26]). In our system, AC Pzem-004T has a current of 0-100A, while the measured ranges (AC input/output of inverter) have maximum values of 17.7A / 13A, respectively. Therefore, we multiply four times of AC input by increasing wired rings through the current transformer to reach a maximum current of 70.8A/52A (to have over 50% of 100A). Correction of conversion errors (for instance INA219 sensor) by a calibrated function could reduce voltage/current error from 1.07% / 1.7% to 1%, 1.2% respectively.

Uncertainties of measurement can be reduced by averaging measurement results [27]. Our data were collected every second and then were averaged every 1 minute. The sampling rate shown in [25] is seconds to minutes per sample, time uploading data is 1s to 5 min. Other authors in [19] suggested timestamp of recorded data is around 5 to 15 min that is enough for tracking and can avoid overload database system. In our application, we collected 20-30 samples/minute (depending on sensors), and then store average data every 1 min.

Some importance evaluated factors are often used as RMSE (root mean square error), MAPE (mean absolute percentage error), MRE (mean relative error) [25], or STD (standard deviation) [27]. Our estimations in this study are based on RMSE.

**Controller and loads:** In order to control the pump, a two-channel relay has been connected to the existing speed driver. Our controller is a simulating button pushes on the existing one. Therefore, it is necessary to test the response of load and calibrate commands to ensure that loads can conduct the controller requests with expected accuracy in real-time. In our system, the time to complete command is approximately 2 seconds. The load was characterized to produce a model useful for the controller with input of power and output of motor speed (e.g., what is the speed if we want to consume only 10W).

In this part, a Greenhouse study case helps us to highlight implementation issues and recommendations to settle a monitoring and control system. This first one is required to be accurate
enough and well configured in order to start energy analysis and develop control strategies to reach a robust and autonomous system.

### 3. Energy autonomy strategies

#### 3.1. Energy balance evaluation

The characteristics associated with photovoltaic production simulation obtained by PVSyst software are to estimate the energy autonomy in our system. The relationship between demand and self-supply is represented by load matching indicators, including supply cover factor ($\gamma_{supply}$ in Equation 1) and load cover factor ($\gamma_{load}$ in Equation 2) on the different time scale (year, month, ...), which are defined in [28]:

$$ \gamma_{supply} = \frac{\int_{t1}^{t2} \min[g(t)-S(t)-\zeta(t),l(t)]dt}{\int_{t1}^{t2} g(t)dt} \quad (1) $$

$$ \gamma_{load} = \frac{\int_{t1}^{t2} \min[g(t)-S(t)-\zeta(t),l(t)]dt}{\int_{t1}^{t2} l(t)dt} \quad (2) $$

$$ S(t) = s_c(t) - s_{dc}(t) \quad (3) $$

Where: $t_1/t_2$ are start/end of the evaluation period; $\zeta(t)$ is energy losses; $l(t)$ is the power of loads; $S(t)$ is the storage energy balance defined by Equation 3. In which, $s_c/s_{dc}$ are charging/discharging storage energy.

On Greenhouse, the nominal power of loads is equal to 42 (W), and the losses system was approximated 10% nominal power of loads (4.2 W). We assume that the operation time of the system is 24h per day. So energy consumption of loads per (month and year) could be identified in table 2.

<table><caption>**Table 2.** Monthly/Yearly Consumption of loads, PV production, Load and Supply cover factors</caption><thead><tr><th></th><th>Jan</th><th>Feb</th><th>Mar</th><th>Apr</th><th>May</th><th>Jun</th><th>Jul</th><th>Aug</th><th>Sep</th><th>Oct</th><th>Nov</th><th>Dec</th></tr></thead><tbody><tr><td>Monthly consumption (kWh)</td><td>31.2</td><td>29.2</td><td>31.2</td><td>30.2</td><td>31.2</td><td>30.2</td><td>31.2</td><td>31.2</td><td>30.2</td><td>31.2</td><td>30.2</td><td>31.2</td></tr><tr><td>Yearly consumption (kWh)</td><td colspan="12">368.4</td></tr><tr><td>Monthly production (kWh)</td><td>15.0</td><td>18.5</td><td>33.1</td><td>45.1</td><td>50.4</td><td>45.6</td><td>61.4</td><td>47.7</td><td>36.7</td><td>24.3</td><td>15.5</td><td>13.1</td></tr><tr><td>Yearly production (kWh)</td><td colspan="12">406.4</td></tr><tr><td>Monthly supply cover factor</td><td>1</td><td>1</td><td>1</td><td>0.68</td><td>0.63</td><td>0.67</td><td>0.51</td><td>0.66</td><td>0.84</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Yearly supply cover factor</td><td colspan="12">0.91</td></tr><tr><td>Monthly load cover factor</td><td>0.48</td><td>0.63</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>0.78</td><td>0.51</td><td>0.42</td></tr><tr><td>Yearly load cover factor</td><td colspan="12">1</td></tr></tbody></table>

As shown in table 2, the annual time scale, $\gamma_{load}= 1$, and $\gamma_{supply} = 0.91$ indicated that the system's annual energy production meets demand and has only small surplus energy (around 9%). On a monthly scale, during the winter months (Jan, Feb, Oct, Nov, and Dec), the load cover factor varies from 0.42-0.78, indicating that local production does not meet the demand. In the summer months, energy excess fluctuates strongly in range ($0 < \gamma_{supply} < 1$), especially in August, the self-consumption level reached the highest value ($\gamma_{supply} = 0.84$). The intermittent of energy production on Greenhouse made influence significantly to load operation. Imagine that we want to store the exceeding summer energy (104kWh) in batteries, to reuse it during winter (need 66kWh), then approximately 250 batteries (22Ah-12 V) were required. This is not possible. That is why reducing load during winter is required. It is also coherent with the winter period, where fewer plants are in the Greenhouse. The same study has to be made on a daily scale, but we need a dedicated PV production model or enough data to produce some statistics during a year, on hourly energy balance. Indeed, the supply load during the night requires energy storage. In order to limit this battery capacity, we would like to manage the load to reduce its consumption when the hourly load cover factor is lower than 1. In the next part, we are introducing how to reach such control strategies.

#### 3.2. Control strategies approach for autonomous energy system sizing

In order to control and improve energy autonomy, we would like to provide a predictive strategy based on predictive models. PV production forecast can be based on sun irradiance forecast, which can itself
be obtained from available cloudiness forecast web service<fnref n="9" />. This leads us to develop the irradiance forecast model in the first phase of our project [29]. In this second phase, we continued by the PV production forecast model from the previous irradiance model. The power generated by photovoltaic panels (PPV) is given by the equation below [18], [29]:

$$P_{PV}(t) = \eta_{PV} \cdot S_{PV} \cdot I_{PV}(t) \qquad (4)$$

Where: S<sub>PV</sub> - PV area (m²); η<sub>PV</sub> - System global efficiency; I<sub>PV</sub> - Global solar irradiance on the panel plane (W/m²), as following:

$$I_{PV}(t) = DNI(t) \cdot \cos\theta(t) + DHI(t) \cdot \frac{1+\cos\beta}{2} + GHI(t) \cdot \rho \cdot \frac{1-\cos\beta}{2} \qquad (5)$$

$$I_{PV}(t) = DNI(t) \cdot \cos\theta_z(t) + DHI(t) \qquad (6)$$

DNI - Direct Normal Irradiance (W/m²); DHI - Diffuse Horizontal Irradiance (W/m²); GHI - Global horizontal irradiance (W/m²); β - Panel Tilt angle (rad); θz - Zenith angle (rad); θ - Theta angle (rad); ρ - Albedo coefficient of Ground.

PV power generation forecast is updated every 3 hours from web service. The measured GHI/DNI dataset from Campbell Scientific weather station (including Rotating Shadowband Radiometer) located just beside Greenhouse, and measured PV power data from our building PV's system in 2018, were used to validate our model.

<figure><img src="image_11.png" /><figcaption>Figure 6. Comparison of PV power measure (W/m²), and PV model output from measured irradiances</figcaption></figure>

The accuracy of forecasting energy production models could affect the performance of the PV system and control strategies. Figure 6 pointed out that our model has a good agreement with measured data.

### 3.2.1. Losses calculation

A monitoring and control system is integrated into the inverter in order to control battery modes. The integrated algorithms are in black-boxes supplied by manufacturers. In this case, an additional monitoring and control system can help us implement saving energy strategies more easily. According to some studies, inverter operating modes significantly affect losses [14-15], and this value increases while the system runs with a small load. Therefore, loads shedding could be leading to much fluctuation of losses, but it has not been considered in many studies [13]. In this study, we took into account inverter losses during battery charging and discharging modes.

In order to calculate inverter losses while lack measured data in charging battery mode, we had to identify periods of charging or discharging basing on tracking the increasing/decreasing trend of battery voltage. A function D(t) was created to observe the duration time of charging/discharging battery modes:

$$D(t) = \begin{cases} n, & V_B(t) - V_B(t-1) < 0 \text{ with } n > 0 \\ -n, & V_B(t) - V_B(t-1) > 0, \end{cases} \qquad (7)$$

* In discharging mode:

$$P_{PV} + P_{AC\_in} + P_{discharge} - P_{loss-discharge} - P_{loads} = 0 \qquad (8)$$

<footnote n="9">⁹ www.infoclimat.fr</footnote>
$$E_{loss-discharge} = \sum_{n start-discharge}^{end-discharge} P_{loss-discharge}(t_n) \times (t_n - t_{n-1}) \quad (9)$$

* In charging mode:

$$P_{PV} + P_{AC\_in} - P_{charge} - P_{loss-charge} - P_{loads} = 0 \quad (10)$$

We considered a set of experiments data consisting of the start time, stop time while battery capacity was preserved (Cᵢ = Cₐnd). Where: (Cᵢ, Cₐnd - Coresponding with battery capacity at initial, endpoint).

$$E_{loss} = E_{PV} + E_{Grid} - E_{loads} \quad (11)$$

$$E_{loss-charge} = E_{loss} - E_{loss-discharge} \quad (12)$$

For two days of data, we assumed that inverter losses were constant in each operation mode. Therefore, power and energy losses through the inverter in charging and discharging modes were determined.

$$P_{loss-charge} = \frac{E_{loss-charge}}{duration \ charging \ time} \quad (13)$$

$$P_{charge} = P_{PV} + P_{AC\_in} - P_{loss-charge} - P_{loads} \quad (14)$$

$$SOC(t_n) = SOC(t_{n-1}) + P_{bat}(\Delta t) \quad (15)$$

By Equation 7-15, unknown parameters as inverter losses in charging/discharging modes, stage of charge of the battery (SOC), and autonomous level were identified.

### 3.2.2. Analysis of the energy autonomy level

<figure><img src="image_12.png" /><figcaption>**Figure 7.** Battery power, trend of battery voltage, and PV generation</figcaption></figure>

In Figure 7, from 14/8/2019 to 16/8/2019 with a start/stop time while the battery was full, inverter's operating modes created significant energy losses (over 50% of the power produced by system). In which, there is a big gap (over two times) between losses in charging and discharge modes with E_(loss-discharge)=0.67 (kWh) and E_(loss-charge)=1.54 (kWh). On a daily scale (2 days of summer), Greenhouse has only a maximum of 26.2 hours of energy autonomy. That means losses and analysis on a smaller time scale should be considered to ensure the precision of solutions.

<figure><img src="image_13.png" /><figcaption>**Figure 8.** Relationship between Power generate of PV by measuring and our model, loads consumption, load cover factor in minute scale of 10 days</figcaption></figure>
In summer with 10 days data, there was small deficient energy because an average of PV energy production (1kWh) was lower than a demand for loads and losses (1.1kWh). During the night (13h), when the sun is not available, we need to supply (around 600Wh) for pump and losses in discharge mode. In this case, two batteries of (22Ah, 12V) to storage energy are required. Nevertheless, we need bigger energy storage to maintain this consumption level because of lower energy production in the winter days. Figure 8, with a minute time scale, shown that PV production was not enough to supply for the load even while the solar energy was available, that we can see several points with $\gamma_{load}<1$. Therefore, load control strategies in a minute are necessary to avoid oversized storage capacity and increase auto-consumption ($\gamma_{load}=1$). A comparison between our PV production prediction model with measured data figured out a small gap, but total energy prediction obtained a better accuracy. Therefore, our model with a load profile can use to predict SOC of battery by Equation15. Then, we can develop energy-saving strategies to avoid power consumption exceeding the system supplying capacity. The evaluation of SOC and PV power will be updated according to the load control and weather conditions, every 3 hours. Then, a controller will reduce the power of the pump when the forecast shows that there is a deficiency of energy in the system and will increase the power of the pump when the system is predicted a surplus of energy.

## 4. Conclusions

In this study, we developed an energy monitoring and control system based on power sensors, an actuator to control the load, and model predictive strategy. The low-cost hardware and open-source software were considered to accelerate the progress of our project and reduce costs. Several tests and evaluations were done to ensure accuracy, stability, response-ability of the system, and limit data errors. A suitable controller and load model were estimated, and unknown parameters were calculated based on a minimal set of measured data. The experiment of low-cost sensors in the laboratory has several challenges in real-world applications because of many uncertainty conditions and robustness issues. But they can be used for non-critical systems such as our greenhouse autonomous system. A model of PV energy prediction was developed and validated with real data. Based on load matching indicators, we assessed the system's ability to self-supply power on-site in different seasons, but a battery is still necessary to overcome daily variations. Losses in various modes of inverter were pointed out. Analyzing energy autonomy levels of Greenhouse figured out lacking power supply to loads on Greenhouse in a day and monthly scale. In further work, the control strategies need to be done to achieve an autonomous energy system adapted to the limited size of our storage.

## 5. References

[1] V. B. Dinh, H. A. Dang, B. Delinchant, and F. Wurtz, "Optimal sizing of PV system combined to cooling load management strategy towards photovoltaic self-consumption in buildings," *Int. J. Electr. Electron. Eng. Telecommun.*, vol. 7, no. 3, pp. 90-95, Jul. 2018.

[2] A. S. B. M. Shah, H. Yokoyama, and N. Kakimoto, "High-Precision Forecasting Model of Solar Irradiance Based on Grid Point Value Data Analysis for an Efficient Photovoltaic System," *IEEE Trans. Sustain. Energy*, vol. 6, no. 2, pp. 474-481, Apr. 2015.

[3] U. K. Das et al., "Forecasting of photovoltaic power generation and model optimization: A review," *Renewable and Sustainable Energy Reviews*, vol. 81. Elsevier Ltd, pp. 912-928, 2018.

[4] Arthouros Zervos, "Renewables 2018 global status report," 2018.

[5] G. B. M. A. Litjens, E. Worrell, and W. G. J. H. M. van Sark, "Assessment of forecasting methods on performance of photovoltaic-battery systems," *Appl. Energy*, vol. 221, pp. 358-373, 2018.

[6] C. Rae and F. Bradley, "Energy autonomy in sustainable communities - A review of key issues," *Renewable and Sustainable Energy Reviews*, vol. 16, no. 9. pp. 6497-6506, Dec-2012.

[7] A. Hirsch, Y. Parag, and J. Guerrero, "Microgrids: A review of technologies, key drivers, and outstanding issues," *Renewable and Sustainable Energy Reviews*, vol. 90. Elsevier Ltd, pp. 402-411, 2018.

[8] J. G. De Matos, F. S. F. E Silva, and L. A. S. Ribeiro, "Power control in AC isolated
microgrids with renewable energy sources and energy storage systems," *IEEE Trans. Ind. Electron.*, vol. 62, no. 6, pp. 3490–3498, 2015.

[9] S. A. Klein and W. A. Beckman, "Loss-of-load probabilities for stand-alone photovoltaic systems," *Sol. Energy*, vol. 39, no. 6, pp. 499–512, 1987.

[10] A. Hadj Arab, B. Ait Driss, R. Amimeur, and E. Lorenzo, "Photovoltaic systems sizing for Algeria," *Sol. Energy*, vol. 54, no. 2, pp. 99–104, 1995.

[11] E. Koutroulis, D. Kolokotsa, A. Potirakis, and K. Kalaitzakis, "Methodology for optimal sizing of stand-alone photovoltaic/wind-generator systems using genetic algorithms," *Sol. Energy*, vol. 80, no. 9, pp. 1072–1088, Sep. 2006.

[12] D. Michaelson, H. Mahmood, and J. Jiang, "A Predictive Energy Management System Using Pre-Emptive Load Shedding for Islanded Photovoltaic Microgrids," *IEEE Trans. Ind. Electron.*, vol. 64, no. 7, pp. 5440–5448, Jul. 2017.

[13] E. S. Gavanidou and A. G. Bakirtzis, "Design of a stand alone system with renewable energy sources using trade off methods," *IEEE Trans. Energy Convers.*, vol. 7, no. 1, pp. 42–48, 1992.

[14] L. Keller and P. Affolter, "Optimizing the panel area of a photovoltaic system in relation to the static inverter-Practical results," *Sol. Energy*, vol. 55, no. 1, pp. 1–7, 1995.

[15] A. Mellit, S. A. Kalogirou, L. Hontoria, and S. Shaari, "Artificial intelligence techniques for sizing photovoltaic systems: A review," *Renewable and Sustainable Energy Reviews*, vol. 13, no. 2. pp. 406–419, 2009.

[16] E. Vrettos, E. C. Kara, E. M. Stewart, and C. Roberts, "Estimating PV power from aggregate power measurements within the distribution grid," *J. Renew. Sustain. Energy*, v 11, no. 2, 2019.

[17] J. L. Francisco J. Miguel, Roberto Sanz, Álvaro Corredera, Víctor Serna, D. M. Hernández (CAR), Jesús García, Vicente Madero, Ricardo Palomar (ACC), E. V. (SOL) (ASC), Gulfem Inaner, Zeynep Ozdogru (EKO), Yildirim Ozkaya (NME), and B. T. (TEC), "D5.1: Building Energy Management System (BEMS) definition, WP 5, T5.1," 2016.

[18] Van Binh Dinh, "Méthodes et outils pour le dimensionnement des bâtiments et des systèmes énergétiques en phase d'esquisse intégrant la gestion optimale'," University of Grenoble, 2017.
http://www.theses.fr/2016GREAT092

[19] I. E. A. (IEA), "Analytical monitoring of grid-connected photovoltaic systems : good practices for monitoring and performance analysis : IEA PVPS task 13, subtask 2: report IEA PVPS T13-03, Photovoltaic Power Systems Programme," 2014.

[20] T. Weng and Y. Agarwal, "From buildings to smart buildings-sensing and actuation to improve energy efficiency," *IEEE Des. Test Comput.*, vol. 29, no. 4, pp. 36–44, 2012.

[21] B. Delinchant, H. A. Dang, H. T. T. Vu, and D. Q. Nguyen, "Massive arrival of low-cost and low-consuming sensors in buildings: Towards new building energy services," in *IOP Conference Series: Earth and Environmental Science*, 2019, vol. 307, no. 1.

[22] J. Paredes-Parra, A. Mateo-Aroca, G. Silvente-Niñirola, M. Bueso, and Á. Molina-García, "PV Module Monitoring System Based on Low-Cost Solutions: Wireless Raspberry Application and Assessment," *Energies*, vol. 11, no. 11, p. 3051, Nov. 2018.

[23] S.-C. C. Lung et al., *Low-cost sensors for the measurement of atmospheric composition: overview of topic and future applications*. 2018.

[24] O. T. Way and H. Mani, "AN-639 APPLICATION NOTE Analog Devices Energy" https://www.analog.com/media/en/technical-documentation/application-notes/AN-639.pdf

[25] Sanchez-Sutil, Cano-Ortega, Hernandez, and Rus-Casas, "Development and Calibration of an Open Source, Low-Cost Power Smart Meter Prototype for PV Household-Prosumers," *Electronics*, vol. 8, no. 8, p. 878, Aug. 2019.

[26] M. Schöberle, "Accuracy specifications: Reading it right with range."

[27] S. Bell, "A Beginner's Guide to Uncertainty of Measurement Measurement Good Practice Guide" National Physical Laboratory Teddington, Middlesex, United Kingdom, ISSN 1368-6550. 1999.

[28] Jaume Salom, Anna Joanna Marszal, José Candanedo, Joakim Widén, Karen Byskov Lindberg, Igor Sartori, "ANALYSIS OF LOAD MATCH AND GRID INTERACTION INDICATORS IN NET ZERO ENERGY BUILDINGS WITH HIGH-RESOLUTION DATA A report of
Subtask A, IEA Task 40/Annex 52 Towards Net Zero Energy Solar Buildings,” 2013.

[29] D. V. Nguyen, B. Delinchant, B. V. Dinh, and T. X. Nguyen, “Irradiance forecast model for PV generation based on cloudiness web service,” in *IOP Conference Series: Earth and Environmental Science*, 2019, vol. 307, no. 1.