Fault-Tolerant Strategy for the MMC-Based PV System With Faults Detection and Converter Reconfiguration Using Permutation Algorithms

The modular multilevel converter has gained popularity in various applications, including photovoltaic (PV) solar energy conversion. Its modular structure allows for the transformation of an MMC into an MMC-based photovoltaic system, sharing key operational characteristics such as modularity, flexibility, redundancy, increased efficiency, and fault tolerance. To ensure the reliability and uninterrupted operation of the modified MMC, even in the event of potential failures in the photovoltaic submodules (PVSMs), a fault-tolerant strategy is developed in this study. It assumes that the Maximum Power Point Tracking (MPPT) of the PVSMs is already guaranteed. Redundant submodules (rSM) are utilized to maintain power balance between the converter arms through voltage control, while reserve submodules (RSMs) are in place to rescue the converter in case of a failure. The detection and localization of faults in the PVSMs/rSMs are achieved through sliding mode observers (SMOs), and the converter reconfiguration is carried out using the proposed permutation algorithms for switching signals and SMs voltages. For precise control of the output current and electrical grid connection, the $dq$ -reference frame control method is employed. To validate these proposed algorithms, time-domain simulations are conducted using the Simulink/Matlab software.


I. INTRODUCTION
The continually expanding energy market, coupled with the rising trend in decentralized energy generation plants, whether on a large or small scale, serves as a catalyst for the advancement of cutting-edge electronic power systems in photovoltaic energy generation.Traditionally, microinverters have been employed for smaller PV arrays to enhance power generation, particularly in scenarios involving partial shading of PV panels.This approach offers several advantages, including improved energy capture, seamless plug-and-play functionality, flexibility for expansion, redundancy, and the The associate editor coordinating the review of this manuscript and approving it for publication was Jahangir Hossain .elimination of DC line cabling.Consequently, it presents an appealing solution for grid-connected PV systems, despite its associated cost drawback, as noted in a previous study [1].An even more sophisticated alternative involves the utilization of permutation algorithms.These algorithms enable the extraction of maximum power from individual PV panels, even under partial shading conditions, and facilitate the delivery of the greatest available power to the DC bus connected to the inverter.This innovative approach addresses the challenges posed by PV panels operating under such conditions [2].
One of the main electronic equipment to convert energy is the voltage source converter (VSC) that use capacitors as energy storage elements.The two-level converter is the standard VSC (2L-VSC), which is typically used in low voltage and low power applications [3], [4].However, to reach higher voltages and obtain advantages such as: transformerless systems, lower voltage stress on devices, smaller output filters, lower switching losses (due to low switching frequency), among others, multilevel converters (MLC) are used, but are limited in terms of the number of levels achievable, due to the large number of electronic devices (transistors, diodes, capacitors or DC sources) used in the different topologies of MLCs [4].Therefore, to solve this limitation, in [5] the Modular Multilevel Converter (MMC) was introduced in the literature, which as a result of the advancement of technology made possible the development of large-scale applications.In the beginning, this converter was formed by half-bridge submodules (SMs), but due to its importance, several authors have proposed different SM topologies (which depend on the type of application, resource optimization and to facilitate control).The MMC can normally operate with a different number of SMs/arm, however, for symmetrical operation this number must be identical on all arms.Modularity is its biggest advantage, however, for this converter to work optimally, it is necessary to properly control the submodule voltage, the circulating current and the output current.
The research of the MMC in solar PV applications is currently booming and is not yet an established technology in the literature compared to other applications or based on the MMC.In [20], the research studies are classified in two types, projects that employ a common DC-bus and others that use separate PV arrays to energize the submodules (SMs) with/without the isolated DC/DC stage.In [21] the MMC is studied as a centralized DC/AC inverter for the implementation of PV systems in distributed generation, in this application only the scalability capacity is used to obtain large voltages at the converter output.In these article, a new control for capacitor voltage balancing was introduced based on the concept of virtual submodule (VSM) using the selective virtual loop mapping control (developed in these paper) that does not require voltage classification from highest to lowest, it only identifies the capacitor voltage rating v c,min and v c,max , which makes it suitable for an MMC with a large number of SMs/arm.However, due to the use of a centralized converter, the power generated under partial shading is drastically reduced because of the general MPPT algorithm.In [24] a topology for a solar PV power generation system under partial shading conditions is proposed, in these article, the MMC employs PV panels in series that are directly connected to each half-bridge converter (also knew SM), this arrangement is called the power module (PM) which will operate as SM.The maximum power is extracted by regulating the average voltage between all capacitors (this value is close to the voltage at the maximum power point).The main drawback of this control is when the partial shading condition occurs, because the average voltage of all capacitors drops, generating energy generation losses.Also, a redundant submodule (rSM) is added to each arm to compensate for the voltage variation of energy generated by the PMs in partial shading condition.In [25] a new topology is proposed, where the PV panels are connected to an isolated DC/DC converter of dual active bridge (DAB) which is connected to each SM of the MMC.The energy balance between the converter arms is done through of the power mismatch elimination strategy.The direct connection between the isolated converters and the SMs allows the independent action of the MPPT algorithm and the PV modules ground connection.
In [28] a grid-connected PV system based on MMC is proposed, which realizes long-distance DC transmission while feeding local power consumption.In addition, by using the triple active bridge converter, there is no photovoltaic power mismatch between the upper and lower arms, since the isolation transformer couples two SMs (one in the upper arm and the other in the lower arm) on a three-ports transformer, consequently, the differential mode components from the upper and lower arms cancel each other.
To ensure that the MMC remains operational even with a faulty redundant PVSM or SM, some fault-tolerant strategy must be included in the converter control.In this way, the MMC can continue without affecting overall performance.This condition is insured by a minimum percentage number of failed SMs/arm, this is known as a redundancy factor which is around 10%.This means that the converter operation can continue if less than 10% of the SMs fail, for a conventional MMC [16].The detection methods mainly focus on semiconductor failures such as short-circuit and open-circuit, which can happen due to overcurrent, high temperature of the devices, or incompatibility of the thermal coefficients between silicon and aluminum [15].Among the main detection and locations of faults methods we have: sliding mode observers (SMO), Kalman filters, state observers, resilient structure, a clustering algorithm that compares the calculated capacitances with the measured, supervision sensors and methods based on PWM modulation [14], [15], [17], [18], [30], [31].All these fault diagnosis methods identify faults according to the internal dynamics of the MMC.
Based on all the information already mentioned, this paper proposes a fault-tolerant strategy for the MMC-based PV system and the redundant SM voltage distribution method, the topology used is a version inspired by [16], [24], and [25].The redundancy control and the fault-tolerant operation is considered, which is necessary feature due to a possible/unexpected failure in some of the SMs/PVSMs (this failure could compromise the converter, generating cascade failures in the arm or on the converter phase), to avoid this situation a backup system is required.Therefore, for the system to be considered ''fault-tolerant'', three aspects are necessary: (1) Fault diagnosis (detection and location of the SMs/PVSMs at fault) and MMC reconfiguration.When a fault occurs in any of the SMs, it is necessary to locate the fault in order to reconfigure the converter to guarantee the continuous and uninterrupted operation of the MMC.For this, the SMO is used for diagnosis and, for the reconfiguration, a permutation algorithm proposed, using the signals generated by the SMO.
(2) The redundant control and fault-tolerant MMC structure.During normal operation (without faults) the redundant SMs (rSM) are used to compensate for possible voltage imbalances in the DC bus.When a rSM fault is detected a reserve SM (RSM) is inserted in the circuit.However, when a PVSM fault is detected, a new SM is inserted into the main circuit and the rSM reference voltage is modified.For this, the Redundant operation based on Spare SMs (RSS) strategy based on submodule cold reserve method is used this way the reserve SMs will be available to be inserted into the circuit [32].When a PVSM faults, the inserted RSM takes a period of time to reach the reference voltage value generating a short transient.
(3) The operation strategy.Basically consists of controlling the converter together with the considerations above mentioned, for this purpose, it is necessary to guarantee the adequate control of the following points: the energy balance between the arms of each phase, the current control output, the minimization of the circulating current and the control of each sub-module (PVSM, rSM).This paper is structured as follows.A system description and its control is presented in Section II.The proposed faulttolerant strategy is detailed in Section III.Section IV presents the simulations results of the proposed fault-tolerant strategy for the MMC-based photovoltaic system.Finally, conclusions are presented Section V.

