# Fault Diagnosability Analysis of Multi-Mode Systems

Fatemeh Hashemniya, Benoît Caillaud, Erik Frisk, Mattias Krysander, Mathias Malandain

► To cite this version:

Fatemeh Hashemniya, Benoît Caillaud, Erik Frisk, Mattias Krysander, Mathias Malandain. Fault Diagnosability Analysis of Multi-Mode Systems. SAFEPROCESS 2024 - 12th IFAC Symposium on Fault Detection, Supervision and Safety for Technical Processes, IFAC, Jun 2024, Ferrara, Italy. pp.210-215, 10.1016/j.ifacol.2024.07.219. hal-04803147

HAL Id: hal-04803147

https://inria.hal.science/hal-04803147v1

Submitted on 25 Nov 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Fault Diagnosability Analysis of Multi-Mode Systems

Fatemeh Hashemniya*, Benoît Caillaud**, Erik Frisk*,
Mattias Krysander*, and Mathias Malandain**

* Department of Electrical Engineering
Linköping University, SE 581-83, Linköping, Sweden

e-mail: {fatemeh.hashemniya, erik.frisk, mattias.krysander} @ liu.se

** National Institute for Research in Digital Science and Technology (Inria),
Inria centre at Rennes University, Rennes, France.

e-mail: {benoit.caillaud, mathias.malandain} @inria.fr

**Abstract:** Multi-mode systems can operate in different modes, leading to large numbers of different dynamics. Consequently, applying traditional structural diagnostics to such systems is often untractable. To address this challenge, we present a multi-mode diagnostics algorithm that relies on a multi-mode extension of the Dulmage-Mendelsohn decomposition. We introduce two methodologies for modeling faults, either as signals or as Boolean variables, and apply them to a modular switched battery system in order to demonstrate their effectiveness and discuss their respective advantages.

**Keywords:** Multi-mode systems, Diagnostics, Dulmage-Mendelsohn decomposition.

## 1. INTRODUCTION

Fault detection and diagnosis are important for the health monitoring of physical systems. Model-based approaches for single-mode, smooth, systems is a well-established field, supported by a large body of literature covering various approaches like structural methods (Blanke et al., 2006), parity space techniques, and observer-based methods (Isermann, 2006).

While single-mode systems are often described using differential algebraic equations (DAEs), the modeling of non-smooth physical systems yields switched DAEs, also known as multi-mode DAEs (mmDAEs), which combine continuous behaviors, defined as solutions of a set of DAE systems, with discrete mode changes (Trenn, 2012; Benveniste et al., 2020). Direct application of traditional fault diagnosis methods to all possible configurations of multi-mode systems quickly becomes intractable, as the number of modes tends to be exponential in the size of the system. The method proposed by (Khorasgani and Biswas, 2017) works around this issue by coupling a mode estimation algorithm with a single-mode diagnosis methodology, akin to just-in-time compilation in computer science. This approach unfortunately puts the burden on solving mode estimation problems, which often turn out to be intractable for the same reason.

Structural fault detectability and isolability is a graph-based method to evaluate diagnosability properties on DAEs (Frisk et al., 2012). It is based on the Dulmage-Mendelsohn decomposition (DM), a building block of the structural analysis of equation systems. In this study, we show how its extension to multi-mode systems, introduced in (Benveniste et al., 2022), can be applied in the context of structural fault detectability and isolability of mmDAEs (Hashemniya et al., 2023). Building upon our previous research studies, the methods presented in this paper represent advancements in diagnostic methodologies for multi-mode systems, providing novel ways to study the diagnosability of multi-mode systems without enumerating their modes.

The case study used throughout this article is a model of a reconfigurable battery system, in which switching strategies

enable to produce an AC output without relying on a central inverter (Balachandran et al., 2021). This model is parametrized by the number of battery cells, so that both the inherent complexity associated with the diagnostics of such systems and the scalability of our approaches can be addressed.

## 2. PROBLEM FORMULATION

The main problem studied here is how to perform the diagnosability analysis of multi-mode systems. Specifically, the method should be able to determine whether a fault $f_i$ can be detected and/or isolated from another fault $f_j$, and if so, under which operational modes.

As an illustrative example, we consider throughout this paper a battery pack composed of $n$ switched submodules (SM) arranged in series, as introduced in (Hashemniya et al., Accepted). Each SM has four valid modes, resulting in a total of $4^n$ system configurations that need to be investigated to calculate the multi-mode isolability performance matrix introduced in (Hashemniya et al., 2023). There, individual configurations have different diagnosability properties leading to complexity concerns, since the number of configurations grows exponentially with the number of SMs. This inherent computational complexity is a key problem and motivating factor of this study.

As discussed in (Hashemniya et al., Accepted), even a modest-sized example with a limited number of SMs results in a large number of system configurations, making any brute-force approach untractable when faced with realistic problem sizes. A more efficient method for assessing structural diagnosability is needed. In (Hashemniya et al., Accepted), an approach was introduced to reduce the number of modes and system configurations, resulting in complexity gains. However, that solution was designed specifically for that particular use case. To establish a comprehensive diagnostic framework applicable to general multi-mode systems, a generalized multi-mode Dulmage-Mendelsohn (mmDM) decomposition (Benveniste et al., 2022) is used to develop a method for general multi-
mode diagnosability analysis. In this framework, the modeling of the faults themselves is an important question: two different approaches are presented here, and their properties are studied.

