# Faults Detection in a Photovoltaic Generator by Using Matlab Simulink and the chipKIT Max32 Board

Authors: Riadh Khenfer; Mohamed Mostefai; Seddik Benahdouga; Mounir Maddad
Journal: International Journal of Photoenergy
 (2014)

---

## Abstract

This paper presents a laboratory with equipment and an algorithm for teaching graduate students the monitoring and the diagnosis of PV arrays. The contribution is the presentation of an algorithm to detect and localize the fault, in photovoltaic generator when a limited number of voltage sensors are used. AnI-V curve tracer using a capacitive load is exploited to measure the I-V characteristics of PV arrays. Such measurement allows characterization of PV arrays on-site, under real operating conditions, and provides also information for the detection of potential array anomalies. This I-V curve tracer is based on a microcontroller board family called chipKIT Max32 which is a popular platform for physical computing. A user program can be developed visually on a PC side via the graphical user interface (GUI) in Matlab Simulink, where the chipKIT Max32 of Digilent which is a low-cost board is designed for use with the Arduinompid software. The obtained results from the partial shade default showed the effectiveness of the proposed diagnosis method and the good functioning of this board with the Matlab/Simulink environment.


---

## Body

## 1. Introduction

The photovoltaic power generation has been widely spread in different applications, ranging from space systems to the residential and commercial installations in buildings, telecommunication stations, power plants, and industrial applications [1].During operation, a PV generator is subject to several defects. The most commonly encountered mismatch in the PV generator is the partial shade. This defect greatly minimizes the output power and makes the control of the converters ineffective, because the power delivered by the generator may have several maxima [2, 3]. This can happen, in particular, when the protective diodes (bypass diodes) of the PV cells are closed.Also, the operation of a PV generator in the presence of several defects and anomalies causes a decrease in the performance or total unavailability of the system. All these adverse consequences are obviously going to reduce productivity and therefore reduce the performance of the plant and increase the cost of maintenance to make the system operating in normal state.To minimize the unavailability period and maximize the performance and efficiency of PV systems, the diagnosis and the monitoring of PV system operation are essential.I-V curve measurements provide direct performance characterization and verification as well as a diagnostic tool for periodic PV system performance assessments. TracingI-V curve is the most informative measurement that can be performed on a PV module or array. AnI-V curve tracer is the best way to gain an understanding of the change based on ambient conditions and array problems, since it provides a graphical representation of the array operating characteristics.The most precise and inexpensive measuring method is represented in capacitor charging by the PV generator. Using the equivalent circuit of the PV generator with a capacitor as load and applying on it a transient analysis, we obtain the capacitor charging voltage and current as a function of time, as well as their differentials, depending on short circuit current and capacitor size [4, 5].In this work the developed tracer of theI-V characteristic based on the use of graphical user interface (GUI) by using Arduino Support from Matlab Simulink which is intended for Arduino boards and by using the chipKIT Max32 board of Digilent, where the chipKIT Max32 platform helps students understand the workflow for designing an embedded system without using manual programming. Students can use Simulink to create algorithms for control system and robotic applications. They can apply industry-proven techniques for model-based design to verify that their algorithms work during simulation.Using, the (GUI), the mismatch of partial shade is detected and the shaded groups of panels are located; in addition, the outputs of the model which are the I(V) and P(V) characteristics and also the voltage, current, and power at the maximum power point (MPP) of the PV array are presented.


## 2. Detection and Localization Method

A monitoring system must achieve three main tasks, detection which consist to take a binary decision, either the system works properly or a failure occurred.The localization: its role is to determine the defective components; the identification consists of determining the shape of the failure in order to determine the nature of maintenance or correction that should be made.Recent approaches offer new types of PV panels’ connections other than the standard serial and parallel connections by adding a certain number of current and voltage sensors. The comparison of these currents leads to locating the location of the photovoltaic panels that are faulty. The use of certain fusions rules of data helps to improve the decision making and the fault localization, these methods are not effective on conventional connections [6, 7].The proposed method of faults detection and localization is to use a minimum number of voltage sensors in a group ofn  panels, connected in a classical way and presented as a string of N series groups in Figure 1.Figure 1
Structure of a PV string and the connected voltage sensors on each group.The total voltage delivered by the string is given by the following equation:(1)Vs=∑i=1NvGi.Vs is the voltage with a string and vGi is the voltage delivered by a group. In the case of normal operation (D=0), the voltage of a group is given by the following equation:
(2)vGi=n·v.Withv as the voltage panel and n as the number panel in a group. In the case of a defect (D=1) in a group, the voltage of the group will be as follows:
(3)vGi=(n-k)·v+∑j=1kvk,
where k is the number of panels in failure, in a group, vk is the voltage of the defected panel, D is the signal of the absence or presence of the defect, and j is the number of defected panels.To fulfill the detection and localization, we have to compare the measured voltagesvGi of each group with a threshold S calculated from the model equations, depending on weather conditions, uncertainties of the system, and instrumentation measures.Consider(4)S=vGe-ϵ,
where vGe is the estimated voltage of the group and ϵ is the uncertainty on the system and the instrumentation measures.The decrease ofvGi voltage under the threshold makes the signal D equal to 1, which means that the group i is defected as shown in Figure 2.Figure 2
Fault detection algorithm.WhereT is the temperature of the PV panels, G is the solar radiation.