II. MMC-BASED PV SYSTEM STRUCTURE AND ITS CONTROL A. SYSTEM DESCRIPTION
The conventional MMC is composed of two arms (singlephase) or six arms (three-phase) and each arm contains a number of identical N −submodules, one arm at the top and one arm at the bottom of each phase.Due to its modular structure, the converter is scalable and flexible for any medium/high voltage application.
Fig. 1 shows the structure of the MMC-based PV system proposed, the control algorithms are implemented in each arm of the MMC, it is considering the photovoltaic SMs (PVSM), the redundant SM (rSM) and the reserve SMs (RSM).One arm detailing is shown in Fig. 2. All SMs are connected in series, the PVSMs generate energy in both arms of same phase; due to partial shading conditions, there is a natural imbalance in the energy generated by the PV panels and, consequently, exist a energy discrepancy between the arms of the MMC; the redundant SMs are used to correct this energy discrepancy and the possible voltage imbalance between the arms.Also, the reserve SMs are used for the uninterrupted operation of the MMC in case of failure of any SM.For this, constant monitoring is carried out and when a failure is detected, a contingency plan is activated [15], [17].

B. MATHEMATICAL MODELING
The submodules are connected in series with an inductor in each converter arm, the upper and lower arm submodules are modeled as controlled AC voltage sources.The DC system part is modeled as two virtual DC voltage sources.
The upper and lower arm voltage are given by: By Kirchhoff's current law, the output current is given by: From ( 1), v xl is subtracted from v xu , and i xo is substituted for i xu − i xl , obtaining: The effect of i xo can be neglected as long as the value of L a and r a are relatively low and the new variable v * xo is introduced, this defines the reference voltage v xo , given by: From (1), add v xl and v xu and, replace i xz in place of Then, the voltage across the inductor L a and resistor r a caused by current i xz is defined by: In this particular application, it's important to consider that the converter exhibits symmetry in the number of submodules within both the upper and lower arms, as highlighted in [33].As a result, half of the grid current must be provided by each arm.To achieve this, it's crucial to maintain the voltage of the submodule capacitors at a specific level.Additionally, another parameter that requires control is the circulating current, which needs to be suppressed or mitigated.This control is essential to ensure the energy balance between the arms of the converter.
In this paper, the output current control approach is adopted to manage active and reactive power.Then, the command voltages for the submodules can be obtained through the following process: Substituting (4) in ( 5) (for each voltage), these are the arm modulation voltage in steady state, defined by: Then, the arm modulation index are given by: The equation (7)  xu and S k xl for each submodule.However, in Section II-D the independent balancing factor for each SM is added as shown Fig. 3.
In Fig. 3, the switching signal generation diagram is presented, outlining the key components of the MMC control.This diagram provides a comprehensive view of the control strategy and its implementation within the MMC.The switching signal generation diagram serves as a reference for understanding the control mechanisms involved in the MMC, particularly in this application.It encompasses various elements, including signal generation, modulation technique, capacitor voltage balancing control, and circulating and output current control.This visual representation is essential for gaining insight into the control process, as it showcases the flow of signals and actions within the MMC, which will later be added to fault tolerance algorithms.
For the proposed converter, in the control strategy, there are multiple vectors to control, including: (1) Output current control: This is essential to regulate the current delivered to the grid or the load.The limiting factors for this control include the power rating of the MMC and the grid/load requirements.A limitation here can result in not meeting the desired output current, affecting the power output of the converter, but in this paper, the power generated is injected into the electrical grid.(2) Capacitor voltage control: The voltage across the arm capacitors needs to be controlled to maintain the desired output voltage.The limiting factor for this control is the voltage rating of the capacitors.If the voltage exceeds this limit, it can result in capacitor overvoltage and potential failure.(3) Circulating current control: To minimize circulating current between the arms of the converter, control strategies are employed.The limiting factor here is the control bandwidth and the dynamic response of the control system.If the circulating current is not well- controlled, it can lead to losses and a power mismatch in the converter.
The interplay between these controls is complex.Changes in one control loop can affect the others.For instance, if the output current control is too aggressive, it may lead to increased circulating currents.If the voltage control is not precise, it can affect the output current regulation.Therefore, careful tuning and coordination of these control strategies are crucial to ensure the proper and efficient operation of the MMC.These controls are detailed to follow.

