Main Content

Fault Qualification

Fault qualification algorithm

Since R2022b

Libraries:
Simscape / Battery / BMS / Protection

Description

This block implements a fault qualification algorithm. The input and output ports are logic signals. To prevent error disqualification, set the Disqualification time parameter to 0.

This block supports single-precision and double-precision floating-point simulation.

Note

To enable single-precision floating-point simulation, the data type of all inputs and parameters, except for the Sample time (-1 for inherited) parameter, must be single.

You can switch between continuous and discrete implementations of the block by using the Sample time (-1 for inherited) parameter. To configure the block for continuous time, set the Sample time (-1 for inherited) parameter to 0. To configure the block for discrete time, set the Sample time (-1 for inherited) parameter to a positive, nonzero value, or to -1 to inherit the sample time from an upstream block.

Note

Continuous-time implementation of this block works only in a double-precision floating-point simulation. If you provide single-precision floating-point parameters and inputs, this block casts them to double-precision floating-point values to prevent errors.

This diagram shows the structure of the block:

Equations

This figure shows how the internal counter and the Error output port of this block work:

The fault qualification takes a symptom as input. The input is 1 when a symptom is present, such as an overvoltage error, and 0 when the symptom is not present. When the symptom is present, the block increments an internal counter. When the counter reaches the maximum value corresponding to the desired qualification time, the output port is 1.

You must provide a disqualification time greater than 0 to allow disqualification. When the disqualification time is not 0 and the symptom is not present, the block decrements the counter until it reaches 0. When the counter is 0, the output port is 0.

Examples

Ports

Input

expand all

Indication that the battery has a symptom to qualify. If this input is equal to 1, the battery has a symptom.

Output

expand all

Indication that the battery has an error. If this output is equal to 1, the battery has an error.

Parameters

expand all

Time required to qualify the error, in seconds.

Time required to disqualify the error, in seconds. If you set this parameter to 0, the block does not disqualify the error.

Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.

For inherited discrete-time operation, specify this parameter as -1. For discrete-time operation, specify this parameter as a positive integer. For continuous-time operation, specify this parameter as 0.

If this block is in a masked subsystem or a variant subsystem that allows you to switch between continuous operation and discrete operation, promote the sample time parameter. Promoting the sample time parameter ensures correct switching between the continuous and discrete implementations of the block. For more information, see Promote Block Parameters on a Mask.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2022b