Add, Trigger, and Analyze Faults in a Simscape Driveline Model
You can add faults to certain Simscape™ Driveline™ components. Faults help you analyze how a system responds to a failure in a given block. Components that support faults contain faultable subelements that you can control and parameterize. You can create faults by using the block dialog box or you can add them programmatically. When you create a fault, the Simscape faults interface creates or adds information to the fault information file. You can add faults without affecting your model file.
This example shows how to add faults to multiple Disc Friction Clutch blocks in a four-speed transmission model. To open the model, enter
openExample('sdl/VehicleWithFourSpeedTransmissionExample')
Add and Analyze a Fault
To observe the vehicle velocity over time without added faults, double-click
the Vehicle Speed
block and run the model.
In this model, the Transmission
block is a
masked subsystem that contains several Disc Friction
Clutch blocks. Double-click the subsystem to open it.
To add a fault to the Disc Friction
Clutch block labeled Clutch C
,
double-click the block. To add a fault with the default settings, in the
Faults section, click the Add
fault hyperlink. Leave the trigger type set to Always
On
. Click OK.
The block displays an icon to show that you created a fault for that block. Return to the top-level of the model and double-click the Scope block to reopen the window. Run the model.
The vehicle velocity rises but repeatedly fails to reach
steady-state. The fault is on throughout the simulation, and the transmission is
unable to disengage the Clutch C
block.
To access a table of the model faults, click the Fault Table icon in the Faults tab. From the table, you can change which faults are enabled and rerun the simulation to analyze the impacts of different fault combinations.
Add and Configure Faults Programmatically
To add or modify one or more faults programmatically, you can use the MATLAB command window. For example, to add faults to all of the blocks in the model, create an array of all of the blocks that support faults:
faultableBlocks = simscape.findFaultableBlocks(VehicleWithFourSpeedTransmission)
faultableBlocks = 6×1 string array "VehicleWithFourSpeedTransmission/Transmission/Clutch A" "VehicleWithFourSpeedTransmission/Transmission/Clutch B" "VehicleWithFourSpeedTransmission/Transmission/Clutch C" "VehicleWithFourSpeedTransmission/Transmission/Clutch D" "VehicleWithFourSpeedTransmission/Transmission/Clutch R" "VehicleWithFourSpeedTransmission/Vehicle Body/Double-Shoe Brake"
for
-loop.for idx = 1:5 simscape.addFaultsToBlock(faultableBlocks(idx)) end
See Also
Introduction to Simscape Faults | Simscape Driveline Blocks that Support Fault Modeling