C. REDUNDANT SUBMODULE (RSM) CONTROL
This control is for specific applications, in this case for the photovoltaic system based on the MMC.In [24] the redundant control of the upper and lower arm voltage is proposed in order to obtain V dc,xu = V dc,xl .This is just to compensate the DC-bus voltage to a desired voltage, on each arm of the converter, and consequently improve its reliability.In practical application, it is expected that the sum of the voltage of all submodules (photovoltaic and redundant) of each arm will be constant and its value equal to the DC reference voltage V * dc of the MMC.For this, the reference voltage of the rSM is expressed by: where j indicates the j−th element of the variable x(j), for this case j ∈ {1, . . ., M }, M represents the number of rSM/arm and v PVSM c,xy is the PVSMs voltage vector.Initially the converter operates only with one rSM/arm.
In this paper, the following clarification is made, the reference voltage v * rSM c,xy can be distributed among several rSMs of the same arm, if this value exceeds the rated value of 0.75 v PVSM c,xy (normally in case of failure of any PVSM).Then, the control of rSMs is carried out through: where the sgn(x) function denotes the direction of the current, taking values of {−1, 0, 1}; u * rSM xu (j) represents the balancing factor of rSM(j) and K u is the proportional gain.

D. PHOTOVOLTAIC SUBMODULE (PVSM) BALANCE CONTROL
In [34] this method (for PWM signal) is studied in more detail.In summary, balancing is possible because the MMC submodules are modulated independently using iPSC-PWM technique.The voltage balance of the capacitors can be achieved by adjusting the reference signal for each factor of (7).The reference signals u * PVSM xu (j) and u * PVSM xl (j) together with the voltage balancing variable are given by: u * PVSM xu (j) and u * PVSM xl (j) represent the reference adjustment of each submodule in the upper and lower arms, respectively.For this case j ∈ {1, . . ., N }.These reference adjustments are intended to control the PVSMs voltage balance and can be calculated as [35] and [34]: Therefore, the normalized reference signals for each SM with the voltage balancing factor, are given by: where the superscript XSM denotes all types of SMs in operation (PVSM and rSM/RSM) and k denotes the k−th element of variable x(k) that takes values {1, . . ., (N +M )}.