### 3. SINGLE-MODE DIAGNOSIS

This section briefly recaps the foundations of a graph theoretical method and corresponding definitions for single-mode detectability and isolability analysis. These concepts will be extended in later sections to the multi-mode case.

The Dulmage-Mendelsohn decomposition (Dulmage and Mendelsohn, 1958) is a basic theoretical tool, illustrated by Figure 1, where the structure of a set of equations *M* with the set of unknown variables *X* is represented as an incidence matrix. Three main parts of *M* can be identified in the decomposition: *M*⁻ is called the structurally underdetermined part, *M*⁰ is the structurally well-determined part, and *M*⁺ is the structurally overdetermined part.

<figure><img src="image_2.png" /><figcaption>Fig. 1. Dulmage-Mendelsohn decomposition.</figcaption></figure>

The overdetermined part has more equations than unknowns, which implies that there exists some degree of redundancy. Assume that each fault *f* is present in one equation, denoted as *e*<sub>*f*</sub>, then the following definitions of structural detectability and isolability from (Frisk et al., 2012) will be used.

**Definition 3.1.** A fault *f* is structurally detectable in a model *M* if *e*<sub>*f*</sub> ∈ *M*<sup>+</sup>. A fault *f*<sub>*i*</sub> is structurally isolable from *f*<sub>*j*</sub> in a model *M* if *e*<sub>*f*<sub>*i*</sub></sub> ∈ (*M* \ {*e*<sub>*f*<sub>*j*</sub></sub>})<sup>+</sup>.

Fault detectability and isolability of a model will be called the diagnosability of the model. From Definition 3.1, it appears that one DM decomposition is required to compute the detectability of a given fault or the isolability of one fault from another fault. For a multi-mode system, detectability and isolability can be computed in the same way for each mode separately, but as said before, this naive way of computing diagnosability properties quickly becomes intractable both in terms of computational complexity and memory usage. In this work, we propose to use a multi-mode framework where modes are encoded efficiently to avoid the need for a complete enumeration of system modes and to use a multi-mode version of the DM decomposition that can be used to compute detectability or isolability properties for all modes in one execution.

### 4. MULTI-MODE SYSTEMS

This section describes the modeling framework for multi-mode systems, including two distinct methodologies for modeling faults. This multi-mode modeling framework will be exemplified in a case study of a reconfigurable battery system with integrated converters. While this example may seem simple, it is complex enough to illustrate the difficulties inherent to the fault diagnosis of multi-mode systems. Note that the method presented in this paper can easily be extended to handle more complex, non-linear, multiphysics models.

<figure><img src="image_3.png" /><figcaption>Fig. 2. Reconfigurable battery system with integrated converters. (a) Battery pack with *n* submodules. (b) Battery submodule.</figcaption></figure>

The modular battery pack considered includes *n* SMs in series, numbered from 1 to *n*, as illustrated in Fig. 2. SM *k* in Fig. 2(a) includes a battery cell, modeled as an equivalent circuit model, along with a full-bridge converter consisting in four MOSFET switches, i.e., S<sub>1</sub>-S<sub>4</sub>, and two sensors, i.e., a voltage and a current sensor, measuring *v*<sub>cell,k</sub> and *i*<sub>cell,k</sub> respectively. Additionally, two global pack sensors measure the output voltage *v*<sub>pack</sub> and the output current *i*<sub>pack</sub> respectively, as shown in Fig. 2(b). Faults for each battery cell and each sensor will be considered, and we denote by *F* the set of faults.

The mode of an SM is given by the states of its four switches, i.e., there are in total 2<sup>4</sup> switch configurations. However, many of these switch configurations lead to short circuit; in practice, there are only 4 modes that are used. Table 1 shows the four valid operation modes for each SM based on the states of the switches. It would be possible to model the modes of an SM using the states of the 4 switches, but here, a more compact description will be used that also reduces the number of Boolean variables. In this approach, the Boolean variables forward and backward encode the four valid modes as shown in Table 1. With this abstraction, the two bypass modes are modeled identically, and there is indeed no need to distinguish them. Furthermore, remark that the mode forward = *T*, backward = *T* is forbidden.

<table><caption>Table 1. Full-bridge sub-module modes.</caption><thead><tr><th colspan="2">encoding</th><th rowspan="2">mode</th><th colspan="4">switches</th></tr><tr><th>forward</th><th>backward</th><th>S<sub>1</sub></th><th>S<sub>2</sub></th><th>S<sub>3</sub></th><th>S<sub>4</sub></th><th>v<sub>sm,k</sub></th></tr></thead><tbody><tr><td><b>T</b></td><td><b>F</b></td><td>forward</td><td>on</td><td>off</td><td>off</td><td>on</td><td>v<sub>cell,k</sub></td></tr><tr><td><b>F</b></td><td><b>T</b></td><td>backward</td><td>off</td><td>on</td><td>on</td><td>off</td><td>-v<sub>cell,k</sub></td></tr><tr><td><b>F</b></td><td><b>F</b></td><td>bypass 1</td><td>on</td><td>off</td><td>on</td><td>off</td><td>0</td></tr><tr><td><b>F</b></td><td><b>F</b></td><td>bypass 2</td><td>off</td><td>on</td><td>off</td><td>on</td><td>0</td></tr></tbody></table>

The code for defining the multi-mode Differential Algebraic Equation (mmDAE) of an SM is:

