FAULT TOLERANT CONTROL AND FAULT DIAGNOSIS METHODS INTEGRATED USING INTELLIGENT CONTROLLER FOR HYBRID DYNAMIC SYSTEMS

This research aims to provide a fault diagnosis approach for Hybrid Dynamic (SDHs), Systems and Fault-Tolerant Control synthesis, while also ensuring the smooth operation of industrial settings. This study is a part of the larger topic of Hybrid Dynamic System control and fault diagnosis. The primary focus is on modelling strategies designed expressly for Hybrid Dynamic Systems, with a concentration on combining continuous and event-driven components. Much work is devoted to developing a model that can incorporate both kinds of elements. A system model that can track several modes without explicit identification can be created by utilizing Neuro-Fuzzy Networks, providing a thorough overview. On the basis of this synthesized model, an AI-based fault diagnosis method is subsequently developed.


INTRODUCTION
A system comprises elements that work together to achieve a specific task, with connections to external factors through inputs (control and disturbances) and outputs (reactions or responses).Systems come in various types, such as static or unchanging systems, dynamic systems that evolve over time, systems dealing with one or multiple variables, continuous or uninterrupted systems, discrete event systems, linear or non-linear systems, causal systems, and invariant or unchanging systems, among others [1].
Real-world or industrial systems tend to be intricate, exhibiting dynamics that are modeled by a mix of discrete and continuous phenomena when viewed on a larger scale.As a result of combining discrete and continuous elements, a new class of systems known as "Hybrid Dynamic Systems" (HDS) emerges.From the 1990s onward, significant emphasis within the scientific community has been placed on investigating these hybrid systems, as evidenced by various studies [2], [3], [4], [5], [6].
Numerous modeling approaches have been introduced to address the simultaneous integration of continuous and discrete aspects in these systems.
The goal of enhancing system automation is to enhance its efficiency.However, the pursuit of improved performance has resulted in the creation of increasingly intricate systems, thereby escalating the potential for malfunctions that could jeopardize both the system and its surroundings.
Consequently, in numerous applications, it becomes essential to establish a monitoring or diagnostic system to identify, locate, and recognize faults.Accomplishing this task necessitates a comprehensive understanding of a fault model.Numerous techniques have been developed in the field of automation to locate and diagnose problems in hybrid dynamic systems.Every method is distinguished by the necessary comprehension of the fundamental procedure.Certain strategies emphasize an exhaustive understanding of the system, relying on detailed prior knowledge to pinpoint faults.Conversely, alternative methods prioritize fault detection and diagnosis without comprehensive prior insights, employing adaptive algorithms or machine learning techniques to deduce faults in these systems.The spectrum of these approaches underscores the significance of prior knowledge and its influence on fault detection strategies in hybrid dynamic systems.data-driven projection method (EDPM) that estimates faults using input and output measures, eliminating the necessity for mathematical models, as outlined in reference [13].
The Fault Tolerant Control (FTC) method ensures the integrity of the multicellular converter's structure even in the event of flying capacitors failure.This is achieved through the implementation of robust sliding mode control, effectively managing various fault scenarios, as detailed in reference [14].
A study that proposes Fault Tolerant Control (FTC) and a machine learning-based fault diagnosis approach is presented in Reference [15].In this study and [16], two power converters, one using the Maximum Power Point Tracking (MPPT) algorithm and the other a three-cell multi-cellular converter, are used to power a photovoltaic water pumping system.The DC motor is connected to a submerged pump through this converter.
The work in this paper is dedicated to the modeling of a hybrid dynamic system, employing a two-part approach.
-Firstly, Neuro-Fuzzy models are developed to represent the continuous aspect of the system during standard operation.-Simultaneously, a hybrid automata model is formulated to capture the discrete aspect of the system.-For system diagnosis, an offline diagnostic tool based on Neuro-Fuzzy models is proposed, specifically tailored for these systems.-Additionally, the study presents an approach to fault accommodation by utilizing pre-computed Neuro-Fuzzy control laws, thereby introducing a fault-tolerant command mechanism equipped with a compensation term to address faults effectively.This innovative methodology leverages Fuzzy Logic to facilitate the selection of pre-computed Neuro-Fuzzy control laws, ensuring robust fault accommodation within the system.Through simulation, the proposed techniques are set to be validated, considering the intricate nonlinear dynamics of the model.By integrating Fuzzy Logic into the selection process, the study not only enhances fault tolerance but also demonstrates the adaptability and effectiveness of these techniques in addressing complex system faults.