E. OUTPUT CURRENT CONTROL
The output current of the MMC is controlled using the synchronous dq−reference frame [36], and the block diagram for the three-phase MMC is shown in Fig. 3.
where vs represents the peak value of the grid voltage, ω o is the angular frequency of the AC output voltage.Note that for closed loop AC voltage and AC current control is defined, where, θ ∈ {0, −2π/3, 2π/3} is the phase angle for singlephase or three-phase system.The dynamics of the AC threephase side of the VSC system is described by: where L s represents the inductance of the output filter and r s is the resistance of the filter material.Then, the equation that expresses (14) in the frame of reference dq, is defined by [36]: where i do and i qo represent the current components in dq frame, injected into the electrical grid; v ds and v qs represents the components in dq frame of the electrical grid three-phase voltage; v do and v do are defined as the components in dq frame of the converter output three-phase voltage.
In (15), i do and i qo are coupled due to the presence of L s ω o .To decouple the dynamic behavior, the control variables u do and u qo are introduced.
v * do and v * qo are reference variables of v do and v qo , respectively.Therefore, v * do ≈ v do and v * qo ≈ v qo .

F. CIRCULATING CURRENT CONTROL
The AC component flows only between the legs of the MMC and is derived from the upper and lower arm instantaneous currents, given by: The control of the circulating current consists basically in the adequate distribution of the energy between the arms, that is, in the leg of the MMC.This ensures power balance and symmetrical operation.
The average voltage (V c,x ) measured from each leg is given by: Note that v OP c,xu and v OP c,xl are the the upper and lower voltages vectors (SM in operation) that will be observed by the fault-tolerant algorithm.These vectors are composed of the voltage of the arm capacitors as elements, i.e.
with the SMs in initial operating status.
Fig. 3 shows the control diagram, which has two loops.The external one, regulates the average voltage of the leg (2N −SMs) to a constant value of V * dc , this loop minimizes the error voltage and provides the reference circulating current.The internal one, takes care of the circulating current minimization.

III. PROPOSED FAULT-TOLERANT STRATEGY BASED ON SMO FOR THE MMC-BASED PV SYSTEM
The operating strategy mainly consists of: (1) Output current control.
• Voltage distribution of redundant SMs: Managing voltage distribution among redundant SMs when PVSMs fail.(3) Command signals generation.
• Energy balance of the between the arms.
126124 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
• SMO for fault detection and location.
• Command signal permutation algorithm for the MMC reconfiguration.
• SM voltage permutation algorithm: Manage voltage permutations, especially in cases involving PVSMs.Due to the nature of the study, which primarily focuses on fault tolerance within the PV system based on MMC, an analysis of harmonic levels (i.e., THD) has not been included.The central objective of this research is to ensure the uninterrupted operation of the converter under various conditions, with a particular emphasis on fault tolerance mechanisms, fault detection, and system reconfiguration.While THD analysis holds significance in the context of photovoltaic applications, this study prioritizes the successful implementation of fault tolerance strategies.This includes the use of sliding mode observers and redundant structures to ensure the MMC can adapt and operate effectively even in the event of a fault.The research aims to maintain the converter's continuous functionality and reliable operation by minimizing downtime and disruptions.