```c
module SM()
    // Mode variables
    forward: boolean;
    backward: boolean;
    invariant !(forward & backward);
    // Faults
    constant f_-cell : real;
    constant f_i_-cell : real;
    constant f_v_-cell : real;
    // Equations of a cell
    e1 : v_p-der = i_-cell / Cp - v_p / (Rp * Cp);
    e2 : v_-cell = v_p + R0 * i_-cell + v_ocv + f_-cell;
    e3 : v_p-der = der(v_p);
    e4 : v_sm =
```
```pascal
if forward then v_cell else
if backward then -v_cell
else 0.;
e5 : i_cell =
    if forward then i_pack else
    if backward then -i_pack
    else 0.;
e6 : y_i_cell = i_cell + f_i_cell;
e7 : y_v_cell = v_cell + f_v_cell;
end
```

The model is expressed in the MEL equation language presented in (Benveniste et al., 2022). The model begins with a declaration of all variables, then the equations are defined. Three types of variables need to be distinguished in a model used for diagnosability analysis. Mode variables are declared as Booleans, unknowns as real variables, and everything else, including model parameters, sensor signals, and fault signals, as real constants. Here, only the declaration of the mode variables and fault signals are shown. Note that the invariant declaration (line 5) states that the mode assignment forward = T, backward = T is not valid.

Equations e1-e3 outline the behavior of the cell, e4-e5 govern the switches, and e6-e7 address the cell current and cell voltage sensors. This model is indeed a multi-mode model, as equations e4-e5 depend on the operating mode of the system. The fault modeling strategy itself will be discussed separately at the end of this section.

To expand the system to n SMs within the battery pack, and subsequently integrate it by incorporating pack sensors, the following statements are included in model $M_s$:

```pascal
// System architecture
#include "SM.mel"
g1 : v_pack = sum { k in 1 .. N : c[k].v_sm };
foreach k in 1 .. N do
    g2[k] : i_pack = c[k].i_pack;
done;
g3 : y_i_pack = i_pack + f_i_pack;
g4 : y_v_pack = v_pack + f_v_pack
```

where equation g1 defines the output voltage of the pack, g2[k] states current relationships, and g3-g4 correspond to the pack's current and voltage sensors, respectively.

## 4.1 Fault signal approach

Faults can be modeled either as real signals or as Boolean mode variables. In the *fault signal approach*, a fault is modeled as a real variable *f* such that *f ≠ 0* in the presence of the fault, *f = 0* otherwise. The model with fault signals is denoted $M_s$. In it, the considered faults of an SM are modeled with the fault signals $f_{cell}$ for a general cell fault, $f_{i_{cell}}$ for a current sensor fault, and $f_{v_{cell}}$ for a voltage sensor fault. Furthermore, sensor faults measuring pack current and voltage are modeled with fault signals $f_{i_{pack}}$ and $f_{v_{pack}}$ respectively. Therefore, the total number of faults is $3n + 2$, where *n* is the number of SMs in the pack.

## 4.2 Boolean fault approach

Faults can also be considered to be discrete modes of the system, i.e., fault modes. In this approach, faults are modeled by Boolean mode variables. As a result, equations containing faults also need to be changed, resulting in the following declarations:

```pascal
F_cell : boolean;
F_i_cell : boolean;
F_v_cell : boolean;
if !F_cell then e2 : v_cell = v_p +
```

```pascal
R0 * i_cell + v_ocv end;
if !F_i_cell then e6 : y_i = i_cell end;
if !F_v_cell then e7 : y_v = v_cell end;
if !F_i_pack then g3 : y_i_pack = i_pack end;
if !F_v_pack then g4 : y_v_pack = v_pack end
```

For example, the last equation describes that the voltage sensor is measuring the correct voltage if the sensor is not faulty. This model will be called $M_b$, where subscript *b* stresses the fact that faults are modeled with Boolean variables.

One difference between the two methodologies lies in the number of Boolean variables, which directly impact the computational complexity, as we shall see. The first approach involves a total of $2n$ Boolean mode variables, where *n* is the number of SMs, whereas the second approach includes $5n + 2$ Boolean variables. Each approach possesses its respective advantages and drawbacks, which will be discussed in Section 7.

# 5. MULTI-MODE DULIMAGE-MENDELSOHN DECOMPOSITION

Multi-mode structural diagnosis analysis requires an efficient way to compute the DM decomposition of a multi-mode system. In this section, we present the necessary background about the DM decomposition, then introduce a multi-mode extension that does not require enumerating the modes of the system.

## 5.1 The single-mode case

The DM algorithm, introduced in (Dulmage and Mendelsohn, 1958), is a canonical decomposition of the set of vertices of a bipartite graph $G = (E \uplus X, A \subseteq E \times X)$ that is commonly used for solving systems of algebraic equations. When applied to any bipartite graph $G$, this decomposition uniquely partitions set $E$ (respectively, set $X$) into three subsets $E^-$, $E^0$ and $E^+$ (resp., $X^-$, $X^0$ and $X^+$). As stated in Section 3, these subsets take a specific meaning when applied to the adjacency graph of an algebraic system of equations $M$.

In what follows, we abstract model $M$ by its *adjacency graph*, where each vertex in $E$ represents an equation, each vertex in $X$ represents a variable, and an edge $(e, x)$ is in $A$ if and only if variable $x$ occurs in equation $e$. The DM decomposition then partitions the set of equations $E$ into three subsystems: we say that $E^-$ is the *underdetermined* part of $E$, $E^0$ is its *square* (or *well-determined*) part, and $E^+$ is its *overdetermined* part; the corresponding subsets of $X$ are the subsets of their dependent variables. We only focus here on the overdetermined parts $E^+$ and $X^+$, as these are the ones to be used for fault analysis.