MODELING HYBRID DYNAMIC SYSTEM
Conventional representations of the behavior of dynamic systems rely on a model in which the form (continuous or discrete) is directly related to the underlying state variables and the temporal features that characterize the system.In order to model hybrid dynamic systems, two different behaviors must be described: First, the discrete dynamics represented by a set of states and transitions; and second, the continuous dynamics usually represented by a system of differential and algebraic equations.Reconciling these distinct and continuous parts has led to a substantial formalization.
A variety of hybrid models are used in the literature to describe physical processes that have traits of both continuous and event-driven behaviors [17], [18], [19] and [20].

Modelling Hybrid Dynamic System
Real systems frequently exhibit complex, nonstationary, and nonlinear characteristics, which presents modeling difficulties.Despite this intricacy, these elements should be taken into consideration while creating a predictive tool.For prediction challenges, a variety of artificial intelligence algorithms have been tested, showing better performance than conventional approaches [21], [22], [23].This study highlights how well-suited Neuro-Fuzzy networks, in particular, Jang's invention, ANFIS, the Adaptive Neuro Fuzzy Inference System, are for handling such complexity [24].More precisely, the work we do focus on investigating ANFIS's capabilities in this situation.

Adaptive Neuro-Fuzzy Inference System
The five-layer neural network structure used by ANFIS, or the Adaptive Network-Based Fuzzy Inference System, represents a stage in a Takagi-Sugeno type fuzzy inference system.Fig. 1.ANFIS structure for TS system with 2 inputs/one output Let's take a look at a fuzzy inference system that has two inputs (x and y) and an output (f) in order to simplify.Using two fuzzy Takagi-Sugeno rules as the rule base, the TS model applies these rules in a "If-Then" manner as follows: The parameters p1, q1, r1, and p2, q2, r2 are linear coefficients associated with the output in the Takagi-Sugeno fuzzy inference model.
The core idea of the five-layer ANFIS architecture is the combination of the multilayer feed-forward neural network's supervised learning capabilities with the explicit knowledge of the Takagi-Sugeno (TS) fuzzy inference system.This combination defines the ANFIS technique.
Describe the ANFIS architecture that is standard: The first layer's primary goal is to produce the node output that matches the membership values connected to the premise section: ) In the second layer, each node takes on a fixed role denoted as π.These nodes perform a multiplication operation on the incoming signals: ) In the third layer, every node is labeled as N and functions as a constant element for the purpose of normalization.Its role is to compute the proportion of the firing strength associated with the i-th rule in relation to the overall sum of firing strengths across all rules: In the fourth layer, each node is adaptive in nature.These nodes perform a specific function, which is:   4 =  ̅  ×   =  ̅  (   +    +   ),  = 1,2 (6) In this context, wi signifies the output of layer 3, while pi, qi, riare the parameters associated with the first-order Sugeno rule.The network's output is computed using these parameters and the rules defined within the system.  5 =  = ∑  ̅  ×    (7) To learn and update parameters in the ANFIS model, Jang's hybrid learning algorithm is utilized.This algorithm combines the least squares approach and the gradient descent method.The purpose of this algorithm is to update the linear consequent parameters in layer 4 and the nonlinear premise parameters in layer 1.
There are two paths that the algorithm takes: the forward path and the backward path.Recursive least square estimator (RLSE) technique is applied to update the consequent parameters in the fourth layer in the forward path, while the premise parameters in layer 1 stay fixed.The use of RLSE is motivated by the consequent parameters' linearity, which aims to accelerate convergence during the hybrid learning process.
On the other hand, the gradient descent algorithm is used in the backward path to update the premise parameters in layer 1 while keeping the consequent parameters constant.The ANFIS model's dual-path strategy maximizes the learning process for both kinds of parameters.
As part of the learning process, an error is generated that shows the difference between the desired and actual output and is then propagated back to the first layer.This backward path makes sure that the premise parameters are changed in accordance with the errors that are observed, which helps the model learn and become more refined.

