A Fault Diagnosis Mechanism with Power Generation Improvement for a Photovoltaic Module Array

: This paper aims to develop an online diagnostic mechanism, doubling as a maximum power point tracking scheme, for a photovoltaic (PV) module array. In case of malfunction or shadow event occurring to a PV module, the presented diagnostic mechanism is enabled, automatically and immediately, to reconﬁgure a PV module array for maximum output power operation under arbitrary working conditions. Meanwhile, the malfunctioning or shaded PV module can be located instantly by this diagnostic mechanism according to the array conﬁguration, and a PV module replacement process is made more efﬁcient than ever before for the maintenance crew. In this manner, the intended maximum output power operation can be resumed as soon as possible in consideration of a minimum business loss. Using a particle swarm optimization (PSO)-based algorithm, the PV module array is reconﬁgured by means of switch manipulations between modules, such that a load is supplied with the maximum amount of output power. For compactness, the PSO-based online diagnostic algorithm is implemented herein using a TMS320F2808 digital signal processor (DSP) and is experimentally validated as successful to identify a malfunctioning PV module at the end of this work.


Introduction
A plunge in the output power of a photovoltaic (PV) module array is seen due to a shadow or malfunction event in [1,2]. Furthermore, an current-voltage (I-V) curve distortion in a PV module array results in a multiple peak problem along a power-voltage (P-V) characteristic curve. As a consequence, a maximum power point tracker (MPPT) in a power conditioner is likely to be trapped at a local, rather than the desired global, maximum power point (MPP). Even though the global maximum power point (GMPP) can be successfully tracked as expected on a P-V characteristic curve with multiple peaks [3,4], the overall power generation efficiency deteriorates in a heavily shaded case, and little improvement is made accordingly because a PV module array is not built with adaptive configuration. For this sake, a PV module array is made up of a fixed part and an adaptive bank, as presented in [5]. In the case of a partially shaded event, the adaptive bank is connected to the fixed part through array switches as an effective way to reduce the shadow effect on the operation of a power system. Nonetheless, this scheme requires a great number of voltage/current sensors and switches to connect an adaptive bank to a fixed part. It also particularly requires a tremendous amount of PV modules deployed in an adaptive bank to achieve a high output power level. Therefore, it is an impractical strategy in terms of cost. In addition, as put forward in [6], a PV module array is reconfigured in a way that deploys an MPPT on each branch to reduce the module shadow or malfunction effect. This approach is validated as effective in respect to the improvement in the overall power generation efficiency, but it requires a greater number of DC-DC converters, leading to a rise in the facility cost. As in [7], a shaded PV module goes offline, not to deteriorate the overall output power performance, but at the cost of a highly complex array configuration and a greater number of switches between modules. The static array configuration proposed in [8] does not require sensors or switches, and the PV modules are arranged in such a way that the shade is not concentrated but dispersed all over the PV module array. However, the dispersion of shade in the proposed arrangement has to be preformed in advance for different series and parallel connections. Therefore, it is only suitable for a specific number of PV module connections, and a considerable number of cables are needed for reassembling the configuration. Some mismatch mitigation techniques using power electronics integrated for PV modules are developed in [9,10] to become smart PV modules, but more complex module-integrated topologies/converters should be required, thus increasing the cost.
So far, there has been a great volume of published studies on PV module array malfunction diagnosis. As in [11], a method to detect PV array faults and partial shading in the PV system was proposed under all irradiation conditions using the measured array voltage, array current, and irradiance. However, this proposed method can only classify the status of the PV module array into three possible scenarios-normal operation, partial shading, and fault. A simple online fault detection method for PV systems using the available data of PV array voltage and current by means of wavelet packets was presented in [12]. However, this method can only detect the line-line fault with one or more than one module mismatch and partial shading occurrence. As shown in [13], a simple and effective approach was adopted for the automatic diagnosis of fault module strings in PV systems, which is based on the real-time operating voltage of PV modules. The analysis of PV string failure includes several electrical fault scenarios and their impact on the PV string characteristics. Nevertheless, this method can only locate the faulty strings. One major disadvantage of all the above-mentioned methods [11][12][13] is that the malfunctioning modules cannot be located. Another disadvantage is that if the malfunction of the module happens, these methods will fail to provide an improvement in the output power before the replacement. As suggested in [14][15][16], a fault diagnosis is made on the basis of field test results, while it might result in output power performance deterioration or even put operators in danger if a PV power generation system is not properly wired. Another problem is that this approach is developed to diagnose a case in a seriously abnormal operation, not a shaded or malfunction case, and it lacks a way to improve the output performance as well. An extension-based model and a PSIM circuit-oriented simulator model [17] are built for fault diagnosis and a nonlinear PV source, respectively, and give an accurate diagnosis due to a good agreement between computer simulations and experimental results. However, not taking into consideration the blocking and bypass diodes, the mathematical models result in errors in the output characteristic curves for a malfunction case.
In addition, there are few large-scale projects on fault diagnosis for PV module arrays worldwide other than photovoltaic operation using satellite data (PVSAT) co-conducted by Switzerland, Germany, and the Netherlands [18][19][20]. In PVSAT, the operation of gridconnected PV systems is monitored and remote failure detection is made based on a comparison between satellite and ground station meteorological data as the parameters for atmospheric simulation purposes and is based on another comparison between simulated and measured output performance. Needless to say, PVSAT is definitely a high-cost project because it involves satellite-based meteorological observation and is developed for commercial grid-connected, rather than stand-alone, PV power generation systems [21]. For this sake, each branch's current and voltage are detected as a way for online fault detection using a microcontroller-based measurement technique [22]. All it takes is simply a voltage/current comparison among all the branches, and the fault zone is indicated on an LED display. Yet, a clear disadvantage is that a fault cannot be located accurately once the same fault is shared by all the branches, namely, the same voltage and current are seen over branches. As in [23], the output performance of a PV module array was simulated using Solar Pro software and was collected under various working conditions, i.e., solar radiation, module temperature, and malfunction. An extension neural network (ENN) based analysis was conducted on the collected data, and the analysis results were then transmitted to a human-machine interface for real-time display via a ZigBee wireless network module. Nevertheless, a major disadvantage is the aging problem resulting from a long-term operation of a PV module array, which leads to a deteriorated diagnostic accuracy. Besides, modifications must be made for all the characteristic parameters once a PV module array is reconfigured. An optimal configuration of photovoltaic module arrays based on adaptive switching controls was proposed in [24]. This study proposed a strategy for determining the optimal configuration of photovoltaic (PV) module arrays in shading or malfunction conditions. If shading or malfunctions of the photovoltaic module array occur, the module array immediately undergoes adaptive reconfiguration to increase the power output of the PV power generation system. However, this strategy only provides power generation performance improvement using simulation and does not propose a fault diagnosis method. A binary search-based fault detection system [25] was proposed for PV modules to ameliorate the deficiencies in the existing fault detectors for PV module arrays. To overcome multi-node voltage detection and reduce the number of integrated circuit components, an analog switch was used to perform detection channel switching. However, when the system gets larger, the time of fault diagnosis becomes longer, and the accuracy decreases. In recent years, some fault diagnosis technologies of photovoltaic module arrays were carried by using infrared and optical imaging equipment carried by unmanned aerial vehicles (UAVs) [26][27][28]. However, in order to improve the accuracy of diagnosis, high-priced and high-pixel lenses must be used so that the cost of maintenance cannot be reduced.
In light of this, this work presents a novel PV module array configuration requiring a single MPP tracker and a typical number of switches. In case of any partial shadow or malfunction event, a particle swarm optimization (PSO)-based algorithm is enabled as a way to deliver the maximum amount of output power to load by means of switch manipulations. In the meantime, the malfunctioning PV module can be located instantly according to the PV module array configuration for a prompt module replacement.