An efficient algorithm for computing the DM decomposition of sparse systems was published by (Pothen and Fan, 1990). A maximum matching $M$ of the system's adjacency graph is required as an input; the resulting decomposition is independent from the choice of a particular maximum matching.

Let $E^u$ (respectively, $X^u$) be the set of equations (resp., variables) that are not matched in $M$. Then, $E^+$ and $X^+$ are the subsets of $E$ and $X$ (respectively) that are reachable via an alternating path from $E^u$, where an *alternating path* is a path whose edges belong alternatively to $M$ and $A \setminus M$.

## 5.2 Multimode extension

This section introduces mmDM, a multimode generalization of the DM algorithm, presented in (Benveniste et al., 2022, Section 4.2). It is designed for algebraic systems of equations in which both equations and variables can be enabled or disabled depending
on the satisfaction of a set of Boolean conditions on mode variables. Equations may also contain *if-then-else* operators, meaning that the incidence relation may also vary depending on the satisfaction of Boolean conditions on the mode variables. In what follows, we denote by $\mathbb{M}$ the set of valid modes, i.e., the set of all valuations of the mode variables satisfying the invariant of the model as introduced in Section 4.

The key principle of this algorithm is that it is based on a dual representation of the structure of the system: each vertex and edge of the incidence graph is labeled by a Boolean condition that characterizes the set of modes in which it is enabled. Hence, we assume in the sequel that we are given Boolean functions $\gamma_e, \gamma_x, \gamma_a: \mathbb{M} \to \mathbb{B}$ for every $e \in E, x \in X$ and $a \in A$. Given an edge $a = (e, x) \in A$, denote $\mathcal{E}(a) = e$ its incident vertex in $E$ and $\mathcal{X}(a) = x$ its incident vertex in $X$. The inverse mappings $\mathcal{E}^{-1}(e) = \{(e, x) \in A\}$ (resp., $\mathcal{X}^{-1}(x) = \{(e, x) \in A\}$) define the set of edges that are incident to vertex $e \in E$ (resp., $x \in X$).

The choice of one maximum matching per mode is performed without enumerating the modes via an adaptation of the maximum weight perfect matching algorithm detailed in (Benveniste et al., 2022), Section 4.3. This maximum matching is given by its characteristic functions $T_a: \mathbb{M} \to \mathbb{B}$ for all edges $a \in A$.

For each equation $e \in E$, a function $\varepsilon_e^+ : \mathbb{M} \to \mathbb{B}$ is defined, whose final value states the modes in which this equation belongs to the overdetermined part of model $M$. In a similar fashion, a function $\chi_x^+ : \mathbb{M} \to \mathbb{B}$ is defined for each variable $x \in X$.

Each $\varepsilon_e^+$ is initialized so that it encodes the set of modes in which equation $e$ is unmatched, that is:

$$ \varepsilon_e^+ \leftarrow \gamma_e \wedge \neg \left( \bigvee_{a \in \mathcal{E}^{-1}(e)} T_a \right) \quad (1) $$

while function $\chi_x^+$ is initialized to $\mathbb{F}$, the false constant.

The propagation steps that follow consist in exploring alternating paths from the “overdetermined sets” $\varepsilon_e^+$, $\chi_x^+$ and updating the corresponding functions as follows, for all $x \in X$ and all $e \in E$:

$$ \begin{aligned} \chi_x^+ &\leftarrow \chi_x^+ \vee \left( \gamma_x \wedge \bigvee_{a \in \mathcal{X}^{-1}(x)} \left( \neg T_a \wedge \gamma_a \wedge \varepsilon_{\mathcal{E}(a)}^+ \right) \right) \\ \varepsilon_e^+ &\leftarrow \varepsilon_e^+ \vee \left( \gamma_e \wedge \bigvee_{a \in \mathcal{E}^{-1}(e)} \left( T_a \wedge \chi_{\mathcal{X}(a)}^+ \right) \right) \end{aligned} \quad (2) $$

until a fixpoint is reached.

An OCaml implementation of this method, based on Binary Decision Diagrams (BDD, see (Bryant, 1986)), is used for the multi-mode fault diagnosability analyses presented next.

## 6. MULTI-MODE DIAGNOSABILITY

We recall that the structural diagnosability analysis of a single-mode system is performed by computing the detectability of every fault $f \in \mathcal{F}$ and the isolability for every fault pair $(f_i, f_j) \in \mathcal{F} \times \mathcal{F}$. Note that, from Definition 3.1, detectability of a fault $f$ can be seen as the isolability of $f$ from the empty set of faults, i.e., the no-fault case NF. Thus, the diagnosability of a single-mode model $M$ can compactly be described by

$$ \begin{aligned} D_{(f, \text{NF})}^{M} &= \mathbf{T} \text{ iff } f \in \mathcal{F} \text{ is detectable} \\ D_{(f_i, f_j)}^{M} &= \mathbf{T} \text{ iff } (f_i, f_j) \in \mathcal{F} \times \mathcal{F} \text{ is isolable.} \end{aligned} \quad (3) $$

