analyzing and displaying data from a pv system - excel vba

34
Degree Project Bachelor’s level thesis Analyzing and displaying data from a PV system Excel VBA programming and MATLAB data analysis Authors: Alexandre KREBS / Pierre TISSOT Supervisor: Pei HUANG Project holder: Frank FIEDLER Examiner: Johan HEIER Subject/main field of study: Energy Technology Course code: EG2004 Credits: 15 credits Date of examination: June 7th, 2020 At Dalarna University it is possible to publish the student thesis in full text in DiVA. The publishing is open access, which means the work will be freely accessible to read and download on the internet. This will significantly increase the dissemination and visibility of the student thesis. Open access is becoming the standard route for spreading scientific and academic information on the internet. Dalarna University recommends that both researchers as well as students publish their work open access. We give our consent for full text publishing (freely accessible on the internet, open access): Yes No Dalarna University – SE-791 88 Falun – Phone +4623-77 80 00

Upload: others

Post on 11-Jan-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Analyzing and Displaying Data from a PV System - Excel VBA

Degree Project Bachelor’s level thesis Analyzing and displaying data from a PV system

Excel VBA programming and MATLAB data analysis

Authors: Alexandre KREBS / Pierre TISSOT Supervisor: Pei HUANG Project holder: Frank FIEDLER Examiner: Johan HEIER Subject/main field of study: Energy Technology Course code: EG2004 Credits: 15 credits Date of examination: June 7th, 2020 At Dalarna University it is possible to publish the student thesis in full text in DiVA. The publishing is open access, which means the work will be freely accessible to read and download on the internet. This will significantly increase the dissemination and visibility of the student thesis. Open access is becoming the standard route for spreading scientific and academic information on the internet. Dalarna University recommends that both researchers as well as students publish their work open access.

We give our consent for full text publishing (freely accessible on the internet, open access):

Yes ■ No ☐

Dalarna University – SE-791 88 Falun – Phone +4623-77 80 00

Page 2: Analyzing and Displaying Data from a PV System - Excel VBA

Abstract: This thesis work’s purpose is to collect, analyze, and display data from a PV array located in Borlänge, Sweden. For the data analysis, MATLAB is used as an analysis tool, in order to have an idea of how the system is going in its entirety by drawing several different graphs such as daily irradiance or temperature but also to gather all the data that is available and regroup it in the same Excel sheet in order to simplify the usage of the program. For the display of the data, Excel Visual Basics for Applications (VBA) is used to establish a user-controlled interface which lets the choice to study a certain parameter over a certain period of time, and then display graphs and data automatically, all of this being chosen by the user, for example to create daily, monthly or yearly plots of the energy production as well as the efficiency of the system. Keywords: Photovoltaics, Data analysis, Analysis tool, Excel VBA, program.

Acknowledgement Firstly, we would like to thank our supervisor Pei HUANG as well as this project’s holder Frank FIEDLER for having given us a tremendous amount of useful feedback, advices and help in order to make us succeed as much as possible in our work. We also want to thank Dalarna University for having welcomed us for a huge part of this year before we had to head back home due to the current health situation, and also all of our teachers that guided us so well throughout this year.

Page 3: Analyzing and Displaying Data from a PV System - Excel VBA

2

Concepts and/or abbreviations PV: PhotoVoltaic(s) = conversion of the sunlight energy into electricity. PVT: Hybrid Photovoltaic Thermal = combination of electrical and thermal energy production. Excel VBA: Visual Basics for Applications: programming software in Excel. STC: Standard Test Conditions = laboratory conditions for testing a PV module: irradiance of 1000W/m2, solar-type light and room temperature of 25+-2°C [1]. PR: Performance Ratio = expressed in percent, it gives the relation between theoretical and actual energy production of a PV system. The closer to 100%, the more performant the system is.

Page 4: Analyzing and Displaying Data from a PV System - Excel VBA

3

Table of Contents

1 Introduction 4 1.1 Background 4 1.2 Aims 5 1.3 Limitations 5

2 Studied system 6 2.1 System: general 6 2.2 Characteristics 7

3 Method 8 3.1 Data analysis method 8 3.2 Calculations 9 3.3 Programming method 9

3.3.1 User interface 9

3.3.2 Program 11

3.4 Method discussion 13 4 Results and discussions 13

4.1 Meteorological data 13 4.1.1 Temperature 13

4.1.2 Irradiance 14

4.2 Energy results 17 4.2.1 Energy production 17

4.2.2 Efficiency 20

4.3 Results discussion 22 4.4 Future work 22

5 Conclusions 23 6 References 24 Appendices 25