Effect of Array Configuration on Output Performance
There are a great number of ongoing studies on PV module array configurations [29,30]. The most common configurations can be categorized into three types, namely, (i) series array, (ii) parallel array, and (iii) series-parallel (SP) array, each of which is depicted as follows. In the series configuration, all the PV modules are connected in series, resulting in a tremendous drop in the output current once there are shaded or malfunctioning modules. In the parallel configuration, all the PV modules are connected in parallel, but, in analogy with the series configuration, a major disadvantage is a plunge in the output voltage as the shadow or malfunction effect. As its name indicates, in the SP configuration, all the PV modules are connected in series and then in parallel, and it appears as an easy-to-implement and the most common configuration. However, the above three configurations will greatly reduce the output power of a PV module array due to module shading or failure [31,32]. In the bridge-linked (BL) configuration, all the PV modules are bridge linked, but a major problem is that the behaviors of neighboring modules are found susceptible to a shaded one, leading to a deterioration in the overall output performance [31]. Particularly, there is no way to integrate a global MPP tracker into this type of array configuration. In the honey-comb (HC) array configurations, all the PV modules are configured as a honeycomb [32]. It is developed as a way to reduce the shadow effect on the output power in some, but not in all cases, meaning that it is not a robust design. In the total cross-tied (TCT) configuration, all the PV modules are connected in parallel and then in series, as an improved version of the series and parallel configurations. Although the TCT configuration is rare in practical applications and will increase the cost of connection cables, this configuration can improve the problem of power reduction due to module shading or failure [31,32].
At identical module surface temperature and irradiation level, all the above-stated six array configurations share the same output performance only if there is no shadow or malfunction event in the configurations. Otherwise, the output power varies among the configurations, simply due to the fact that the output performance of the neighboring modules, and finally the entire array, are adversely affected by the shaded one. For this sake, an array in this work is automatically reconfigured in such a way that the maximum amount of output power is provided in case of a shadow or malfunction event.
As illustrated in Figure 1, switches, deployed between PV module array on neighboring branches, are manipulated as a way to reconfigure an array for MPP operation. At the lower part of each branch, a Hall-effect current sensor is employed as a requirement for online fault diagnosis purposes. The well-known particle swarm optimization (PSO) algorithm will be detailed in the following section, based on which an array configuration mechanism is developed.
bridge linked, but a major problem is that the behaviors of neighboring modules are found susceptible to a shaded one, leading to a deterioration in the overall output performance [31]. Particularly, there is no way to integrate a global MPP tracker into this type of array configuration. In the honey-comb (HC) array configurations, all the PV modules are configured as a honeycomb [32]. It is developed as a way to reduce the shadow effect on the output power in some, but not in all cases, meaning that it is not a robust design. In the total cross-tied (TCT) configuration, all the PV modules are connected in parallel and then in series, as an improved version of the series and parallel configurations. Although the TCT configuration is rare in practical applications and will increase the cost of connection cables, this configuration can improve the problem of power reduction due to module shading or failure [31,32].
At identical module surface temperature and irradiation level, all the above-stated six array configurations share the same output performance only if there is no shadow or malfunction event in the configurations. Otherwise, the output power varies among the configurations, simply due to the fact that the output performance of the neighboring modules, and finally the entire array, are adversely affected by the shaded one. For this sake, an array in this work is automatically reconfigured in such a way that the maximum amount of output power is provided in case of a shadow or malfunction event.
As illustrated in Figure 1, switches, deployed between PV module array on neighboring branches, are manipulated as a way to reconfigure an array for MPP operation. At the lower part of each branch, a Hall-effect current sensor is employed as a requirement for online fault diagnosis purposes. The well-known particle swarm optimization (PSO) algorithm will be detailed in the following section, based on which an array configuration mechanism is developed.