Extending diagnosability analysis to a multi-mode model, with valid modes $\mathbb{M}_s$, then amounts to computing a Boolean function $D_{(f_i, f_j)}: \mathbb{M}_s \to \mathbb{B}$, for every $f_i \in \mathcal{F}$ and $f_j \in \mathcal{F} \cup \{\text{NF}\}$, such that, for any valid assignment of the mode variables $S = S_0$:

$$ D_{(f_i, f_j)}[S := S_0] = D_{(f_i, f_j)}^{M[S := S_0]} $$

where $M[S := S_0]$ is the single-mode model obtained from $M$ by setting its mode variables according to $S_0$.

Next, we present algorithms for computing the diagnosability function, for both fault modeling methodologies, by considering all valid modes at once (that is, without enumerating them).

### 6.1 Diagnosability based on fault signals

In the fault signal approach, the set $\mathcal{F}$ of faults in a multi-mode model $\mathbb{M}_s$ is described by the fault signals $f = (f_1, f_2, \dots, f_n)$ such that $f_i \neq 0$ if fault $i$ is present, $f_i = 0$ otherwise. The set of Boolean variables $S = (S_1, \dots, S_n)$, called system mode variables, represent, e.g., valve and switch positions in the system. It is assumed that faults are introduced only in equations without system mode variables.

For each equation $e \in E$ in $\mathbb{M}_s$, mmDM returns a Boolean function $\varepsilon_e^+ : \mathbb{M}_s \to \mathbb{B}$, where the superscript + denotes the overdetermined part, and $\mathbb{M}_s$ denotes the set of valid modes. These functions will be used to answer diagnosability questions. The dd library (Filippidis et al., 2022) is used for efficiently handling these functions as BDDs.

**Definition 6.1.** (Structural detectability). A fault $f_i$ is structurally detectable in a multi-mode system $\mathbb{M}_s$ if

$$ \varepsilon_{e_{f_i}}^{+}(\mathbb{M}_s) \notin \mathbf{F}, \quad (4) $$

where $e_{f_i}$ is the equation including fault $f_i$. ♦

This means that a fault is structurally detectable if there exists at least one valid mode assignment $S = S_0$ such that $\varepsilon_{e_{f_i}}^+(\mathbb{M}_s)[S := S_0] = \mathbf{T}$. Given a set of modes $\mathcal{S}$, fault $f_i$ is detectable in all modes belonging to $\mathcal{S}$ iff $1_{\mathcal{S}} \to \varepsilon_{e_{f_i}}^+(\mathbb{M}_s)$ is the constant true function. Hence, a fault $f_i$ is detectable in all valid modes iff $(1_{\mathbb{M}_s} \to \varepsilon_{e_f}^+(\mathbb{M}_s)) \equiv \mathbf{T}$.

Consider a system with only one SM, as defined in Section 4, and fault $f_{cell}$. This fault is detectable for the modes defined by $\varepsilon_{e_{f_{cell}}}^+(\mathbb{M}_s) = \neg \text{backward} \vee \neg \text{forward}$, which is the model invariant $1_{\mathbb{M}_s}$. Hence, fault $f_{cell}$ is detectable in all valid modes.

Algorithm 1 computes the detectability of all faults in model $\mathbb{M}_s$. In line 4, the Boolean expression is simplified for faults that are detectable in all valid modes. Note that only one run of mmDM is performed to compute the detectability of all faults in all modes. This algorithm will be used when computing fault isolability.

**Algorithm 1** $\langle D_{(f, \text{NF})} \rangle_{f \in \mathcal{F}} = \text{Detectability}(\mathbb{M}_s)$

1: $\langle \varepsilon_e^+(\mathbb{M}_s) \rangle_{e \in E} = \text{mmDM}(\mathbb{M}_s)$

2: **for all** $f \in \mathcal{F}$ **do**

3: &nbsp;&nbsp;&nbsp;&nbsp;**if** $1_{\mathbb{M}_s} \to \varepsilon_{e_f}^+(\mathbb{M}_s) \equiv \mathbf{T}$ **then**

4: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$D_{(f, \text{NF})} = \mathbf{T}$ ▷ Detectable in all valid modes

5: **else**

6: &nbsp;&nbsp;&nbsp;&nbsp;$D_{(f, \text{NF})} = \varepsilon_{e_f}^+(\mathbb{M}_s)$

**Definition 6.2.** (Structural isolability). Fault $f_i$ is structurally isolable from fault $f_j$ in a multi-mode system $\mathbb{M}_s$ if

$$ \varepsilon_{e_{f_i}}^{+}(\mathbb{M}_s \setminus \{e_{f_j}\}) \notin \mathbf{F}, \quad (5) $$

where $\mathbb{M}_s \setminus \{e_{f_j}\}$ is obtained by removing $e_{f_j}$ from $\mathbb{M}_s$. ♦

As an illustration, considering a single SM, one gets

$$ \varepsilon_{e_{f_{cell}}}^{+}(\mathbb{M}_s \setminus \{e_{f_{cell}}\}) \equiv \neg \text{backward} \wedge \neg \text{forward}, $$

which shows that $f_{cell}$ is isolable from $f_{cell}$ only in the bypass modes according to Table 1.
Algorithm 2 computes the multi-mode diagnosability D of model $M_s$ using Algorithm 1. It is assumed, without loss of generality, that there is at most one fault in each equation.

**Algorithm 2 D = Diagnosability(M_s)**