A. SLIDING MODE OBSERVER
In [37], the SMO is studied using the equivalent control method for a first order system.However, for clarity in [35] an introduction to the derivation of SMO equations from [37] using the equivalent control method for a second-order system is presented.However, this method is complex to implement (when the number of observed variables is high).
Note that x is a measured variable, therefore, x is the estimated/observed variable of x; v is the sliding mode variable, L is the observer gain and sgn(x) is the signal function defined by: sgn The sliding mode variable and the observer gain need to be set to ensure that x → x in a short finite period of time.In [37] and [35] the sliding mode variable is adopted as v = x − x.
Replacing the sliding mode variable ''v'' by x − x, and doing ẋ − ẋ, the dynamic error between observed and measured variables is obtained.
The average value of ''L sgn(x)'' performs as a control function that counterbalances ''Ax'', for this way, the control keeps the observer variable on the sliding surface, and thus guarantees x − x = 0.
The Disturbance compensation is the quality that an estimator must have to recover the estimated variable, even if there is a failure or disturbances caused by measurement error.In [35] and [31] the estimated value is used to compensate the observation controller, and thus robustly detect and locate faults.Due to the function sgn(x), L is obtained from L > |ax|.Therefore, (21) keeps x → 0 and ẋ → 0, so the system is on the sliding surface.
To compensate for disturbances in the estimated variable in (19), it is consider perturbations in A, B and u and it is added a general perturbation variable D, this results in: where A and B are the perturbations of A and B, respectively.u is the measurement error and/or the scaling error of the observed variable.It is assumed that the values of these perturbations are limited and smaller than the error value when a failure occurs.Subtracting (23) from measured variable in (19), the error between the measured and estimated states is obtained by: The updated L is taken from (24): Once (24) enters the sliding surface (sliding mode), this is when ẋ → 0 and x → 0.Then, ( 24) is expressed as: Due to the high frequency switching generated by the term ''−L sgn(x)'', a low-pass filter is applied to obtain the estimated value of D: where D represents the estimated value of the perturbations, K d is the filter gain and τ is the low-pass filter time constant.Therefore, the observed state in ( 19) is rewritten as: The value of D varies aggressively when there is a failure, thus forcing the correction of the estimated variable.

1) SMO FOR MMC APPLICATIONS
In [30] the SMO is implemented using the arm currents and in [38] the circulating current as the main parameter.In this paper, the variable defined by x is implemented by the arm current (to avoid false positives that could change the performance of the algorithm on the opposite arm of the same phase or on another phase of the converter) and the SM capacitor voltage.The aim of this variable estimator is to locate the open-circuit fault after its occurrence.For this, two modes of operation are necessary, suppose that initially, it is in normal operation.Fig. 4 shows the flowchart used for the detection and location of defective SMs.

a: FAULT DETECTION MODE
This mode determines whether the MMC is working normally or not.By observing the arm current.
4. Fault detection and location flowchart.
where: L 1 is the observer gain, K ds is the disturbance correction gain and, the estimated current error is given by: One of the critical parameters to consider is the gain ''L 1 '', This value should be adjusted based on the dynamic behavior of the estimated variable.If the gain is too high, the estimation of the measured variable will consistently resemble the estimated one.In the event of a possible fault, the estimation will exhibit the same behavior as the measured variable, making it challenging to detect discrepancies between them.Conversely, if the gain value is low, the estimation will not adequately track the measured variable and won't be able to keep up with its changes.A choice of observer gain is: To locate the faulty SM, the voltage of all SMs is observed too.For that, if i xy is greater than a current threshold value i xy,th (for more than 1 ms), and the estimated voltage error is greater than the voltage threshold value v c,th , a faulty SM is detected.Next, all parameters are represented in vector form and, the estimated voltage error used to locate the fault is given by: L 2a and L 2b represent the observer gains.Similar to how the current estimation gains are adjusted.To ensure effective fault detection in the SMs, the tuning of these parameters, L 2a and L 2b , can be performed by:

B. FAULT-TOLERANT STRATEGY
The block diagram shown in Fig. 5 provides an explanation of the proposed fault-tolerant procedure.

1) SWITCHING SIGNAL PERMUTATION
In order to avoid the addition of comparators that could generate the signal of the reserve SMs (once these are inserted into the main circuit) a switching signal permutation algorithm is implemented which basically consists of two steps, (a) blocking signal generation and (b) switching signal permutation.
(a) The SMO provides the vector sts xy that contains the instantaneous detection states of the all SMs, these states are used to generate the blocking vector B xy and limit the number 126126 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.In this approach, the strategy involves excluding the signals originating from SMs that are in bypassed-state due to faults or placed in reserve-state.Instead, the strategy exclusively utilizes the signals originating from the SMs in operation, that actively participate in the primary circuit.