Particle Swarm Optimization Algorithm
Proposed in 1995 by James Kennedy and Russell Eberhart, the particle swarm optimization (PSO) algorithm is characterized as having collective intelligence and is essentially a type of evolutionary algorithm [33][34][35][36]. As presented in [33,34,36], the

Particle Swarm Optimization Algorithm
Proposed in 1995 by James Kennedy and Russell Eberhart, the particle swarm optimization (PSO) algorithm is characterized as having collective intelligence and is essentially a type of evolutionary algorithm [33][34][35][36]. As presented in [33,34,36], the velocity of each particle is updated according to the difference between the particle velocity and the optimal value p best of a particle or between the particle velocity and the global optimal value of all particles g best . The position, the search range, and direction of each particle are updated according to an updated velocity. The adopted PSO-based algorithm of this paper was provided in [37]. The velocity and position of a particle are updated as v k+1 where v k+1 j and v k j respectively denote the velocities of particle j at time instants k + 1 and k, C 1 and C 2 are the learning factors, w is the inertia weight, p best k j is the optimal value of particle j at time instant k, g best is the global optimal value, X k+1 j and X k j indicate the switch positions of particle j at time instants k + 1 and k, and rand (·) is a rand real number between 0 and 1.

System Framework
As illustrated in Figure 2, the presented online diagnostic system for a PV module array mainly involves (i) a boost converter, (ii) an MPP tracker, (iii) an array configuration optimizer, (iv) a unit to detect module shielding and malfunction, and (v) an LED array for shaded or malfunctioning module display. A PV module array is designed to operate at the MPP all the time via skillful manipulation of the MPP tracker-controlled boost converter. In case of any module shadow or malfunction, the array configuration optimizer is enabled as a way to reconfigure the PV module array and detect the output voltage and current thereof to achieve the aim of MPP operation under arbitrary working conditions. A complete set of switch statuses together with the above-stated measured output quantities are then delivered to the malfunction diagnostic block for the real-time location and the LED array for displaying the shaded or malfunctioning modules. algorithm of this paper was provided in [37]. The velocity and position of a particle are updated as (1) and k j v respectively denote the velocities of particle j at time instants k + 1 and k, C1 and C2 are the learning factors, w is the inertia weight, k j best p is the optimal value of particle j at time instant k, gbest is the global optimal value, 1 + k j X and k j X indicate the switch positions of particle j at time instants k + 1 and k, and rand (⋅) is a rand real number between 0 and 1.

System Framework
As illustrated in Figure 2, the presented online diagnostic system for a PV module array mainly involves (i) a boost converter, (ii) an MPP tracker, (iii) an array configuration optimizer, (iv) a unit to detect module shielding and malfunction, and (v) an LED array for shaded or malfunctioning module display. A PV module array is designed to operate at the MPP all the time via skillful manipulation of the MPP tracker-controlled boost converter. In case of any module shadow or malfunction, the array configuration optimizer is enabled as a way to reconfigure the PV module array and detect the output voltage and current thereof to achieve the aim of MPP operation under arbitrary working conditions. A complete set of switch statuses together with the above-stated measured output quantities are then delivered to the malfunction diagnostic block for the real-time location and the LED array for displaying the shaded or malfunctioning modules.

MPPT under Shaded Conditions
As pointed out in [38], the simple and easy-to-implement perturbation and observation (P&O) method stands as the most popular maximum power point tracking approach for a PV module array. Yet, multiple peaks exist along the P-V characteristic curve in the event of shaded or malfunctioning PV modules, meaning that the output power is likely to be trapped at a local, rather than the desired global, MPP. For this sake, a PSO-based global MPP tracker is employed herein to handle the multiple peak problem, hence leading to an improved power generation efficiency. A PSO-based MPP tracking algorithm, as presented in [39], is adopted in this study.

