Manually Trigger Faults in Models
Before you configure your fault simulation studies, you may want to manually control when faults inject during simulation to experiment with their effects. You can specify which faults you want to manually inject by assigning them a manual trigger. You can define the trigger type for new faults or for existing faults that have assigned behavior by updating the Trigger type property.
Create Manual Triggers
You can define manual triggers for new faults or existing faults. To define new faults with manual triggers:
Add a fault to your model. Select a signal and, in the Fault Analyzer tab, in the Prepare Faults section, click Add Fault.
In the Add Fault window, enable the Add fault behavior property and set the Trigger Type property to
Manual
.Click OK.
To define manual triggers on existing faults, update the fault properties.
Open the Fault Table pane. In the Fault Analyzer tab, in the View section, click Fault Table.
Expand the model element list. Right-click the fault you want to update and click Properties.
In the Property Inspector, set the Trigger type property to
Manual
.
You can also specify the trigger type programmatically by accessing the
Fault
object properties. Set the
TriggerType
property to "Manual"
.
Control Fault Injection
After you create a manually triggered fault, you can control it by using the Current Configuration tab in the Fault Dashboard pane. In the Simscape Block tab, click FaultsFaults > Fault Dashboard.In the Fault Analyzer tab, in the View section, click Fault Dashboard. The Current Configuration tab displays the enabled faults and their injection status.
You can turn manually triggered faults on or off by clicking the button in the Status column. Select a fault in the table to highlight the fault in the model.
Manual Fault Triggers Example
This example shows how to control manual triggers in a model. You can manually trigger faults during simulation by setting their trigger status.
Open the Model and View the Faults
Open the manualTriggers
model to view the faults. The model contains three signals that each have a fault.
Adjust the Trigger Setting
Each fault is enabled and activated for fault simulation, which means it injects when the fault triggers. See Enable, Modify, and Select Active Faults. In this example, each fault trigger is manual, and you control when the fault injects. Open the Fault Dashboard pane to view the faults. In the Fault Analyzer tab, in the View section, click Fault Dashboard. Open the Current Configuration tab to see the fault injection status. In this example, each fault trigger status is off.
To change the trigger setting before simulation starts, click the button in the Status column.
Simulate the Model and Adjust the Faults
Run the model. If you do not open the Fault Dashboard pane before simulating, it opens automatically. In this example, none of the faults are injected at the start of simulation. You can turn the faults on or off during simulation by pressing the button in the Status column. You can view the trigger status of the faults in the Simulation Data Inspector. In the Fault Analyzer tab, in the Review Results section, click Data Inspector.
In the Fault Dashboard pane, in the Simulation Results tab, you can confirm how many faults you injected during the simulation.