## 3. Obtaining theI-V Characteristic by the Use of a Capacitor Load

The method is based on biasing the PV module by a large capacitor, which is charged, while the ancient pass from short circuit to open circuit. A schematic circuit using this principle is shown in Figure3.Figure 3
PV module biasing with capacitor load.At the beginning of the measurement, the capacitor is short-circuited, and when the switch S2 is opened and the Sl is closed, loading of capacitors starts. As the charge of the capacitor is increasing, the current is dropping and voltage rises.When the charge is completed, the current supplied by the module becomes zero and the open circuit condition is achieved. Instead of beginning in short circuit, we could start with S3 closed, so the capacitor initially would be charged to negative voltage, and theI-V curve crosses the axis of current, in order to get the current of short-circuit (ISC). To obtain a reliableI-V curve with the capacitor method, the three switches (S1, S2 and S3) must be activated with the appropriate sequence, and the capacitor’s prior discharge is needed to start a new measurement [8].


## 4. Electronic Design

### 4.1. Power Circuit

In Figures3 and 4 the schematic of the real power circuit that we have developed is shown. Comparing it with the ideal capacitive load, the switch S1 can be identified as the Relay (REL1) and S2 and S3 as the Relay (REL2). The electrical characteristics of these function and remainder power circuit components are the following.(i)
REL1 connects the PV array with the capacitors (C); many capacitors can also be connected two in series and two in parallel for measuring and that depends on the required value of the voltage(VOC) and capacitor.(ii)
REL2 allows the discharge of the capacitors through the resistorRdc before performing a newI-V sweep. This discharging process takes several seconds.(iii)
Subcircuit composed of REL2 (S2), resistorRc, and voltage source Vb is used to recharge the capacitors with a negative voltage before measuring theI-V curve. This negative voltage compensates the voltage drop across load components (diodes, wiring, etc.,) ensuring that the array voltage starts in the second quadrant (V<0, I>0) and crosses the short-circuit point (V=0, I=ISC).Figure 4
Electronic structure of power and control circuits.Diode D2 prevents the discharge of the capacitors throughRdc when the negative voltage is applied.


### 4.2. Drive and Control Circuits

Each Relay is switched from off state to on state, and vice versa, by a drive circuit, whose schematic is shown in Figure4. The core of the circuit is consisting of transistors T1 and T2 and optocouplers OP1 and OP2, which operates as following. Optocouplers OP1 and OP2 are connected, respectively, to the pins 9 and 11 of the chipKIT. When OP1 is turned on, the transistor T1 is on, then the Relay (REL1) is closed and the capacitor is charged by the PV generator. On the contrary, when OP1 is turned off, the transistor T1 is off, then the Relay REL1 is opened and the capacitor is discharged.When OP2 is turned on, the transistor T2 is on, then the Relay REL2 is closed and the capacitor is charged with a negative voltage by the Vb battery.The signals generated by pins 9 and 11 of the chipKIT Max32 are complementary.The chipKIT Max32 board is inserted in a board for voltage measurement and the HX3-10p sensor is used for the current measurement.


## 4.1. Power Circuit