Integration between MPPT and Array Configuration Optimization
The power generation efficiency is maximized herein as a consequence of a joint operation between a global MPP tracker and the presented configuration optimization mechanism. Once a branch current in Figure 1 is detected by a Hall-effect current sensor as far below the others, it is identified as a module shading or malfunctioning event, and the presented configuration optimization mechanism is enabled right away to manipulate the switches between modules. The algorithm is the same as stated in [37,39] except that the switch control signal is set to the position of a particle, and the output power of a PV module array is defined as the objective function.

Online Fault Detection Mechanism
In an attempt to reduce a business loss due to PV module shading or malfunction, a way must be found to efficiently locate the non-well operated PV modules online. For this sake, an online diagnostic mechanism is integrated with the presented configuration optimization strategy. Once a branch current is detected by a Hall-effect current sensor as far below the others, it is identified as a non-well-operated event, and the configuration optimization and then the diagnostic mechanisms are enabled. Illustrated in Figure 2 as a system, a high-level step sequence block diagram of configuration optimization and flowchart of the algorithm are shown in Figures 3 and 4, and the presented diagnostic mechanism is stated as follows: step 1: Initialize all the PSO parameters, including the controlled signal (i.e., the configuration of switch position) of all the switches (here using relays as switches) p best and g best . The controlled signal of all the switches are set as the positions of particles, and the output power of a PV module array is defined as the objective function, that is, P pv (X k j ) = V pv × I pv . step 2: The configuration of switch positions of particles is employed as the switch control signals in the progress of an MPP tracking event. step 3: The output power of the PV module array is evaluated as the output voltage times the output current at the end of a tracking event. step 4: Compare the current output power with P PV,best . In case the current output power is superior to P PV,best , then P PV,best is updated. At the same time, the optimal configuration of switch position P best is also update. Then, further compare P PV,best with g PV,best . If P PV,best is superior to g PV,best , then g PV,best is replaced with P PV,best . Meanwhile, the global optimal configuration of switch position g best is also updated. step 5: The positions and velocities of all the particles are updated according to Equations (1) and (2). The X k j indicates the switch positions of particle j at kth iteration. step 6: Repeat steps 2 to 5 until the maximum number of iterations is reached. step 7: The malfunction diagnostic block takes the switch control signals (configuration of switch positions) and the measured output power as inputs and locates and displays the non-well-operated PV modules on an LED array. step 8: In case of any change in the state of a malfunction event, go back to step 1 for a new run. Otherwise, remain idle. displays the non-well-operated PV modules on an LED array. step 8: In case of any change in the state of a malfunction event, go back to step 1 fo new run. Otherwise, remain idle.     In the algorithm of fault diagnosis, a particle represents the configuration of switch position in the Boolean variable. In Figure 1, the configuration of switch positions of S2, S3, S6, S7, S10, and S11 is presented in Binary form 000000 ~ 111111. Therefore, there are 64 different switch position configurations. Here, 0 indicates that the switch is at the "OFF" state, and 1 indicates that the switch is at the "ON" state. Four particles are adopted in the algorithm of fault diagnosis in this paper each of which represents 16 switching states. For example, the first particle represents one of the position configurations 000000 ~ 001111, while the second particle represents another one of the position configurations 010000 ~ 011111, etc. However, in order to facilitate the iteration of a continuous variable in the iterative formula, the binary switch states are converted to a decimal value.
As for the particles adopted in the maximum power tracking controller, they represent the output voltages of the PV module array or are equivalent to the duty cycles of the boost converter. This is also equivalent to the output voltage of the photovoltaic module array. Because the output voltage of the photovoltaic module can be controlled In the algorithm of fault diagnosis, a particle represents the configuration of switch position in the Boolean variable. In Figure 1, the configuration of switch positions of S 2 , S 3 , S 6 , S 7 , S 10 , and S 11 is presented in Binary form 000000~111111. Therefore, there are 64 different switch position configurations. Here, 0 indicates that the switch is at the "OFF" state, and 1 indicates that the switch is at the "ON" state. Four particles are adopted in the algorithm of fault diagnosis in this paper each of which represents 16 switching states. For example, the first particle represents one of the position configurations 000000~001111, while the second particle represents another one of the position configurations 010000~011111, etc. However, in order to facilitate the iteration of a continuous variable in the iterative formula, the binary switch states are converted to a decimal value.
As for the particles adopted in the maximum power tracking controller, they represent the output voltages of the PV module array or are equivalent to the duty cycles of the boost converter. This is also equivalent to the output voltage of the photovoltaic module array. Because the output voltage of the photovoltaic module can be controlled by changing the duty cycle of the boost converter, taking the duty cycle of each iteration to control the boost converter will control the photovoltaic module array to operate at different voltages and get different output power until the maximum power point is tracked or the number of iterations is reached.