Appendix 1 – Solibro PV modules datasheet (2 pages) 25 Appendix 2 - Data loggers datasheet (2 pages) 28 Appendix 3 - MATLAB code used to compile the data 30 Appendix 4 - Excel program dashboard 30 Appendix 5 - Function find in VBA 31 Appendix 6 - Time period selection 31 Appendix 7 - Data selection 32 Appendix 8 - VBA code used to create a graph 32 Appendix 9 Pivot table of the efficiency 33

Page 5: Analyzing and Displaying Data from a PV System - Excel VBA

4

1 Introduction This world is progressively turning into a much greener world, and a way of achieving this turn is investing into cleaner energy sources. The Sun is one of these energy sources. Using photovoltaics to convert some of its light into electrical energy leads to a way of producing electricity with a very low CO2 footprint, since only the production and the transport of the panels have to be taken into account. Combined with hydropower, wind power and much more, this energy source will probably become one of the most preponderant in the world of tomorrow, a world where all the major pollution sources in the electricity generation will have disappeared. This is why numerous people invest in PV systems, for example by building one on their garage, as this is the case within this study. However, to best overview and provide maintenance to a PV system, an observation and overseeing tool is very often needed, giving an idea of the array’s performance in a simple and intuitive way as well as the availability for big data analysis. 1.1 Background Chadi Abd Alrahman, former student at Dalarna University, has already worked on this studied system. Indeed, the PhotoVoltaic Thermal (PVT) air collector, that is present within this work, has been studied in [2], where the thermal and electrical performances of the system have been analyzed. This evaluation has been used to study if the cooling could be optimized in order to increase the electrical energy produced by the PV modules, and maximize the heat production. The solar irradiation has been measured and the electrical efficiency for a 13th of May has been calculated, showing an efficiency of 14% for an irradiance of about 200W/m2, which is higher than the rated efficiency at STC (around 12%). This can be explained by the fact that, for example, STC have a test temperature of 25°C, and this 13th of May had probably a lower temperature, which could have enhanced the system’s efficiency. Another literature relevant to the area under study would be System for Measuring and Collecting Data from Solar-cell Systems [3], by Machacek et al, 2007. This project’s purpose was, among others, to calculate the values displayed in table 1. This table shows a very interesting list of parameters, which will for sure be taken here as inspiration for the present work and results display.

Table 1: Summary of Machacek et al calculations (source:[3])

Energy calculations

Daily energy

Monthly summarization of energy

Yearly summarization of energy, displayed by months

Total summarization of energy, displayed by years

Page 6: Analyzing and Displaying Data from a PV System - Excel VBA

5

Efficiency calculations Cumulative and instantaneous efficiency of the energy conversion

It was found that the efficiency of the PV modules was highly influenced by the temperature. Indeed, in addition to the solar radiation, temperature is an especially important factor regarding the efficiency, hence the energy output. Moreover, Ascencio Vásquez and Topič [4] have studied and provided a methodology for PV-related data analysis. A lot of important information were given, such as the data quality check method which consists in looking for missing data, calibration issues or sensor drifting. These parameters were seriously taken into account in this study in order to check the results, ensuring it was real and reliable. It is also added in [4] that data analysis in PV systems is primordial in order to have a good maintenance and supervising on it, thus increasing greatly the value of the systems. A further study related to the topic would be the work from Díez-Mediavilla et al [5]. This study’s purpose was to compare two different PV installations that were located in the same area and wired in the same way, which means the fluctuations in temperature and irradiation were the same. To achieve this, every measured data has been observed for different radiation levels in order to have much more consistent results. This method will be taken as inspiration for this work to define the studied PV system as exhaustively as possible. 1.2 Aims This study aims to visualize and analyze the energy performance of a real PV system. The purpose is to help understanding the performance of the system: is the performance as high as expected? How is it compared to other existing PV systems? Is there any degradation factor to be taken into consideration? The second main aim is to create an intuitive interface for the building’s owner to monitor the system without wasting time, by having an easy access to all of the measured data, and the capability of plotting any wished graph or chart from it., such as weather data or energy production over a certain period of time. It can also help the owner to better understand the system and thus make decisions in maintenance by having an observation tool which purpose is to gather and display all of the data in an intuitive way. 1.3 Limitations

The data is only available over a 5-years period, which makes an analysis over the whole PV system lifespan (approximately around 20 years) impossible for now. Moreover, some data is missing, as it is sadly often the case with such systems, which can reduce the accuracy since a lot of results are made using mean values over certain periods of time. Finally, the two data loggers cannot be synchronized on the same Excel sheet since they don’t have the same timestamps, which will limit the ability of plotting two different variables from two different data loggers.

