Modeling and Control Design Based on Petri Nets Tool for a Serial Three-Phase Five-Level Multicellular Inverter Used as a Shunt Active Power Filter

: In this work, we represent a shunt active power ﬁlter (SAPF) based on a serial three-phase ﬂying capacitor multilevel inverter (FCMI) controlled by a Petri Nets representation (PNs). This structure is chosen for its signiﬁcant performances. In fact, the use of the FCMI within the SAPF makes it possible to increase the apparent switching frequency of the structure in order to reduce the value then the volume and weight of the inductance of the output ﬁlter. Besides, the FCMI allows the synthesis of a high-voltage signal using low-voltage semiconductor components. Therefore, improving the reliability of this structure leads to the improvement of the dynamics of the SAPF. This paper deals with a new control methodology based on PNs to regulate the ﬂying capacitor voltages and the reference currents issued by the instantaneous active and reactive power theory. Compared to a conventional SAPF composed by a classical two-level inverter and controlled by a simple PWM control, simulation results demonstrate that our proposed control enhances the dynamic system and the power quality by reducing the total harmonic distortion (THD) satisfying the limits of IEEE standards.


Introduction
In recent years, the field of power electronics has seen a notable development mainly due to industrial applications using electrical systems [1][2][3]. However, every revolution comes with its benefits and drawbacks. In fact, any load based on power electronics devices has a so-called "nonlinear" behavior [4] because they create significant disturbances which degrade the optimal functioning of the installation and its overall efficiency, this also causes current deformation and creates additional losses and heating in the electrical equipments. In this context, three-phase nonlinear loads [5] lead, on the one hand, to a regular increase in the harmonic rate by producing harmonic currents whose frequencies are integer multiples of the fundamental frequency. By the other hand, they cause current imbalance and high consumption of reactive power. We can find these disturbance problems mainly in the industrial environment, in hospitals or others (control of rotating machines by inverters or rectifiers) [6,7]. To reduce the THD of currents delivered by these equipments and to ensure the performance of the dynamical system [8], power electronics have undergone significant technological development [9,10]. Those that best meet industrial constraints today are the parallel active filters. Thus, active filtering tends to cancel out harmonic currents by injecting signals with identical amplitudes but in phase opposition into the disturbing source, this one becomes sinusoidal after filtering. Indeed, a measurement of the nonlinear load current makes it possible to know the harmonic current to supply. The author of [11,12] explains the working principle of the active filters in depth. He reports several regulatory structures in his works, including an improved version of the RST, the latter demonstrates the limits of application of the classical RST. Several studies of SAPFs based on conventional inverters having a switching frequency between 12 and 16 kHz and consisting of two voltage level topology associated to a first-order output filter have been carried out; we note that this structure is expensive and very difficult to design. In contrast, the control of this structure is very easy to implement. The second structure represented in [13], which is based on the same conventional inverter associated, in this case, with an LCL output filter, is very easy to carry out but difficult to control. However, some scientific obstacles remain and need to be raised such as the hybrid control of hybrid dynamical systems (HDS) explicitly and simultaneously involving continuous and discrete behaviors. With a reduced number of switching inputs and a large number of variable states [14,15], these systems contribute to the improvement of the filtering function. The performance of these systems was demonstrated for a 4-cell inverter connected to an inductive load. Introduced in the 1980s and 1990s in [16], this structure constitutes a new solution: it consists of the design of new conversion architectures from the serial association of several switching cells. These associations allow the reduction of the constraints on switches providing multilevel output voltages with better quality compared to traditional architectures. The output signal is characterized by optimal spectral quality noted from the importance of the apparent switching frequency which increases to the value of the frequency of switching multiplied by the number of cells. These combinations of switching cells are made from energy storage elements which are floating capacitors. Their energy management is carried out according to the different states of each association so that their voltages remain always balanced around a fraction of the input voltage. This is ensured by following the principle of direct torque control (DTC) which was patented in [17]. This control is based on the principle of hysteresis control. It was initially reserved for asynchronous machines, then, advanced studies allow to use it for synchronous machines. The method of Pulse Width Modulation (PWM) is an extension of the DTC concept [18,19]. It is a conventional method associated with multicellular converters. The most used strategy is Phase Shifted modulation (PS) based on the PWM principle. Indeed, the regular phase shift between the control signals allows to increase the apparent frequency of the output voltage. This allows, therefore, to repel the harmonics of the output voltage, thus reducing the constraints related to the sizing of the output filter. Several works have been carried out for the development of the serial multicellular converters. Then, the authors of [20][21][22] have developed these structures and found adequate control strategies considering that this type of converters requires an in-depth study, especially with regard to the charges and discharges of floating capacitors [1,23,24]. The works of Guillaume Gateau led to two essential problems characterizing this type of converters, which are the saturation of the controls and the controllability of the floating voltages. Based on these principles, many recent studies have been treated. Compared to the traditional voltage source converters, the authors of [25,26] give an increasing attention to both of serial and parallel multicellular structures owing to their ability to synthesize signals with a better harmonic analysis. They focused their studies on observability and control based on sliding mode techniques represented in [27]. Recently, the authors in References [28,29] applied a control strategy based on Petri Nets representation to a multicellular converter. The main contribution of this strategy is the robust control of this type of inverter ensuring current regulation and voltage balancing. Appearing in 1962 as the subject of the doctoral thesis of Carl Adam Petri [30], PNs is considered as an alternative to automata models; it is a graphical and mathematical modeling language used as an approach for the description and the verification of the dynamical behavior of distributed Discrete Event Systems (DES) [3,31]. In this context, the authors in Reference [32,33] provide a viewpoint of the development of the field of DES. Furthermore, a control strategy based on two PNs representation is proposed to regulate simultaneously the capacitor voltages and the output current. To make sufficient conditions of control, a stability analysis is treated using Lyapunov method [34]. The main objective of using the FCMI within the SAPF is to increase the apparent switching frequency of the structure in order to give the possibility of reducing the value and consequently the volume, weight,.. of the inductance of the output filter. However, a second advantage of this structure is that the voltage applied to the power electronics components is lower than the overall voltage, which increases the operational reliability of the active filter. Note that increasing the number of components, compared to a conventional structure, reduces the overall reliability of the structure. Many active filter solutions for the depollution of electrical grids have been already proposed in the literature. In this paper, a PNs-based controller is applied to a multicell inverter for an active filter operation based on the principle of current reference. In fact, our SAPF structure based on an FCMI associated with a first-order output filter is not discussed in the literature; it has much fewer constraints, and the results presented here show the efficiency of the chosen algorithm in terms of robustness and stability. The remainder of this paper is structured as follows. First, the general model of our system is established. Then, SAPF is explained and the five-level FCMI is briefly described. Then, the control design based on PNs representation for an FCMI is presented along with Lyaponov analysis proofs. Afterwards, we give some simulation results to illustrate the validity of our proposed algorithm. Finally, some concluding remarks are given.