The discrete event part modelling
A collection of systems with continuous dynamics interacting with one or more discrete event systems is typically used to model hybrid systems.
Many methods exist for modeling hybrid dynamic systems.What unites them is that distinct events have an impact on the ongoing evolution.Hybrid automata are one type of discrete part modeling tool used in hybrid dynamic systems [25].
Hybrid automata are frequently utilized in modeling and control applications due to their ability to accurately represent systems with both continuous and discrete behavior.
In the context of the study mentioned, where a hybrid dynamic system is being modeled, the choice of hybrid automata is likely driven by the necessity to capture the diverse aspects of the system's behavior [26].

Hybrid Automata
In a single formalism, differential equations for continuous change and transitions for discrete change are combined in a mathematical model for HDS known as a hybrid automaton.A hybrid automaton is a type of finite state machine that consists of a finite number of continuous variables, each represented by a set of ODEs for its value.A hybrid automaton is defined by the following tuple [27]:  = (, , , , , ) (8) Q: is a representation of the system's hybrid model states; The set of system events is denoted by Σ. X: represents a limited collection of continuous variables that characterize the system's continuous dynamics; :  ×  →<  is a function that describes how X continuously evolves dynamically in each state q; The system's state transition function is denoted by  ∶  ×  → .A shift from state q to state q+ following the occurrence of a discrete event e ∈ Σ is represented by a transition δ(q,e)=q+; The initial conditions are given by the set  = (1 ∈ , (1), (1).

FAULT DETECTION AND EVALUATION
Making a diagnosis is frequently a difficult task, and traditional analytical techniques frequently fall short of offering workable solutions for design problems.For this reason, artificial intelligence techniques like fuzzy logic and neural networks are becoming more and more common in industrial diagnostic applications.
These techniques yield results that are simple to interpret and provide valuable data for the stage of decision-making.The diagnostic task consists of two phases: residual creation and decision-making (residuals evaluation).
By creating residuals, fault indicators can be obtained from the current inputs and outputs.The generation process is based on comparing the observed behavior of the system with the expected reference behavior (derived from model predictions).However, categorizing the defects that have been found through residue analysis is a step in the decision-making process.
Generally speaking, there should be almost no residue (no defects).In contrast, if there are flaws, the value of this residue won't be zero [27,28].

Model based residual generation
The need for a precise mathematical model stands out as a major limitation of analytical methods applied in the diagnostic field.Conventional fault diagnosis and isolation techniques "FDI" rely on a mathematical model, making them notably susceptible to modeling errors, variations in parameters, noise, and disturbances.
To address these challenges, it becomes essential to opt for FDI algorithms that are better suited for real systems, mitigating some of the limitations associated with relying solely on mathematical models.
Analytical models and residual creation are still based on the same fundamental idea.It entails contrasting the process's outputs with the estimators.To compute the estimates, a Neuro-Fuzzy model is used in this instance.

Fig. 3. Generation of residuals by the Neuro-Fuzzy model
The difference between the actuator output vector, y(t), and the output vector from the Neuro-Fuzzy model, ŷ(t), yields the residue vector, r(t)... () = () −  ̂() (9) The construction of the Neuro-Fuzzy model involves several key steps:

Creation of a Database
Begin by offline compilation of a database based on expert knowledge.This database should encompass vital process characteristics such as operating points, stability, noise levels, etc.It's then split into two segments: a significant portion for learning purposes and the remainder for validation.This forms the foundation for further model development.

Choice of Model Structure
Selecting the appropriate structure for the Neuro-Fuzzy model is crucial.The NARX (Nonlinear AutoRegressive with eXogenous inputs) structure is commonly favored, especially for deterministic or minimally noisy systems.This choice helps circumvent stability issues that might arise in other structures like NNARMAX.

Training
Weights and biases are first determined at random and subsequently modified through the use of a learning algorithm that reduces quadratic error.The Levenberg-Marquardt algorithm is widely used for this in our context.