Page 7: Analyzing and Displaying Data from a PV System - Excel VBA

6

2 Studied system 2.1 System: general The system consists of a thin film Building Integrated PhotoVoltaic (BIPV) array made of two PV subsystems organized in two rows which make a total surface area of 32 m2. It is located on the roof of a personal garage in Borlänge, Sweden (Fig.1). The total rated power of the system is 3910Wp, the voltage and the current at maximal power are respectively 70V and 1.6A with an irradiance of 1000W/m2.

Fig.1: Photography of the PV system (ref: [2])

As shown in Fig.2, the array is displayed in a south-westwards position which is optimal for this location, and an angle of 29°. The different sensors, shown later in 2.2, are mainly located inside the building except for the wind speed sensor and pyranometer which are both located on the lower edge of the PV modules.

Fig.2: System surroundings and emplacement (ref: [2])

The Fig.2 also shows that there are two main shadow sources: the neighbor’s house (on the right) which will induce shadow in the morning, and the system owner’s house (on the left) in the end of the afternoon, which will probably mean a lower energy production during these two times of the day.

Page 8: Analyzing and Displaying Data from a PV System - Excel VBA

7

2.2 Characteristics The PV array is equipped with sensors which are measuring and uploading data regularly into Excel sheets since September 2015. There are 24 Excel sheets filled with data measured every 5 minutes for weeks at timestamps scattered in the 2015-2020 period, filled with a lot of different values, such as irradiation, output/input power, etc. The PV modules that are used are Solibro SL2 CIGS Thin-film modules, which have a rated power of 115 Wp, a nominal module efficiency of at least 12,8% (at STC). Their datasheet is included within Appendix 1. The different sensors, used to measure the data that has been analyzed, are shown down below in Table 2.

Table 2: System sensors (source: [2]) Component Type Input range Output range Accuracy Sensitivity

Pyranometer SP lite2 0-1500 W/m² 0-150 mV < 2.5% 73.7 V / W / m²

Compact wind speed sensor

Thies CLIMA Model.No:

4.3519.00.167 0.5-50 m/s 0-2000 mV

±3% (measured

value) < 1 m/s

Air speed velocity Testo 480 0-20 m/s 0-20 m/s

±5% (measured

value) <0.1 m/s

Thermocouple T-type -60 - 350°C -60 - 350°C 0.2°C -

The measured data is transferred to Excel sheets using two EdgeBox V12 data loggers, which characteristics are detailed in Appendix 2. The Fig.3 shows an electrical scheme of the entire system, where are shown the pyranometer which will measure the irradiance and upload it into the logger 2 (containing the irradiance, wind speed, outside and inside temperatures, current from all strings as well as DC power and voltage for each subsystem). Obviously, there is also the PV array linked to the inverter and the AC energy meter which is connected to the grid and to Logger 3 (which in fact is included into logger 1 in the Excel sheets) with all of the temperature sensors.

Fig.3: System electrical scheme (source: [2])

Page 9: Analyzing and Displaying Data from a PV System - Excel VBA

8

The system also includes a PVT air collector which is used to regulate the PV modules temperature. This system is shown in Fig.4 but will not be the object of this study. For further information regarding the air collector, please refer to Abd Alrahman’s master thesis work [2]. The following drawing is a section view of the system that shows the position of the wind speed and air velocity sensors, as well as the pyranometer. Moreover, two temperatures sensors are respectively located at the inlet air location, and at the outlet air, near the fan.

Fig.4: Drawing of the system (source: [2])

3 Method

This part shows the different methods that were used to achieve the aims of the work, as well as the calculations that have been made.

3.1 Data analysis method Firstly, all the data displayed by the sensors (usually in mV) had to be converted into real physical values by using their sensitivity, which is how much voltage corresponds to a variation in the measurand (ex: a sensitivity of 73.7 V/W/m2 means that, for every 1W/m2, the voltage of the sensor will vary by 73.7 V). To do so, every single Excel file that was available had to be opened and added the calculation formulas for each value into a new sheet named “Calculated values”, sheet that will be used for all of the following work. These calculated values are obtained from the sensors’ sensitivities (Table 1, part 2.2) and the data loggers’ output, shown in appendix 2. MATLAB has then been used in order to regroup all the different Excel sheets into one big table in order to have a much more simplified approach to have the Excel VBA program (following in 3.2) running on one single Excel sheet. Then the “Writetable” function has been used in order to convert the table into an Excel file that will be used for the coding section. The code used to achieve all of this is shown in appendix 3. Now that the data is ready to be treated in Excel VBA, MATLAB can still be used to create graphs using the “Plots” window and create stacked graphs for any value in order to check if everything is normal, and if no calculation or acquisition error has occurred [4].