Experimental Results
A succession of simulations and experiments are conducted on a 334 W 4 series-3 parallel array with SANYO (Moriguchi, Osaka, Japan) HIP2717 PV modules [40] as the building blocks. The setting of weight value and learning factors in PSO will affect the success rate and efficiency of maximum power point tracking. If the weight value is set too small, the moving speed of the particle will be slow, resulting in a multi-peak problem and failing to precisely skip the local best solution; on the contrary, when the weight value setting is too large, the particle step is too large when moving, resulting in failure to precisely search the target function. Thus, the selection of a weight value usually depends on the target function. In addition, if the learning factor setting is too large, the iteration time spent increases, resulting in reduced overall tracking efficiency. Therefore, in consideration of the benefits, C 1 and C 2 values set must not be too large. Based on this, according to the suggestion in [39], we select the PSO parameter values shown in Table 1. The same array configuration as in Figure 1 is used to illustrate the presented online malfunction diagnostic mechanism. A shaded PV module is known to provide less amount of output current than in a normal case. Hence, as a way to precisely locate a shaded module on a row basis, a Hall-effect current sensor is placed at the bottom of each branch, as illustrated in Figure 1. Each time before a configuration optimization is performed, each branch current is detected and then sent to the presented online diagnostic module so as to locate the malfunctioning module. The P-V characteristic curves of PV module arrays under different shading ratios were measured using an MP 170 I-V checker manufactured by EKO Instruments CO. Ltd. (Tokyo, Japan) [41]. As a consequence of the switch manipulations, five out of 63 configurations are found to deliver the same and the maximal amount of output power to the load, according to the mechanism stated in Section 4. Taking the case of a 30% shadow in module 1 as an instance, all the possible optimized configurations are presented in a tabular form in Table 2 for comparison purposes. The same observation applies to the cases with a single partially shaded module on the same row, but different column. As highlighted in blue in Table 2, what all the optimized array configurations have in common is that both S 1 and S 6 are switched on. A single P-V characteristic curve, as illustrated in Figure 5, is shared by all the optimized configuration cases. A point worthy of mention is that the peak power plunges from 334 W in an unshaded case to 262.3 W in this case.

Case 2: A 30% shaded PV Module in Row 2 (Module 2, 6, or 10)
The same test as in Case 1 is repeated on the case of a single 30% shaded module on the second row. The optimized array configurations are presented in Table 2 but not illustrated for brevity. The position of each switch in Table 2 is indicated in Figure 1. The highlighted portions in orange indicate that the output power is optimized on a condition that switches S 1 , S 2 , S 6, and S 7 are switched on. The same P-V characteristic curve as in Figure 5 is seen again in Figure 6 for this case. The peak power plunges from 334 W in an unshaded case to 263.4 W in this case. The same test as in Case 1 is repeated on the case of a single 30% shaded module on the second row. The optimized array configurations are presented in Table 2 but not illustrated for brevity. The position of each switch in Table 2 is indicated in Figure 1. The highlighted portions in orange indicate that the output power is optimized on a condition that switches S1, S2, S6, and S7 are switched on. The same P-V characteristic curve as in Figure 5 is seen again in Figure 6 for this case. The peak power plunges from 334 W in an unshaded case to 263.4 W in this case.
Note that 1 and 0 represent the ON and OFF states of a switch, respectively, and the switches with an always ON state in each case are highlighted. The position of each switch is indicated in Figure 1. The same test as in Cases 1 and 2 is repeated on the case of a single 30% shaded module on the third row. The optimized array configurations are presented in Table 2, but not illustrated for brevity. The highlighted portions in gree indicate that the output power is optimized on a condition that switches S2, S3, S7, and S8 are switched on. The same P-V characteristic curve as in Figure 5 is seen again in Figure 7 for this case. The peak power plunges from 334 W in an unshaded case to 266.4 W in this case. Note that 1 and 0 represent the ON and OFF states of a switch, respectively, and the switches with an always ON state in each case are highlighted. The position of each switch is indicated in Figure 1.