3) CONTROL AND VOLTAGE DISTRIBUTION OF THE REDUNDANT SMs
This control ensures that the average voltage on the upper arm (v dc,xu ) will be equal to the lower arm (v dc,xl ).However, if a failure occurs in a PVSM, the imbalance of power is relatively high, then, it is necessary to distribute power to the redundant SMs, in this case the reference voltage is readjusted as needed.The initial reference voltage for the redundant SMs is determined as a function of the reference voltage (V * n dc ) and the summation of all PVSMs voltages (per arm), as depicted in Figure 5.This is expressed by the following equation:

IV. SIMULATION RESULTS
To validate the effectiveness of the fault-tolerant strategy for the MMC-based photovoltaic system of Fig. 2 that is simulated in Simulink/Matlab software environment.
To decrease the number of interactions and the computational burn, allowing the simulation to faster, each isolated dcdc converter is represented by a controllable DC source.The MMC is constituted by twelve-PVSMs, and two-RSMs in each arm (N = 12, M = 1 and R = 2).The PV array is constituted by 13 series-connected panels and 3 parallel-connected strings (39 panels in total) of the Kyocera Solar KD180GX-L type, each panel generates 180W under standard test condition (STC) obtaining 7020W of nominal power in each PVSM.In each PVSM, the isolated dc-dc converter is used to control the voltage at the maximum power point using the perturb and observe MPPT algorithm.
The system parameters are shown in Table 1.

1) INITIAL CONSIDERATIONS
• The initial value of the SM capacitors voltage is of great importance for the fast recovery of the converter (for steady-state), after confronting a failure in some SM.Therefore, this value must be previously defined by a method of capacitors pre-charging.
• The transient effect (period of time that the algorithm takes in the MMC reconfiguration) must be short as possible, since it is always tried to avoid the failures in cascade.
• If the voltage of the submodule inserted in the main circuit undergoes a change in the voltage level there may be a transient, in this case it is necessary to compensate the total voltage of the arm until reaching the steady state, this effect will be detailed in case 2 and 3.In the following, Table 2 presents a comprehensive summary of fault detection and recovery times in Figure 6.

TABLE 2. Summary of fault detection and recovery times.
In Figure 6, for a conventional MMC, the normalized voltage of the SMs from both arms, denoted as ''v n c,y '' (normalized to '' capacitor voltage is considered to be at 50%, 75%, 100%, and 125% of the nominal value, respectively, before being introduced into the main circuit.It can be observed that: • When the voltage of the SM to be introduced is less than or equal to 75% of the nominal value, the reconfiguration of the MMC converter is slower due to the difference between the voltages of the SMs in operation and the voltage of the new SM.Consequently, voltage balancing is slow.
• Similarly, when the voltage exceeds 125% of the nominal value, voltage balancing is slow.

2) PV SYSTEM BASED ON MMC
For the proposed MMC converter.Initially, the photovoltaic generators are all subject to STC (irradiance 1000W /m 2 and temperature 25 o C).Then, at t = 0.25 s, the solar irradiation of the photovoltaic generators of each PVSM goes from 1000W /m 2 to 750W /m 2 and at t = 0.55 s, it goes to 500W /m 2 .Consequently, the power generated by the PV generators in the interval 0 → 0.25 s is reduced from 505 kW to 384 kW and finally, the power in the interval 0.25 s → 0.55 s is reduced to 257 kW while the reactive power output remains unchanged at zero, as Fig. 7  Three case studies are carried out in which the behavior of the converter against SM faults is studied, in Fig. 8 the sequence of Faults ''Fi'' and the moment in which the converter is reconfigured ''Ri'' are presented.This analysis is supported by a graphical representation illustrating the temporal aspects of fault detection and the MMC recovery.By examining these key time frames, it is gain valuable insights into the efficiency and reliability of the fault-tolerant algorithms employed in the system.To comprehensively investigate the converter's behavior under SM failures, three distinct case studies are conducted.
To carry out a comprehensive study of the converter performance under SMs failures, three distinct case studies are carried out.In these scenarios, F1, F2, F3, F4, and F7 represent failures in the rSMs, while F5, F6, and F8 represent failures in the PVSMs.These failures are also distributed across the converter's phases.The purpose of these case studies is to analyze and understand how the converter responds to different fault scenarios, contributing to the assessment of its robustness and fault tolerance capabilities.