Page 10: Analyzing and Displaying Data from a PV System - Excel VBA

9

3.2 Calculations In addition to all the data that has been measured, additional values have also been calculated, such as:

➔ The monthly energy generation (Wh), displayed over the total period of study (2015-2020), obtained by the multiplication of the output AC power (W) and the time (h). The energy is given by the simple formula:

𝐸𝐸 = 𝑃𝑃 ⋅ 𝑡𝑡 [rel.1]

➔ The efficiency of the installation, obtained with the total AC power output of the array as well as the solar power taken at the same time (every value in W):

𝜂𝜂 = 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑝𝑝𝑆𝑆𝑝𝑝𝑝𝑝𝑆𝑆𝐴𝐴𝐴𝐴 𝑆𝑆𝑜𝑜𝑜𝑜𝑝𝑝𝑜𝑜𝑜𝑜

[rel.2]

➔ The total AC (inverted output power) and DC (module output before inversion) power generation for all the system, which simply adds the two subsystems’ respective AC power together and DC power together. This was mainly used to obtain the energy output and the efficiency of the system.

𝑃𝑃 𝐴𝐴𝐴𝐴, 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 = 𝑃𝑃 𝐴𝐴𝐴𝐴, 𝑠𝑠𝑠𝑠𝑠𝑠𝑡𝑡𝑠𝑠𝑠𝑠 1 + 𝑃𝑃 𝐴𝐴𝐴𝐴, 𝑠𝑠𝑠𝑠𝑠𝑠𝑡𝑡𝑠𝑠𝑠𝑠 2 [rel.3]

𝑃𝑃 𝐷𝐷𝐴𝐴, 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 = 𝑃𝑃 𝐷𝐷𝐴𝐴, 𝑠𝑠𝑠𝑠𝑠𝑠𝑡𝑡𝑠𝑠𝑠𝑠 1 + 𝑃𝑃 𝐷𝐷𝐴𝐴, 𝑠𝑠𝑠𝑠𝑠𝑠𝑡𝑡𝑠𝑠𝑠𝑠 2 [rel.4]

3.3 Programming method 3.3.1 User interface In order to automate the tasks, the program has been created using Excel VBA. The goal of this program is to allow a user to simply display the data that they wish over any period of time. To do so, different user forms in VBA such as “Message Box” an “Input Box” have been used: the first one displays a message to the user: this message can be displayed to inform the user of an error or to give some information. The second one is used to ask the user to input information by writing it down. This one has been used a lot with regard to allow the user to be as free as possible and be able to have the greatest control over the program. Four command buttons that each activate a different program have been used to make it easier for the user to know what will be displayed and have a more intuitive guidance throughout the program utilization. The Fig.5 shows different command buttons that allows the user to choose the time length of the wanted data:

• Daily Data: The program will display the data for one day at a certain chosen date. • Monthly Data: The program will display the data for one chosen month at a certain date. • Custom mode: The program will display the data for any wanted period of time at a

certain date. • Instruction: Some information will be displayed on how to use the program.

Page 11: Analyzing and Displaying Data from a PV System - Excel VBA

10

Fig.5 Picture of the command buttons

In addition to the VBA programs, the user also has the possibility to use “pivot graph” to display the energy. Pivot graph is an excel tool that allows the user to create dynamic graphs, meaning that it is possible to change the time frame to display only certain parts of it by simply clicking on the time period. The only drawback of pivot graph is that that it displays the sum of the power hence the energy output. This is why the VBA program complements the pivot graph pretty well, because it will display every point of the power output. A comparison between the two time resolutions given by the two different methods is shown in Fig.6.

Fig.6: Comparison of different time resolutions over the same time frame

(Above: VBA graph; Below: Pivot graph)

In order to make it as practical as possible for the user to use the program, a dashboard has been created on excel and features, in the same page, the VBA program, the pivot graph and the efficiency graph (Appendix 4). Once the program was finished and all the data was put into the same file, the file was too big to run smoothly so it has been broken into several parts. The dashboard will of course be kept as the main file but in addition to that, different yearly files have been created in the VBA programming to make it as small as possible but still convenient to use. The user will also be able to include all of the future measurements to the program, which will give the calculated values from the raw measures and include them after the previous data. The user will mainly interact with the dashboard as all important features are displayed on this sheet, but can also, if wished, have the access to the developing section, where the code is, and to the sheet with all the measured data.