1: $\langle D_{(f,\text{NF})} \rangle_{f \in \mathcal{F}} = \text{Diagnosability}(M_s)$

2: **for all** $f \in \mathcal{F}$ **do**

3: &nbsp;&nbsp;&nbsp;&nbsp;**if** f is detectable **then**

4: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$\langle D_{(f_i, f)} \rangle_{f_i \in \mathcal{F}} = \text{Diagnosability}(M_s \setminus \{e_f\})$

5: &nbsp;&nbsp;&nbsp;&nbsp;**else**

6: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;▷ Avoid unnecessary mmDM

$\langle D_{(f_i, f)} \rangle_{f_i \in \mathcal{F}} = \langle D_{(f_i, \text{NF})} \rangle_{f_i \in \mathcal{F}}$

The diagnosability result of Algorithm 2 for the single SM example is shown in Table 2. In this table, bypass stands for $\neg$backward $\land$ $\neg$forward for clarity. Column NF indicates that all faults are detectable in all modes. The 2-by-2 block of F's indicates that faults $f_{cell}$ and $f_{v_{cell}}$ are not isolable in any mode. The entries with bypass indicate that the faults $f_{cell}$ and $f_{v_{cell}}$ are isolable from fault $f_{i_{cell}}$ in the bypass modes only.

<table><caption>Table 2. Multi-mode fault diagnosability for the one SM example.</caption><thead><tr><th></th><th>NF</th><th>f<sub>cell</sub></th><th>f<sub>v<sub>cell</sub></sub></th><th>f<sub>i<sub>cell</sub></sub></th></tr></thead><tbody><tr><th>f<sub>cell</sub></th><td><b>T</b></td><td><b>F</b></td><td><b>F</b></td><td>bypass</td></tr><tr><th>f<sub>v<sub>cell</sub></sub></th><td><b>T</b></td><td><b>F</b></td><td><b>F</b></td><td>bypass</td></tr><tr><th>f<sub>i<sub>cell</sub></sub></th><td><b>T</b></td><td>bypass</td><td>bypass</td><td><b>F</b></td></tr></tbody></table>

## 6.2 Diagnosability based on Boolean faults

In this approach, faults are modeled by the Boolean mode variables $F = (F_1, F_2, \dots, F_n)$ such that $F_i = \mathbf{T}$ if fault $i$ is present, $F_i = \mathbf{F}$ otherwise. As above, $S$ is the set of Boolean variables that represent system modes; we denote by $M_b$ the set of valid evaluations of the Boolean variables of $F \cup S$. The mmDM decomposition computes, for each equation $e \in E$, a Boolean function $\varepsilon_e^+(M_b \to \mathbb{B})$, where superscript + denotes the over-determined part of DM. The present approach similarly employs this function to assess the diagnosability of multi-mode systems. However, in contrast to the preceding methodology, the results of mmDM are now functions of both system modes and faults.

To define detectability, some notation is needed. Let $\Psi$ be a Boolean function of the Boolean variables in set $X$. For $x \in X$, $\Psi[x := \mathbf{F}/\mathbf{T}]$ denotes the function obtained by assigning the value $\mathbf{F}/\mathbf{T}$ to $x$. Furthermore, for a set $X' \subseteq X$, $\Psi[X' := \mathbf{F}/\mathbf{T}]$ will denote the function obtained by assigning to every $x \in X'$ the value $\mathbf{F}/\mathbf{T}$.

**Definition 6.3.** (Structural detectability). Let $\mathcal{F}$ be the set of faults in a multi-mode system $M_b$. A fault $F_i$ is structurally detectable in a multi-mode model $M_b$ if

$$ \varepsilon_{e_{F_i}}^{+}(M_b)[\mathcal{F} := \mathbf{F}] \not\equiv \mathbf{F}, \qquad (6) $$

where $e_{F_i}$ is the equation related to fault $F_i$.

<figure><img src="image_4.png" /></figure>

As an example, the equation related to $F_{i_{cell}}$ in $M_b$ is $e_6$, since the existence of $e_6$ depends on the Boolean value $\mathbf{T}/\mathbf{F}$ of $F_{i_{cell}}$. Fault $F_i$ is detectable in the modes given by $\varepsilon_{e_{F_i}}^+(M_b)[\mathcal{F} := \mathbf{F}]$, which corresponds to $\varepsilon_{e_{f_i}}^+(M_s)$ in the fault signal approach.

Consider again the single SM example and the detectability of fault $F_{i_{cell}}$. For equation $e_{F_{i_{cell}}}$, the mmDM algorithm yields the overdetermined part

$$ \begin{aligned} \varepsilon_{e_{F_{i_{cell}}}}^{+}(M_b) &\equiv (\neg \text{backward} \land \neg F_{\text{cell}} \land \neg F_{i_{\text{cell}}} \land \neg F_{v_{\text{cell}}}) \lor \\ &\quad (\neg \text{forward} \land \neg F_{\text{cell}} \land \neg F_{i_{\text{cell}}} \land \neg F_{v_{\text{cell}}}) \lor \\ &\quad (\neg \text{forward} \land \neg \text{backward} \land \neg F_{\text{cell}} \land \neg F_{v_{\text{cell}}}) \end{aligned} \qquad (7) $$

which depends on both system and fault mode variables. By assigning $\mathbf{F}$ to all fault variables, the modes where $F_{i_{cell}}$ is detectable are given by