A. CASE 1: REDUNDANT SUBMODULES FAULTS IN OPPOSITE ARMS
This case demonstrates the performance of the proposed fault-tolerant technique in the presence of two redundant SM faults, one in the upper arm and the other in the lower arm of phase a.This type of fault is normally studied in the conventional MMC.When a fault occurs, the MMC must locate the fault as quickly as possible for uninterrupted operation of the MMC.
Figure 9 shows the capacitor voltages in phase a.Note that there are only five voltage signals per arm, this is to facilitate the visualization of the capacitor voltages.Due to the proposed fault-tolerant strategy, the new SM (RSM1 ay ) replaces the defective SM (rSM1 ay ), in both arms, which goes RSM1 au and RSM1 al from a reserve to an operational state, through the proposed permutation algorithms; the voltage signal sent to the modulation stage is also updated considering the new SM.
F1 and F2 represent rSM failures caused in the upper and lower arms, respectively.As noted, the converter is reconfigured accordingly.From now on, in t 1 the fault occurs, in t 2 the new SM is inserted, in t 3 the converter is in steady- state.Then, ''t re = t 2 − t 1 '' is the converter reconfiguration and, ''t ss = t 3 − t 1 '' is the steady-state reach time.For F1: t 1 = 0.15 s, t 2 = 0, 1543 s and t 3 = 0, 162 s, then, is t re = 4.3 ms and t ss = 12 ms.For F2: t 1 = 0.3 s, t 2 = 0.3021 s and t 3 = 0.309 s, then, t re = 2.1 ms and t ss = 9 ms.

B. CASE 2: REDUNDANT AND PHOTOVOLTAIC SUBMODULE FAULTS IN OPPOSITE ARMS
This case presents the behavior of the capacitors voltage in the presence of two faults, a redundant SM fault in the upper arm and a photovoltaic SM fault in the lower arm of phase c. Fig. 10 shows the voltage of the PVSMs, rSM and RSMs, when the fault F7 occurs, the new SM (RSM1 cu ) replaces the defective SM (rSM1 cu ); and when the fault F8 occurs, the new SM (RSM1 cl ) replaces the defective PVSM5 cl , at the same time v rSM1 c,cl and v RSM1 c,cl increase its average voltage level from 443 V to 803 V, due to the fact that the RSM that replaces the PVSM generates a power imbalance between the two arms, this voltage adjustment is made through the voltage distribution algorithm.For F7: t 1 = 0.75 s, t 2 = 0, 751 s and t 3 = 0, 759 s, then, t re = 1 ms and t ss = 9 ms.For F8: t 1 = 0.85 s, t 2 = 0.8736 s and t 3 = 0.925 s, then, t re = 23.6 ms and t ss = 75 ms.