Page 12: Analyzing and Displaying Data from a PV System - Excel VBA

11

3.3.2 Program The following flow chart (Fig.7) summarizes the basic steps of the program for the custom mode (shown in 3.3.1). The program will now be explained in more details, step by step before Fig.7 that will present it in a more pictured way. Step 1: Selection of the program To show an example, the chosen program is the “Custom mode” as described before. Firstly, the user has to activate one of the four command buttons shown in Appendix 4, which are “Daily data”, “Monthly data”, “Custom mode” and “Instruction”. These four buttons will each start a different program. Step 2: Input of the time parameters Afterwards, the user is asked to enter a date so the program will have a starting point to display the graph. The function “find” has been used to reach this date (Appendix 5). This function will search the first time the date appears, making it the beginning of the new graph. It is also possible to enter a certain time of the day for the custom mode to mark the beginning. The user is then asked to enter the time period they wish to display. This time period can be entered in days or hours but must be specified by an input (Appendix 6). Step 3: Creation of the graph Then, the user is asked to name a new sheet where all the data from the selected time period will be displayed. When creating a new sheet, all the important data will be copied and pasted from the “main” sheet to the new one. Creating a new sheet makes it easier for the user because they will not have to spend time looking for the data in the first sheet where all the data from the 5 years are. It makes it easier for the programmer too because the function “end (xldown/up) “can be used to create graphs, that will take all the data in a row disregarding how many lines there is. The user can now choose which data they want to be displayed on the graph. An “input box” has been used to have this kind of multiple answer possible (Appendix 7).

Page 13: Analyzing and Displaying Data from a PV System - Excel VBA

12

Fig.7: Flow chart of the VBA program

After the last step, a graph can be generated. Creating a graph using VBA is little trickier to do than just using regular excel. Indeed, creating require more steps which are shown in appendix 8 in the form of the code that has been used. At the end of the program, the user will have a new sheet with only the data from the selected time frame plus a graph of their choice. The user is then free to add some more values to the displayed graph.

Page 14: Analyzing and Displaying Data from a PV System - Excel VBA

13

3.4 Method discussion One important fact to note is that the acquisition from the data loggers is not continuous, meaning there are some gaps ranging from a few days to even a month in the Excel sheets. During this period of time no data is acquired, causing an impression of malfunction of the sensor due to a very low energy output. Another issue was with the attempt of putting together the two different data loggers. When the two loggers were put into the same excel sheet, the timestamps of every measurement didn’t match at all. A study upon further tests showed that sometimes in either logger 1 or 2, a small time period of around 10 to 20 minutes was missing for no apparent reason. This phenomenon occurs at seemingly random moment, so the two loggers will not be “synchronized” with a concern for the accuracy of the results. (More than 400,000 Excel lines would have had to be inspected, looked for every timestamp and manually removed or added lines to make the two loggers match). That being considered, the two data loggers have been given two respective Excel sheets in the final program. 4 Results and discussions

4.1 Meteorological data 4.1.1 Temperature

It would be interesting to plot some meteorological values, for information, or even to deduct some results if the opportunity presents. Thus, the following graphs represent the inside and outside temperatures of the air collector for respectively a January and an August day in 2017.

Fig.8: 1st of January temperatures

Page 15: Analyzing and Displaying Data from a PV System - Excel VBA

14

For a cold day such as the first of January (Fig.8), the temperature outside of the garage (inlet) is systematically lower than the inside temperature (outlet). Here, it can be assumed that the PVT air collector fills its role in order to use this temperature gap, thus cool down both the PV modules outside of the building and the inverter located inside, which is very likely to be improving the overall efficiency of the system.

Fig.9: 1st of August temperatures

For warm days such as the one presented in Fig.9, the difference between outside and inside temperature is smaller than for cold days, and the air collector might be less effective in that case. Indeed, even though it would of course still work, the efficiency gain would probably be lower than a case with a larger gap between the two temperatures. 4.1.2 Irradiance In addition to temperature records, irradiance data has also been accessible. Using this data, the user will be able to guess the weather for any recorded day, just by plotting the irradiance according to the time on the wished day. The next three Figures are proposed to show a comparison between the appearances of these irradiance plots according to different weathers.

Page 16: Analyzing and Displaying Data from a PV System - Excel VBA

15

Fig.10: Irradiance and DC output for a sunny day