General Description of a Shunt Active Power Filter
As agreed, SAPFs have been introduced as a way to surmount the power quality problems caused by nonlinear and unbalanced loads. In fact, they identify and inject the disturbed currents with phase opposite towards the grid. The SAPFs attenuate a wide range of harmonics, and the filtering quality depends mainly on the performance of the chosen control. Figure 1 represents the global system: a three-phase network supplying three-phase nonlinear load and a filter mounted in parallel. Therefore, an SAPF is basically made up of two parts: a power circuit constituted by a voltage source inverter (VSI) including a DC capacitive storage element, and an output passive filter (RL) permitting the VSI to connect to the grid. A control circuit is employed for the DC voltage regulation and for the VSI to ensure the injection of the currents into the network. This circuit is usually consisted of a disturbed current identification method we use the instantaneous, real and imaginary power method which is a well-established compensation technique [35]. The circuit also contains controllers based on the PWM-VSI method, which is used for controlling the switches. The importance of output filter is in preventing the components that are caused by the switching frequency from spreading into the grid without degrading the SAPF dynamics. By conclusion, the principle of the shunt active power filter is to produce harmonic currents equal in magnitude but opposite in-phase to those harmonics that are present in the grid following this equation:

Modeling and Control of the SAPF
Nowadays, various configurations of SAPFs are studied and realized. Therefore, we can distinguish three tension structure configurations: single-phase filter, three-wire filter, and four-wire filter which is especially designed for the source current imbalance and to compensate the excessive harmonic current in the neutral. It is therefore an inverter connected to the grid via a passive L-R filter. It is mounted in parallel with the three-phase network and injects in real-time the harmonic components of the currents absorbed by the nonlinear loads connected to the network. Marketed inverters used for actual SAPF applications are almost the classical two level inverters. These ones show a switching frequency around 16 kHz. Further, at this frequency, the output filter is very heavy, voluminous, expensive, and very difficult to design.
Thus, our choice is based on a hybrid dynamical model with instantaneous values, known as a five-level FCMI because, on the one hand, it makes it possible to limit the voltage constraints undergone by the power switches: each component, in a blocked state, supports a smaller fraction of full DC bus voltage as the number of levels is high. On the other hand, the output voltage delivered shows interesting spectral qualities. Therefore, this model allows the study of the evolution of the different states in order to generate the polluted current and to balance the voltages of the flying capacitors. This topology includes p cells, and between each two cells we insert flying capacitors as continuous sources. Thus, an FCMI is composed by p-1 floating voltage sources; note that p is equal to n-1 with n is the level number of the corresponding structure. Each cell contains two complementary switches controlled by a binary function. The FCMI therefore requires careful control of the switches allowing it to eliminate certain harmonics. Figure 2 shows the power circuit of a three-phase SAPF based on three-phase fourlevel multicellular power inverter as previously described. In this system, considering an ideal grid, the FCMI injects an opposite current harmonic to make a sinusoidal grid-side current then obtains a unity power factor. The current filter variations are given in the following equation:

