Main Content

Analyze a DC Armature Winding Fault

This example shows how to create a fault in a model, analyze the fault response, and remove faults. To open a model with a block that supports fault modeling, enter:

openExample('simscape_shared/SimpleMotorArmatureWindingFaultExample')

Simscape model of a voltage source that powers a DC motor.

Evaluate Baseline Results

Run the model without any faults to establish baseline results. The results in the figure are normal for a DC motor starting up and reaching steady state.

Baseline results for the model shows a normal startup for a DC motor. The RPM reaches 4000 at steady-state, around 2 seconds.

Configure and Analyze a Timed Fault

To include faults in your simulation, you must first save your model. By default, the fault interface saves the fault information file and the fault model file in the same directory, but you can specify a different directory in the Create Fault window. Blocks that support faults have a Faults drop down menu in the block dialog box. To add a new fault from the menu, click the Add fault hyperlink. The Create Fault window opens, which is where you specify the fault properties.

Open the DC Motor block dialog box and click Add fault to add an armature winding fault. Use the Create Fault window to create a new fault with Trigger type set to Timed, and set Trigger fault at to 2. By this point, the DC motor is nearly at steady state.

When you click OK in the Create Fault window, Simscape saves the fault model file and the fault information file to the directory you specify. Once you create the fault, you can change the properties in the Property Inspector window.

DC Motor block with a fault enabled shows a lightning bolt to represent the fault.

Observe the oscillating behavior when the fault triggers. The DC motor reaches a new, slower steady-state speed.

Current and Voltage start to oscillate when the fault triggers. The DC motor speed is slower than when there is no fault, around 3400 RPM.

The motor reaches the same steady-state speed regardless of the trigger time.

Configure and Analyze a Second Fault

Open the block dialog box for the DC Motor block, and click the Open fault properties hyperlink to add a second fault to the block. Set Trigger type to Always On. To check which fault is currently enabled, click the Fault Table button from the Simscape Block tab. Select the new fault and ensure any other faults are cleared.

Fault Table shows Always On is selected.

When the trigger is always on, current is negligible at 12V. The RPM reaches 0.9.

Note that the motor is barely moving and the current is negligible despite sufficient voltage.

Delete Faults

You can delete a fault by right-clicking the fault in the Fault Table and selecting Delete. You can turn off fault modeling from the Fault Table of from the Faults section of the Simscape Block tab. When the button indicates that fault simulation is off, your model runs with the baseline results. If you want to delete the faults and behaviors that you created without manually deleting each fault or model element:

  1. Close out of the model or models that contain faults.

  2. Clear the associated fault models from memory using one of these methods:

    1. If the fault model is open, close the fault model.

    2. If the fault model has only been loaded into memory, clear the model from memory by using the close_system function.

  3. Delete the fault information file and the fault models.

Deleting these files permanently deletes the faults, behaviors, and conditionals associated with the models that use the fault information file or fault model.