C. CASE 3: REDUNDANT AND PHOTOVOLTAIC SUBMODULE FAULTS IN THE SAME ARM
For this case, the rSM1 bu , rSM1 bl , PVSM4 bu and PVSM8 bl fail in that order (a rSM and a PVSM in each arm), this is to demonstrate the robustness of the fault-tolerant strategy, for that, in this case the fault detection and location process is detailed.The arm current is used as a detection parameter (through equation ( 29)).
Fig. 11 shows the procedure performed by the algorithms (i) Switching signal permutation and (ii) SM voltage permutation, concerning to fault F3 and F5 shown in Fig. 12. Initially (MMC arm without faults), all elements of the vector sts bu are zeros (0: healthy SM and 1: faulty SM); the vector B bu has N OP −elements with value zero and R−elements with value one (0: normal operation and 1: bypass); the vector S bu contains the switching signals of the operational N OP −SMs and the signals of the SMs in bypass state are represented by zeros; the voltage of all the capacitors of the submodules are in the vector v c,bu , in sequence, and the vector v OP c,bu contains the first N OP −elements of v c,bu that will be processed by the modulation method.When F3 occurs, in (i), if sts bu ([13]) = 1, B bu ([13]) turns 1 and in S bu the 13th element g 13 goes to the 14th place and the 13th place becomes zero.Similarly in (ii), v c,bu the 13th and 14th element are swapped.The same logic is applied to the fault F5 in 4th column.
Fig. 12(a) shows as the estimated current îbu closely follows the measured current i bu , and when a failure occurs, the estimated signal quickly returns to follow the measured value, avoiding cascading failures.Fig. 12(b) shows the capacitor voltages with details, demonstrating the rapid replacement of a faulty SM allowing uninterrupted operation of the converter.Fig. 12(c)-(d Fig. 13 shows the capacitor voltages in the lower arm of phase b, when the fault F4 occurs at t = 0.5 s in the rSM1 bl .Then, the reserve SM (RSM1 bl ) replaces the defective SM (rSM1 bl ).Similarly, when fault F6 occurs in PVSM8 bl , the reserve SM (RSM2 bu ) replaces the defective SM (PVSM8 bl ); immediately, v RSM1 c,bl and v RSM2 c,bl increase its average voltage level from 443 V to 803 V. F3 and F4 represent rSM failures and, F5 and F6 represent PVSM failures.As noted, all faults are reconfigured accordingly.
Note that F5 represents an eventual fault in an upper-arm PVSM, and F6 represents a deliberate fault in a lower-arm PVSM.This is done to minimize the power mismatch.While the distribution algorithm manages to maintain the bus voltage V dc , the generated energy is unbalanced.For this reason, a PVSM in the opposite arm is disconnected, as indicated by F6.
Finally, the total DC voltage of the upper arm (sum of the voltages of the SMs in operation) and lower arm of all phases are shown in Fig. 14(a)-(c).When an rSM fault occurs, a small transient is observed, while when a PVSM fault occurs, the transient is larger, this is due to the unbalance generated in the voltage of the arms and also because the inserted SM voltage must still reach the reference voltage (guaranteed by the distribution control), so that v dc,xu is equal to v dc,xl , showing that the voltages of the arms in each phase are balanced.While Fig. 14

V. CONCLUSION
The photovoltaic system is based on a modular multilevel converter, each PVSMs is interconnected with photovoltaic array through isolated DC-DC converters, which allows independent monitoring of the maximum power point (MPPT) and provides grounding for each submodule.The proposed system encompasses various types of SMs, including photovoltaic and half-bridge SMs, each exhibiting distinct dynamic behavior.Consequently, it becomes imperative to conduct fault observation and diagnosis separately for each SM type.
The performance of the SMO and the proposed switching and voltage permutation algorithms are verified, observing results consistent with those presented in the scientific literature in relation to the SMO, with this, the possibility of using this fault-tolerant strategy in the modified MMC is made possible.By employing the arm current as an observation variable, the strategy effectively eliminates false positives or potential failures that might impede diagnosis in the opposite arm.This approach demonstrates robustness in identifying defective internal semiconductor devices within the submodule.Furthermore, the permutation and signal blocking algorithms were subject to specific testing.These tests resulted in a reduction in the number of comparators required for the PWM signal.To stabilize the DC-bus voltages of each leg, redundant submodules are deployed.This ensures that one-third of the total photovoltaic energy generated flows through each phase of the MMC and subsequently feeds into the electrical grid.Consequently, balanced currents are injected into the electrical grid, mitigating the impact of potentially uneven photovoltaic energy generation due to shading or submodule failures.
The voltage distribution algorithm comes into play exclusively in the presence of photovoltaic submodule failures.This algorithm prevents voltage overstress in certain redundant submodules or Reserve Submodules (ex-float) and guarantees that the total average voltage on one arm equals that of the opposing arm.In summary, this article offers a comprehensive exploration of the mathematical foundations and flowcharts underpinning the proposed fault-tolerant strategy.These concepts have been rigorously validated through simulation results.
In this study, the analysis of harmonic levels (THD) has not been included due to the primary focus on fault tolerance within the PV system based on MMC.The central objective of this research is to ensure the uninterrupted operation of the converter under various conditions, with a particular emphasis on fault tolerance mechanisms, fault detection, and system reconfiguration.

FIGURE 1 .
FIGURE 1.The proposed MMC-based PV system.

FIGURE 5 .
FIGURE 5. Diagram of strategy for MMC-based PV system.
(a) shows.The current in dq−synchronous frame are shown in Fig. 7(b).Hence, as Fig. 7(c) shows, the sinusoidal three-phase output current injected into the electrical grid is balanced at all times despite the existence of PVSMs and rSMs faults.

FIGURE
FIGURE (a) Active and reactive power, (b) dq−currents and (c) three-phase output currents.

FIGURE 8 .
FIGURE 8. Fault occurrence and reconfiguration time of phase a, b and c.

FIGURE 9 .
FIGURE 9. Capacitor voltages in phase a.(a) upper arm and (b) lower arm.

FIGURE 10 .
FIGURE 10.Capacitor voltages in phase c.(a) upper arm and (b) lower arm.

FIGURE 11 .
FIGURE 11.Procedure performed by the permutation algorithms.

FIGURE 12 .
FIGURE 12. Waveforms of upper arm of phase b.(a) Arm current (measured and estimated), (b) Capacitor voltages (measured and estimated), (c) v PVSMj c,bu observed variable error with details and (d) v xSMj c,bu observed variable error with details.

FIGURE 13 .
FIGURE 13.Capacitor voltages in lower arm of phase b.
(d)  shows the DC-bus voltage of MMC.The voltages of the PVSMs and rSMs are regulated to approximately 1163 V and 443 V, respectively, and the DC link voltage of the MMC has been set to approximately 14400 V (initially it corresponds to 12 PVSMs and 1 rSM per arm).
) shows the observed voltage error of the PVSMs and rSM/RSMs, v XSMjc,bu > v XSMj c,bu ), the defective SM is detected and replaced efficiently, in both case of PVSM and rSM.