Validation
Following the training of the network, the ultimate weight and bias values are determined.An evaluation phase is crucial to verify that the network satisfies predefined criteria.Various tests are performed on the network, and if it falls short of expectations, adjustments may involve modifying the network structure (e.g., adjusting input or output orders) or increasing the learning phase's iteration count to get enough network parameter convergence.

Neuro-Fuzzy model based residual evaluation
The basis of fuzzy logic, also referred to as approximate reasoning, is the use of linguistic variables to express fuzzy rules in natural language.Fuzzy reasoning, fuzzy adaptive threshold, and fuzzy classification are some common forms that these fuzzy rules take.A lot of Fault Detection and Isolation (FDI) techniques use fuzzy logic, especially when evaluating residuals.

Fuzzification
This procedure involves creating fuzzy membership functions for each input and output in order to convert raw data values into fuzzy input values.Every residue is given a membership function, which is typically represented by a triangle or trapezoid shape, indicating the degree of its involvement in a failure.

Inference
This phase serves as the foundation for establishing rules that discern fault conditions from non-faulty states within the system.For instance: "If residue1 = 0 and residue2 = 0, then no failure is detected." "If residue1 > 0 and residue2 < 0, then fault1 is detected." Validation of these rules can be challenging if they don't align with an operator's experience or expertise.

Defuzzification
The inference sets' raw output values are produced at this step.This output goes beyond a binary declaration to indicate the level of fault presence in the system.It indicates both the scale of the existing fault and the confidence in its presence.Each considered fault receives such an output.
During this phase, raw output values are generated based on the inference sets.The output reflects the degree of fault presence in the system, surpassing a straightforward binary declaration [29] and [30].

FAULT TOLERANT CONTROL
Fault diagnosis is undoubtedly crucial, yet it shouldn't stand alone.Considering faults during the system control law's design phase is prudent.The significance of diagnosis and fault tolerance in automated systems is evident, aiming to: -Enhance safety for people and systems.
-Enhance production quality and efficiency.
Over the years, fault tolerance has been approached from various perspectives, underscoring its crucial role in preventing catastrophic consequences and ensuring system safety.Main goal of fault tolerance techniques is to maintain accuracy and stability while keeping the system operating normally.
Preventing the propagation of faults that could lead to system-wide failure is of paramount importance.Therefore, fault tolerance holds a central position in the synthesis of control laws and system design.By reducing or eliminating the effects of faults, a fault-tolerant control law seeks to preserve stability and nominal system performance in the face of failures.
There are two primary types of fault-tolerant control systems: active and passive methods.The passive method uses strong control laws that show resistance to particular faults without the need for reconfiguration or detection schemes.
On the other hand, the active approach incorporates fault detection schemes and strategies for adjusting the control law while ensuring system stability and performance are maintained.
Within the active approach, two strategies, fault accommodation and system reconfiguration, are prominent.
Accommodation involves fault estimation enabled by the Fault Detection and Identification (FDI) stage.If fault estimation isn't viable, system reconfiguration becomes essential, involving component subsets or replacing faulty elements [31], [32] and [33].
An online fault accommodation approach integrates fault diagnosis modules for tolerant control.This module, a bank of controllers, compensates for control law faults.It selects the appropriate control law from pre-calculated offline controllers, maintaining input/output relationships with the system.
These controllers vary in structure, including neuronal, fuzzy, or Neuro-Fuzzy designs.Depending on the process phase identified by the diagnostic step, a fuzzy mode selector picks the suitable control mode-adjusting control parameters or switching between controller structures-to meet performance requirements.Regarding fault-tolerant control applied to SDH, only a restricted number of studies have been conducted [33],[34] and [35].Furthermore, even in normal operation, a typical assumption for discrete control in these systems is the continuous awareness of the system's current mode.
However, this assumption can be quite stringent and might not always hold in industrial setups.It necessitates abundant, efficient, and sometimes costly sensor instrumentation.The determination of the current mode becomes an additional functionality that the monitoring software layer must provide.-A reconfigurable regulator.
-A reference applied to the system.Fig. 5. Principle of an active FTC control law

