Main Content

Model and Detect Drivetrain Faults

This example shows how to detect and respond to a fault in a drivetrain using a Rotational Damper block. The Rotational Damper block allows you to specify the damping coefficient as a function of temporal or behavioral triggers. You can program the damping coefficient to change at a particular time in the simulation or when the number of shocks for a given acceleration exceeds a limit to model fault behavior. Fault modeling allows you to predict how your actual physical system responds when it experiences real faults. It also allows you to test the robustness and responsiveness of your control system.

In the example, the fault is detected by a damper that is attached to a flexible shaft. Although you can perform most of the steps in this example using the tools that tshhe Simulink® and Simscape™ Driveline™ user interfaces provide, scripts are supplied. You can combine the scripts into a larger script for parameter sweeps.

  1. Open the model. At the MATLAB® command prompt, enter:

    openExample('sdl/ShaftWithTorsionalFlexibilityExample')
    model = 'ShaftWithTorsionalFlexibility';

    This model contains two flexible aluminum shafts modeled using a lumped parameter approach. A motor drives the motor shaft. A viscous damper is connected to the load shaft. The viscous damper is represented by a Rotational Damper block from the Simscape > Foundation Library > Mechanical > Rotational Elements library. The Foundation Library Rotational Damper block is not able to detect or respond to faults.

  2. Simulate the model and plot the results.

     Script for Generating and Plotting Simulation Results

    At the start of the simulation, the clutch is unlocked and the driven shaft is free. The initial velocity of the motor shaft is the specified 200 rad/s and the system starts at steady state. The oscillations triggered by the engaging and disengaging of the clutch are due to the flexibility in the shafts.

  3. Replace the Simscape damper with the Simscape Driveline Rotational Damper, which is in the Simscape > Driveline > Couplings & Drives > Springs & Dampers library. Label the new block Faultable Damper.

     Script for Replacing the Rotational Damper Block

  4. Enable a time-based fault and specify a response that includes a change in the damping coefficient and the generation of a MATLAB warning. Use these values for the damper Fault parameters:

    • Enable faultsEnabled

    • Faulted damping coefficient10

    • Enable temporal fault triggerEnabled

    • Simulation time for fault event0.06

    • Reporting when fault occursWarning

     Script for Configuring the Rotational Damper Block Using a Timed Fault

  5. Simulate the model and plot the results.

     Script for Generating and Plotting Simulation Results

    Warning: At time 0.060000, one or more assertions are triggered.
    A fault event has occurred The assertion comes from:
    Block path: ShaftWithTorsionalFlexibility/Faultable Damper
    Assert location: (location information is protected)
    

    At simulation time t = 0.06 s, the time specified for the fault, a warning is reported. The damping coefficient drops and slows the speed of both shafts.

  6. Enable a shock-based fault and specify a response that includes a change in the damping coefficient and the generation of a MATLAB warning. Then, simulate the model and plot the new results. Use these values for the damper Fault parameters:

    • Enable faultsYes

    • Faulted damping coefficient150

    • Enable temporal fault triggerDisabled

    • Enable behavioral fault triggerEnabled

    • Maximum permissible acceleration50

    • Maximum number of shocks2

    • Reporting when fault occursWarning

     Script for Configuring the Rotational Damper Block Using a Timed Fault

  7. Simulate the model and plot the results.

     Script for Generating and Plotting Simulation Results

    Warning: At time 0.026048, one or more assertions are triggered.
    A fault event has occurred The assertion comes from:
    Block path: ShaftWithTorsionalFlexibility/Faultable Damper
    Assert location: (location information is protected)
    

    At simulation time t = 0.026 s, the maximum number of shocks for the specified acceleration is reached. A warning is reported and the damping coefficient increases and slows the speed of both shafts.