In Figures3 and 4 the schematic of the real power circuit that we have developed is shown. Comparing it with the ideal capacitive load, the switch S1 can be identified as the Relay (REL1) and S2 and S3 as the Relay (REL2). The electrical characteristics of these function and remainder power circuit components are the following.(i)
REL1 connects the PV array with the capacitors (C); many capacitors can also be connected two in series and two in parallel for measuring and that depends on the required value of the voltage(VOC) and capacitor.(ii)
REL2 allows the discharge of the capacitors through the resistorRdc before performing a newI-V sweep. This discharging process takes several seconds.(iii)
Subcircuit composed of REL2 (S2), resistorRc, and voltage source Vb is used to recharge the capacitors with a negative voltage before measuring theI-V curve. This negative voltage compensates the voltage drop across load components (diodes, wiring, etc.,) ensuring that the array voltage starts in the second quadrant (V<0, I>0) and crosses the short-circuit point (V=0, I=ISC).Figure 4
Electronic structure of power and control circuits.Diode D2 prevents the discharge of the capacitors throughRdc when the negative voltage is applied.


## 4.2. Drive and Control Circuits

Each Relay is switched from off state to on state, and vice versa, by a drive circuit, whose schematic is shown in Figure4. The core of the circuit is consisting of transistors T1 and T2 and optocouplers OP1 and OP2, which operates as following. Optocouplers OP1 and OP2 are connected, respectively, to the pins 9 and 11 of the chipKIT. When OP1 is turned on, the transistor T1 is on, then the Relay (REL1) is closed and the capacitor is charged by the PV generator. On the contrary, when OP1 is turned off, the transistor T1 is off, then the Relay REL1 is opened and the capacitor is discharged.When OP2 is turned on, the transistor T2 is on, then the Relay REL2 is closed and the capacitor is charged with a negative voltage by the Vb battery.The signals generated by pins 9 and 11 of the chipKIT Max32 are complementary.The chipKIT Max32 board is inserted in a board for voltage measurement and the HX3-10p sensor is used for the current measurement.


## 5. Matlab/Simulink Environment and the Max32 Board

Matlab is one of the representatives of high-performance language for the CACSD, where Simulink environment is known as a software package for modeling, simulating, and analyzing dynamic systems.Matlab supports linear and nonlinear systems, modeled in continuous time, sampled time, or a hybrid of the two. Simulation is an interactive process, so one can change parameters “on the fly” and immediately see what happens. One has instant access to all of the analysis tools in Matlab, so one can analyze and visualize the results.With Simulink, one can move beyond idealized linear models to explore more realistic nonlinear models. For modeling, Simulink provides a graphic user interface (GUI) for building models as block diagrams, using click-and-drag mouse operations [9].The chipKIT Max32 is a microcontroller board based on the microchip PIC32MX795F512L, a member of the 32-bit PIC32 microcontroller family. The Max32 boards are compatible with the popular Arduino microcontroller board shields. The Max32 is designed to be easy to use and suitable for use by anyone from beginners to advanced users for experimenting with electronics and embedded control systems. The Max32 is intended to be used with the Multi-Platform IDE, (modified Arduino IDE), MPIDE, and contains everything needed to start developing embedded applications [10].To operate the chipKIT Max32 correctly with Matlab, initially download and install the Arduino IDE and driver, ensure that you select the right IDE and Board on the Tools menu (chipKIT Max32), and then connect your chipKIT Max32 board to the USB port and Find the COM port associated with chipKIT. At this time we can explore the Arduino library of device driver blocks in Matlab Simulink. The required Matlab is R2011b or the more recent.For our application, two analog inputs are required to measure current and voltage of the photovoltaic generator (PVG).For our measures the Arduino IO Analog Read block is used. Every time this block is executed it asks the server program running on the Max32 to perform an analog input that reads the voltage from on a given pin and to return the value (0 to 1023) via serial port. This value is then set as the output of the block [11].A digital filter and a gain are used to reconstruct the current and the voltage of our PVG. We also need two signals for controlling optocouplers and that is to close the Relay REL1 when the capacitor is charged by the PV generator and to close the Relay REL2 when the capacitor is charged with a negative voltage by the Vb battery for generating these control signals we used the block Arduino IO digital write; every time this block is executed it gets the value (0 or 1) at its input and sends to the server program running on the chipKIT Max32 a command to set that value as the digital output of a given pin. These blocks are preceded by a step of generating signals with an adequate time for the charging and discharging of the capacitor.It is essential to use the block Matlab (Arduino IO Setup). This block instantiates an Arduino object before starting simulation. The object is then used by the other Arduino IO blocks in the Simulink model and is deleted at the end of the simulation. The first mask parameter is the name of the Arduino object and the second is the serial port which is connected to it.Another block that is necessary to use is the Real Time Pacer block. The Real Time Pacer block slows down “paces” simulation time to track real elapsed time. The degree of slowdown is controllable via the Speedup parameter.Figure5 Shows the Simulink Matlab model.Figure 5
Matlab Simulink interface for control and data acquisition via chipKIT Max32.