$$ \varepsilon_{e_{F_{i_{cell}}}}^{+}(M_b)[\{F_{\text{cell}}, F_{i_{\text{cell}}}, F_{v_{\text{cell}}}\} := \mathbf{F}] \equiv \neg \text{backward} \lor \neg \text{forward}. $$

This is equal to the invariant condition, therefore $F_{i_{cell}}$ is detectable in all modes.

**Definition 6.4.** (Single fault structural isolability). Let $\mathcal{F}$ be the set of faults in a multi-mode system $M_b$. Fault $F_i$ is structurally isolable from fault $F_j$ if

$$ \varepsilon_{e_{F_i}}^{+}(M_b)[F_j := \mathbf{T}, \mathcal{F} \setminus \{F_j\} := \mathbf{F}] \not\equiv \mathbf{F}. \qquad (8) $$

The assignment of the fault variables establishes that model $M_b$ is valid in the mode with fault $F_j$ only. If equation $e_{F_i}$ is in the overdetermined part of $M_b$, the definition states that $F_i$ is isolable from $F_j$. Note that the same function $\varepsilon_{e_{F_i}}^+(M_b)$ used in Definition 6.3 to compute detectability properties is used for computing isolability properties of the model as well. This means that mmDM only has to be run once for the complete diagnosability analysis, including both detectability and isolability analysis.

As an example, let us consider the single SM example and check whether $F_{\text{cell}}$ is isolable from $F_{i_{\text{cell}}}$. This is computed by the following substitution in (7):

$$ \varepsilon_{e_{F_{i_{\text{cell}}}}}(M_b)[F_{i_{\text{cell}}} := \mathbf{T}, \{F_{\text{cell}}, F_{v_{\text{cell}}}\} := \mathbf{F}] \equiv \neg \text{backward} \land \neg \text{backward}, $$

according to Definition 6.4. Thus, $F_{\text{cell}}$ is isolable from $F_{i_{\text{cell}}}$ if and only if the submodule is in a bypass mode, which is consistent with the results obtained with the fault signal methodology.

From this approach, the concept of isolability can easily be extended to multiple fault isolability analysis as the following. **Definition 6.5.** (Multiple fault structural isolability). Let $\mathcal{F}$ be the set of faults in $M_b$ and let $\Gamma \subseteq \mathcal{F}$ be a subset of faults. Fault $F_i \in \mathcal{F}$ is structurally isolable from the multiple fault $\Gamma$ if

$$ \varepsilon_{e_{F_i}}^{+}(M_b)[\Gamma := \mathbf{T}, \mathcal{F} \setminus \Gamma := \mathbf{F}] \not\equiv \mathbf{F}. \qquad (9) $$

In the single SM model, for example, one can determine the isolability of fault $F_{\text{cell}}$ from the dual fault scenario including both $F_{i_{\text{cell}}}$ and $F_{v_{\text{cell}}}$ as follows:

$$ \varepsilon_{e_{F_{\text{cell}}}}^{+}(M_b)[F_{\text{cell}} := \mathbf{F}, \{F_{i_{\text{cell}}}, F_{v_{\text{cell}}}\} := \mathbf{T}] \equiv \mathbf{F}. \qquad (10) $$

Hence, $F_{\text{cell}}$ is not isolable from the double fault.

To show the applicability of these algorithms, we use them in a case study in the next section.

## 7. CASE STUDY AND RESULTS

We assessed both modeling approaches on the battery pack model introduced in Section 4, with varying number $n$ of SMs. The diagnosability, as given (3), is the same for both fault modeling approaches, as expected; it is summarized in Table 3. This table presents the results for $n$ SMs, as the same pattern is always observed across all SMs. This common pattern is aggregated and represented by subscript $k$ within the blue highlighted area.

The first column, highlighted in gray, shows detectability. All faults are detectable, except $f_{i_{pack}}$ which is undetectable if all SMs are in bypass mode. In cases where $f_{i_{pack}}$ is not detectable, other faults cannot be isolable from it, indicated in the $f_{i_{pack}}$ row.

It is important to note that any fault occurring within a given SM is detectable, and uniquely isolable from both pack faults
<table><caption>Table 3. Multi-mode fault diagnosability.</caption><thead><tr><th></th><th>NF</th><th>f<sub>cell,k</sub></th><th>f<sub>vcell,k</sub></th><th>f<sub>cell,k</sub></th><th>f<sub>pack</sub></th><th>f<sub>vpack</sub></th></tr></thead><tbody><tr><th>f<sub>cell,k</sub></th><td>T</td><td>F</td><td>-bypass<sub>k</sub></td><td>T</td><td>T</td><td>T</td></tr><tr><th>f<sub>vcell,k</sub></th><td>T</td><td>-bypass<sub>k</sub></td><td>F</td><td>T</td><td>T</td><td>T</td></tr><tr><th>f<sub>cell,k</sub></th><td>T</td><td>T</td><td>T</td><td>F</td><td>T</td><td>T</td></tr><tr><th>f<sub>pack</sub></th><td>-bypass<sub>all</sub></td><td>-bypass<sub>all</sub></td><td>-bypass<sub>all</sub></td><td>-bypass<sub>all</sub></td><td>F</td><td>-bypass<sub>all</sub></td></tr><tr><th>f<sub>vpack</sub></th><td>T</td><td>T</td><td>T</td><td>T</td><td>T</td><td>F</td></tr></tbody></table>