To begin with, the study of a typical sunny day in Fig.10 is very interesting, since several different information can be brought from it. Firstly, it shows a “typical” October maximal irradiation value which is of around 600 to 700 W/m2 and can be used as a comparison variable with the next weather types. Moreover, clear irradiance drops can be seen in the morning as well as in the evening. These drops are most likely caused by the different shadow sources discussed in 2.1: in the morning, the neighbor’s house shadow covers the PV system, and then, in a large part of the afternoon, shadow is caused by the owner’s house itself, decreasing drastically the production over these two periods of the day. The reason why the power does not drop as harshly as the irradiance is that the pyranometer is only located on one point: when it is shadowed, some of the PV modules may still receive light.

Fig.11: Irradiance and DC output for a partly cloudy day

Page 17: Analyzing and Displaying Data from a PV System - Excel VBA

16

The Fig.11 shows the irradiance for a partly cloudy day. The maximal irradiance stays up to the standard value shown just before, with a maximum value of around 600 W/m2. Moreover, irradiance drops can be seen over the whole day, which correspond to clouds blocking partially the sunlight by interposing between the PV system and the Sun. Since after the pyranometer detects the sunlight in only one point, the reason why the power does not decrease as soon as the irradiance drops would be that only the area around the pyranometer is shadowed, and that a part of the PV system keeps on producing electricity, which would explain why the power curve does not suffer such huge drops throughout the day. Moreover, most of the received light is direct, so the times corresponding to the shadows caused by the two different houses in the vicinity can still clearly be seen, just as shown before in Fig.10.

Fig.12: Irradiance for an overcast day

For overcast days such as shown as Fig.12, since no direct sunlight is received by the pyranometer, the value of the irradiance is way lower than for the two other presented weather types. The fluctuation is probably caused by the variation of the cloud layer thickness additionned to the accuracy of the sensor. Since the irradiance is way smaller than the two other discussed weather types and varies slowly, the power follows almost exactly the same shape. In addition to this, the shadows from the houses are harder to see since the majority of the light is actually diffused by the clouds, which means that the different shadows appear less significantly.

Page 18: Analyzing and Displaying Data from a PV System - Excel VBA

17

4.2 Energy results 4.2.1 Energy production The Fig.13 is a bar chart showing the energy production over the four whole years that are under study (2015 and 2020 having incomplete data), displayed by monthly production by the Excel VBA program.

Fig.13: Energy production from 2016 to 2019 (energy in Wh)

The previous bar chart gives a usual energy variation over a year, showing this quasi-hyperbolic shape meaning that the production is obviously way higher in summer than it is in winter, especially for a country that is pretty far from the Equator such as Sweden. The June energy outputs usually stays around approximately 5 MWh, but is it realistic? And are these results viable? To answer this question, the example of the Dalarna University PV array can be taken as a comparison because, with a rated power output of 3.2kW, it usually produces around 2 MWh in total for the same period (source: [7]). These numbers being considered, these results look fairly realistic thanks to the comparison with this other PV system located in the vicinity of the studied system.

Page 19: Analyzing and Displaying Data from a PV System - Excel VBA

18

Fig 14: Energy production for one day in summer (above) and winter (below) (energy in Wh)

The Fig.14 displays the typical energy output for a day in summer and winter. The summer curve has this shape because of the clouds, as seen in 4.1.2. On the other hand, the winter curve shows barely any energy production and has only a very small peak at around midday, which corresponds to the small time frame when the Sun shows up in this region.

Fig 15: Energy production for one week in summer (above) and winter (below) (energy in Wh)

This figure (Fig.15) shows the energy production for a week, respectively in Summer and in Winter. For the Summer week, the seven peaks corresponding to the seven days of the week can clearly be seen, with the four first days being sunny days, and meteorological disturbance, most likely clouds, occurring for the three last days. In opposition to that, in Winter the production manages to break over zero on only three single days, most likely three days when there was not any cloud in the sky.

Page 20: Analyzing and Displaying Data from a PV System - Excel VBA

19

Fig 16: Energy production per trimester for four years (energy in Wh)

This graph gives a better understanding of when most of the energy is produced. Indeed, most of the energy is produced during trimester 2 and 3 (from April to September) while almost nothing is produced during the rest of the years. This is again due to the large difference in sun hours between summer and winter in Sweden.

Fig 17: Energy production for specific months (energy in Wh)

The Fig.17 graph gives a clear sight of the difference in monthly production for different months within different seasons of the years (March, June and November). This stresses out even more the fact that most of the energy is produced in summer, and that nearly nothing is produced in wintertime each year.

Page 21: Analyzing and Displaying Data from a PV System - Excel VBA

20

In addition to the electrical energy production, another study concerning a potential degradation rate over the years has been carried out. To do so, five different days over five different years while keeping the same conditions were taken: similar temperature and similar irradiation. The table 3 shows the five different days presenting the same conditions, as well as each of their different power outputs.