Case 3: A 30% Shaded PV Module in Row 3 (Module 3, 7, or 11)
The same test as in Cases 1 and 2 is repeated on the case of a single 30% shaded module on the third row. The optimized array configurations are presented in Table 2, but not illustrated for brevity. The highlighted portions in gree indicate that the output power is optimized on a condition that switches S 2 , S 3 , S 7 , and S 8 are switched on. The same P-V characteristic curve as in Figure 5 is seen again in Figure 7  The same test as in Cases 1-3 is repeated on the case of a single 30% shaded module on the fourth row. The optimized array configurations are presented in Table 2, but not illustrated for brevity. The highlighted portions in purple indicate that the output power is optimized on a condition that switches S3 and S8 are switched on. The same P-V characteristic curve as in Figure 5 is seen again in Figure 8 for this case. The peak power plunges from 334 W in an unshaded case to 265.6 W in this case.  The same test as in Cases 1-3 is repeated on the case of a single 30% shaded module on the fourth row. The optimized array configurations are presented in Table 2, but not illustrated for brevity. The highlighted portions in purple indicate that the output power is optimized on a condition that switches S 3 and S 8 are switched on. The same P-V characteristic curve as in Figure 5 is seen again in Figure 8 for this case. The peak power plunges from 334 W in an unshaded case to 265.6 W in this case. The same test as in Cases 1-3 is repeated on the case of a single 30% shaded module on the fourth row. The optimized array configurations are presented in Table 2, but not illustrated for brevity. The highlighted portions in purple indicate that the output power is optimized on a condition that switches S3 and S8 are switched on. The same P-V characteristic curve as in Figure 5 is seen again in Figure 8 for this case. The peak power plunges from 334 W in an unshaded case to 265.6 W in this case.  Hence, it is concluded that a malfunctioning PV module can be located by means of the switch statuses in an optimized array configuration. As can be found in Table 2, all the possible optimized configurations for each case are able to be characterized as a set of switch conditions, say (S 1 = S 6 = 1) and (S 1 = S 2 = S 6 = S 7 = 1) for Cases 1 and 2, respectively. Thus, this close observation gives a diagnostic criterion for PV module malfunction, formulated as n + 1 = m where m represents the row on which a module malfunction event occurs and n denotes the smallest index among the ON switches. Nevertheless, an additional condition must be tested whether S 2 and S 7 are switched on when n = 1 for distinguishing a malfunction in row 1 from a malfunction in row 2.
The malfunctioning PV module can be accurately located via the combined use of Equation (3) and each branch current, which is detected by a Hall-effect current sensor, in a pre-optimized array configuration. The malfunction diagnostic mechanism is illustrated as follows. For instance, exhibited in Figures 9 and 10 are the pre-and post-optimized configurations of a 4 series-3 parallel array with a 30% shadow in module 3 (in Case 3), respectively. As can be seen in Figure 10, S 2 , S 3 , S 7, and S 8 are switched on, meaning that S 2 is the leading switch in ascending order and n = 2 accordingly. A substitution of n = 2 into Equation (3) gives m = 3, meaning that there is a single abnormal event on row 3, namely, module 3, 7, or 11. If the current in branch 1 is detected as far below the others in the pre-optimized configuration, then the module on column 1 and row 3 (module 3), is recognized as malfunctioning and is displayed on an LED array. It must be noted that this diagnostic mechanism can be directly applied to an arbitrary m series-n parallel array configuration and is not limited to this case. Hence, it is concluded that a malfunctioning PV module can be located by means of the switch statuses in an optimized array configuration. As can be found in Table 2, all the possible optimized configurations for each case are able to be characterized as a set of switch conditions, say (S1 = S6 = 1) and (S1 = S2 = S6 = S7 = 1) for Cases 1 and 2, respectively. Thus, this close observation gives a diagnostic criterion for PV module malfunction, formulated as where m represents the row on which a module malfunction event occurs and n denotes the smallest index among the ON switches. Nevertheless, an additional condition must be tested whether S2 and S7 are switched on when n = 1 for distinguishing a malfunction in row 1 from a malfunction in row 2.
The malfunctioning PV module can be accurately located via the combined use of Equation (3) and each branch current, which is detected by a Hall-effect current sensor, in a pre-optimized array configuration. The malfunction diagnostic mechanism is illustrated as follows. For instance, exhibited in Figures 9 and 10 are the pre-and post-optimized configurations of a 4 series-3 parallel array with a 30% shadow in module 3 (in Case 3), respectively. As can be seen in Figure 10, S2, S3, S7, and S8 are switched on, meaning that S2 is the leading switch in ascending order and n = 2 accordingly. A substitution of n = 2 into Equation (3) gives m = 3, meaning that there is a single abnormal event on row 3, namely, module 3, 7, or 11. If the current in branch 1 is detected as far below the others in the preoptimized configuration, then the module on column 1 and row 3 (module 3), is recognized as malfunctioning and is displayed on an LED array. It must be noted that this diagnostic mechanism can be directly applied to an arbitrary m series-n parallel array configuration and is not limited to this case. Figure 9. A pre-optimized array configuration with a 30% shadow in module 3. Figure 9. A pre-optimized array configuration with a 30% shadow in module 3.

On-Line Tests of Duo Purpose Mechanism
As discussed in Section 5.1, the presented online malfunction diagnostic mechanism that was developed for a PV power generation system had been well analyzed by measurement results. This subsection is devoted to the implementation of the online diagnostic mechanism using a TMS320F2808 digital signal processor (DSP) and a PSObased MPP tracker [37,39]. Presented in Figure 11 is a photo of the realized online PSObased diagnostic apparatus. All the PV modules are built with a user-specified shadow, and field tests can be conducted on all the cases in the preceding subsection.

On-Line Tests of Duo Purpose Mechanism
As discussed in Section 5.1, the presented online malfunction diagnostic mechanism that was developed for a PV power generation system had been well analyzed by measurement results. This subsection is devoted to the implementation of the online diagnostic mechanism using a TMS320F2808 digital signal processor (DSP) and a PSO-based MPP tracker [37,39]. Presented in Figure 11 is a photo of the realized online PSO-based diagnostic apparatus. All the PV modules are built with a user-specified shadow, and field tests can be conducted on all the cases in the preceding subsection.