## 6. Experimental Results

The performance of the proposed fault detection method has been experimentally verified by testing a new PV panel produced by Algerian societies (CONDOR). The PV module is formed by series connection of sixty solar cells and includes a bypass diode for each twenty solar cells.For the proposed fault scenarios of this test system, we consider a string that consists of six PV panels connected in series. This string is composed in turn of three groups (G1, G2, and G3), Figure6(a). Each group consists of two panels; and we have considered the following mismatch.Structure of a PV string and the partial shading in each group.
(a)
(b)
(c)In the first scenarios we have considered no faults in the PVG, Figure6(a). In the second we have taken a shadowing of one cell, which belongs in group G3 (square white spot), Figure 6(b). And finally, a shadowing which is a square white spot in two cells in groups G2 and G3 is considered, Figure 6(c).Figure7 shows the laboratory experimental prototype developed to obtain the results described in this paper. The prototype was developed to measureI-V curves of PV modules and to detect the defected panels group.Figure 7
Implemented system.Graphical user interfaces (GUI) shown in Figures8, 9, 10, and 11 are made of two principal buttons control,I-V andP-V plot and fault detection and localization.Figure 8
Screenshot of the GUI in case of inshaded groups.Figure 9
Screenshot of the GUI in case of partial shading in G3.Figure 10
Screenshot of the GUI in case of inshaded groups.Figure 11
Screenshot of the GUI in case of partial shading in G2 and G3.In the GUI, theI-V andP-V plot buttons allow us to draw the curvesI-V andP-V and therefore have deferent electrical points of our PV generator, the open circuit voltage VCO and the short circuit current ISC, and the current and the voltage at the MPP.The button of faults detection and location allows us to compare between the operating point of each group and the operating MPP by applying the algorithm explained above Figure2.A voltage measurement error ofϵ=±3v is added to the MPP of each group to obtain the threshold voltage, only if the voltage of a group is above or below the threshold of the group concerned is reported as defected. The defective group is indicated by the red in Figures 9 and 11.In the case of no partial shade in a PV generator, Figure6(a), theI-V andP-V curves present no inflection point, Figures 8 and 10. By cons, in the case of partial shading in the G3 group, Figure 6(b), it is clear that the curve is changed; that is due to the conduction of the by-pass diode of the partially shady group, Figure 9. In the same way in the case of partial shading in groups G2 and G3, Figure 6(c), several peaks are observed because the by-pass diodes in G2 and G3 groups are in conduction, Figure 11.The start of the detection and localization of spot as well as theI-V characteristic tracing can be made automatically or in a manual way.


### 6.1. Automatic Step

In the step during each 5 mn the detection and localization procedure is executed; if the PVG is defected it is automatically disconnected from the load and theI-V andP-V characteristic is plotted; electrical values are displayed in the GUI.


### 6.2. Manual Step

In the manual case, detection, localization, and tracing of theI-V andP-V characteristic are launched directly.The results presented in Figures8, 9, 10, and 11 show us the correct functioning of the algorithm presented and the experimental system developed.


## 6.1. Automatic Step

In the step during each 5 mn the detection and localization procedure is executed; if the PVG is defected it is automatically disconnected from the load and theI-V andP-V characteristic is plotted; electrical values are displayed in the GUI.


## 6.2. Manual Step

In the manual case, detection, localization, and tracing of theI-V andP-V characteristic are launched directly.The results presented in Figures8, 9, 10, and 11 show us the correct functioning of the algorithm presented and the experimental system developed.


## 7. Conclusion

We have presented laboratory work equipment based on a Max32 board and a method for fault detection and diagnosing of PV systems. In the literature and in the official website of Digilent we find no information that this board can be used with Matlab. The results presented in this work show the possibility to exploit the Arduino library of Matlab Simulink for the chipKIT Max32.The proposed algorithm provides the faults detection and localization of a group which is working in partial shading of the PV generator string. The developed platform allows the acquisition and the control of all necessary data from the PV system, using this one, we can trace theI-V/P-V curves and visualize the electrical parameters, and allows us to detect the defect of the group with precision. All these data and the dynamic system behavior are visualized by graphical interface developed with Matlab Simulink. The obtained results showed the effectiveness of the proposed method and the good work of the Max32 board with Matlab environment.



---

*Source: 350345-2014-05-28.xml*