Table 3: Degradation study

Reading this table, at first sight, the output power seems to stay overall the same over the years. Indeed, considering similar conditions, there is apparently no significant negative difference between 2015 and 2019, for example. A reason for this would be that the time frame is too short, and that it would take a few more years before noticing any degradation on the PV system on the long term, or maybe the high number of parameters that could make the results less viable.

4.2.2 Efficiency

Fig.18: Average efficiency for 4 years (efficiency in %)

Page 22: Analyzing and Displaying Data from a PV System - Excel VBA

21

The initial way to use the efficiency was as a way to determine the rate of decay of the panel. Indeed, through the years, the panel will decay and therefore have a decreased efficiency. However, to display the efficiency the Power received from the sun and the AC Power output are needed: these two parameters being found on two different loggers therefore having two different time resolutions was making it impossible to create a chart with the efficiency for every point in time. What has been done was the usage of another pivot chart because this function automatically sums the Solar power and the AC power per month, respectively (the pivot chart is shown in appendix 9). With this method the problem is that sometimes a logger keeps on acquiring data while the other one is off, leading to some irrelevant result which have been corrected according to [4]. As enunciated before, a slight drop of efficiency over the years was to be expected, and it seems to be the case here: efficiency drops of 0,1 to 0,2% can clearly be seen between the years 2017, 2018 and 2019 in Fig.18. Of course, it can be distorted by how the efficiency is calculated, due to the gaps of data and the lack of synchronization, the result is probably too inaccurate to show a decay but when looking into a smaller time frame the data seems coherent (another chart showing the efficiency for every month is shown in Fig.19). As an example of inaccuracy, for the month of October 2018 and January 2019 one of the two loggers, logger2, was off most of the time hence the total solar power for these months was very low. However, in the meantime, the logger 1 on which the AC power production is acquired was working for the month. When carried out, the calculation of the efficiency was totally wrong (over 100%) so these two months had to be disregarded. What was done in the end to avoid as much as possible the errors was to always verify for the time period if the two loggers had the same amount of data. If they did not, then it was not relevant to calculate the efficiency.

Fig.19: Average monthly efficiency for 4 years (efficiency in %)

Fig. 19 shows the monthly efficiency for the four full years that were available, displayed by months. The normal hyperbolic shape is overall respected, with peak value varying from 10 to 15% efficiency in summer, which matches with Abd Alrahman’s findings [2], and winter efficiency never exceeding 5% which is what draws the yearly averages (Fig.18) so low. However, a peak over 20% has been recorded in September 2018: that can be due to a measurement error, a sensor could have not operated normally during this period or more likely the logger recording the Solar power was off while the logger recording the AC energy was on, inducing this peak.

Page 23: Analyzing and Displaying Data from a PV System - Excel VBA

22

4.3 Results discussion The results are plausible compared to other northern-hemisphere PV systems, as shown in the comparison made in 4.1.1 between this system and the one from Dalarna University. Moreover, it seems like no significant sensor error is occurring, viewing the order of magnitude of the results. Degradation is one of the main threats for PV systems: it stands as an unstoppable force that decreases the energy production over time. However, there are ways of reducing the degradation, for example by cleaning the PV modules, by keeping the temperature not overly high, or by preventing over voltages within the system using specialized equipment, even though it would add relatively a lot to the investment granted to the array. Moreover, shading is another obvious factor that can decrease the production: indeed, a shadowed PV module will produce less (if not zero) than a lighted one. This study’s results show that shading occurs during the early morning as well as in the afternoon. Apart from bulldozing any building in the near vicinity, there’s sadly no way to prevent shading to happen to this system. Finally, it has been proposed that the position of the sensors could impact the reliability of the measurements: the pyranometer may detect a cloud while some of the modules are lighted, giving a false idea of a non-production situation. A way of deflecting that would be adding more sensors and arrange them equally on the roof, giving an overall representation of the irradiance over the whole system and preventing such errors to happen.

4.4 Future work Right now, the work that can be done would be deeper calculations (such as economical approach), which will be possible for the user to add directly into the Excel program. Another task would be drawing more complex graphs which were not accessible throughout this study due to difficult times. Later in the PV system lifespan, a further study could also be done concerning its degradation over the years. Indeed, the current data is spread in a too short amount of time, which makes the calculation of a reliable degradation rate impossible.

Page 24: Analyzing and Displaying Data from a PV System - Excel VBA

23