On-Line Tests of Duo Purpose Mechanism
As discussed in Section 5.1, the presented online malfunction diagnostic mechanism that was developed for a PV power generation system had been well analyzed by measurement results. This subsection is devoted to the implementation of the online diagnostic mechanism using a TMS320F2808 digital signal processor (DSP) and a PSObased MPP tracker [37,39]. Presented in Figure 11 is a photo of the realized online PSObased diagnostic apparatus. All the PV modules are built with a user-specified shadow, and field tests can be conducted on all the cases in the preceding subsection. Figure 11. A photo of the implemented online fault diagnosis system. Figure 11. A photo of the implemented online fault diagnosis system. The branch current 1, 2, and 3 are detected as 1.16, 1.54, and 1.56 A, respectively, in the pre-optimized array configuration. Since branch current 1 is far below the other two, there must be a shaded module on column 1. An array configuration mechanism, as referred to in Section 4, is enabled, following which the optimized configuration is characterized as Case 1 in Table 2, that is, S 1 and S 6 both are switched on, and hence n = 1. A further condition is found that S 2 and S 7 are not switched on, and module 1 is diagnosed with the shadow.
Exhibited in Figure 12 is the measured output waveforms in the progress of an array configuration optimization. The post-optimized configuration is measured to provide a maximum output power of 261.9 W, in agreement with the peak value of the P-V characteristic curve in Figure 5. The branch current 1, 2, and 3 are detected as 1.16, 1.54, and 1.56 A, respectively, in the pre-optimized array configuration. Since branch current 1 is far below the other two, there must be a shaded module on column 1. An array configuration mechanism, as referred to in Section 4, is enabled, following which the optimized configuration is characterized as Case 1 in Table 2, that is, S1 and S6 both are switched on, and hence n = 1. A further condition is found that S2 and S7 are not switched on, and module 1 is diagnosed with the shadow.
Exhibited in Figure 12 is the measured output waveforms in the progress of an array configuration optimization. The post-optimized configuration is measured to provide a maximum output power of 261.9 W, in agreement with the peak value of the P-V characteristic curve in Figure 5. V PV after optimal reconfiguration I PV after optimal reconfiguration P PV after optimal reconfiguration P PV before reconfiguration

Case 2: Module 6 with a 30% Shadow
The branch current 1, 2, and 3 are detected as 1.59, 1.14, and 1.56 A, respectively in the pre-optimized array configuration. Since branch current 2 is far below the other two, there must be a shaded module on column 2. The same array configuration mechanism as in Case 1 is enabled, following which the optimized configuration is characterized as Case 2 in Table 2, that is, S1, S2, S6, and S7 are switched on, and hence n = 1. According to Equation (3), m is found to be 2. In other words, the module on column 2 and row 2, i.e., module 6, is diagnosed with the shadow. Figure 13 exhibits the measured output waveforms in the progress of an array configuration optimization. The post-optimized configuration is measured to provide a maximum output power of 262.91 W, in agreement with the peak value of the P-V characteristic curve in Figure 6.

Case 2: Module 6 with a 30% Shadow
The branch current 1, 2, and 3 are detected as 1.59, 1.14, and 1.56 A, respectively in the pre-optimized array configuration. Since branch current 2 is far below the other two, there must be a shaded module on column 2. The same array configuration mechanism as in Case 1 is enabled, following which the optimized configuration is characterized as Case 2 in Table 2, that is, S 1 , S 2 , S 6, and S 7 are switched on, and hence n = 1. According to Equation (3), m is found to be 2. In other words, the module on column 2 and row 2, i.e., module 6, is diagnosed with the shadow. Figure 13 exhibits the measured output waveforms in the progress of an array configuration optimization. The post-optimized configuration is measured to provide a maximum output power of 262.91 W, in agreement with the peak value of the P-V characteristic curve in Figure 6. V PV after optimal reconfiguration I PV after optimal reconfiguration P PV after optimal reconfiguration P PV before reconfiguration Figure 13. Response to an optimization request in a Case 2 array configuration.

Case 3: Module 11 with a 30% Shadow
In Case 3, branch current 1, 2, and 3 are detected as 1.5, 1.49, and 1.15 A, respectively, in the pre-optimized array configuration. Since branch current 3 is far below the other two, there must be a shaded module on column 3. The same array configuration mechanism as in Case 1 is enabled, following which the optimized configuration is characterized as Case 3 in Table 2, that is, S2, S3, S7, and S8 are switched on, and hence, n = 2. A substitution of n = 2 into Equation (3) gives m = 3. In other words, the module on column 3 and row 3, i.e., module 11, is diagnosed with the shadow. Figures 7 and 14 exhibit the P-V characteristic curve and the measured output waveforms in the progress of an array configuration optimization. The post-optimized configuration is measured to provide a maximum output power of 266.2 W, in agreement with the peak value of the P-V characteristic curve in Figure 6.