APPLICATION
The hydraulic system, depicted in Figure ( 6), comprises two cylindrical tanks with identical crosssectional areas  = 0.0154  2 .These tanks are connected by pipes  2 ,  3 , positioned at levels = 0  and ℎ = 0.5  respectively.Valves  1 and  4 , attached to pipes  1 and 4 , facilitate liquid evacuation for usage.Pipes  2 and  3 are equipped with valves  2 and  3 .
The system utilizes pump  1 to regulate flow   affecting the level of tank 1. Level sensors monitor the levels ℎ 1 and ℎ 2 in the respective tanks.
For simplicity in analysis, valves  1 and 2 and  3 are assumed to remain open consistently.Additionally, the pump operates in an on-off manner to maintain ℎ 2 within a predetermined range.The pump generates zero flow when it's not operational.However, when activated, it produces a flow denoted as   =  0 = 0.001  3 /ℎ.The pump logic is as follows: ▪ The pump is initially on.▪ It is turned off when ℎ 2 ≥ 0.2.▪ It starting when ℎ 2 ≤ 0.1.
The valve  4 is manually operated, allowing users to open or close it as needed.The system considers two discrete states for  3 pipe: "Empty" (denoted as V) or "Full" (denoted as P), and for valve  4 : "Open" (O) or "Closed" (F).Therefore, four distinct modes define the system's behavior.Each mode is characterized by discrete states (the state of pipe  3 and valve 4 , specific state equations, and inequality constraints.Torricelli's law provides expressions for the flows:  2. Spontaneous Events: These events are internally triggered.They appear when the water levels in tanks ℎ 1 andℎ 2 exceed or fall below certain thresholds.
To construct a diagnostic model for this hybrid system, a modelling approach using a hybrid automaton will be presented.Neuro-fuzzy models are employed to generate fault indicators.This strategy is specifically utilized in scenarios such as diagnosing hydraulic systems.The proposed Fault Detection and Identification (FDI) technique is outlined in Figure 7.The simulation is run with the following initial conditions for a total simulation time of 500 s: The next figure provides the liquid levels for.The simulation has 500 s of total simulation time, and the following initial conditions are set:
After the modeling step, specifically after generating the residuals, the next step is the evaluation of these residuals.They are utilized to diagnose the faults present within the system and provide relevant information for conducting the diagnosis.
In order to demonstrate the effectiveness of the proposed Neuro-Fuzzy model, we investigated two scenarios: 1.In the first scenario, we initially demonstrate the effectiveness of the diagnostic system (without reconfiguration).Subsequently, we present the proposed fault-tolerant control strategy.2. The simulation results are obtained from experiments conducted on the hydraulic process, which are illustrated in the parts below.

Fault Diagnosis strategy
The diagnostic approach introduced in this research relies on real-time fault estimation, facilitating direct fault diagnosis such as the isolation and identification of detected faults.
This method enables the identification of all faults, including simultaneous ones, and provides immediate insights into the nature and severity of each fault.
Fault scenarios with the prefix "f" are taken into account to illustrate the recommended methodology and confirm the reliability and effectiveness of the diagnostic system.
For example, one false fault scenario suggests a decrease in pump actuator efficiency.Such a system failure has an instantaneous effect on the differential equations that govern the system's dynamics.
The proposed method classifies defects using a fuzzy reasoning model.Three membership functions, two trapezoidal and one triangular, have been selected for each residue.Setting the parameters for these functions required extensive testing that included a range of flaws.One simulated scenario involves a 20% efficiency loss in the first actuator input, initiated at time 3100 and lasting until 3400.Subsequently, we observe the system's output, associated residues, and the decision model produces outputs to evaluate the impact of this fault on the system.Figure 20 illustrates that the residue outputs remain steady at zero until time 3100.Subsequently, due to the fault introduced in the system's input until instant 3400, the residue values change.Additionally, the evolution of decisions reflects a consistent value of one (1) during this period.Notably, the diagnostic system consistently generates positive decisions when faults influence the system input.

Table 1. Membership functions of the residuals
Numerous additional experiments were conducted, consistently affirming the capability of this diagnostic approach to identify and acknowledge all possible faults affecting the system.