5 Conclusions Throughout this project, a way of displaying all of the data in an intuitive and easy way thanks to Excel VBA has been achieved. Indeed, the ability for the user to be able to plot any wanted data, combined to any period of time with on top of that the capability of adding future data to this overseeing tool makes it simple while as exhaustive as possible. This work has also granted the access to a large variety of data that was available for analysis thanks to the MATLAB analysis tool. Indeed, it enabled the opportunity to ascertain the veracity of the measurement as well as of the calculations made, by plotting different graphs that were used to define the PV system performance, such as the energy output for certain periods of the year, that matched well with other PV systems performance with a close rated power in the vicinity. Moreover, the calculated electrical efficiency of the panel matches the expectations: efficiencies at peak production of about 12 to 14% have been found, which matches pretty well with the theoretical value that was supposed to be around this interval. Given the high number of parameters influencing this value, the results are still to be taken with a pinch of salt. In addition to these values, the access to meteorological and temperature data that have been analyzed in order to make the user able to access a weather database has been granted. Indeed, just by analyzing the shape of a simple XY graph, the weather of a certain day can be determined for informational purposes.

Page 25: Analyzing and Displaying Data from a PV System - Excel VBA

24

6 References [1]: Dictionnaire environnement, Standard Test Conditions, 2010 (FR) [Online] available: https://www.dictionnaire-environnement.com/standard_test_conditions_stc_ID3106.html [2]: C. Abd Alrahman, ‘Evaluation of a PVT Air Collector’, M.S. Thesis, Dalarna University, Borlänge, 2015. [3]: J. Machacek, Zdenek Prochazka and J. Drapela, "System for measuring and collecting data from solar-cell systems," 2007 9th International Conference on Electrical Power Quality and Utilisation, Barcelona, 2007, pp. 1-4. [4]: Ascencio-Vasquez, Julian & Topic, Marko, “An Overall Data Analysis Methodology for PV Energy Systems”, 53rd International Conference on Microelectronics, Devices and Materials, Ljubljana, 2017.

[5]: M. Díez-Mediavilla, C. Alonso-Tristán, M.C. Rodríguez-Amigo, T. García-Calderón, M.I. Dieste-Velasco, Performance analysis of PV plants: Optimization for improving profitability, Energy Conversion and Management, Volume 54, Issue 1, 2012, Pages 17-23, ISSN 0196-8904, [6]: WALKENBACH John 2004. VBA pour excel 2003. Edition Eyrolles ,780p [7]: Sunny Portal, Högskolan Dalarna Monthly report. Accessed: May 2020, [Online] available: https://www.sunnyportal.com/Templates/PublicPageOverview.aspx?page=b6778e03-1a854631-831e-5c5e3dc9a41b&plant=467cfead-7076-4769-a96e-18fdccac65bd&splang=en-US

Page 26: Analyzing and Displaying Data from a PV System - Excel VBA

25

Appendices

Appendix 1 – Solibro PV modules datasheet (2 pages) Here is the datasheet of the PV modules that have been used for the object of this

study, as well as their technical specifications.

Page 27: Analyzing and Displaying Data from a PV System - Excel VBA

26

Page 28: Analyzing and Displaying Data from a PV System - Excel VBA

27

Page 29: Analyzing and Displaying Data from a PV System - Excel VBA

28

Appendix 2 - Data loggers datasheet (2 pages) Here is the datasheet of the data loggers that have been used for the object of this study, as

well as their technical specifications.

Page 30: Analyzing and Displaying Data from a PV System - Excel VBA

29

Page 31: Analyzing and Displaying Data from a PV System - Excel VBA

30

Appendix 3 - MATLAB code used to compile the data This code was used to regroup every Excel sheet into one, using a simple MATLAB code that

basically tracks every input table and add them into another single one

Appendix 4 - Excel program dashboard This is how the program looks like when finished

Page 32: Analyzing and Displaying Data from a PV System - Excel VBA

31

Appendix 5 - Function find in VBA This function has been used in the Excel program to search for a date and time when the user

wants to display data for a specific day.

Appendix 6 - Time period selection These are the dialogue boxes that are displayed for the user to input the wished time

resolution.

If “D” is entered the following message will be displayed

Page 33: Analyzing and Displaying Data from a PV System - Excel VBA

32

Appendix 7 - Data selection This dialogue boxed is displayed for the user to enter which parameter they want to study.

Appendix 8 - VBA code used to create a graph This code has been used in order to create graphs within the program

Page 34: Analyzing and Displaying Data from a PV System - Excel VBA

33

Appendix 9 Pivot table of the efficiency This pivot table has been used to create a large amount of different graphs