Case 3: Module 11 with a 30% Shadow
In Case 3, branch current 1, 2, and 3 are detected as 1.5, 1.49, and 1.15 A, respectively, in the pre-optimized array configuration. Since branch current 3 is far below the other two, there must be a shaded module on column 3. The same array configuration mechanism as in Case 1 is enabled, following which the optimized configuration is characterized as Case 3 in Table 2, that is, S 2 , S 3 , S 7, and S 8 are switched on, and hence, n = 2. A substitution of n = 2 into Equation (3) gives m = 3. In other words, the module on column 3 and row 3, i.e., module 11, is diagnosed with the shadow. Figures 7 and 14 exhibit the P-V characteristic curve and the measured output waveforms in the progress of an array configuration optimization. The post-optimized configuration is measured to provide a maximum output power of 266.2 W, in agreement with the peak value of the P-V characteristic curve in Figure 6. In Case 4, branch current 1, 2, and 3 are detected as 1.48, 1.15, and 1.54 A, respectively, in the pre-optimized array configuration. Since branch current 2 is far below the other two, there must be a shaded module on column 2. The same array configuration

Case 4: Module 8 with a 30% Shadow
In Case 4, branch current 1, 2, and 3 are detected as 1.48, 1.15, and 1.54 A, respectively, in the pre-optimized array configuration. Since branch current 2 is far below the other two, there must be a shaded module on column 2. The same array configuration mechanism as in Case 1 is enabled, following which the optimized configuration is characterized as Case 4 in Table 2, that is, S 3 and S 8 are switched on, and hence n = 3. A substitution of n = 3 into Equation (3) gives m = 4. In other words, the module on column 2 and row 4, i.e., module 8, is diagnosed with shadow. Figures 8 and 15 exhibit the P-V characteristic curve and the measured output waveforms in the progress of an array configuration optimization. The post-optimized configuration is measured to provide a maximum output power of 265.43 W, in agreement with the peak value of the P-V characteristic curve in Figure 8. V PV after optimal reconfiguration I PV after optimal reconfiguration P PV after optimal reconfiguration P PV before reconfiguration Figure 15. Response to an optimization request in a Case 4 array configuration.

Conclusions
As a preliminary step in this work, the SANYO HIP217 PV module is used to build a 4 series-3 parallel array for testing. By sensing current in each series of photovoltaic module array, we can judge whether there is a fault in a photovoltaic module array. Once a module failure occurs, it starts the switch reconfiguration scheme based on the PSO algorithm to control each switch at the "ON" or "OFF" state. When the switch position configuration of each particle is changed, a PSO-based global MPP tracker is enabled each time till the MPP is tracked or the number of iterations is reached. Then, which switch configuration can obtain the maximum output power among all of the particles is recorded. In this manner, the malfunctioning module can be identified and indicated on an LED array instantly as a way to speed up the replacement process for a PV module and as a means to reduce a business loss accordingly. In the end, the PSO-based online diagnostic mechanism is implemented using a TMS320F2808 digital signal processor and is experimentally validated as successful to locate a malfunctioning PV module out of four malfunction cases. In case of a malfunction occurring to a module, an optimized PV module array operating together with an MPP tracker turns out to provide a 4-6% improvement in the output power relative to an unoptimized counterpart. More importantly, the online diagnostic mechanism is presented as a way to efficiently recognize and then replace a malfunctioning PV module for maintenance staff, such that the maximum output power operation can be resumed as soon as possible in practical operations.
Indeed, it is possible for two or more modules to fail at the same time. Nevertheless, Figure 15. Response to an optimization request in a Case 4 array configuration.

Conclusions
As a preliminary step in this work, the SANYO HIP217 PV module is used to build a 4 series-3 parallel array for testing. By sensing current in each series of photovoltaic module array, we can judge whether there is a fault in a photovoltaic module array. Once a module failure occurs, it starts the switch reconfiguration scheme based on the PSO algorithm to control each switch at the "ON" or "OFF" state. When the switch position configuration of each particle is changed, a PSO-based global MPP tracker is enabled each time till the MPP is tracked or the number of iterations is reached. Then, which switch configuration can obtain the maximum output power among all of the particles is recorded. In this manner, the malfunctioning module can be identified and indicated on an LED array instantly as a way to speed up the replacement process for a PV module and as a means to reduce a business loss accordingly. In the end, the PSO-based online diagnostic mechanism is implemented using a TMS320F2808 digital signal processor and is experimentally validated as successful to locate a malfunctioning PV module out of four malfunction cases. In case of a malfunction occurring to a module, an optimized PV module array operating together with an MPP tracker turns out to provide a 4-6% improvement in the output power relative to an unoptimized counterpart. More importantly, the online diagnostic mechanism is presented as a way to efficiently recognize and then replace a malfunctioning PV module for maintenance staff, such that the maximum output power operation can be resumed as soon as possible in practical operations.
Indeed, it is possible for two or more modules to fail at the same time. Nevertheless, so far there is no way to automatically detect the faults of two or more modules simultaneous in the world unless an unmanned aerial vehicle (UAV) or manpower is used to detect them on site. However, it will increase the cost of detection. Because the current flow direction is very complex when two or more modules break down simultaneously, it will be impossible to find a regular way to determine the location of the module fault in a short period of time. In the next stage of research, the authors will focus on fault detection on two or more modules.