SAPF Modeling and Description
With v s k being the supply voltage and i f k being the output current which is equal to A coupled state representation of three-phase SAPF with five-level MFCI is given as follows: This model can be expressed in a compact form aṡ where the square matrix A q j ∈ R 4×4 , B q j ∈ R 4×1 , and x ∈ R 4×1 representing the state vector, q j represents the 2 p discrete variables. Each mode of operation is given by a set of possible switching combinations called (SDD) (Specific discontinuous driving) In order to ensure normal operations, a balanced distribution of the floating voltages should be necessary guarantee as follows: With V dc is the DC source that should be equal to E 2 and E represents the input voltage.

Sizing of the DC Bus Voltage
The fundamental current delivered by the filter is given by With V s is the supply voltage and V f 1 indicates the fundamental component of the output voltage of the SAPF and L f is its inductance.
The reactive energy delivered by the filter is Then, This allows the active filter to compensate reactive energy if and only if V f 1 > V s . The maximum reactive power is then obtained from the derivative of the reactive power with respect to the grid voltage dQ f dV s = 0, then As a result, the maximum compensation capacity of the active filter occurs at V f 1 = 2V s and the maximum energy is the following:

Hybrid Control Design Based on Petri Nets Modelization
Hybrid dynamical systems (HDS) result from the hierarchical organization of complex control or the interaction between discrete planning and continuous control algorithms.
To highlight the control of our chosen HDS, two cascaded PNs representations are proposed and developed. The first PNs allows the reference current regulation giving the required voltage level, while the second one ensures, by one side, the voltage level corresponding to the current regulation and the balance of the capacitor voltages by another side. Note that the reference current is determined by the instantaneous active and reactive method. The figure 3 describes the regulation principle. Note that the regulation algorithm is carried out while ensuring the development of the following points: • SDD selection: The selection of the SDD must ensure simultaneously the output current regulation and the capacitor voltage regulation. The following control property make it possible to establish the conditions ensuring the convergence of current error and capacitor voltages errors to zero then we can determine the appropriate SDD that should be selected.

Proposition 1.
For any initial condition, there exits an SDD such that the capacitor voltages and the output current converge to their reference values.
Proof. Consider the Lyapunov function as follows: where is the the output current error and e j = v cjk − v * cjk ; j ∈ [1 . . . n − 2] is the capacitor voltage error. Taking the time derivative of Equation (14) for n = 5: We aim to obtainV < 0 under the action of the SDDs. It can be noticed that for each discrete voltage level L there is at least one SDD holdingV < 0. Table 1 summarizes the equations obtained from 15.
First Petri Nets representation: The objective of this PNs representation is to select the appropriate voltage level to reach the current reference. As shown in Figure 4, the behavior of the output current follows the corresponding voltage level for a five-level FCMI, with imax = V dc −V smax 2 * R . With V smax is the maximum supply voltage. The places of this PNs representation are defined in Table 2. Level L = 0, corresponding to the voltage 0V P 3 Level L = 1, corresponding to the voltage E 4 V P 4 Level L = 2, corresponding to the maximum voltage E 2 V The token is moved to the place corresponding to the required voltage level which is obtained by defining at first an operating region OpRe(i * ) as follows: where w ∈ [−1; 2]. Then, the required voltage level m ∈ [1 . . . 4] for the output current regulation of a 5-level FCMI is Figure 5 describes the behavior of the control law. Finally, the rules that fire the transitions to transfer a token from a place to another are summarized in Table 3.

