Main Content

Test Chart with Fault Detection and Redundant Logic

This example shows how to use operating points to test the response of an aircraft elevator system to an actuator failure. An operating point is a snapshot of the state of a Simulink® model during simulation. If your model contains a Stateflow® chart, the operating point includes information about active states, output and local data, and persistent variables. For more information, see Save and Restore Operating Points for Stateflow Charts.

The model sf_aircraft demonstrates a fault detection, isolation, and recovery (FDIR) application for a pair of aircraft elevators controlled by redundant actuators.

Model sf_aircraft

The Mode Logic chart monitors the status of the four actuators. Each elevator has a primary, outer actuator (represented by the states LO and RO) and a secondary, inner actuator (represented by the states LI and RI). In normal operation, the outer actuators are active and the inner actuators are on standby.

Stateflow chart Mode Logic.

When the actuators work correctly, the left and right elevators reach steady-state positions in 3 seconds.

Scope showing simulation results between t=0 and t=10.

To see what happens when one actuator fails, you can simulate the model, save the operating point at t = 3, modify the operating point to reflect an actuator failure, and then simulate again between t = 3 and t = 10.

For more information about this model, see Detect Faults in Aircraft Elevator Control System.

Define Operating Point for Steady State

  1. Open the sf_aircraft model.

  2. Set the model to save the final operating point. Open the Configuration Parameters dialog box and, in the Data Import/Export pane:

    1. Select Final states and enter a name for the operating point. For this example, use xSteadyState.

    2. Select Save final operating point.

    3. Click OK.

  3. Set the stop time for this simulation segment. In the Simulation tab, set Stop Time to 3.

  4. Run the simulation.

    When you simulate the model, you save the final operating point at t = 3 in the variable xSteadyState in the MATLAB® base workspace.

    Scope showing simulation results between t=0 and t=3.

  5. In the Configuration Parameters dialog box, in the Data Import/Export pane, clear the Save final operating point and Final states parameters. This step prevents you from overwriting the operating point you saved in the previous step.

Modify Operating Point Values for Actuator Failure

  1. Access the Stateflow.op.BlockOperatingPoint object that contains the operating point information for the Mode Logic chart.

    blockpath = "sf_aircraft/Mode Logic";
    op = get(xSteadyState,blockpath)
    op = 
      Block:    "Mode Logic"    (handle)    (active)
      Path:     sf_aircraft/Mode Logic
        + Actuators          "State (OR)"                    (active)
        + LI_act             "Function"
        + LO_act             "Function"
        + L_switch           "Function"
        + RI_act             "Function"
        + RO_act             "Function"
        + R_switch           "Function"
          LI_mode            "State output data"		sf_aircraft_ModeType [1,1]
          LO_mode            "State output data"		sf_aircraft_ModeType [1,1]
          RI_mode            "State output data"		sf_aircraft_ModeType [1,1]
          RO_mode            "State output data"		sf_aircraft_ModeType [1,1]

    The operating point contains a list of states, functions, and data in hierarchical order.

  2. Highlight the states that are active in your chart at t = 3.


    Active states appear highlighted. The two outer actuators are active and the two inner actuators are on standby.

    Stateflow chart showing active states.

  3. Change the substate activity in the state LO to reflect a failure of the left-outer actuator.


    Stateflow chart showing active states.


    The setActive function ensures that the chart exits and enters the appropriate states to maintain state consistency. However, the method does not perform exit actions for the previously active substate or entry actions for the newly active substate.

  4. Save the modified operating point as the workspace variable xFailure.

    xFailure = set(xSteadyState,blockpath,op);

Test Model Behavior after Actuator Failure

  1. Load the operating point as the initial state of the model. In the Configuration Parameters dialog box, in the Data Import/Export pane, select Initial state and enter the variable that contains the modified operating point of your chart, xFailure. Then, click OK.

  2. Define the stop time for the simulation segment to test. In the Simulation tab, set Stop Time to 10.

  3. Run the simulation.

    The chart animation shows how the other three actuators react to the failure of the left-outer actuator:

    • The left-inner actuator switches from standby to active to compensate for the left-outer actuator failure.

    • The right-inner actuator switches from standby to active because the same hydraulic line connects to both inner actuators.

    • The right-outer actuator switches from active to standby because only one actuator can be active for each elevator.

    Stateflow chart showing active states.

    After the failure, both elevators continue to maintain steady-state positions.

    Scope showing simulation results between t=3 and t=10.

See Also

Model Settings



Related Topics