Main Content

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')

Model of a vehicle with a four-speed transmission.

Add and Analyze a Fault

To observe the baseline vehicle velocity over time, double-click the Scope block and run the model .

Vehicle velocity rises, peaks at 40 seconds, and then begins to go down.

In this model, the Transmission block is a masked subsystem that contains several Disc Friction Clutch blocks. Double-click the subsystem to open it.

Transmission subsystem containing multiple Disc Friction Clutch blocks.

To add a fault to the Disc Friction Clutch block labeled Clutch C, double-click the block. In the Faults section, click the Add fault hyperlink. Use the Add Fault window to name the fault and set the fault trigger type. The default fault is set to Always On. Do not change the default options, and click OK.

Transmission subsystem with Clutch C highlighted and with a Faults icon.

The block displays an icon to show that you created a fault for that block. Return to the Scope block window and run the model.

Vehicle velocity rises but repeatedly fails to reach steady-state as the transmission tries to disengage the Clutch C block.

The vehicle velocity rises but repeatedly fails to reach steady-state as the transmission tries to disengage the Clutch C block.

Add and Configure Faults Programmatically

If you want to add or modify several faults at the same time, you can use the MATLAB command window to configure the faults programmatically. 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"
Add faults all five Disc Friction Clutch blocks by using a for-loop.
for idx = 1:5
    simscape.addFaultsToBlock(faultableBlocks(idx))
end
All of the Disc Friction Clutch blocks display the fault badge. Click one of the blocks, then click the Simscape Block tab. In the Faults section, click Fault Table.

The Fault Table pane displays the model faults. You can change which faults are enabled and rerun the simulation to analyze the impacts of different combinations. In the Model Element/Fault Name column, expand Transmission/Clutch C/Friction.

To change the block fault behavior when a given fault triggers, right-click the row of the fault in the Fault Table pane and select Open fault behavior. Because of the way that the Transmission blocks implements the clutch schedule, it can be challenging to judge when a timed fault has an impact on the Clutch blocks.

See Also

|