Fault Tolerant Control strategy
In contrast, the proposed control strategy adopts a cooperative framework that integrates the nominal control system, the diagnostic module, and the regulators responsible for ensuring fault tolerance.This integrated approach enhances system robustness by effectively coordinating control and diagnostic functionalities within a single structure.
To confirm the fault-tolerant control system's dependability and efficiency, we ran a test that DIAGNOSTYKA, Vol. 25, No. 3 (2024) Achbi MS, Rouabah B, Mahboub MA, Benarabi B, Kafi MR, Kechida S: Fault tolerant control and fault … 10 simulated a 20% reduction in efficiency in the first actuator's input from instant 3100 to 3400.To evaluate the impact, we then looked at the system outputs, related residues, and decision model outputs.
The goal of the suggested fault-tolerant control approach is to keep the system operating at the targeted performance levels.In order to make up for the drop in pump efficiency, a spare pump has been added.The plan calls for quickly shutting down the malfunctioning pump and turning on the backup pump to maintain system functionality.The employed fault-tolerant control strategy showcases excellent results, ensuring the system's outputs remain unaffected by the input fault.Within the decision system, there's a minor deviation followed by a swift return to zero.This brief delay, termed as the detection time  = 1.  , signifies the activation of the tolerant control reconfiguration mechanism after one sample time of the fault's onset.This duration typically aligns with the system reaching its steady state.The comparison between the diagnosis strategy and the fault-tolerant control strategy reveals significant differences in output behaviour.While the diagnosis strategy leads to gradual divergence of outputs from the nominal values, the fault-tolerant control strategy ensures that all outputs remain unchanged.These findings highlight the critical function and importance of using fault-tolerant control strategies.
The purpose of this simulation was to assess how actuator faults that might impair system functionality would compensate.The outcomes of the simulation validate the desired properties of fault-tolerant control in nullifying the detrimental effects associated with the occurrence of one or more faults within the system.

CONCLUSION
The primary objective of our work is to demonstrate that the diagnostic method presented herein relies on the online estimation of faults.This enables direct diagnosis, involving the isolation and identification of detected faults.It facilitates the isolation of all faults while providing immediate insights into the fault's nature and its severity (magnitude).Concurrently, the proposed control strategy operates through a cooperative framework that integrates the nominal control system, diagnostic module, and responsible regulators to ensure fault tolerance.
The fault-tolerant control strategy involves three pivotal steps.First, a modeling method utilizing Neuro-Fuzzy systems and hybrid automata is employed to represent Hybrid Dynamic System dynamics, encompassing both continuous and discrete aspects.The second step involves generating residuals used in residue evaluation, employing a fuzzy reasoning model to classify detected defects.Finally, the third step selects preestablished Neuro Fuzzy control laws, introducing fault-tolerant control capable of compensating for faults by integrating a compensation term.The proposed tolerant control laws assume a perfect estimation of actuator faults.
This application demonstrates the usefulness of Neuro-Fuzzy models in managing complex system dynamics by demonstrating their suitability for faulttolerant control as well as diagnosis of hybrid dynamic systems.

Declaration of competing interest:
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Figure ( 4 )
outlines a general diagram of faulttolerant control utilizing neural networks and fuzzy logic.

Fig. 4 .
Fig. 4. General diagrams of Fault Tolerant Control using Neural Networks and Fuzzy Logic This extensive and interdisciplinary research area encompasses various domains, including stability concerns, control methods, modeling techniques, and fault diagnosis for Systems with Discrete Dynamics (HDS).The underlying philosophy of these approaches predominantly centers on fault modeling and adjusting control laws based on the magnitudes of detected faults.Regarding fault-tolerant control applied to SDH, only a restricted number of studies have been conducted[33],[34] and[35].Furthermore, even in normal operation, a typical assumption for discrete control in these systems is the continuous awareness of the system's current mode.However, this assumption can be quite stringent and might not always hold in industrial setups.It necessitates abundant, efficient, and sometimes costly sensor instrumentation.The determination of the current mode becomes an additional functionality that the monitoring software layer must provide.

Fig. 7 .Fig. 8 .
Fig. 7. Residuals generationThe following figure shows the hybrid automata that represent the system under typical operating conditions:

ℎ 1 ,Fig. 10 .
Fig. 10.The evolution of the levels ℎ 1  ℎ 2The chronogram of the modes, depicting the evolution over time, is presented in the following figure: