Building fault detection and diagnosis systems

  • FDSystem FDD system for fault detection or fault detection and isolation.
  • FDISystem FDD system for fault detection and isolation.
  • MDSystem FDD system for model detection.
  • tstep! Time step on the FDD system.
FaultDetectionTools.FDSystemType
FDSystem <: AbstractFDDObject

Type for a FDD system for fault detection or fault isolation.

If fddsys::FDSystem is the FDD system object, then the matrices of the underlying standard state-space system model of the discrete-time residual generator can be obtained via fddsys.A, fddsys.By, fddsys.Bu, fddsys.C, fddsys.Dy, fddsys.Du, fddsys.A, the sampling time can be obtained via fddsys.Ts, the initial state and initial time can be obatined via fddsys.x0 and fddsys.t0, while fddsys.SFDI contains the structure matrix underlying the synthesis. For decision making fddsys.τ contains a vector of detection thresholds. The discrete-time Narendra-type fault evaluation filter parameters are contained in the vectors fddsys.α, fddsys.β and fddsys.γ. The current state of the FDD system is formed from the current residual state fddsys.x, current time fddsys.t, current residual value fddsys.r, current residual evaluation filter state fddsys.re, and current evaluation signals fddsys.θ. For decision making purposes, the vector fddsys.isig contains the current fault detection status, such that the i-th component is set to 1 if the i-th evaluation signal exceeds the i-th threshold value. Strong fault isolation is performed if the structure matrix fddsys.SFDI = I to allow the detection of simultaneous faults. In this case, fddsys.strongfdi = true and fddsys.indfault contains the indices of currently detected faults. If fddsys.strongfdi = false, weak fault isolation is performed and fddsys.indfault = k, where k is the index of currently matched fault signature (i.e., the column number of fddsys.SFDI). fddsys.indfault is an empty vector if no signature match occurred.

This FDD system type is relevant for residual generators determined by one of the functions efdsyn, afdsyn, emmsyn(::FDIModel, ::FDFilterIF) or ammsyn(::FDIModel, ::FDFilterIF).

source
FaultDetectionTools.FDSystemMethod
FDSystem(filter::FDFilter[,SFDI::BitMatrix = falses(1,1)]; Ne = size(SFDI,1), 
x0::Union{Vector,Missing} = missing, t0 = 0, τ::Vector = ones(Ne), α::Vector = zeros(Ne), β::Vector = ones(Ne), γ::Vector = .9*ones(Ne), 
) -> fdsys:FDSystem

Build for a filter::FDFilter and, optionally, for a structure matrix SFDI (Default: SFDI = BitMatrix([1;;]) ), a FDD system of type FDSystem for fault detection or fault isolation. Ne is the number of residual evaluation signals (i.e., the number of rows of SFDI). If Ne = 1 a FDD system for fault detection is built, while for Ne > 1 a FDD system for fault isolation is built. The initial state vector of the residual generator can be set using the keyword argument x0 (default: x0 = 0 if x0 = missing) and the initial time can be set via the keyword argument t0 (default: t0 = 0). The vectors τ, α, β, γ have the same number of components Ne, and contain the detection thresholds and the Narendra-type evaluation filter parameters (α,β,γ), respectively.

source
FaultDetectionTools.FDISystemType
FDISystem <: AbstractFDDObject

Type for a FDD system for fault isolation.

If fddsys::FDISystem is the FDD system object, then fddsys.fdsys is a vector of FDD systems for fault detection, where the i-th FDD system is setup based on the i-th residual generation filter of a bank of fault detection and isolation filters (see FDSystem). The sampling time can be obtained via fddsys.Ts, fddsys.SFDI contains the structure matrix underlying the synthesis, the current time is contained in fddsys.t and the current evaluation signals are contained in the vector fddsys.θ. For decision making purposes, the vector fddsys.isig contains the current fault detection status, such that the i-th component is set to 1 if the i-th evaluation signal exceeds the i-th threshold value. Strong fault isolation is performed if the structure matrix fddsys.SFDI = I to allow the detection of simultaneous faults. In this case, fddsys.strongfdi = true and fddsys.indfault contains the indices of currently detected faults. If fddsys.strongfdi = false, weak fault isolation is performed and fddsys.indfault = k, where k is the index of currently matched fault signature (i.e., the column number of fddsys.SFDI). fddsys.indfault is an empty vector if no signature match occurred.

This FDD system type is relevant for residual generators determined by one of the functions efdisyn, afdisyn, emmsyn(::FDIModel, ::FDIFilterIF) or ammsyn(::FDIModel, ::FDIFilterIF).

source
FaultDetectionTools.FDISystemMethod
FDISystem(filter::FDIFilter,SFDI::BitMatrix; Ne = size(SFDI,1), 
x0::Union{Vector,Missing} = missing, t0 = 0, τ::Vector = ones(Ne), α::Vector = zeros(Ne), β::Vector = ones(Ne), γ::Vector = .9*ones(Ne), 
) -> fdsys:FDISystem

Build for a filter::FDIFilter and a structure matrix SFDI, a FDD system of type FDISystem for fault detection and isolation. Ne is the number of component residual generators in filter.sys (also the number of evaluation signals and the number of rows of SFDI). The initial state vectors of the bank of Ne residual generators contained in filter.sys can be set using the keyword argument x0 as a vector of initial conditions of appropriate dimensions, where the i-th vector x0[i] is the initial condition of the i-th residual generator contained in filter.sys[i] (default: x0[i] = 0 for i = 1, ..., Ne if x0 = missing). The initial time can be set via the keyword argument t0 (default: t0 = 0). The vectors τ, α, β, γ have the same number of components Ne, and contain the detection thresholds and the Narendra-type evaluation filter parameters (α,β,γ), respectively.

source
FaultDetectionTools.MDSystemType
MDSystem <: AbstractFDDObject

Type for a FDD system for model detection.

If mfddsys::MDSystem is the FDD system object, then mfddsys.mdsys is a vector of FDD systems for fault detection, where the i-th FDD system is setup based on the i-th residual generation filter of a bank of model detection filters (see MDSystem). The sampling time can be obtained via mfddsys.Ts, the current time is contained in mfddsys.t and the current evaluation signals are contained in the vector mfddsys.θ. For decision making purposes, the vector mfddsys.isig contains the current model detection status, such that the i-th component is set to 1 if the i-th evaluation signal exceeds the i-th threshold value. mfddsys.indmodel contains the index of currently detected model and is zero if no signature match occurred. mfddsys.indminim provides the index of best matched model, corresponding to the least component of the evaluation vector.

This FDD system type is relevant for model detection filters determined by one of the functions emdsyn or amdsyn.

source
FaultDetectionTools.MDSystemMethod
MDSystem(filter::MDFilter; N = length(filter.sys), 
x0::Union{Vector,Missing} = missing, t0 = 0, τ::Vector = ones(N), α::Vector = zeros(N), β::Vector = ones(N), γ::Vector = .9*ones(N), 
) -> mdsys:MDSystem

Build for a filter::MDFilter a FDD system of type MDSystem for model detection. N is the number of component model detection filters in filter.sys (also the number of evaluation signals). The initial state vectors of the bank of N model detection filters contained in filter.sys can be set using the keyword argument x0 as a vector of initial conditions of appropriate dimensions, where the i-th vector x0[i] is the initial condition of the i-th model detection filter contained in filter.sys[i] (default: x0[i] = 0 for i = 1, ..., N if x0 = missing). The initial time can be set via the keyword argument t0 (default: t0 = 0). The vectors τ, α, β, γ have the same number of components N, and contain the detection thresholds and the Narendra-type evaluation filter parameters (α,β,γ), respectively.

source
FaultDetectionTools.tstep!Function
tstep!(fdsys::FDSystem, y::Vector, u::Vector; init = false)

Perform a time step on the FDD system fdsys using the output measurements y and control inputs u. If init = true, a reinitialization of filter state vector, evaluation vector and time value is performed first.

The following quantities are updated:

  • fdsys.r - the residual filter output vector r
  • fdsys.x - the residual filter state vector x
  • fdsys.θ - the residual evaluation signal vector θ
  • fdsys.re - the residual evaluation filter state re
  • fdsys.t - time value t

Using the threshold values τ in fdsys.τ and the updated values of the residual evaluation signal vector θ, the fault detection status vector fdsys.isig is updated as follows:

  • for fault detection: fdsys.isig[1] = 1 if θ[1] ≥ τ[1]; otherwise fdsys.isig[1] = 0;
  • for fault isolation: the i-th component is set as fdsys.isig[i] = 1 if θ[i] ≥ τ[i]; otherwise fdsys.isig[i] = 0.

Based on the updated values of the fault detection status vector fdsys.isig, the decison vector fdsys.indfault is set as follows:

  • for fault detection: fdsys.indfault = [1] if fdsys.isig[1] = 1; otherwise fdsys.indfault = Int[];
  • for weak fault isolation: fdsys.indfault = [k] if fdsys.isig matches the k-th column of fdsys.SFDI;
  • for strong fault isolation: fdsys.indfault contains the indices of nonzero elements of fdsys.isig.
source
tstep!(fdisys::FDISystem, y::Vector, u::Vector; init = false)

Perform a time step on the FDD system fdisys using the output measurements y and control inputs u. If init = true, a reinitialization of the component filter state vectors, evaluation vectors and time values is performed first.

If Ne is the number of component filters, the following quantities are updated for each of the i = 1, ..., Ne component filters:

  • fdisys.fdsys[i].r - the i-th residual filter output vector r
  • fdisys.fdsys[i].x - the i-th residual filter state vector x
  • fdisys.fdsys[i].θ - the i-th residual evaluation signal vector θ
  • fdisys.fdsys[i].re - the i-th residual evaluation filter state re
  • fdisys.fdsys[i].t - i-th filter time value t

Using the threshold value τ[i] = fdisys.fdsys[i].τ[1] and the updated value θ[i] = fdisys.fdsys[i].θ[1] of the residual evaluation signal, the fault detection status vector fdisys.isig is updated as follows: the i-th component is set as fdisys.isig[i] = 1 if θ[i] ≥ τ[i]; otherwise fdisys.isig[i] = 0.

Based on the updated values of the fault detection status vector fdisys.isig, the decison vector fdisys.indfault is set as follows:

  • for weak fault isolation: fdisys.indfault = [k] if fdisys.isig matches the k-th column of fdisys.SFDI;
  • for strong fault isolation: fdisys.indfault contains the indices of nonzero elements of fdisys.isig.
source
tstep!(mfddsys::MDSystem, y::Vector, u::Vector; init = false)

Perform a time step on the FDD system mfddsys using the output measurements y and control inputs u. If init = true, a reinitialization of the component filter state vectors, evaluation vectors and time values is performed first.

If N is the number of component filters, the following quantities are updated for each of the i = 1, ..., N component filters:

  • mfddsys.mdsys[i].r - the i-th residual filter output vector r
  • mfddsys.mdsys[i].x - the i-th residual filter state vector x
  • mfddsys.mdsys[i].θ - the i-th residual evaluation signal vector θ
  • mfddsys.mdsys[i].re - the i-th residual evaluation filter state re
  • mfddsys.mdsys[i].t - i-th filter time value t

Using the threshold value τ[i] = mfddsys.mdsys[i].τ[1] and the updated value θ[i] = mfddsys.mdsys[i].θ[1] of the residual evaluation signal, the model detection status vector mfddsys.isig is updated as follows: the i-th component is set as mfddsys.isig[i] = 1 if θ[i] ≥ τ[i]; otherwise mfddsys.isig[i] = 0.

Based on the updated values of the model detection status vector mfddsys.isig, the decison variable mfddsys.indmodel is set to the index of the currently detected model and is set to zero if no signature match occurred. mfddsys.indminim provides the index of best matched model, corresponding to the least component of the evaluation vector.

source