Transition
Transition Rule Reached Level • Second Petri Nets representation: Considering the required voltage level determined by the first PNs, a second PNs representation was established to select the SDD to ensure simultaneously the pursuit of the reference current and the balance of the capacitor voltages. Table 4 shows the conditions in order to choose the equivalent SDD. The symbol (-) represents when no change is taking place and e j → 0 represents when the error voltage of the jth capacitor tends to zero.
The places of the second PNs representation are defined in Table 5. Closing of the first switch P 7 Closing of the second switch P 8 Closing of the third switch P 9 Closing of the fourth switch The movement of the token from one place to another is described according to the following procedure: - Step 1: Choose the subset that contains all SDDs of the desired voltage level L.

-
Step 2: Select an SDD that reduces the error in the capacitor voltages as described in Table 4. - Step 3: In the case where exists more than one SDD, the one that reduces the greater number of voltage errors will be selected. - Step 4: The SDD which allows the reduction of errors by increasing the voltages of the capacitors will be chosen among the rest of the existing choices. Figure 6 represents the Petri diagram which describes the algorithm defined by the procedure previously explained, and Table 6 summarizes the laws of the transitions chosen for this Petri networks when the output current is positive, note that e + j ≡ e j > 0 and e − j ≡ e j < 0 for j = 1, 2, 3.

Transition Transition Rule
Finally, the global system composed by a SAPF based on three-phase 5-level FCMI controlled by a PNs representation is developed.

Simulation Results
In this section, simulation results and a discussion of some relevant theoretical issues of the proposed hybrid model as well as the control of system state variables are presented and validated using MATLAB/SIMSCAPE ELECTRICAL. Then, this will be compared to a SAPF based on a classical two-level inverter controlled by a PWM control. Starting first with the control based on PNs representation of the proposed system composed by a SAPF containing three-phase supply with 50 Hz frequency feeding a three-phase uncontrolled rectifier with an RL load.
The test is performed with a sample time equal to 10 µs taking into account a delay time of 18 µs in order to fix the minimum ON and OFF times of the power semiconductors. Simulation results of the global system confirm that the proposed control strategy accomplish all the control objectives. In fact, Figure 7a represents the load current of the phase a, this signal is composed by a fundamental component and harmonics, the injected current as shown in Figure 7b contains only harmonics of the identified current but in opposite phase. The injected current allows the filter to cancel all the harmonic signals and to keep only the fundamental one as presented in Figure 7c. The following FFT analysis of the phase a of the current after filtering for our proposed system and the classical one shows the different signals composing the resulting current: As can be seen in Figures 8 and 9, the fundamental signal of 50 Hz composes 100% of the totality of signals. The THD of the proposed system is equal to 0.97%, while it is equal to 1.58% when using the conventional filter that meets the standards required by IEEE.
The measured capacitor voltages of one leg of the three-phase FCMI are balanced and they peruse the adequate references V c1 = 750 V; V c1 = 1500 V and V c1 = 2250 V which are well defined according to the Equation (4), these results are shown in Figure 10. Figure 11 represents the behavior of the charge and discharge ensuring the monitoring of the voltage reference of the floating capacitor v c1 . The range of the voltage variation around the reference depends on the value of the capacitance C 1 = C 2 = C 3 = 1 µF as well as the waiting time T = 1.8 × 10 −7 s to avoid the so called "electrical over-stress".    The error between the phase current injected by the inverter and its reference is represented by the Figure 12. The output voltage of the first leg of the inverter is shown in Figure 13. During a switching cycle, the number of activations and deactivations of all the switches is approximately 3200. This gives a switching 3200 × 50 Hz/2 = 80 kHz representing the switching frequency (dividing by 2 in order to allow the activation and deactivation of the switch in a single switching cycle) [36]. However, the switching frequency is equal to 16 kHz when using the conventional inverter.
Finally, the comparison between the two structures proves that the control based on a representation by Petri networks is then robust as it is able to guarantee performance criteria in stability, speed and precision for our hybrid system whose model represented varies around the theoretical or nominal model.

Conclusions
This paper presented a three-phase flying capacitor topology used as shunt active power filter with PNs-based control. The simulation results using MATLAB/SIMSCAPE ELECTRICAL have proved the effectiveness of this proposed study. In fact, instantaneous power theory determines with great precision the reference currents to be injected to the grid. The control based on Petri Nets representation using two cascaded representations permits the SAPF to pursue the required reference currents. Therefore, the first PNs representation determines the needed voltage level for the output current regulation, and the second one defines the switching state to ensure the required voltage level and the capacitor voltage regulation. These strategies enhance the performance and reliability of the system. Additionally, in normal operating using hysteresis control, our proposed control can mitigate harmonics of grid current with THD = 0.96% which satisfies the limits of IEEE-519 standard. Moreover, this algorithm ensures the continuity of electrical power production with good quality compared with the conventional structure. As further directions, we propose developing a fault detection algorithm for the global system.