and faults in any other SM. For instance, $f_{cell,1}$ and $f_{cell,2}$ are detectable and uniquely isolable from each other since they belong to different SMs. However, within a given SM $k$, component fault $f_{cell,k}$ and sensor fault $f_{vcell,k}$ are not isolable when that particular SM is in bypass mode.

These findings are consistent with our earlier study (Hashemniya et al., Accepted) on sensor investigation for reconfigurable battery systems. However, while that study relied on a brute force approach to systematically explore all modes and system configurations, the use of mmDM has resulted in an important reduction of computational times.

## Fault modeling comparison

With the Boolean fault approach, a notable advantage is the single run of mmDM, followed by subsequent evaluations of various possibilities on fault modes. In contrast, within the fault signal approach, mmDM must be run once per fault.

However, as demonstrated by the computational times for both approaches shown in Figure 3, the Boolean fault approach leads to a rapid escalation in computational complexity, due to the higher number of Boolean variables to handle: $5n + 2$ in this approach, versus $2n$ in the fault signal approach. The computational demands for the signal fault approach are higher for a small number of SMs, but remain lower in scenarios involving more SMs, as partial evaluations of the outputs of mmDM on fault modes are cheap compared to the whole multimode DM decomposition.

<figure><img src="image_5.png" /><figcaption>Fig. 3. Computation time comparison for two fault modeling approaches.</figcaption></figure>

## 8. CONCLUSION

A novel methodology for conducting structural fault diagnostics for multi-mode systems has been introduced. An inherent challenge in diagnosing such systems arises from their ability to operate in different modes: Enumerating all possible modes of operation results in a combinatorial explosion of the analysis. Using a multi-mode extension of the Dulmage-Mendelsohn decomposition, called mmDM, provides an effective means to curb this complexity issue.

Additionally, two distinct approaches for modeling faults are introduced, as either signals or Boolean variables. In both methodologies, multimode extensions of the concepts of detectability and isolability are introduced. To demonstrate the efficiency of our method, we applied our approaches to an illustrative example of a modular switched Li-ion battery pack with a full-bridge converter.

Future works will aim at generalizing our approach to more complex multi-mode models, including ones where some faults can only occur in some modes. Algorithmic improvements of mmDM are also in the works for improving computational times.

## REFERENCES

* Balachandran, A., Jonsson, T., and Eriksson, L. (2021). Design and analysis of battery-integrated modular multilevel converters for automotive powertrain applications. In *2021 23rd European Conference on Power Electronics and Applications (EPE'21 ECCE Europe)*, P-1. IEEE.

* Benveniste, A., Caillaud, B., and Malandain, M. (2020). The mathematical foundations of physical systems modeling languages. *Annual Reviews in Control*, 50, 72–118. doi:10.1016/j.arcontrol.2020.08.001. URL https://inria.hal.science/hal-03045498.

* Benveniste, A., Caillaud, B., Malandain, M., and Thibault, J. (2022). Algorithms for the Structural Analysis of Multimode Modelica Models. *Electronics*, 11(17), 1–63. doi:10.3390/electronics11172755. URL https://inria.hal.science/hal-03768331.

* Blanke, M., Kinnaert, M., Lunze, J., and Staroswiecki, M. (2006). *Diagnosis and Fault-Tolerant Control*, 109–188. Springer Berlin, Heidelberg. doi:https://doi.org/10.1007/978-3-540-35653-0.

* Bryant, R.E. (1986). Graph-based algorithms for Boolean function manipulation. *IEEE Transactions on Computers*, C-35(8), 677–691. doi:10.1109/tc.1986.1676819.

* Dulmage, A.L. and Mendelsohn, N.S. (1958). Coverings of bipartite graphs. *Canadian Journal of Mathematics*, 10, 517–534. doi:10.4153/CJM-1958-052-0.

* Filippidis, I., Haesaert, S., Livingston, S., and Wenzel, M. (2022). TuLiP/dd. https://github.com/tulip-control/dd. Accessed: November 15th, 2023.

* Frisk, E., Bregon, A., Aslund, J., Krysander, M., Pulido, B., and Biswas, G. (2012). Diagnosability analysis considering causal interpretations for differential constraints. *IEEE Transactions on Systems, Man, and Cybernetics-Part A: Systems and Humans*, 42(5), 1216–1229.

* Hashemniya, F., Balachandran, A., Mattias, K., and Frisk, E. (Accepted). Structural diagnosability analysis of switched and modular battery packs. In *Prognostics and System Health Management Conference (PHM 2024), Stockholm, Sweden*. IEEE.

* Hashemniya, F., Frisk, E., and Krysander, M. (2023). Hierarchical diagnosis algorithm for component-based multi-mode systems. In *22nd IFAC World Congress. IFAC*.

* Isermann, R. (2006). *Fault-Diagnosis Systems: An Introduction from Fault Detection to Fault Tolerance*. Springer Berlin Heidelberg.

* Khorasgani, H. and Biswas, G. (2017). Structural fault detection and isolation in hybrid systems. *IEEE Transactions on Automation Science and Engineering*, 15(4), 1585–1599.

* Pothen, A. and Fan, C. (1990). Computing the block triangular form of a sparse matrix. *ACM Trans. Math. Softw.*, 16(4), 303–324. doi:10.1145/98267.98287. URL http://doi.acm.org/10.1145/98267.98287.

* Trenn, S. (2012). *Switched Differential Algebraic Equations*, 189–216. Springer London, London. doi:10.1007/978-1-4471-2885-4.