Main Content

Introduction to Simscape Faults

You can use faults in Simscape to identify potential failures and analyze their effects on the system performance and behavior. You can predict and evaluate their impacts on the system functionality, reliability, and safety before they occur. You can add faults from the block dialog or the MATLAB Command Window, then specify when the faults trigger.

Fault Terminology

Some of the terminology to describe the fault process is specific to Simscape fault modeling:

  • Model element — Any part of your model that can support a fault, such as a block.

  • Subelement — The one or more independent components that support faults for a given model element. For example, you can add a fault to the armature windings, the series field windings, or the shunt field windings of the Compound Motor block.

  • Fault trigger — A value that switches from false to true when the simulation reaches a fault condition.

  • Fault configuration — The fault parameterization for a given block that contains information about the model element or subelements, the fault behavior, and the fault trigger.

  • Fault scenario — The collection of faults that are enabled during the simulation.

  • Fault information file — The XML file associated with the fault parameter data for each fault.

  • Fault model file — The SLX file associated with each model element that contains the fault parameterizations. This file is separate from the model file.

Add Faults to a Block

To add the first fault to a block from the block dialog box, in the Faults section, click the Add fault hyperlink for the fault that you want to add. Some blocks supports multiple faults, and some faults are dependent on parameter settings. To learn which blocks support faults, see Blocks that Support Fault Modeling.

Blocks that support faults have a Faults section in the Simscape Block tab.

Faults section of Simscape Block tab, where the button on the left indicates that fault simulation is on.

When you create a fault, Simscape applies the default name and trigger type to the block. You can change these and add a description that is visible in the Fault Table.

You parameterize the fault using the Property Inspector

To learn more, see Analyze a DC Armature Winding Fault.

Set Fault Triggers

You can use fault triggers to specify when faults occur in your Simscape blocks. You can configure faults to trigger for a given time, condition, behavior, always, or manually. When you add a fault to a block, the default trigger type is Always On. The Trigger Type parameter control the trigger type. If you select Additional triggers, you can use the Open fault properties hyperlink to specify triggers not available in the block dialog box. Simscape faults supports these triggers:

  • Always On — The fault injects at the start of simulation.

  • Timed — The fault injects when the simulation reaches the time in the Trigger fault at time property. The value must be a real scalar.

  • Conditional — The fault injects as a result of a condition that reflects a behavior associated with a signal. Conditionals evaluate the Boolean expression in the Condition parameter at each time step. To learn more, see Create and Manage Conditionals.

  • Manual — The fault injects or clears when you toggle the status in the Fault Dashboard. To learn more, see Manually Trigger Faults in Models.

  • Behavioral — The fault injects as a result of a fault parameter value during simulation. Setting Trigger type to Behavioral enables parameters for you to specify the value when the fault triggers.

Access the Fault Table and Fault Dashboard

To view all faults in a model, open the Fault Table. Click a block that has a fault and, in the Simscape Block tab, click Faults > Fault Table. Each fault that you create appears in this table. From the Fault Table pane, you can enable or disable fault simulation for a specific fault, all the faults in a block, or for the Simscape model.

Fault Table shows all faults in the model including which one is active. Here the model, DC Motor block, and the DCMotor_fault_1 fault is selected.

When you simulate the model, Simscape logs the trigger status data for you to view in the Simulation Data Inspector. You can see the fault status and a summary of the triggered faults in the Fault Dashboard. To open the Fault Dashboard, click Faults > Fault Dashboard.

View Fault Behavior in Simscape Code

When a block supports faults, the source code for the block contains the definition of the fault behavior. Open the source code to view the behavior.

Using Fault Model Files

When you add a fault to a model, the fault information is stored in the fault model file. When you make changes to a fault, these changes do not impact the base Simscape model. You can erase all fault information in the model by deleting the fault model file.

Advanced

You can use fault annotations to create faults for custom components. To learn more, visit Fault Annotations.

Limitations

Simscape faults triggered by Simulink Signals do not support code generation.

See Also

|